2021-01-25 08:26:54 +00:00
|
|
|
{ lib, appleDerivation, xcbuildHook
|
2019-08-26 00:31:10 +01:00
|
|
|
, openssl_1_0_2, Librpcsvc, xnu, libpcap, developer_cmds }:
|
2016-11-10 04:30:32 +00:00
|
|
|
|
2019-08-13 22:52:01 +01:00
|
|
|
appleDerivation {
|
2018-07-06 23:53:50 +01:00
|
|
|
nativeBuildInputs = [ xcbuildHook ];
|
2019-08-26 00:31:10 +01:00
|
|
|
buildInputs = [ openssl_1_0_2 xnu Librpcsvc libpcap developer_cmds ];
|
2016-11-10 04:30:32 +00:00
|
|
|
|
2016-11-12 21:51:25 +00:00
|
|
|
NIX_CFLAGS_COMPILE = " -I./unbound -I${xnu}/Library/Frameworks/System.framework/Headers/";
|
2016-11-10 04:30:32 +00:00
|
|
|
|
2016-11-10 20:56:58 +00:00
|
|
|
# "spray" requires some files that aren't compiling correctly in xcbuild.
|
|
|
|
# "rtadvd" seems to fail with some missing constants.
|
2018-03-09 01:00:09 +00:00
|
|
|
# "traceroute6" and "ping6" require ipsec which doesn't build correctly
|
2016-11-10 04:30:32 +00:00
|
|
|
patchPhase = ''
|
|
|
|
substituteInPlace network_cmds.xcodeproj/project.pbxproj \
|
|
|
|
--replace "7294F0EA0EE8BAC80052EC88 /* PBXTargetDependency */," "" \
|
2018-03-09 01:00:09 +00:00
|
|
|
--replace "7216D34D0EE89FEC00AE70E4 /* PBXTargetDependency */," "" \
|
|
|
|
--replace "72CD1D9C0EE8C47C005F825D /* PBXTargetDependency */," "" \
|
|
|
|
--replace "7216D2C20EE89ADF00AE70E4 /* PBXTargetDependency */," ""
|
2016-11-10 04:30:32 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
# temporary install phase until xcodebuild has "install" support
|
|
|
|
installPhase = ''
|
2018-12-30 05:58:10 +00:00
|
|
|
for f in Products/Release/*; do
|
|
|
|
if [ -f $f ]; then
|
2019-01-07 04:31:21 +00:00
|
|
|
install -D $f $out/bin/$(basename $f)
|
2018-12-31 19:31:46 +00:00
|
|
|
fi
|
2018-12-30 05:58:10 +00:00
|
|
|
done
|
2016-11-10 04:30:32 +00:00
|
|
|
|
|
|
|
for n in 1 5; do
|
|
|
|
mkdir -p $out/share/man/man$n
|
|
|
|
install */*.$n $out/share/man/man$n
|
|
|
|
done
|
|
|
|
|
2016-11-10 20:56:58 +00:00
|
|
|
# TODO: patch files to load from $out/ instead of /usr/
|
2016-11-10 04:30:32 +00:00
|
|
|
|
2016-11-10 20:56:58 +00:00
|
|
|
# mkdir -p $out/etc/
|
|
|
|
# install rtadvd.tproj/rtadvd.conf ip6addrctl.tproj/ip6addrctl.conf $out/etc/
|
2016-11-10 04:30:32 +00:00
|
|
|
|
2016-11-10 20:56:58 +00:00
|
|
|
# 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
|
2016-11-10 04:30:32 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2021-01-15 14:45:37 +00:00
|
|
|
platforms = lib.platforms.darwin;
|
|
|
|
maintainers = with lib.maintainers; [ matthewbauer ];
|
2016-11-10 04:30:32 +00:00
|
|
|
};
|
|
|
|
}
|