summary refs log tree commit diff
path: root/pkgs/os-specific/darwin/apple-source-releases/libsecurity_utilities/default.nix
blob: e811c4c11a82e5be22ff2241c963dd91bc0220d2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{ IOKit, appleDerivation, apple_sdk, libauto, libobjc, libsecurity_codesigning, sqlite, stdenv, osx_private_sdk }:
appleDerivation {
  buildInputs = [
    libauto
    libobjc
    IOKit
  ];
  propagatedBuildInputs = [
    sqlite
    apple_sdk.frameworks.PCSC
  ];
  NIX_LDFLAGS = "-framework PCSC";
  patchPhase = ''
    substituteInPlace lib/errors.h --replace \
      '<CoreServices/../Frameworks/CarbonCore.framework/Headers/MacTypes.h>' \
      '"MacTypes.h"'
    substituteInPlace lib/debugging.cpp --replace PATH_MAX 1024
    substituteInPlace lib/superblob.h --replace 'result->at' 'result->template at'
    substituteInPlace lib/ccaudit.cpp --replace '<bsm/libbsm.h>' '"bsm/libbsm.h"'
    substituteInPlace lib/powerwatch.h --replace \
      '<IOKit/pwr_mgt/IOPMLibPrivate.h>' \
      '"${IOKit}/Library/Frameworks/IOKit.framework/Headers/pwr_mgt/IOPMLibPrivate.h"'
    cp -R ${osx_private_sdk}/include/bsm lib
    cp ${osx_private_sdk}/include/utilities_dtrace.h lib
  '' + stdenv.lib.optionalString (!stdenv.cc.nativeLibc) ''
    substituteInPlace lib/vproc++.cpp --replace /usr/local/include/vproc_priv.h ${stdenv.libc}/include/vproc_priv.h
  '';
}