nixpkgs/pkgs/os-specific/darwin/apple-source-releases/libsecurity_apple_csp/default.nix
Domen Kožar e211504db6
Get rid of some usages of osx_private_sdk
For example this reduces haskell closure on
darwin for some packages for almost 500MB.
2017-07-09 22:48:04 +02:00

32 lines
1.3 KiB
Nix

{ appleDerivation, apple_sdk, libsecurity_asn1, libsecurity_cdsa_plugin, libsecurity_cdsa_utilities, libsecurity_cdsa_utils, libsecurity_utilities, CommonCrypto, stdenv }:
appleDerivation {
buildInputs = [
libsecurity_cdsa_utilities
libsecurity_utilities
libsecurity_cdsa_plugin
libsecurity_asn1
libsecurity_cdsa_utils
];
NIX_CFLAGS_COMPILE = "-Iopen_ssl";
patchPhase = ''
for file in lib/BlockCryptor.h lib/RSA_DSA_signature.h lib/castContext.h \
lib/RawSigner.h lib/MD2Object.h lib/HMACSHA1.h lib/bfContext.h lib/rc4Context.h; do
substituteInPlace ''$file --replace \
'"CoreServices/../Frameworks/CarbonCore.framework/Headers/MacTypes.h"' \
'"${apple_sdk.sdk}/include/MacTypes.h"'
done
for file in lib/castContext.h lib/gladmanContext.h lib/desContext.h lib/rc4Context.h; do
substituteInPlace ''$file --replace \
'/usr/local/include/CommonCrypto/CommonCryptorSPI.h' \
'${CommonCrypto}/include/CommonCrypto/CommonCryptorSPI.h'
done
substituteInPlace lib/opensshWrap.cpp --replace RSA_DSA_Keys.h RSA_DSA_keys.h
'' + stdenv.lib.optionalString (!stdenv.cc.nativeLibc) ''
substituteInPlace lib/pbkdf2.c --replace \
'<CoreServices/../Frameworks/CarbonCore.framework/Headers/ConditionalMacros.h>' \
'"${stdenv.libc}/include/ConditionalMacros.h"'
'';
}