diff options
Diffstat (limited to 'nixpkgs/pkgs/os-specific/darwin/apple-source-releases/diskdev_cmds/default.nix')
-rw-r--r-- | nixpkgs/pkgs/os-specific/darwin/apple-source-releases/diskdev_cmds/default.nix | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/diskdev_cmds/default.nix b/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/diskdev_cmds/default.nix new file mode 100644 index 000000000000..f27b5ae13022 --- /dev/null +++ b/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/diskdev_cmds/default.nix @@ -0,0 +1,34 @@ +{ stdenv, appleDerivation, xcbuildHook +, Libc, xnu, libutil-new }: + +appleDerivation { + nativeBuildInputs = [ xcbuildHook ]; + buildInputs = [ libutil-new ]; + + NIX_CFLAGS_COMPILE = "-I."; + NIX_LDFLAGS = "-lutil"; + patchPhase = '' + # ugly hacks for missing headers + # most are bsd related - probably should make this a drv + unpackFile ${Libc.src} + unpackFile ${xnu.src} + mkdir System sys machine i386 + cp xnu-*/bsd/sys/disklabel.h sys + cp xnu-*/bsd/machine/disklabel.h machine + cp xnu-*/bsd/i386/disklabel.h i386 + cp -r xnu-*/bsd/sys System + cp -r Libc-*/uuid System + ''; + installPhase = '' + install -D Products/Release/libdisk.a $out/lib/libdisk.a + rm Products/Release/libdisk.a + for bin in Products/Release/*; do + install -D $bin $out/bin/$(basename $bin) + done + ''; + + meta = { + platforms = stdenv.lib.platforms.darwin; + maintainers = with stdenv.lib.maintainers; [ matthewbauer ]; + }; +} |