2018-07-21 01:44:44 +01:00
|
|
|
{ Foundation, PCSC, Security, GSS, Kerberos, makeWrapper, apple_sdk,
|
2016-08-20 12:43:58 +01:00
|
|
|
fetchurl, gnustep, libobjc, libsecurity_apple_csp, libsecurity_apple_cspdl,
|
2015-10-16 04:49:29 +01:00
|
|
|
libsecurity_apple_file_dl, libsecurity_apple_x509_cl, libsecurity_apple_x509_tp,
|
|
|
|
libsecurity_asn1, libsecurity_cdsa_client, libsecurity_cdsa_plugin,
|
|
|
|
libsecurity_cdsa_utilities, libsecurity_cdsa_utils, libsecurity_cssm, libsecurity_filedb,
|
|
|
|
libsecurity_keychain, libsecurity_mds, libsecurity_pkcs12, libsecurity_sd_cspdl,
|
|
|
|
libsecurity_utilities, libsecurityd, osx_private_sdk, Security-framework, stdenv }:
|
2014-09-30 03:54:45 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2015-06-22 04:29:33 +01:00
|
|
|
version = "55115";
|
|
|
|
name = "SecurityTool-${version}";
|
2014-09-30 03:54:45 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://opensource.apple.com/tarballs/SecurityTool/SecurityTool-${version}.tar.gz";
|
|
|
|
sha256 = "0apcz4vy2z5645jhrs60wj3w27mncjjqv42h5lln36g6qs2n9113";
|
|
|
|
};
|
|
|
|
|
2018-07-04 20:08:35 +01:00
|
|
|
disallowedRequisites = [ apple_sdk.sdk ];
|
|
|
|
|
2015-06-22 04:29:33 +01:00
|
|
|
patchPhase = ''
|
|
|
|
# copied from libsecurity_generic
|
2017-10-30 12:45:36 +00:00
|
|
|
cp -R ${osx_private_sdk}/include/SecurityPrivateHeaders Security
|
2015-06-22 04:29:33 +01:00
|
|
|
|
|
|
|
substituteInPlace cmsutil.c --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-06-22 04:29:33 +01:00
|
|
|
substituteInPlace createFVMaster.c --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-06-22 04:29:33 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
postUnpack = ''
|
|
|
|
unpackFile ${Security.src}
|
|
|
|
cp Security-*/utilities/src/fileIo.c SecurityTool*
|
|
|
|
cp Security-*/utilities/src/fileIo.h SecurityTool*
|
2014-09-30 03:54:45 +01:00
|
|
|
'';
|
|
|
|
|
2015-06-22 04:29:33 +01:00
|
|
|
preBuild = ''
|
2018-07-02 22:48:29 +01:00
|
|
|
makeFlagsArray=(-j$NIX_BUILD_CORES)
|
2014-09-30 03:54:45 +01:00
|
|
|
'';
|
|
|
|
|
2015-06-22 04:29:33 +01:00
|
|
|
NIX_LDFLAGS = "-no_dtrace_dof";
|
|
|
|
|
2016-08-20 12:43:58 +01:00
|
|
|
makeFlags = [
|
|
|
|
"-f ${./GNUmakefile}"
|
|
|
|
"MAKEFILE_NAME=${./GNUmakefile}"
|
|
|
|
"GNUSTEP_MAKEFILES=${gnustep.make}/share/GNUstep/Makefiles"
|
|
|
|
];
|
2015-06-22 04:29:33 +01:00
|
|
|
|
|
|
|
installFlags = [
|
|
|
|
"security_INSTALL_DIR=\$(out)/bin"
|
|
|
|
];
|
|
|
|
|
2015-10-16 04:49:29 +01:00
|
|
|
propagatedBuildInputs = [ GSS Kerberos Security-framework PCSC Foundation ];
|
2015-07-01 00:10:51 +01:00
|
|
|
|
2015-07-12 00:04:27 +01:00
|
|
|
__propagatedImpureHostDeps = [ "/System/Library/Keychains" ];
|
|
|
|
|
2015-06-22 04:29:33 +01:00
|
|
|
buildInputs = [
|
2016-08-20 12:43:58 +01:00
|
|
|
gnustep.make
|
2015-06-22 04:29:33 +01:00
|
|
|
libsecurity_asn1
|
|
|
|
libsecurity_utilities
|
|
|
|
libsecurity_cdsa_utilities
|
|
|
|
libobjc
|
|
|
|
libsecurity_cdsa_client
|
|
|
|
libsecurity_keychain
|
|
|
|
libsecurity_cssm
|
|
|
|
libsecurity_cdsa_utils
|
|
|
|
libsecurity_mds
|
|
|
|
libsecurity_cdsa_plugin
|
|
|
|
libsecurity_apple_csp
|
|
|
|
libsecurity_apple_cspdl
|
|
|
|
libsecurity_apple_file_dl
|
|
|
|
libsecurity_apple_x509_cl
|
|
|
|
libsecurity_apple_x509_tp
|
|
|
|
libsecurity_pkcs12
|
|
|
|
libsecurity_sd_cspdl
|
|
|
|
libsecurity_filedb
|
|
|
|
libsecurityd
|
2015-07-05 09:41:56 +01:00
|
|
|
makeWrapper
|
2015-06-22 04:29:33 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
NIX_CFLAGS_COMPILE = [
|
|
|
|
"-F${Security}/Library/Frameworks"
|
|
|
|
"-F${PCSC}/Library/Frameworks"
|
|
|
|
"-Wno-deprecated-declarations"
|
|
|
|
];
|
|
|
|
|
2015-07-05 09:41:56 +01:00
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/security --set DYLD_INSERT_LIBRARIES /usr/lib/libsqlite3.dylib
|
|
|
|
'';
|
|
|
|
|
2014-09-30 03:54:45 +01:00
|
|
|
meta = with stdenv.lib; {
|
2017-08-06 23:05:18 +01:00
|
|
|
description = "Command line interface to macOS keychains and Security framework";
|
2015-06-22 04:29:33 +01:00
|
|
|
maintainers = with maintainers; [
|
|
|
|
copumpkin
|
|
|
|
joelteon
|
|
|
|
];
|
|
|
|
platforms = platforms.darwin;
|
|
|
|
license = licenses.apsl20;
|
2014-09-30 03:54:45 +01:00
|
|
|
};
|
2015-06-22 04:29:33 +01:00
|
|
|
}
|