mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2025-01-04 01:42:53 +03:00
mkDerivation mesonFlags: Fix cross file logic to handle more cases
Otherwise eval breaks
This commit is contained in:
parent
941d2765fd
commit
cf858e6d57
@ -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'"}
|
||||||
''
|
''
|
||||||
|
Loading…
Reference in New Issue
Block a user