From 6966da14c2c58a136fc64c48d930aa83079e06a0 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 10 Jan 2025 22:25:57 +1100 Subject: [PATCH] Start installing PyQt6 into the Linux ARM64 venv by default Now that an ARM wheel is on PyPI, we no longer need to rely on a system PyQt to build on ARM. The install is skipped when PYTHONPATH is set, so older distros with glibc <2.39 can continue to use the system packages instead. --- build/configure/src/python.rs | 4 ++-- docs/linux.md | 13 ++++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/build/configure/src/python.rs b/build/configure/src/python.rs index 5e9880c9d..3755110fe 100644 --- a/build/configure/src/python.rs +++ b/build/configure/src/python.rs @@ -28,8 +28,8 @@ pub fn setup_venv(build: &mut Build) -> Result<()> { ] } else if cfg!(target_os = "macos") { inputs!["python/requirements.qt6_mac.txt",] - } else if cfg!(all(target_os = "linux", target_arch = "aarch64")) { - // system-provided Qt on ARM64 + } else if std::env::var("PYTHONPATH").is_ok() { + // assume we have a system-provided Qt inputs![] } else { // normal linux diff --git a/docs/linux.md b/docs/linux.md index ae4a52838..eee4cf85f 100644 --- a/docs/linux.md +++ b/docs/linux.md @@ -52,13 +52,16 @@ To play and record audio during development, install mpv and lame. ## ARM64 support -Other platforms download PyQt binary wheels from PyPI. There are no PyQt wheels available -for ARM Linux, so you will need to rely on your system-provided libraries instead. Your distro -will need to have Python 3.9 or later. +If you're on a glibc 2.39+ system, you can skip the rest of this section. -After installing the system libraries (eg 'sudo apt install python3-pyqt6.qt{quick,webengine} python3-venv'), +If your system has an older glibc, you won't be able to use the PyQt wheels that are +available in pip/PyPy, and will need to use your system-installed PyQt instead. +Your distro will also need to have Python 3.9 or later. + +After installing the system libraries (eg: +'sudo apt install python3-pyqt6.qt{quick,webengine} python3-venv pyqt6-dev-tools'), find the place they are installed (eg '/usr/lib/python3/dist-packages'). On modern Ubuntu, you'll -need 'sudo apt remove python3-protobuf'. Then before running any commands like './run', tell Anki where +also need 'sudo apt remove python3-protobuf'. Then before running any commands like './run', tell Anki where the packages can be found: ```