From 32a6838bc6cfd07b1a0e18368468ba825b4b18c2 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 16 Nov 2017 17:40:38 -0500 Subject: [PATCH 1/2] darwin-bintuils: Don't try to bring in missing bits of GNU Binutils libbfd and libopcdes are separate derivations which now provide all headers and libraries. Binutils should just provide executables. --- pkgs/os-specific/darwin/binutils/default.nix | 5 ----- 1 file changed, 5 deletions(-) diff --git a/pkgs/os-specific/darwin/binutils/default.nix b/pkgs/os-specific/darwin/binutils/default.nix index 5fc0db44f860..e38272593d00 100644 --- a/pkgs/os-specific/darwin/binutils/default.nix +++ b/pkgs/os-specific/darwin/binutils/default.nix @@ -37,17 +37,12 @@ stdenv.mkDerivation { ln -sf "${cctools}/bin/$i" "$out/bin/$i" done - for i in ${stdenv.lib.getDev binutils-raw}/include/*.h; do - ln -s "$i" "$out/include/$(basename $i)" - done - for i in ${cctools}/include/*; do ln -s "$i" "$out/include/$(basename $i)" 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 ${cctools}/libexec $out/libexec ''; From 652c2beda9a5351ddd07e422215100aca75412ae Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 16 Nov 2017 15:00:28 -0500 Subject: [PATCH 2/2] cctools: Don't always bring in headers - Give cctools a dev output for the headers - Update Libsystem to grab the headers from that dev output - Don't include the headers in Darwin binutils, just as GNU Binutils no longer does. --- .../darwin/apple-source-releases/Libsystem/default.nix | 2 +- pkgs/os-specific/darwin/binutils/default.nix | 4 ---- pkgs/os-specific/darwin/cctools/port.nix | 2 ++ 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix b/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix index 3d7e59f15547..28406c9751dc 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix @@ -23,7 +23,7 @@ appleDerivation rec { (cd $dep/include && find . -name '*.h' | cpio -pdm $out/include) done - (cd ${cctools}/include/mach-o && find . -name '*.h' | cpio -pdm $out/include/mach-o) + (cd ${cctools.dev}/include/mach-o && find . -name '*.h' | cpio -pdm $out/include/mach-o) cat < $out/include/TargetConditionals.h #ifndef __TARGETCONDITIONALS__ diff --git a/pkgs/os-specific/darwin/binutils/default.nix b/pkgs/os-specific/darwin/binutils/default.nix index e38272593d00..8ac93689373d 100644 --- a/pkgs/os-specific/darwin/binutils/default.nix +++ b/pkgs/os-specific/darwin/binutils/default.nix @@ -37,10 +37,6 @@ stdenv.mkDerivation { ln -sf "${cctools}/bin/$i" "$out/bin/$i" done - for i in ${cctools}/include/*; do - ln -s "$i" "$out/include/$(basename $i)" - done - # FIXME: this will give us incorrect man pages for bits of cctools ln -s ${binutils-raw.out}/share $out/share diff --git a/pkgs/os-specific/darwin/cctools/port.nix b/pkgs/os-specific/darwin/cctools/port.nix index 1f2e7c143780..8fd2cb715a01 100644 --- a/pkgs/os-specific/darwin/cctools/port.nix +++ b/pkgs/os-specific/darwin/cctools/port.nix @@ -29,6 +29,8 @@ let sha256 = "0l45mvyags56jfi24rawms8j2ihbc45mq7v13pkrrwppghqrdn52"; }; + outputs = [ "out" "dev" ]; + nativeBuildInputs = [ autoconf automake libtool_2 ]; buildInputs = [ libuuid ] ++ # Only need llvm and clang if the stdenv isn't already clang-based (TODO: just make a stdenv.cc.isClang)