From 3940b219882f873314cd36c261cf807e94fa5f3b Mon Sep 17 00:00:00 2001 From: aszlig Date: Mon, 10 Mar 2014 22:08:51 +0100 Subject: [PATCH] cctools-port: Pass through wrapped XCToolchain. At the moment, this includes only dyldinfo, dwarfdump and dsymutil, but we'll see whether we need more of these utilities later. Tho reason those are wrapped in cctools-port is because it is the binutils used to cross-compile for Mac OS X. Signed-off-by: aszlig --- pkgs/os-specific/darwin/cctools-port/default.nix | 11 ++++++++++- pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/pkgs/os-specific/darwin/cctools-port/default.nix b/pkgs/os-specific/darwin/cctools-port/default.nix index 0d40409a994..cdc259c1e2a 100644 --- a/pkgs/os-specific/darwin/cctools-port/default.nix +++ b/pkgs/os-specific/darwin/cctools-port/default.nix @@ -1,5 +1,6 @@ { stdenv, cross, fetchurl, autoconf, automake, libtool , libcxx, llvm, clang, openssl, libuuid +, maloader, makeWrapper, xctoolchain }: stdenv.mkDerivation rec { @@ -13,7 +14,7 @@ stdenv.mkDerivation rec { }; buildInputs = [ - autoconf automake libtool libcxx llvm clang openssl libuuid + autoconf automake libtool libcxx llvm clang openssl libuuid makeWrapper ]; patches = [ ./ld-rpath-nonfinal.patch ./ld-ignore-rpath-link.patch ]; @@ -47,6 +48,14 @@ stdenv.mkDerivation rec { "--target=${cross.config}" ]; + postInstall = '' + for tool in dyldinfo dwarfdump dsymutil; do + makeWrapper "${maloader}/bin/ld-mac" "$out/bin/${cross.config}-$tool" \ + --add-flags "${xctoolchain}/bin/$tool" + ln -s "$out/bin/${cross.config}-$tool" "$out/bin/$tool" + done + ''; + meta = { homepage = "http://www.opensource.apple.com/source/cctools/"; description = "Mac OS X Compiler Tools (cross-platform port)"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c6ea2cbc3fe..9109e1e5952 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6554,6 +6554,8 @@ let darwin = rec { cctools = forceNativeDrv (callPackage ../os-specific/darwin/cctools-port { cross = assert crossSystem != null; crossSystem; + inherit maloader; + xctoolchain = xcode.toolchain; }); maloader = callPackage ../os-specific/darwin/maloader {