diff options
author | Matthew Bauer <mjbauer95@gmail.com> | 2019-02-06 20:13:51 -0500 |
---|---|---|
committer | Matthew Bauer <mjbauer95@gmail.com> | 2019-04-20 23:17:04 -0400 |
commit | d69cc779b520ea74a5b52fa5691f3f8fd7fe9cf3 (patch) | |
tree | 7ec6f7707d70df2aee4260ec7b90e88ba59b84cb /pkgs/os-specific/darwin/apple-source-releases/dtrace | |
parent | 4c3c8f4a7d5d82e3a148819d8c80bdef6bcb0c6f (diff) | |
download | nixpkgs-d69cc779b520ea74a5b52fa5691f3f8fd7fe9cf3.tar nixpkgs-d69cc779b520ea74a5b52fa5691f3f8fd7fe9cf3.tar.gz nixpkgs-d69cc779b520ea74a5b52fa5691f3f8fd7fe9cf3.tar.bz2 nixpkgs-d69cc779b520ea74a5b52fa5691f3f8fd7fe9cf3.tar.lz nixpkgs-d69cc779b520ea74a5b52fa5691f3f8fd7fe9cf3.tar.xz nixpkgs-d69cc779b520ea74a5b52fa5691f3f8fd7fe9cf3.tar.zst nixpkgs-d69cc779b520ea74a5b52fa5691f3f8fd7fe9cf3.zip |
Revert "Revert "darwin 10.12 commits""
This reverts commit 8505e710e707b2e425379dc356721194f742d8d0.
Diffstat (limited to 'pkgs/os-specific/darwin/apple-source-releases/dtrace')
-rw-r--r-- | pkgs/os-specific/darwin/apple-source-releases/dtrace/default.nix | 79 | ||||
-rw-r--r-- | pkgs/os-specific/darwin/apple-source-releases/dtrace/xcode.nix | 47 |
2 files changed, 41 insertions, 85 deletions
diff --git a/pkgs/os-specific/darwin/apple-source-releases/dtrace/default.nix b/pkgs/os-specific/darwin/apple-source-releases/dtrace/default.nix index fd2c95563b4..8706d22be19 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/dtrace/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/dtrace/default.nix @@ -1,50 +1,53 @@ -{ appleDerivation, cctools, zlib }: +{ appleDerivation, xcbuildHook, CoreSymbolication +, xnu, bison, flex, darling, stdenv, fixDarwinDylibNames }: appleDerivation { - buildInputs = [ cctools zlib ]; - - buildPhase = '' - export CFLAGS=" -I$PWD/head -I$PWD/sys -I$PWD/libelf -I$PWD/libdwarf" - - pushd libelf - for f in *.c; do - if [ "$f" != "lintsup.c" ]; then # Apple doesn't use it, so I don't either - cc -D_INT64_TYPE -D_LONGLONG_TYPE -D_ILP32 $CFLAGS -c $f - fi - done - libtool -static -o libelf.a *.o - popd + nativeBuildInputs = [ xcbuildHook flex bison fixDarwinDylibNames ]; + buildInputs = [ CoreSymbolication darling xnu ]; + NIX_CFLAGS_COMPILE = "-DCTF_OLD_VERSIONS -DPRIVATE -DYYDEBUG=1 -I${xnu}/Library/Frameworks/System.framework/Headers -Wno-error=implicit-function-declaration"; + NIX_LDFLAGS = "-L./Products/Release"; + xcbuildFlags = "-target dtrace_frameworks -target dtrace"; + + doCheck = false; + checkPhase = "xcodebuild -target dtrace_tests"; + + postPatch = '' + substituteInPlace dtrace.xcodeproj/project.pbxproj \ + --replace "/usr/sbin" "" + substituteInPlace libdtrace/dt_open.c \ + --replace /usr/bin/clang ${stdenv.cc.cc}/bin/clang \ + --replace /usr/bin/ld ${stdenv.cc.bintools.bintools}/bin/ld \ + --replace /usr/lib/dtrace/dt_cpp.h $out/include/dt_cpp.h \ + --replace /usr/lib/dtrace $out/lib/dtrace + ''; - pushd libdwarf - ./configure CFLAGS="$CFLAGS -Icmplrs" - make + # hack to handle xcbuild's broken lex handling + preBuild = '' + pushd libdtrace + yacc -d dt_grammar.y + flex -l -d dt_lex.l popd - cp libelf/libelf.a tools/ctfconvert - cp libdwarf/libdwarf.a tools/ctfconvert + substituteInPlace dtrace.xcodeproj/project.pbxproj \ + --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>"; };' \ + --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>"; };' + ''; + + # xcbuild doesn't support install + installPhase = '' + mkdir -p $out - pushd tools/ctfconvert - for f in ../../darwin_shim.c *.c; do - cc -DNDEBUG -DNS_BLOCK_ASSERTIONS $CFLAGS -c $f - done + cp -r Products/Release/usr/include $out/include + cp scripts/dt_cpp.h $out/include/dt_cpp.h - export COMMON="alist.o ctf.o darwin_shim.o hash.o iidesc.o input.o list.o \ - memory.o output.o stack.o strtab.o symbol.o tdata.o traverse.o util.o" + mkdir $out/lib + cp Products/Release/*.dylib $out/lib - export CONVERT="ctfconvert.o dwarf.o merge.o st_bugs.o st_parse.o stabs.o" - export MERGE="barrier.o ctfmerge.o dwarf.o fifo.o merge.o st_bugs.o st_parse.o stabs.o utils.o" - export DUMP="dump.o fifo.o utils.o" + mkdir $out/bin + cp Products/Release/dtrace $out/bin - clang -o ctfconvert $CONVERT $COMMON -L. -lz -lelf -ldwarf - clang -o ctfmerge $MERGE $COMMON -L. -lz -lelf -ldwarf - clang -o ctfdump $DUMP $COMMON -L. -lz -lelf - popd - ''; + mkdir -p $out/lib/dtrace - installPhase = '' - mkdir -p $out/bin - cp tools/ctfconvert/ctfconvert $out/bin - cp tools/ctfconvert/ctfmerge $out/bin - cp tools/ctfconvert/ctfdump $out/bin + install_name_tool -change $PWD/Products/Release/libdtrace.dylib $out/lib/libdtrace.dylib $out/bin/dtrace ''; } diff --git a/pkgs/os-specific/darwin/apple-source-releases/dtrace/xcode.nix b/pkgs/os-specific/darwin/apple-source-releases/dtrace/xcode.nix deleted file mode 100644 index f8636403ed5..00000000000 --- a/pkgs/os-specific/darwin/apple-source-releases/dtrace/xcode.nix +++ /dev/null @@ -1,47 +0,0 @@ -{ appleDerivation, xcbuildHook, CoreSymbolication -, xnu, bison, flex, darling, stdenv }: - -appleDerivation { - nativeBuildInputs = [ xcbuildHook flex bison ]; - buildInputs = [ CoreSymbolication darling ]; - NIX_CFLAGS_COMPILE = "-DCTF_OLD_VERSIONS -DPRIVATE -DYYDEBUG=1 -I${xnu}/Library/Frameworks/System.framework/Headers"; - NIX_LDFLAGS = "-L./Products/Release"; - xcbuildFlags = "-target dtrace"; - - patchPhase = '' - substituteInPlace dtrace.xcodeproj/project.pbxproj --replace "/usr/sbin" "" - substituteInPlace libdtrace/dt_open.c \ - --replace "/usr/bin/clang" "${stdenv.cc}/bin/cpp" \ - --replace "/usr/bin/ld" "${stdenv.cc}/bin/ld" \ - --replace "/usr/bin/dtrace" $out/lib/dtrace - ''; - - # hack to handle xcbuild's broken lex handling - preBuild = '' - cd libdtrace - yacc -d dt_grammar.y - flex -l -d dt_lex.l - cd .. - - substituteInPlace dtrace.xcodeproj/project.pbxproj \ - --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>"; };' \ - --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>"; };' - ''; - - # xcbuild doesn't support install - installPhase = '' - mkdir -p $out - - cp -r Products/Release/usr $out - mv $out/usr/* $out - rmdir $out/usr - - mkdir $out/lib - cp Products/Release/*.dylib $out/lib - - mkdir $out/bin - cp Products/Release/dtrace $out/bin - - mkdir -p $out/lib/dtrace - ''; -} |