mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 15:32:23 -04:00
don't bundle Qt into ARM Linux package
While it worked, it was not portable to other distros, so we'll rely on the user to provide their own (Py)Qt.
This commit is contained in:
parent
08ad9f33b9
commit
e11cad9bf7
2 changed files with 15 additions and 62 deletions
|
@ -62,11 +62,8 @@ else:
|
||||||
else:
|
else:
|
||||||
os.environ["TARGET"] = "aarch64-unknown-linux-gnu"
|
os.environ["TARGET"] = "aarch64-unknown-linux-gnu"
|
||||||
pyqt5_folder_name = None
|
pyqt5_folder_name = None
|
||||||
|
pyqt6_folder_path = None
|
||||||
arm64_linux = True
|
arm64_linux = True
|
||||||
# path to a custom-built/prepared PyQt5 folder
|
|
||||||
# must be provided
|
|
||||||
pyqt6_folder_path = os.getenv("PREPARED_QT_PATH")
|
|
||||||
assert pyqt6_folder_path
|
|
||||||
|
|
||||||
|
|
||||||
python = python_bin_folder / "python"
|
python = python_bin_folder / "python"
|
||||||
|
@ -197,10 +194,11 @@ def adj_path_for_windows_rsync(path: Path) -> str:
|
||||||
return f"/{path.drive[0]}{rest}"
|
return f"/{path.drive[0]}{rest}"
|
||||||
|
|
||||||
|
|
||||||
def merge_into_dist(output_folder: Path, pyqt_src_path: Path):
|
def merge_into_dist(output_folder: Path, pyqt_src_path: Path | None):
|
||||||
if not output_folder.exists():
|
if not output_folder.exists():
|
||||||
output_folder.mkdir(parents=True)
|
output_folder.mkdir(parents=True)
|
||||||
# PyQt
|
# PyQt
|
||||||
|
if pyqt_src_path:
|
||||||
subprocess.run(
|
subprocess.run(
|
||||||
[
|
[
|
||||||
"rsync",
|
"rsync",
|
||||||
|
@ -241,12 +239,6 @@ def merge_into_dist(output_folder: Path, pyqt_src_path: Path):
|
||||||
)
|
)
|
||||||
# Linux ARM workarounds
|
# Linux ARM workarounds
|
||||||
if arm64_linux:
|
if arm64_linux:
|
||||||
with open(output_folder / "qt.conf", "w") as file:
|
|
||||||
file.write(
|
|
||||||
"""[Paths]
|
|
||||||
Prefix = lib/PyQt5/Qt5
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
# copy orjson ends up broken; copy from venv
|
# copy orjson ends up broken; copy from venv
|
||||||
subprocess.run(
|
subprocess.run(
|
||||||
[
|
[
|
||||||
|
|
|
@ -1,39 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
#
|
|
||||||
# This script copies a system-installed PyQt. Written for Debian Bullseye;
|
|
||||||
# will need adjusting for other platforms.
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
sudo apt install -y python3-pyqt5.{qtwebengine,qtmultimedia} patchelf
|
|
||||||
|
|
||||||
pyqtBase=/usr/lib/python3/dist-packages/PyQt5
|
|
||||||
qtData=/usr/share/qt5
|
|
||||||
qtLibBase=/usr/lib/aarch64-linux-gnu
|
|
||||||
qtLibExtra=$qtLibBase/qt5
|
|
||||||
|
|
||||||
outDir=~/PyQtPrepared/PyQt5/
|
|
||||||
qtOutputBase=$outDir/Qt5
|
|
||||||
rm -rf $outDir
|
|
||||||
mkdir -p $qtOutputBase
|
|
||||||
|
|
||||||
# pyqt
|
|
||||||
rsync -ai --exclude-from=qt.exclude --exclude Qt5 \
|
|
||||||
$pyqtBase/ $outDir/
|
|
||||||
patchelf --set-rpath '$ORIGIN/Qt5/lib' $outDir/*.so
|
|
||||||
|
|
||||||
# qt libs
|
|
||||||
rsync -ai $qtLibBase/libQt5* $qtOutputBase/lib/
|
|
||||||
patchelf --set-rpath '$ORIGIN' $qtOutputBase/lib/*.so.*
|
|
||||||
|
|
||||||
# qt libexec/plugins
|
|
||||||
rsync -ai --exclude=qml $qtLibExtra/ $qtOutputBase/
|
|
||||||
patchelf --set-rpath '$ORIGIN/../../lib' $qtOutputBase/plugins/*/*.so
|
|
||||||
patchelf --set-rpath '$ORIGIN/../lib' $qtOutputBase/libexec/QtWebEngineProcess
|
|
||||||
cat > $qtOutputBase/libexec/qt.conf <<EOF
|
|
||||||
[Paths]
|
|
||||||
Prefix = ..
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# qt translations/resources
|
|
||||||
rsync -ai $qtData/ $qtOutputBase/
|
|
Loading…
Reference in a new issue