diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2020-04-28 16:51:44 -0400 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2020-04-28 16:51:44 -0400 |
commit | cf858e6d57c4753ca872ef9c24d2c31cb6a1204f (patch) | |
tree | 153dfb474d38e1248c06e035f496b66ba1b5b734 /pkgs | |
parent | 941d2765fd34c31ab77db7b3903d97b7450030af (diff) | |
download | nixpkgs-cf858e6d57c4753ca872ef9c24d2c31cb6a1204f.tar nixpkgs-cf858e6d57c4753ca872ef9c24d2c31cb6a1204f.tar.gz nixpkgs-cf858e6d57c4753ca872ef9c24d2c31cb6a1204f.tar.bz2 nixpkgs-cf858e6d57c4753ca872ef9c24d2c31cb6a1204f.tar.lz nixpkgs-cf858e6d57c4753ca872ef9c24d2c31cb6a1204f.tar.xz nixpkgs-cf858e6d57c4753ca872ef9c24d2c31cb6a1204f.tar.zst nixpkgs-cf858e6d57c4753ca872ef9c24d2c31cb6a1204f.zip |
mkDerivation mesonFlags: Fix cross file logic to handle more cases
Otherwise eval breaks
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/stdenv/generic/make-derivation.nix | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index e6363ce42c0..b06541a7e41 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -256,21 +256,19 @@ in rec { mesonFlags = if mesonFlags == null then null else let # See https://mesonbuild.com/Reference-tables.html#cpu-families - cpuFamilies = { - aarch64 = "aarch64"; - armv5tel = "arm"; - armv6l = "arm"; - armv7l = "arm"; - i686 = "x86"; - x86_64 = "x86_64"; - }; + cpuFamily = platform: with platform; + /**/ if isAarch64 then "arm" + else if isAarch32 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; crossFile = builtins.toFile "cross-file.conf" ('' [properties] needs_exe_wrapper = true [host_machine] system = '${stdenv.targetPlatform.parsed.kernel.name}' - cpu_family = '${cpuFamilies.${stdenv.targetPlatform.parsed.cpu.name}}' + cpu_family = '${cpuFamily stdenv.targetPlatform}' cpu = '${stdenv.targetPlatform.parsed.cpu.name}' endian = ${if stdenv.targetPlatform.isLittleEndian then "'little'" else "'big'"} '' |