2018-07-06 18:53:50 -04:00
|
|
|
{ stdenv, appleDerivation, xcbuildHook
|
2019-01-03 15:09:44 -06:00
|
|
|
, Libc, xnu, libutil-new }:
|
2018-04-12 17:16:49 -05:00
|
|
|
|
|
|
|
appleDerivation {
|
2018-07-06 18:53:50 -04:00
|
|
|
nativeBuildInputs = [ xcbuildHook ];
|
2019-01-03 15:09:44 -06:00
|
|
|
buildInputs = [ libutil-new ];
|
2018-04-12 17:16:49 -05:00
|
|
|
|
|
|
|
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
|
2018-12-29 23:58:10 -06:00
|
|
|
for f in Products/Release/*; do
|
|
|
|
if [ -f $f ]; then
|
|
|
|
install -D $file $out/bin/$(basename $f)
|
|
|
|
done
|
2018-04-12 17:16:49 -05:00
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
platforms = stdenv.lib.platforms.darwin;
|
|
|
|
maintainers = with stdenv.lib.maintainers; [ matthewbauer ];
|
|
|
|
};
|
|
|
|
}
|