@@ -1,13 +1,33 @@
|
||||
{ stdenv, appleDerivation }:
|
||||
{ stdenv, lib, appleDerivation, xcbuildHook
|
||||
|
||||
# headersOnly is true when building for libSystem
|
||||
, headersOnly ? false }:
|
||||
|
||||
# all symbols are located in libSystem
|
||||
appleDerivation {
|
||||
installPhase = ''
|
||||
mkdir -p $out/include
|
||||
cp *.h $out/include
|
||||
nativeBuildInputs = lib.optional (!headersOnly) xcbuildHook;
|
||||
|
||||
prePatch = ''
|
||||
substituteInPlace tzlink.c \
|
||||
--replace '#include <xpc/xpc.h>' ""
|
||||
'';
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
xcbuildFlags = "-target util";
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/include
|
||||
'' + lib.optionalString headersOnly ''
|
||||
cp *.h $out/include
|
||||
'' + 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
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
maintainers = with maintainers; [ copumpkin ];
|
||||
platforms = platforms.darwin;
|
||||
license = licenses.apsl20;
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
{ stdenv, appleDerivation, xcbuildHook }:
|
||||
|
||||
# TODO: make this the official libutil expression once we've integrated xcbuild in the bootstrap
|
||||
appleDerivation {
|
||||
nativeBuildInputs = [ xcbuildHook ];
|
||||
|
||||
prePatch = ''
|
||||
substituteInPlace tzlink.c \
|
||||
--replace '#include <xpc/xpc.h>' ""
|
||||
'';
|
||||
|
||||
xcbuildFlags = "-target util";
|
||||
|
||||
installPhase = ''
|
||||
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
|
||||
'';
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
maintainers = with maintainers; [ copumpkin ];
|
||||
platforms = platforms.darwin;
|
||||
license = licenses.apsl20;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user