systemd: Fix cross build

This was very similar to the Mesa issues fixed in
62e6d73a09: 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
This commit is contained in:
John Ericson 2020-06-08 00:25:01 +00:00
parent 87e86b4574
commit a239864fc6

View File

@ -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" ];