diff --git a/pkgs/development/tools/build-managers/meson/default.nix b/pkgs/development/tools/build-managers/meson/default.nix index 977ffe837ec..3fb435c5c2b 100644 --- a/pkgs/development/tools/build-managers/meson/default.nix +++ b/pkgs/development/tools/build-managers/meson/default.nix @@ -45,6 +45,11 @@ python3Packages.buildPythonApplication rec { # We remove the check so multiple outputs can work sanely. ./allow-dirs-outside-of-prefix.patch + # Meson is currently inspecting fewer variables than autoconf does, which + # makes it harder for us to use setup hooks, etc. Taken from + # https://github.com/mesonbuild/meson/pull/6827 + ./more-env-vars.patch + # Unlike libtool, vanilla Meson does not pass any information # about the path library will be installed to to g-ir-scanner, # breaking the GIR when path other than ${!outputLib}/lib is used. @@ -67,13 +72,7 @@ python3Packages.buildPythonApplication rec { crossFile = writeTextDir "cross-file.conf" '' [binaries] - c = '${targetPackages.stdenv.cc.targetPrefix}cc' - cpp = '${targetPackages.stdenv.cc.targetPrefix}c++' - ar = '${targetPackages.stdenv.cc.bintools.targetPrefix}ar' - strip = '${targetPackages.stdenv.cc.bintools.targetPrefix}strip' pkgconfig = 'pkg-config' - ld = '${targetPackages.stdenv.cc.targetPrefix}ld' - objcopy = '${targetPackages.stdenv.cc.targetPrefix}objcopy' [properties] needs_exe_wrapper = true diff --git a/pkgs/development/tools/build-managers/meson/more-env-vars.patch b/pkgs/development/tools/build-managers/meson/more-env-vars.patch new file mode 100644 index 00000000000..a8f860f03cc --- /dev/null +++ b/pkgs/development/tools/build-managers/meson/more-env-vars.patch @@ -0,0 +1,16 @@ +diff --git a/mesonbuild/envconfig.py b/mesonbuild/envconfig.py +index ac13a710..e0d07c51 100644 +--- a/mesonbuild/envconfig.py ++++ b/mesonbuild/envconfig.py +@@ -119,9 +119,9 @@ def get_env_var_pair(for_machine: MachineChoice, + # compiling we fall back on the unprefixed host version. This + # allows native builds to never need to worry about the 'BUILD_*' + # ones. +- ([var_name + '_FOR_BUILD'] if is_cross else [var_name]), ++ [var_name + '_FOR_BUILD'] + ([] if is_cross else [var_name]), + # Always just the unprefixed host verions +- ([] if is_cross else [var_name]), ++ [var_name], + )[for_machine] + for var in candidates: + value = os.environ.get(var)