chromium,chromedriver: 129.0.6668.91 -> 129.0.6668.100
[NixPkgs.git] / pkgs / os-specific / darwin / apple-source-releases / dtrace / default.nix
blobafff7897488efed397a4d19703b21bb597ca5245
1 { appleDerivation, xcbuildHook, CoreSymbolication, apple_sdk
2 , xnu, bison, flex, stdenv, fixDarwinDylibNames }:
4 appleDerivation {
5   nativeBuildInputs = [ xcbuildHook flex bison fixDarwinDylibNames ];
6   buildInputs = [ CoreSymbolication apple_sdk.frameworks.CoreSymbolication xnu ];
7   # -fcommon: workaround build failure on -fno-common toolchains:
8   #   duplicate symbol '_kCSRegionMachHeaderName' in: libproc.o dt_module_apple.o
9   env.NIX_CFLAGS_COMPILE = "-DCTF_OLD_VERSIONS -DPRIVATE -DYYDEBUG=1 -I${xnu}/Library/Frameworks/System.framework/Headers -Wno-error=implicit-function-declaration -fcommon";
10   NIX_LDFLAGS = "-L./Products/Release";
11   xcbuildFlags = [ "-target" "dtrace_frameworks" "-target" "dtrace" ];
13   doCheck = false;
14   checkPhase = "xcodebuild -target dtrace_tests";
16   postPatch = ''
17     substituteInPlace dtrace.xcodeproj/project.pbxproj \
18       --replace "/usr/sbin" ""
19     substituteInPlace libdtrace/dt_open.c \
20       --replace /usr/bin/clang ${stdenv.cc.cc}/bin/clang \
21       --replace /usr/bin/ld ${stdenv.cc.bintools.bintools}/bin/ld \
22       --replace /usr/lib/dtrace/dt_cpp.h $out/include/dt_cpp.h \
23       --replace /usr/lib/dtrace $out/lib/dtrace
24     substituteInPlace libproc/libproc.c \
25       --replace "#include <sandbox/rootless.h>" ""
26   '';
28   # hack to handle xcbuild's broken lex handling
29   preBuild = ''
30     pushd libdtrace
31     yacc -d dt_grammar.y
32     flex -l -d dt_lex.l
33     popd
35     substituteInPlace dtrace.xcodeproj/project.pbxproj \
36       --replace '6EBC9800099BFBBF0001019C /* dt_grammar.y */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.yacc; name = dt_grammar.y; path = libdtrace/dt_grammar.y; sourceTree = "<group>"; };' '6EBC9800099BFBBF0001019C /* y.tab.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = y.tab.c; path = libdtrace/y.tab.c; sourceTree = "<group>"; };' \
37       --replace '6EBC9808099BFBBF0001019C /* dt_lex.l */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.lex; name = dt_lex.l; path = libdtrace/dt_lex.l; sourceTree = "<group>"; };' '6EBC9808099BFBBF0001019C /* lex.yy.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = lex.yy.c; path = libdtrace/lex.yy.c; sourceTree = "<group>"; };'
38   '';
40   # xcbuild doesn't support install
41   installPhase = ''
42     mkdir -p $out
44     cp -r Products/Release/usr/include $out/include
45     cp scripts/dt_cpp.h $out/include/dt_cpp.h
47     mkdir $out/lib
48     cp Products/Release/*.dylib $out/lib
50     mkdir $out/bin
51     cp Products/Release/dtrace $out/bin
53     mkdir -p $out/lib/dtrace
55     install_name_tool -change $PWD/Products/Release/libdtrace.dylib $out/lib/libdtrace.dylib $out/bin/dtrace
56   '';