nixpkgs/pkgs/os-specific/darwin/apple-source-releases/security_systemkeychain/default.nix
Matthew Bauer 0534ceac81 xcbuild: move setup hook to xcbuildHook
Not every package that needs xcbuild will want to use its build phase.
I have moved the xcbuild setup hook to the new attribute xcbuildHook.
This means that dontUseXcbuild is no longer needed. If you just need
to call xcbuild on its own you can just refer to xcbuild.
2018-07-09 17:13:58 -04:00

33 lines
1.0 KiB
Nix

{ appleDerivation, xcbuildHook, Security
, libsecurity_codesigning, libsecurity_utilities, libsecurity_cdsa_utilities
, xnu, osx_private_sdk, pcsclite}:
appleDerivation {
nativeBuildInputs = [ xcbuildHook ];
buildInputs = [ Security libsecurity_utilities
libsecurity_cdsa_utilities libsecurity_codesigning
pcsclite ];
NIX_LDFLAGS = "-lpcsclite";
# can't build the whole thing
xcbuildFlags = "-target codesign";
preBuild = ''
mkdir -p include/Security
cp ${osx_private_sdk.src}/PrivateSDK10.10.sparse.sdk/System/Library/Frameworks/Security.framework/PrivateHeaders/*.h include/Security
cp ${osx_private_sdk.src}/PrivateSDK10.10.sparse.sdk/System/Library/Frameworks/Security.framework/Headers/*.h include/Security
unpackFile ${xnu.src}
mkdir -p include/sys
cp -r xnu-*/bsd/sys/codesign.h include/sys/codesign.h
'';
NIX_CFLAGS_COMPILE = "-Iinclude";
installPhase = ''
mkdir -p $out/bin
cp Products/Release/codesign $out/bin/codesign
'';
}