@@ -0,0 +1,37 @@
1+{ stdenv, appleDerivation, xcbuild }:
2+
3+appleDerivation rec {
4+ # xcbuild fails with:
5+ # /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
6+ # buildInputs = [ xcbuild ];
7+
8+ # # temporary install phase until xcodebuild has "install" support
9+ # installPhase = ''
10+ # mkdir -p $out/bin/
11+ # install system_cmds-*/Build/Products/Release/* $out/bin/
12+
13+ # for n in 1 5 8; do
14+ # mkdir -p $out/share/man/man$n
15+ # install */*.$n $out/share/man/man$n
16+ # done
17+ # '';
18+
19+ # For now we just build sysctl because that's all I need... Please open a
20+ # PR if you need any other utils before we fix the xcodebuild.
21+ buildPhase = "cc sysctl.tproj/sysctl.c -o sysctl";
22+
23+ installPhase =
24+ ''
25+ mkdir -p $out/bin
26+ install sysctl $out/bin
27+ for n in 5 8; do
28+ mkdir -p $out/share/man/man$n
29+ install sysctl.tproj/*.$n $out/share/man/man$n
30+ done
31+ '';
32+
33+ meta = {
34+ platforms = stdenv.lib.platforms.darwin;
35+ maintainers = with stdenv.lib.maintainers; [ shlevy ];
36+ };
37+}