summary refs log tree commit diff
path: root/pkgs/os-specific/darwin/apple-source-releases/system_cmds
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2017-10-11 15:13:27 -0400
committerShea Levy <shea@shealevy.com>2017-10-11 15:13:27 -0400
commit48595335f41f3a2778a79f77578832ab829ccaee (patch)
tree4886f0b0c704b70268fdc4b295dc63853e026da4 /pkgs/os-specific/darwin/apple-source-releases/system_cmds
parent0d8c6f4022153b712a8e0d5c82942ec970516c2c (diff)
downloadnixpkgs-48595335f41f3a2778a79f77578832ab829ccaee.tar
nixpkgs-48595335f41f3a2778a79f77578832ab829ccaee.tar.gz
nixpkgs-48595335f41f3a2778a79f77578832ab829ccaee.tar.bz2
nixpkgs-48595335f41f3a2778a79f77578832ab829ccaee.tar.lz
nixpkgs-48595335f41f3a2778a79f77578832ab829ccaee.tar.xz
nixpkgs-48595335f41f3a2778a79f77578832ab829ccaee.tar.zst
nixpkgs-48595335f41f3a2778a79f77578832ab829ccaee.zip
Add system_cmds apple project
Actually just build sysctl for now, as xcbuild segfaults.
Diffstat (limited to 'pkgs/os-specific/darwin/apple-source-releases/system_cmds')
-rw-r--r--pkgs/os-specific/darwin/apple-source-releases/system_cmds/default.nix37
1 files changed, 37 insertions, 0 deletions
diff --git a/pkgs/os-specific/darwin/apple-source-releases/system_cmds/default.nix b/pkgs/os-specific/darwin/apple-source-releases/system_cmds/default.nix
new file mode 100644
index 00000000000..2247ef3ddd2
--- /dev/null
+++ b/pkgs/os-specific/darwin/apple-source-releases/system_cmds/default.nix
@@ -0,0 +1,37 @@
+{ stdenv, appleDerivation, xcbuild }:
+
+appleDerivation rec {
+  # xcbuild fails with:
+  # /nix/store/fc0rz62dh8vr648qi7hnqyik6zi5sqx8-xcbuild-wrapper/nix-support/setup-hook: line 1:  9083 Segmentation fault: 11  xcodebuild OTHER_CFLAGS="$NIX_CFLAGS_COMPILE" OTHER_CPLUSPLUSFLAGS="$NIX_CFLAGS_COMPILE" OTHER_LDFLAGS="$NIX_LDFLAGS" build
+  # buildInputs = [ xcbuild ];
+
+  # # temporary install phase until xcodebuild has "install" support
+  # installPhase = ''
+  #   mkdir -p $out/bin/
+  #   install system_cmds-*/Build/Products/Release/* $out/bin/
+
+  #   for n in 1 5 8; do
+  #     mkdir -p $out/share/man/man$n
+  #     install */*.$n $out/share/man/man$n
+  #   done
+  # '';
+
+  # For now we just build sysctl because that's all I need... Please open a
+  # PR if you need any other utils before we fix the xcodebuild.
+  buildPhase = "cc sysctl.tproj/sysctl.c -o sysctl";
+
+  installPhase =
+    ''
+      mkdir -p $out/bin
+      install sysctl $out/bin
+      for n in 5 8; do
+        mkdir -p $out/share/man/man$n
+        install sysctl.tproj/*.$n $out/share/man/man$n
+      done
+    '';
+
+  meta = {
+    platforms = stdenv.lib.platforms.darwin;
+    maintainers = with stdenv.lib.maintainers; [ shlevy ];
+  };
+}