From a239864fc610ff7738c5a8af2a7be25a0af4a28b Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 8 Jun 2020 00:25:01 +0000 Subject: [PATCH] systemd: Fix cross build This was very similar to the Mesa issues fixed in 62e6d73a09870174a891d2a8d29a38e62b05efd5: the user-written code is looking up an unprefixed binutils program. [I think we should have a way in Meson of specifying a program prefix in the cross / native files, as a fallback for any program that isn't explicitly specified. This could both be availible for user written rules, and help with the default rules.] Fixes https://github.com/NixOS/mobile-nixos/issues/161 --- pkgs/os-specific/linux/systemd/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index 00a545ed3f54..3235fb3b95cd 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -66,6 +66,13 @@ in stdenv.mkDerivation { postPatch = '' substituteInPlace src/basic/path-util.h --replace "@defaultPathNormal@" "${placeholder "out"}/bin/" + substituteInPlace src/boot/efi/meson.build \ + --replace \ + "find_program('ld'" \ + "find_program('${stdenv.cc.bintools.targetPrefix}ld'" \ + --replace \ + "find_program('objcopy'" \ + "find_program('${stdenv.cc.bintools.targetPrefix}objcopy'" ''; outputs = [ "out" "lib" "man" "dev" ];