packaging: conditionalize the macOS build script to support both Qt5 and Qt6
The version can be overridden by setting `QT_MAJOR` to 5 or 6 in the environment, but it tries to do the right thing by default. I didn't check that all of the same libraries are in the app bundle and need to be removed that are in the Qt5 app, but when skipping that section of post-build customizing, `codesign` reported that it wasn't signed properly. It's just easier to run through it for now and re-sign at the end. Qt5 doesn't support arm64, and requires Rosetta to be installed to run it. Unfortunately, while python, py2app, and PyQt6 are all universal2 binaries, the libraries installed for Qt6 are thin binaries. Maybe there's a way to download the wheels for both architectures and smash them together. Perhaps with something like this: https://github.com/ronaldoussoren/py2app/issues/399#issuecomment-1709305758 For now, we'll just have to build 2 things on two different machines. We might also have the opposite problem we had before with py2app being a universal binary, and defaulting to running the arm64 image on Apple Silicon- it will want to run the amd64 image on an Intel mac, and crash on startup if it was built for AS because the Qt6 libraries are the wrong architecture again. But since I expect the Qt6 stuff to be less stable, let's not worry about removing the amd64 image when building on AS like we do the arm64 image with Qt5 builds.
Please register or sign in to comment