From 38b084f621b51c721341331ae13e321010d8eebb Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 28 Apr 2020 22:51:22 -0400 Subject: [PATCH 1/2] meson: Fix cross The old `CC=.. CXX= .. meson ...` env var hack I removed in 3c00ca03a251693e58eb4e3c247ee1f640215783 had a side effect of ensuring that Meson always had access to a native C compiler, which unforunately it expects in most cases. Thankfully, that will be fixed soon. --- pkgs/development/tools/build-managers/meson/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/development/tools/build-managers/meson/default.nix b/pkgs/development/tools/build-managers/meson/default.nix index 3809d19e7d0..0eae4215d46 100644 --- a/pkgs/development/tools/build-managers/meson/default.nix +++ b/pkgs/development/tools/build-managers/meson/default.nix @@ -3,6 +3,7 @@ , stdenv , writeTextDir , substituteAll +, pkgsHostHost }: python3Packages.buildPythonApplication rec { @@ -58,6 +59,10 @@ python3Packages.buildPythonApplication rec { setupHook = ./setup-hook.sh; + # Ensure there will always be a native C compiler when meson is used, as a + # workaround until https://github.com/mesonbuild/meson/pull/6512 lands. + depsHostHostPropagated = [ pkgsHostHost.stdenv.cc ]; + # 0.45 update enabled tests but they are failing doCheck = false; # checkInputs = [ ninja pkgconfig ]; From 05d26adb0ad90ec17ad38a0ed638e9be33cbc7c7 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 28 Apr 2020 22:55:37 -0400 Subject: [PATCH 2/2] mkDerivation mesonFlags: Fix arm cpu families In my haste to unbreak eval, I screwed up and got the bit-widths, backwards. --- pkgs/stdenv/generic/make-derivation.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index b06541a7e41..09879451d8e 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -257,8 +257,8 @@ in rec { mesonFlags = if mesonFlags == null then null else let # See https://mesonbuild.com/Reference-tables.html#cpu-families cpuFamily = platform: with platform; - /**/ if isAarch64 then "arm" - else if isAarch32 then "aarch64" + /**/ if isAarch32 then "arm" + else if isAarch64 then "aarch64" else if isx86_32 then "x86" else if isx86_64 then "x86_64" else platform.parsed.cpu.family + builtins.toString platform.parsed.cpu.bits;