about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJohn Ericson <Ericson2314@Yahoo.com>2017-04-24 16:00:11 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2017-06-22 17:56:12 -0400
commitf43ae985a68e515197c57de5ab8413d63ae6ef1a (patch)
tree478184b7b2e22f3df6981bd7eeddc5481763a62b
parent198dceccbe5414a5fd72ca83624c0cc715db1aad (diff)
downloadnixlib-f43ae985a68e515197c57de5ab8413d63ae6ef1a.tar
nixlib-f43ae985a68e515197c57de5ab8413d63ae6ef1a.tar.gz
nixlib-f43ae985a68e515197c57de5ab8413d63ae6ef1a.tar.bz2
nixlib-f43ae985a68e515197c57de5ab8413d63ae6ef1a.tar.lz
nixlib-f43ae985a68e515197c57de5ab8413d63ae6ef1a.tar.xz
nixlib-f43ae985a68e515197c57de5ab8413d63ae6ef1a.tar.zst
nixlib-f43ae985a68e515197c57de5ab8413d63ae6ef1a.zip
ios-cross: Just properly use the cc-wrapper
No other downstream derivations are needed anymore.
-rw-r--r--pkgs/os-specific/darwin/ios-cross/default.nix37
1 files changed, 8 insertions, 29 deletions
diff --git a/pkgs/os-specific/darwin/ios-cross/default.nix b/pkgs/os-specific/darwin/ios-cross/default.nix
index e5375ef60915..e0981d48c8c9 100644
--- a/pkgs/os-specific/darwin/ios-cross/default.nix
+++ b/pkgs/os-specific/darwin/ios-cross/default.nix
@@ -6,7 +6,7 @@
 , stdenv
 , coreutils
 , gnugrep
-, targetPlatform
+, hostPlatform, targetPlatform
 }:
 
 /* As of this writing, known-good prefix/arch/simulator triples:
@@ -28,14 +28,14 @@ let
 
   sdk = "/Applications/Xcode.app/Contents/Developer/Platforms/iPhone${sdkType}.platform/Developer/SDKs/iPhone${sdkType}${sdkVer}.sdk";
 
-  /* TODO: Properly integrate with gcc-cross-wrapper */
-  wrapper = import ../../../build-support/cc-wrapper {
-    inherit stdenv coreutils gnugrep;
+in (import ../../../build-support/cc-wrapper {
+    inherit stdenv coreutils gnugrep runCommand;
     nativeTools = false;
     nativeLibc = false;
     inherit binutils;
     libc = runCommand "empty-libc" {} "mkdir -p $out/{lib,include}";
-    cc = clang;
+    inherit (clang) cc;
+    inherit hostPlatform targetPlatform;
     extraBuildCommands = ''
       if ! [ -d ${sdk} ]; then
           echo "You must have ${sdkVer} of the iPhone${sdkType} sdk installed at ${sdk}" >&2
@@ -49,27 +49,6 @@ let
       # Purposefully overwrite libc-ldflags-before, cctools ld doesn't know dynamic-linker and cc-wrapper doesn't do cross-compilation well enough to adjust
       echo "-arch ${arch} -L${sdk}/usr/lib ${lib.optionalString simulator "-L${sdk}/usr/lib/system "}-i${if simulator then "os_simulator" else "phoneos"}_version_min 7.0.0" > $out/nix-support/libc-ldflags-before
     '';
-  };
-in {
-  cc = runCommand "${prefix}-cc" { passthru = { inherit sdkType sdkVer sdk; }; } ''
-    mkdir -p $out/bin
-    ln -sv ${wrapper}/bin/clang $out/bin/${prefix}-cc
-    mkdir -p $out/nix-support
-    echo ${llvm} > $out/nix-support/propagated-native-build-inputs
-    cat > $out/nix-support/setup-hook <<EOF
-    if test "\$dontSetConfigureCross" != "1"; then
-        configureFlags="\$configureFlags --host=${prefix}"
-    fi
-    EOF
-    fixupPhase
-  '';
-
-  binutils = runCommand "${prefix}-binutils" {} ''
-    mkdir -p $out/bin
-    ln -sv ${wrapper}/bin/ld $out/bin/${prefix}-ld
-    for prog in ar nm ranlib; do
-      ln -s ${binutils}/bin/$prog $out/bin/${prefix}-$prog
-    done
-    fixupPhase
-  '';
-}
+  }) // {
+    inherit sdkType sdkVer sdk;
+  }