summary refs log tree commit diff
path: root/pkgs/os-specific/darwin/command-line-tools/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/os-specific/darwin/command-line-tools/default.nix')
-rw-r--r--pkgs/os-specific/darwin/command-line-tools/default.nix43
1 files changed, 43 insertions, 0 deletions
diff --git a/pkgs/os-specific/darwin/command-line-tools/default.nix b/pkgs/os-specific/darwin/command-line-tools/default.nix
new file mode 100644
index 00000000000..c437c76cfd6
--- /dev/null
+++ b/pkgs/os-specific/darwin/command-line-tools/default.nix
@@ -0,0 +1,43 @@
+{ stdenv, fetchurl, xar, gzip, cpio }:
+
+let
+  pkg = { name, sha256 }: stdenv.mkDerivation {
+    inherit name;
+
+    src = fetchurl {
+      url = "http://swcdn.apple.com/content/downloads/00/14/031-07556/i7hoqm3awowxdy48l34uel4qvwhdq8lgam/${name}.pkg";
+      inherit sha256;
+    };
+
+    buildInputs = [ xar gzip cpio ];
+
+    phases = [ "unpackPhase" "installPhase" ];
+
+    unpackPhase = ''
+      xar -x -f $src
+    '';
+
+    installPhase = ''
+      start="$(pwd)"
+      mkdir -p $out
+      cd $out
+      cat $start/Payload | gzip -d | cpio -idm
+    '';
+
+    meta = with stdenv.lib; {
+      description = "Apple developer tools ${name}";
+      maintainers = with maintainers; [ copumpkin ];
+      platforms   = platforms.darwin;
+    };
+  };
+in rec {
+  tools = pkg {
+    name   = "CLTools_Executables";
+    sha256 = "1rqrgip9pwr9d6p1hkd027lzxpymr1qm54jjnkldjjb8m4nps7bp";
+  };
+
+  sdk = pkg {
+    name   = "DevSDK_OSX109";
+    sha256 = "0x6r61h78r5cxk9dbw6fnjpn6ydi4kcajvllpczx3mi52crlkm4x";
+  };
+}