From 858076ef564bf00ce3fd36543c094895273ecb30 Mon Sep 17 00:00:00 2001 From: Samuel Dionne-Riel Date: Tue, 21 May 2019 21:00:34 -0400 Subject: [PATCH] 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 92a0ae3eb85..3ae7df0ed82 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'"} '';