diff --git a/qt/package/build.py b/qt/package/build.py index 1d7dde1c9..aafd6f246 100644 --- a/qt/package/build.py +++ b/qt/package/build.py @@ -62,11 +62,8 @@ else: else: os.environ["TARGET"] = "aarch64-unknown-linux-gnu" pyqt5_folder_name = None + pyqt6_folder_path = None 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" @@ -197,22 +194,23 @@ def adj_path_for_windows_rsync(path: Path) -> str: 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(): output_folder.mkdir(parents=True) # PyQt - subprocess.run( - [ - "rsync", - "-a", - "--delete", - "--exclude-from", - "qt.exclude", - adj_path_for_windows_rsync(pyqt_src_path), - adj_path_for_windows_rsync(output_folder / "lib") + "/", - ], - check=True, - ) + if pyqt_src_path: + subprocess.run( + [ + "rsync", + "-a", + "--delete", + "--exclude-from", + "qt.exclude", + adj_path_for_windows_rsync(pyqt_src_path), + adj_path_for_windows_rsync(output_folder / "lib") + "/", + ], + check=True, + ) # Executable and other resources resources = [ adj_path_for_windows_rsync( @@ -241,12 +239,6 @@ def merge_into_dist(output_folder: Path, pyqt_src_path: Path): ) # Linux ARM workarounds 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 subprocess.run( [ diff --git a/qt/package/prepare-system-pyqt.sh b/qt/package/prepare-system-pyqt.sh deleted file mode 100644 index 7dee44aa9..000000000 --- a/qt/package/prepare-system-pyqt.sh +++ /dev/null @@ -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 <