Merge pull request #62178 from samueldr/fix/meson-systemd-cross

Enables systemd-boot for ARM + fixes meson cpu families
This commit is contained in:
Samuel Dionne-Riel 2019-05-28 23:18:37 -04:00 committed by GitHub
commit 9bc34e38ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 2 deletions

View File

@ -1,5 +1,15 @@
{ lib, python3Packages, stdenv, writeTextDir, substituteAll, targetPackages }:
let
# See https://mesonbuild.com/Reference-tables.html#cpu-families
cpuFamilies = {
"aarch64" = "aarch64";
"armv6l" = "arm";
"armv7l" = "arm";
"i686" = "x86";
"x86_64" = "x86_64";
};
in
python3Packages.buildPythonApplication rec {
version = "0.49.2";
pname = "meson";
@ -62,13 +72,15 @@ python3Packages.buildPythonApplication rec {
ar = '${targetPackages.stdenv.cc.bintools.targetPrefix}ar'
strip = '${targetPackages.stdenv.cc.bintools.targetPrefix}strip'
pkgconfig = 'pkg-config'
ld = '${targetPackages.stdenv.cc.targetPrefix}ld'
objcopy = '${targetPackages.stdenv.cc.targetPrefix}objcopy'
[properties]
needs_exe_wrapper = true
[host_machine]
system = '${targetPackages.stdenv.targetPlatform.parsed.kernel.name}'
cpu_family = '${targetPackages.stdenv.targetPlatform.parsed.cpu.family}'
cpu_family = '${cpuFamilies.${targetPackages.stdenv.targetPlatform.parsed.cpu.name}}'
cpu = '${targetPackages.stdenv.targetPlatform.parsed.cpu.name}'
endian = ${if targetPackages.stdenv.targetPlatform.isLittleEndian then "'little'" else "'big'"}
'';

View File

@ -96,7 +96,7 @@ in stdenv.mkDerivation rec {
"-Dsystem-gid-max=499"
# "-Dtime-epoch=1"
(if stdenv.isAarch32 || stdenv.isAarch64 || !stdenv.hostPlatform.isEfi then "-Dgnu-efi=false" else "-Dgnu-efi=true")
(if !stdenv.hostPlatform.isEfi then "-Dgnu-efi=false" else "-Dgnu-efi=true")
"-Defi-libdir=${toString gnu-efi}/lib"
"-Defi-includedir=${toString gnu-efi}/include/efi"
"-Defi-ldsdir=${toString gnu-efi}/lib"