From b64736a8e4eae4c3b5267c9f6a7e6d741c1165c2 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 31 Aug 2017 23:07:41 -0400 Subject: [PATCH] darwin binutils: Unwrap GNU Binutils before splicing with cctools --- pkgs/os-specific/darwin/binutils/default.nix | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/pkgs/os-specific/darwin/binutils/default.nix b/pkgs/os-specific/darwin/binutils/default.nix index 933e7558dbbf..690fd93fcf8a 100644 --- a/pkgs/os-specific/darwin/binutils/default.nix +++ b/pkgs/os-specific/darwin/binutils/default.nix @@ -2,12 +2,15 @@ , hostPlatform, targetPlatform }: +# despite the name, binutils-raw is in fact wrapped. +let binutils-unwrapped = binutils-raw.binutils; in + # Make sure both underlying packages claim to have prepended their binaries # with the same prefix. -assert binutils-raw.prefix == cctools.prefix; +assert binutils-unwrapped.prefix == cctools.prefix; let - inherit (binutils-raw) prefix; + inherit (binutils-unwrapped) prefix; cmds = [ "ar" "ranlib" "as" "dsymutil" "install_name_tool" "ld" "strip" "otool" "lipo" "nm" "strings" "size" @@ -20,7 +23,7 @@ stdenv.mkDerivation { buildCommand = '' mkdir -p $out/bin $out/include - ln -s ${binutils-raw.out}/bin/${prefix}c++filt $out/bin/${prefix}c++filt + ln -s ${binutils-unwrapped.out}/bin/${prefix}c++filt $out/bin/${prefix}c++filt # We specifically need: # - ld: binutils doesn't provide it on darwin @@ -37,7 +40,7 @@ stdenv.mkDerivation { ln -sf "${cctools}/bin/$i" "$out/bin/$i" done - for i in ${binutils-raw.dev or binutils-raw.out}/include/*.h; do + for i in ${binutils-unwrapped.dev or binutils-unwrapped.out}/include/*.h; do ln -s "$i" "$out/include/$(basename $i)" done @@ -46,8 +49,8 @@ stdenv.mkDerivation { done # FIXME: this will give us incorrect man pages for bits of cctools - ln -s ${binutils-raw.out}/share $out/share - ln -s ${binutils-raw.out}/lib $out/lib + ln -s ${binutils-unwrapped.out}/share $out/share + ln -s ${binutils-unwrapped.out}/lib $out/lib ln -s ${cctools}/libexec $out/libexec '';