From 4b3cc9ed87a0c90898950fc1fa94d968acda1bed Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 30 Apr 2018 23:35:21 -0400 Subject: [PATCH 1/2] cctools: Cleanup `useOld` conditions slightly 60771af5b6fc183aa354ed95e4df32c497382414 jumped through some hoops in order to avoid a mass-rebuild. --- pkgs/os-specific/darwin/cctools/port.nix | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pkgs/os-specific/darwin/cctools/port.nix b/pkgs/os-specific/darwin/cctools/port.nix index d8abdc2c6f8..24f21b498aa 100644 --- a/pkgs/os-specific/darwin/cctools/port.nix +++ b/pkgs/os-specific/darwin/cctools/port.nix @@ -108,17 +108,15 @@ let # include_next "unistd.h" #endif EOF - '' + stdenv.lib.optionalString (!stdenv.isDarwin) '' - sed -i -e 's|clang++|& -I${libcxx}/include/c++/v1|' cctools/autogen.sh - '' + stdenv.lib.optionalString useOld '' + cd cctools + '' + stdenv.lib.optionalString (!stdenv.isDarwin) '' + sed -i -e 's|clang++|& -I${libcxx}/include/c++/v1|' autogen.sh ''; # TODO: this builds an ld without support for LLVM's LTO. We need to teach it, but that's rather # hairy to handle during bootstrap. Perhaps it could be optional? - preConfigure = stdenv.lib.optionalString (!useOld) '' - cd cctools - '' + '' + preConfigure = '' sh autogen.sh ''; From 62fd669ab709fbe1b1a7a7a9220c6a42a1c57acd Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 30 Apr 2018 23:42:44 -0400 Subject: [PATCH 2/2] darwin.libiconv: Start to fix for cross I think I need postPatch for `autoreconfHook`, it's better anyways, and I'm pairing this with another mass-rebuild so its essentially free. --- .../darwin/apple-source-releases/libiconv/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/os-specific/darwin/apple-source-releases/libiconv/default.nix b/pkgs/os-specific/darwin/apple-source-releases/libiconv/default.nix index d9b3dfb7404..a89f9fdf90e 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/libiconv/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/libiconv/default.nix @@ -1,14 +1,14 @@ -{ stdenv, appleDerivation }: +{ stdenv, appleDerivation, autoreconfHook }: appleDerivation { - preConfigure = "cd libiconv"; + postUnpack = "sourceRoot=$sourceRoot/libiconv"; postInstall = '' mv $out/lib/libiconv.dylib $out/lib/libiconv-nocharset.dylib - install_name_tool -id $out/lib/libiconv-nocharset.dylib $out/lib/libiconv-nocharset.dylib + ${stdenv.cc.bintools.targetPrefix}install_name_tool -id $out/lib/libiconv-nocharset.dylib $out/lib/libiconv-nocharset.dylib # re-export one useless symbol; ld will reject a dylib that only reexports other dylibs - echo 'void dont_use_this(){}' | clang -dynamiclib -x c - -current_version 2.4.0 \ + echo 'void dont_use_this(){}' | ${stdenv.cc.bintools.targetPrefix}clang -dynamiclib -x c - -current_version 2.4.0 \ -compatibility_version 7.0.0 -current_version 7.0.0 -o $out/lib/libiconv.dylib \ -Wl,-reexport_library -Wl,$out/lib/libiconv-nocharset.dylib \ -Wl,-reexport_library -Wl,$out/lib/libcharset.dylib