nixpkgs/pkgs/os-specific/darwin/apple-source-releases/adv_cmds/default.nix
Matthew Bauer e6f7f2928f darwin: 10.11 → 10.12
Lots of stuff has gotten moved around. Many security libraries have been merged
into the Security monorepo. I’ve cleared them out for now, we will
need to modify Security to build them!

This also moves some things around to more clearly separate
bootstrapping the stdenv from everything else. We want the “normal”
mode to be the non-bootstrapped version. When you ask for “Security”,
you want the actual built software, not a crippled one.

- Add TARGET_OS_OSX to darwin.libSystem. Looks like something
  introduced in 10.12. TARGET_OS_MAC is only set when building for
  desktop (iOS will have TARGET_OS_MAC set)
- Bump darwin.dtrace
- Bump darwin.libpthread
- Remove SmartCardServices, libsecurity*, etc.
- Install some more headers for darling.
2018-12-17 00:07:09 -06:00

59 lines
1.8 KiB
Nix

{ stdenv, appleDerivation, xcbuild, ncurses, libutil }:
appleDerivation {
# We can't just run the root build, because https://github.com/facebook/xcbuild/issues/264
# pkill requires special private headers that are unavailable in
# NixPkgs. These ones are needed:
# - xpc/xpxc.h
# - os/base_private.h
# - _simple.h
# We disable it here for now. TODO: build pkill inside adv_cmds
# We also disable locale here because of some issues with a missing
# "lstdc++".
patchPhase = ''
substituteInPlace adv_cmds.xcodeproj/project.pbxproj \
--replace "FD201DC214369B4200906237 /* pkill.c in Sources */," "" \
--replace "FDF278D60FC6204E00D7A3C6 /* locale.cc in Sources */," "" \
--replace '/usr/lib/libtermcap.dylib' 'libncurses.dylib'
'';
buildPhase = ''
targets=$(xcodebuild -list \
| awk '/Targets:/{p=1;print;next} p&&/^\s*$/{p=0};p' \
| tail -n +2 | sed 's/^[ \t]*//' \
| grep -v -e Desktop -e Embedded -e mklocale -e colldef)
for i in $targets; do
xcodebuild SYMROOT=$PWD/Products OBJROOT=$PWD/Intermediates -target $i
done
'';
# temporary install phase until xcodebuild has "install" support
installPhase = ''
mkdir -p $out/bin/
install Products/Release/* $out/bin/
for n in 1 8; do
mkdir -p $out/share/man/man$n
install */*.$n $out/share/man/man$n
done
mkdir -p $out/System/Library/LaunchDaemons
install fingerd/finger.plist $out/System/Library/LaunchDaemons
# from variant_links.sh
# ln -s $out/bin/pkill $out/bin/pgrep
# ln -s $out/share/man/man1/pkill.1 $out/share/man/man1/pgrep.1
'';
nativeBuildInputs = [ xcbuild ];
buildInputs = [ ncurses libutil ];
meta = {
platforms = stdenv.lib.platforms.darwin;
maintainers = with stdenv.lib.maintainers; [ matthewbauer ];
};
}