python3.pkgs.meson-python: run hook in postConfigure

It's not uncommon for packages to modify mesonFlags/mesonFlagsArray in
e.g. preConfigure.  Since the hook was previously run immediately,
these changes wouldn't have been picked up.  To fix this, run the hook
after the configure phase, where we know the list of meson flags will
have been finalized.

Fixes: 70d182be3f ("python3.pkgs.meson-python: populate python build flags with $mesonFlags")
This commit is contained in:
Alyssa Ross 2023-10-12 08:52:36 +00:00
parent 4a7eb88e55
commit 787af710c6
No known key found for this signature in database
GPG Key ID: F9DBED4859B271C0

View File

@ -1,6 +1,10 @@
# Add all of mesonFlags to -Csetup-args for pypa builds
for f in $mesonFlags; do
pypaBuildFlags+=" -Csetup-args=$f"
# This requires pip>23.0.1, see: https://meson-python.readthedocs.io/en/latest/how-to-guides/config-settings.html
pipBuildFlags+=" --config-settings=setup-args=$f"
done
mesonPythonBuildFlagsHook() {
# Add all of mesonFlags to -Csetup-args for pypa builds
for f in $mesonFlags; do
pypaBuildFlags+=" -Csetup-args=$f"
# This requires pip>23.0.1, see: https://meson-python.readthedocs.io/en/latest/how-to-guides/config-settings.html
pipBuildFlags+=" --config-settings=setup-args=$f"
done
}
postConfigureHooks+=(mesonPythonBuildFlagsHook)