A few qt6 modules require python. We need to override with the
appropriate python version in order to use qt6 with non-default python
packages (like python311).
Nix builds of QTWebEngine doesn't support sound output via Pulse, only
through ALSA, unless sandboxing is disabled and LD_LIBRARY_PATH
contains a reference to the Pulse libraries.
By default, Chromium won't link to PulseAudio, but dlopens it in
run-time. It is tricky to make this work because of the nontrivial
sandbox configuration. Nix builds of Chromium already link against
Pulse directly, so it makes sense to copy this behavior in
QTWebEngine.
The qmlimportscanner tool is provided by qtdeclarative. Because of the
modularized installation in Nix, it can not be found via the usual
mechanisms. Also, hard-coding it like we do for Qt5 would also not
work, as it would require making qtbase depend on qtdeclarative.
Here we add an option to provide its location via the environment.
While this means macdeployqt does not work out of the box, it provides
a workaround for users.
Also, we make sure that qmlimportscanner gets passed the right QML
import paths as described in the environment.
python3 is references in the shebang of three scripts:
/nix/store/gbi67akslfd2n5d8q4vxpy8qzih31myl-qtbase-6.5.0
└───libexec/qt-testrunner.py: …#!/nix/store/fdqpyj613dr0v1l1lrzqhzay7sk4xg87-python3-3.10.10/bin/python3.# C…
libexec/sanitizer-testrunner.py: …#!/nix/store/fdqpyj613dr0v1l1lrzqhzay7sk4xg87-python3-3.10.10/bin/python3.# C…
mkspecs/features/uikit/devices.py: …#!/nix/store/fdqpyj613dr0v1l1lrzqhzay7sk4xg87-python3-3.10.10/bin/python3.# C…
→ /nix/store/fdqpyj613dr0v1l1lrzqhzay7sk4xg87-python3-3.10.10
All of them are normally not used in the build process of packages thus
the shebangs batching can be safely skipped.