swift-corelibs: init

moves swift-corelibs-corefoundation to own dir

also adds libdispatch
This commit is contained in:
Matthew Bauer
2018-04-09 18:35:35 -05:00
parent c3ce4ee723
commit 72f8df9465
4 changed files with 22 additions and 2 deletions
@@ -0,0 +1,32 @@
{ stdenv, fetchFromGitHub, python, ninja, libxml2 }:
stdenv.mkDerivation {
name = "swift-corefoundation";
src = fetchFromGitHub {
owner = "apple";
repo = "swift-corelibs-foundation";
rev = "dce4233f583ec15190b240d6116396bf9641cd57";
sha256 = "0i2ldvy14x05k2vgl5z0g5l2i5llifdfbij5zwfdwb8jmmq215qr";
};
buildInputs = [ ninja python libxml2 ];
patchPhase = ''
substituteInPlace CoreFoundation/build.py \
--replace '-I''${SYSROOT}/usr/include/libxml2' '-I${libxml2.dev}/include/libxml2' \
'';
configurePhase = ":";
buildPhase = ''
cd CoreFoundation
../configure --sysroot unused
ninja
'';
installPhase = ''
mkdir -p $out/lib
cp ../Build/CoreFoundation/libCoreFoundation.a $out/lib
'';
}
@@ -0,0 +1,8 @@
{callPackage, stdenv, darwin, xcbuild}:
rec {
corefoundation = callPackage ./corefoundation.nix {};
libdispatch = callPackage ./libdispatch.nix {
inherit (darwin) apple_sdk_sierra xnu;
};
}
@@ -0,0 +1,12 @@
{ stdenv, fetchFromGitHub, cmake, apple_sdk_sierra, xnu-new }:
stdenv.mkDerivation rec {
name = "swift-corelibs-libdispatch";
src = fetchFromGitHub {
owner = "apple";
repo = name;
rev = "f83b5a498bad8e9ff8916183cf6e8ccf677c346b";
sha256 = "1czkyyc9llq2mnqfp19mzcfsxzas0y8zrk0gr5hg60acna6jkz2l";
};
buildInputs = [ cmake apple_sdk_sierra.sdk xnu-new ];
}