From 858076ef564bf00ce3fd36543c094895273ecb30 Mon Sep 17 00:00:00 2001 From: Samuel Dionne-Riel Date: Tue, 21 May 2019 21:00:34 -0400 Subject: [PATCH 1/3] meson: fix cpu_family for aarch64 As documented, it should be `aarch64` for AArch64. * https://mesonbuild.com/Reference-tables.html#cpu-families ``` $ nix eval '((import {}).pkgsCross.aarch64-multiplatform.stdenv.targetPlatform.parsed.cpu.family)' "arm" ``` The lookup table will ensure that, at any point, meson does not pick the wrong family. --- .../tools/build-managers/meson/default.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pkgs/development/tools/build-managers/meson/default.nix b/pkgs/development/tools/build-managers/meson/default.nix index 92a0ae3eb85b..3ae7df0ed82a 100644 --- a/pkgs/development/tools/build-managers/meson/default.nix +++ b/pkgs/development/tools/build-managers/meson/default.nix @@ -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"; @@ -68,7 +78,7 @@ python3Packages.buildPythonApplication rec { [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'"} ''; From 418c3e11235460aa74ed9bc19810e72b7bc663d4 Mon Sep 17 00:00:00 2001 From: Samuel Dionne-Riel Date: Tue, 21 May 2019 21:02:37 -0400 Subject: [PATCH 2/3] meson: Adds more binaries, needed for systemd-boot --- pkgs/development/tools/build-managers/meson/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/tools/build-managers/meson/default.nix b/pkgs/development/tools/build-managers/meson/default.nix index 3ae7df0ed82a..638fd2eaa43f 100644 --- a/pkgs/development/tools/build-managers/meson/default.nix +++ b/pkgs/development/tools/build-managers/meson/default.nix @@ -72,6 +72,8 @@ 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 From cc058156bdd69fd2b4adaaaa4007930a2b7c4855 Mon Sep 17 00:00:00 2001 From: Samuel Dionne-Riel Date: Tue, 21 May 2019 21:03:35 -0400 Subject: [PATCH 3/3] systemd: Enables systemd-boot for ARM platforms --- pkgs/os-specific/linux/systemd/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index 9d95269daa92..84890b569163 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -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"