about summary refs log tree commit diff
path: root/pkgs/os-specific/darwin/apple-source-releases/network_cmds/default.nix
blob: fe4d60e7ebe963a65d49524be9b8dcb906f9c1c1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{ stdenv, appleDerivation, xcbuild, openssl, Librpcsvc, xnu, libpcap, developer_cmds }:

appleDerivation rec {
  buildInputs = [ xcbuild openssl xnu Librpcsvc libpcap developer_cmds ];

  NIX_CFLAGS_COMPILE = " -I./unbound -I${xnu}/Library/Frameworks/System.framework/Headers/ -D__APPLE_USE_RFC_2292 -DIPV6_DONTFRAG=14 -DINET6";

  patchPhase = ''
    # disable spray, rtadvd
    substituteInPlace network_cmds.xcodeproj/project.pbxproj \
      --replace "7294F0EA0EE8BAC80052EC88 /* PBXTargetDependency */," "" \
      --replace "7216D34D0EE89FEC00AE70E4 /* PBXTargetDependency */," ""
  '';

  # temporary install phase until xcodebuild has "install" support
  installPhase = ''
    mkdir -p $out/bin/
    install network_cmds-*/Build/Products/Release-*/* $out/bin/

    for n in 1 5; do
      mkdir -p $out/share/man/man$n
      install */*.$n $out/share/man/man$n
    done

    mkdir -p $out/etc/
    install rtadvd.tproj/rtadvd.conf ip6addrctl.tproj/ip6addrctl.conf $out/etc/

    mkdir -p $out/local/OpenSourceVersions/
    install network_cmds.plist $out/local/OpenSourceVersions/

    mkdir -p $out/System/Library/LaunchDaemons
    install kdumpd.tproj/com.apple.kdumpd.plist $out/System/Library/LaunchDaemons
 '';

  meta = {
    platforms = stdenv.lib.platforms.darwin;
    maintainers = with stdenv.lib.maintainers; [ matthewbauer ];
  };
}