2019-06-16 20:59:06 +01:00
|
|
|
{ lib, appleDerivation, xcbuildHook
|
2019-02-07 01:13:51 +00:00
|
|
|
|
|
|
|
# headersOnly is true when building for libSystem
|
|
|
|
, headersOnly ? false }:
|
2015-11-04 18:49:13 +00:00
|
|
|
|
|
|
|
appleDerivation {
|
2019-02-07 01:13:51 +00:00
|
|
|
nativeBuildInputs = lib.optional (!headersOnly) xcbuildHook;
|
|
|
|
|
|
|
|
prePatch = ''
|
|
|
|
substituteInPlace tzlink.c \
|
|
|
|
--replace '#include <xpc/xpc.h>' ""
|
|
|
|
'';
|
|
|
|
|
|
|
|
xcbuildFlags = "-target util";
|
|
|
|
|
2015-11-04 18:49:13 +00:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/include
|
2019-02-07 01:13:51 +00:00
|
|
|
'' + lib.optionalString headersOnly ''
|
2015-11-04 18:49:13 +00:00
|
|
|
cp *.h $out/include
|
2019-02-07 01:13:51 +00:00
|
|
|
'' + lib.optionalString (!headersOnly)''
|
|
|
|
mkdir -p $out/lib $out/include
|
|
|
|
|
|
|
|
cp Products/Release/*.dylib $out/lib
|
|
|
|
cp Products/Release/*.h $out/include
|
|
|
|
|
|
|
|
# TODO: figure out how to get this to be right the first time around
|
|
|
|
install_name_tool -id $out/lib/libutil.dylib $out/lib/libutil.dylib
|
2015-11-04 18:49:13 +00:00
|
|
|
'';
|
|
|
|
|
2019-02-07 01:13:51 +00:00
|
|
|
meta = with lib; {
|
2015-11-04 18:49:13 +00:00
|
|
|
maintainers = with maintainers; [ copumpkin ];
|
|
|
|
platforms = platforms.darwin;
|
|
|
|
license = licenses.apsl20;
|
|
|
|
};
|
|
|
|
}
|