nixpkgs/pkgs/os-specific/darwin/apple-source-releases/SmartCardServices/default.nix
2018-04-12 14:12:36 -05:00

42 lines
1.2 KiB
Nix

{ stdenv, appleDerivation, xcbuild, gnumake, Security
, libsecurity_utilities, libsecurity_cdsa_utilities }:
appleDerivation {
buildInputs = [ xcbuild libsecurity_utilities libsecurity_cdsa_utilities ];
DSTROOT = "$out";
NIX_CFLAGS_COMPILE = "-I.";
preBuild = ''
mkdir -p Security
cp ${Security}/Library/Frameworks/Security.framework/Headers/*.h Security
'';
patchPhase = ''
substituteInPlace SmartCardServices.xcodeproj/project.pbxproj \
--replace "/usr/bin/gnumake" "${gnumake}/bin/make"
substituteInPlace src/PCSC/PCSC.exp \
--replace _PCSCVersionString "" \
--replace _PCSCVersionNumber ""
substituteInPlace Makefile.installPhase \
--replace chown "# chown" \
--replace /usr/bin/ ""
'';
installPhase = ''
make -f Makefile.installPhase install
make -f Makefile-exec.installPhase install
mv $out/usr/* $out
rmdir $out/usr
mkdir -p $out/Library/Frameworks
cp -r Products/Release/PCSC.bundle $out/Library/Frameworks/PCSC.framework
'';
meta = with stdenv.lib; {
maintainers = with maintainers; [ matthewbauer ];
platforms = platforms.darwin;
license = licenses.apsl20;
};
}