-
-
Save samueldr/150eda3dbd4ddcb06e7183b48b6a6c5c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ lib, python3Packages, stdenv, writeTextDir, substituteAll, targetPackages }: | |
python3Packages.buildPythonApplication rec { | |
# ... | |
crossFile = writeTextDir "cross-file.conf" '' | |
[host_machine] | |
system = '${targetPackages.stdenv.targetPlatform.parsed.kernel.name}' | |
cpu_family = '${ | |
# http://mesonbuild.com/Reference-tables.html#cpu-families | |
if targetPackages.stdenv.targetPlatform.isAarch32 then "arm" | |
else if targetPackages.stdenv.targetPlatform.isx86_32 then "x86" | |
else targetPackages.stdenv.targetPlatform.parsed.cpu.name | |
}' | |
cpu = '${targetPackages.stdenv.targetPlatform.parsed.cpu.name}' | |
endian = ${if targetPackages.stdenv.targetPlatform.isLittleEndian then "'little'" else "'big'"} | |
''; | |
# ... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ lib, python3Packages, stdenv, writeTextDir, substituteAll, targetPackages }: | |
let | |
# http://mesonbuild.com/Reference-tables.html#cpu-families | |
cpuFamily = | |
if targetPackages.stdenv.targetPlatform.isAarch32 then "arm" | |
else if targetPackages.stdenv.targetPlatform.isx86_32 then "x86" | |
else targetPackages.stdenv.targetPlatform.parsed.cpu.name | |
; | |
in | |
python3Packages.buildPythonApplication rec { | |
# ... | |
crossFile = writeTextDir "cross-file.conf" '' | |
[host_machine] | |
system = '${targetPackages.stdenv.targetPlatform.parsed.kernel.name}' | |
cpu_family = '${cpuFamily}' | |
cpu = '${targetPackages.stdenv.targetPlatform.parsed.cpu.name}' | |
endian = ${if targetPackages.stdenv.targetPlatform.isLittleEndian then "'little'" else "'big'"} | |
''; | |
# ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment