mkDerivation mesonFlags: Fix cross file logic to handle more cases

Otherwise eval breaks
This commit is contained in:
John Ericson 2020-04-28 16:51:44 -04:00
parent 941d2765fd
commit cf858e6d57

View File

@ -256,21 +256,19 @@ in rec {
mesonFlags = if mesonFlags == null then null else let mesonFlags = if mesonFlags == null then null else let
# See https://mesonbuild.com/Reference-tables.html#cpu-families # See https://mesonbuild.com/Reference-tables.html#cpu-families
cpuFamilies = { cpuFamily = platform: with platform;
aarch64 = "aarch64"; /**/ if isAarch64 then "arm"
armv5tel = "arm"; else if isAarch32 then "aarch64"
armv6l = "arm"; else if isx86_32 then "x86"
armv7l = "arm"; else if isx86_64 then "x86_64"
i686 = "x86"; else platform.parsed.cpu.family + builtins.toString platform.parsed.cpu.bits;
x86_64 = "x86_64";
};
crossFile = builtins.toFile "cross-file.conf" ('' crossFile = builtins.toFile "cross-file.conf" (''
[properties] [properties]
needs_exe_wrapper = true needs_exe_wrapper = true
[host_machine] [host_machine]
system = '${stdenv.targetPlatform.parsed.kernel.name}' 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}' cpu = '${stdenv.targetPlatform.parsed.cpu.name}'
endian = ${if stdenv.targetPlatform.isLittleEndian then "'little'" else "'big'"} endian = ${if stdenv.targetPlatform.isLittleEndian then "'little'" else "'big'"}
'' ''