diff options
author | Dan Peebles <thetypesaretoobig@gmail.com> | 2015-02-08 01:53:52 -0500 |
---|---|---|
committer | Dan Peebles <thetypesaretoobig@gmail.com> | 2015-02-08 01:53:52 -0500 |
commit | 29f265dfd28ce5567106a7a1df3bd6c1fbd8406f (patch) | |
tree | 3973e0a11ae1737f8d307ec07651cf5c12498210 /pkgs/os-specific/darwin/apple-source-releases/dtrace/default.nix | |
parent | f43c324cee6ed5fdbe679b70b71caaca1c4629a8 (diff) | |
download | nixpkgs-29f265dfd28ce5567106a7a1df3bd6c1fbd8406f.tar nixpkgs-29f265dfd28ce5567106a7a1df3bd6c1fbd8406f.tar.gz nixpkgs-29f265dfd28ce5567106a7a1df3bd6c1fbd8406f.tar.bz2 nixpkgs-29f265dfd28ce5567106a7a1df3bd6c1fbd8406f.tar.lz nixpkgs-29f265dfd28ce5567106a7a1df3bd6c1fbd8406f.tar.xz nixpkgs-29f265dfd28ce5567106a7a1df3bd6c1fbd8406f.tar.zst nixpkgs-29f265dfd28ce5567106a7a1df3bd6c1fbd8406f.zip |
Add a big bundle of packages from apple source releases. Many of them only provide headers or stubs, but are what's needed for the upcoming pure-darwin stdenv, and don't do any harm for now.
Diffstat (limited to 'pkgs/os-specific/darwin/apple-source-releases/dtrace/default.nix')
-rw-r--r-- | pkgs/os-specific/darwin/apple-source-releases/dtrace/default.nix | 50 |
1 files changed, 50 insertions, 0 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 new file mode 100644 index 00000000000..5fcd04266d5 --- /dev/null +++ b/pkgs/os-specific/darwin/apple-source-releases/dtrace/default.nix @@ -0,0 +1,50 @@ +{ stdenv, appleDerivation, cctools, zlib }: + +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 + + pushd libdwarf + ./configure CFLAGS="$CFLAGS -Icmplrs" + make + popd + + cp libelf/libelf.a tools/ctfconvert + cp libdwarf/libdwarf.a tools/ctfconvert + + pushd tools/ctfconvert + for f in ../../darwin_shim.c *.c; do + cc -DNDEBUG -DNS_BLOCK_ASSERTIONS $CFLAGS -c $f + done + + 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" + + 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" + + 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 + ''; + + installPhase = '' + mkdir -p $out/bin + cp tools/ctfconvert/ctfconvert $out/bin + cp tools/ctfconvert/ctfmerge $out/bin + cp tools/ctfconvert/ctfdump $out/bin + ''; +} |