about summary refs log tree commit diff
path: root/pkgs/os-specific/darwin/command-line-tools
diff options
context:
space:
mode:
authorEric Seidel <gridaphobe@gmail.com>2015-02-03 14:06:13 -0800
committerEric Seidel <gridaphobe@gmail.com>2015-02-03 14:06:13 -0800
commitebb8d03f96e3f1bf8491a3f74540d2cbb47da294 (patch)
tree57f530f3c32b8329b91340ad903d5d2ecf40ef5e /pkgs/os-specific/darwin/command-line-tools
parent92188d9d1751892ddbf8913da73dfc150d18fadb (diff)
downloadnixlib-ebb8d03f96e3f1bf8491a3f74540d2cbb47da294.tar
nixlib-ebb8d03f96e3f1bf8491a3f74540d2cbb47da294.tar.gz
nixlib-ebb8d03f96e3f1bf8491a3f74540d2cbb47da294.tar.bz2
nixlib-ebb8d03f96e3f1bf8491a3f74540d2cbb47da294.tar.lz
nixlib-ebb8d03f96e3f1bf8491a3f74540d2cbb47da294.tar.xz
nixlib-ebb8d03f96e3f1bf8491a3f74540d2cbb47da294.tar.zst
nixlib-ebb8d03f96e3f1bf8491a3f74540d2cbb47da294.zip
darwin-specific stuff
Diffstat (limited to 'pkgs/os-specific/darwin/command-line-tools')
-rw-r--r--pkgs/os-specific/darwin/command-line-tools/default.nix66
1 files changed, 19 insertions, 47 deletions
diff --git a/pkgs/os-specific/darwin/command-line-tools/default.nix b/pkgs/os-specific/darwin/command-line-tools/default.nix
index a4ac20fa0851..c437c76cfd6a 100644
--- a/pkgs/os-specific/darwin/command-line-tools/default.nix
+++ b/pkgs/os-specific/darwin/command-line-tools/default.nix
@@ -1,71 +1,43 @@
-{ stdenv, fetchadc, xar, gzip, cpio }:
+{ stdenv, fetchurl, xar, gzip, cpio }:
 
 let
-  name = "command-line-tools-mac-os-10.9";
-
-  pkg = { installPhase }: stdenv.mkDerivation {
-    name = "${name}.pkg";
-
-    phases = [ "installPhase" ];
-
-    inherit installPhase;
+  pkg = { name, sha256 }: stdenv.mkDerivation {
+    inherit name;
 
-    meta = with stdenv.lib; {
-      description = "Developer tools .pkg file";
-      maintainers = with maintainers; [ copumpkin ];
-      platforms   = platforms.darwin;
-      license     = licenses.unfree;
+    src = fetchurl {
+      url = "http://swcdn.apple.com/content/downloads/00/14/031-07556/i7hoqm3awowxdy48l34uel4qvwhdq8lgam/${name}.pkg";
+      inherit sha256;
     };
-  };
 
-  basic = pkg: stdenv.mkDerivation {
-    inherit name;
+    buildInputs = [ xar gzip cpio ];
 
     phases = [ "unpackPhase" "installPhase" ];
 
-    outputs = [ "sdk" "tools" ];
-
     unpackPhase = ''
-      ${xar}/bin/xar -x -f "${pkg}"
+      xar -x -f $src
     '';
 
     installPhase = ''
       start="$(pwd)"
-      mkdir -p $sdk
-      mkdir -p $tools
-
-      cd $sdk
-      cat $start/DevSDK_OSX109.pkg/Payload | ${gzip}/bin/gzip -d | ${cpio}/bin/cpio -idm
-
-      cd $tools
-      cat $start/CLTools_Executables.pkg/Payload | ${gzip}/bin/gzip -d | ${cpio}/bin/cpio -idm
+      mkdir -p $out
+      cd $out
+      cat $start/Payload | gzip -d | cpio -idm
     '';
 
     meta = with stdenv.lib; {
-      description = "Mac OS command-line developer tools and SDK";
+      description = "Apple developer tools ${name}";
       maintainers = with maintainers; [ copumpkin ];
       platforms   = platforms.darwin;
-      license     = licenses.unfree;
     };
   };
 in rec {
-  dmg = fetchadc {
-    # Isn't this a beautiful path? Note the subtle differences before and after the slash!
-    path   = "Developer_Tools/command_line_tools_os_x_10.9_for_xcode__xcode_6/command_line_tools_for_os_x_10.9_for_xcode_6.dmg";
-    sha256 = "0zrpf73r3kfk9pdh6p6j6w1sbw7s2pp0f8rd83660r5hk1y3j5jc";
+  tools = pkg {
+    name   = "CLTools_Executables";
+    sha256 = "1rqrgip9pwr9d6p1hkd027lzxpymr1qm54jjnkldjjb8m4nps7bp";
   };
 
-  pure = { xpwn }: basic (pkg {
-    installPhase = ''
-      ${xpwn}/bin/hdutil ${dmg} extract "Command Line Tools (OS X 10.9).pkg" $out
-    '';
-  });
-
-  impure = basic (pkg {
-    installPhase = ''
-      /usr/bin/hdiutil attach ${dmg} -mountpoint clt-mount -nobrowse
-      cp "clt-mount/Command Line Tools (OS X 10.9).pkg" $out
-      /usr/bin/hdiutil unmount clt-mount
-    '';
-  });
+  sdk = pkg {
+    name   = "DevSDK_OSX109";
+    sha256 = "0x6r61h78r5cxk9dbw6fnjpn6ydi4kcajvllpczx3mi52crlkm4x";
+  };
 }