1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-01-22 14:45:27 +00:00
nixpkgs/pkgs/os-specific/darwin/apple-source-releases/libsecurity_keychain/default.nix

48 lines
2.2 KiB
Nix
Raw Normal View History

2018-06-09 04:57:36 +01:00
{ CF, Security, appleDerivation, apple_sdk, libsecurity_asn1, libsecurity_cdsa_client, libsecurity_cdsa_utilities, libsecurity_cdsa_utils, libsecurity_ocspd, libsecurity_pkcs12, libsecurity_utilities, libsecurityd, openssl, osx_private_sdk, security_dotmac_tp, lib }:
2015-06-22 04:29:33 +01:00
appleDerivation {
buildInputs = [
libsecurity_utilities
libsecurity_cdsa_client
libsecurity_cdsa_utilities
libsecurityd
CF
libsecurity_asn1
libsecurity_pkcs12
libsecurity_cdsa_utils
openssl
libsecurity_ocspd
security_dotmac_tp
];
patchPhase = ''
substituteInPlace lib/Keychains.cpp --replace DLDbListCFPref.h DLDBListCFPref.h
2015-10-16 04:49:29 +01:00
2015-06-22 04:29:33 +01:00
substituteInPlace lib/SecCertificate.cpp --replace '#include <Security/SecCertificatePriv.h>' ""
2015-10-16 04:49:29 +01:00
cp ${osx_private_sdk}/include/xpc/private.h xpc
2018-06-09 04:57:36 +01:00
cp ${lib.getDev apple_sdk.sdk}/include/xpc/*.h xpc
cp ${osx_private_sdk}/include/sandbox_private.h lib/sandbox.h
2015-10-16 04:49:29 +01:00
2015-06-22 04:29:33 +01:00
substituteInPlace lib/SecItemPriv.h \
--replace "extern CFTypeRef kSecAttrAccessGroup" "extern const CFTypeRef kSecAttrAccessGroup" \
--replace "extern CFTypeRef kSecAttrIsSensitive" "extern const CFTypeRef kSecAttrIsSensitive" \
--replace "extern CFTypeRef kSecAttrIsExtractable" "extern const CFTypeRef kSecAttrIsExtractable"
2015-10-16 04:49:29 +01:00
2015-06-22 04:29:33 +01:00
substituteInPlace lib/Keychains.cpp --replace \
'<CoreServices/../Frameworks/CarbonCore.framework/Headers/MacErrors.h>' \
2018-06-09 04:57:36 +01:00
'"${apple_sdk.sdk.out}/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/Headers/MacErrors.h"'
2015-10-16 04:49:29 +01:00
2015-06-22 04:29:33 +01:00
substituteInPlace lib/CertificateValues.cpp --replace \
'#include <Security/SecCertificatePriv.h>' ""
2015-10-16 04:49:29 +01:00
2015-06-22 04:29:33 +01:00
substituteInPlace lib/DLDBListCFPref.cpp --replace \
'dispatch_once_t AppSandboxChecked;' ''$'namespace Security {\ndispatch_once_t AppSandboxChecked;' \
--replace 'return mLoginDLDbIdentifier;' 'return mLoginDLDbIdentifier; }' \
--replace '_xpc_runtime_is_app_sandboxed()' 'false'
# hope that doesn't hurt anything
substituteInPlace lib/KCEventNotifier.h --replace \
'CoreFoundation/CFNotificationCenter.h' \
2018-06-09 04:57:36 +01:00
'${apple_sdk.sdk.out}/Library/Frameworks/CoreFoundation.framework/Versions/A/Headers/CFNotificationCenter.h'
2015-06-22 04:29:33 +01:00
'';
}