about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorDan Peebles <pumpkin@me.com>2016-08-14 17:35:44 -0400
committerDan Peebles <pumpkin@me.com>2016-08-14 17:35:44 -0400
commit1861744e7cea7db1014b35ba3b1fdce6190d7ac9 (patch)
treeeb83affb7330c463b8624d4155ff29b1b4f399fe /pkgs
parent98b5e3a531a5f560314104ceecb730e59fc78a58 (diff)
downloadnixlib-1861744e7cea7db1014b35ba3b1fdce6190d7ac9.tar
nixlib-1861744e7cea7db1014b35ba3b1fdce6190d7ac9.tar.gz
nixlib-1861744e7cea7db1014b35ba3b1fdce6190d7ac9.tar.bz2
nixlib-1861744e7cea7db1014b35ba3b1fdce6190d7ac9.tar.lz
nixlib-1861744e7cea7db1014b35ba3b1fdce6190d7ac9.tar.xz
nixlib-1861744e7cea7db1014b35ba3b1fdce6190d7ac9.tar.zst
nixlib-1861744e7cea7db1014b35ba3b1fdce6190d7ac9.zip
swift-corefoundation: init
This currently only produces a static library, but is a start :) soon we
might be able to incorporate it into our stdenv, but we need to get the
build system to produce a proper .framework first.
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/os-specific/darwin/swift-corefoundation/default.nix38
-rw-r--r--pkgs/top-level/all-packages.nix2
2 files changed, 40 insertions, 0 deletions
diff --git a/pkgs/os-specific/darwin/swift-corefoundation/default.nix b/pkgs/os-specific/darwin/swift-corefoundation/default.nix
new file mode 100644
index 000000000000..0ec282b503bf
--- /dev/null
+++ b/pkgs/os-specific/darwin/swift-corefoundation/default.nix
@@ -0,0 +1,38 @@
+{ stdenv, fetchFromGitHub, python, ninja, libpthread, libxml2 }:
+
+stdenv.mkDerivation {
+  name = "swift-corefoundation";
+
+  src = fetchFromGitHub {
+    owner  = "apple";
+    repo   = "swift-corelibs-foundation";
+    rev    = "87d1a97d6af07fec568765c47daddff0aaa0d59c";
+    sha256 = "05cmqwzqqxb489g9hq7hhj2yva12pi488iblbpnvyk1y4nx077cw";
+  };
+
+  buildInputs = [ ninja python libpthread libxml2 ];
+
+  patchPhase = ''
+    HACK=$PWD/hack
+    mkdir -p $HACK/CoreFoundation
+    cp CoreFoundation/Base.subproj/CFAsmMacros.h $HACK/CoreFoundation
+
+    substituteInPlace CoreFoundation/build.py \
+      --replace "','" "'," \
+      --replace '-I''${SYSROOT}/usr/include/libxml2' '-I${libxml2.dev}/include/libxml2' \
+      --replace 'cf.ASFLAGS = " ".join([' "cf.ASFLAGS = ' '.join([ '-I$HACK', " \
+  '';
+
+  configureFlags = "--sysroot unused";
+
+  buildPhase = ''
+    cd CoreFoundation
+    ../configure --sysroot foo
+    ninja
+  '';
+
+  installPhase = ''
+    mkdir -p $out/lib
+    cp ../Build/CoreFoundation/libCoreFoundation.a $out/lib
+  '';
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 42cf49c1143d..bb3689467ab5 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -10848,6 +10848,8 @@ in
 
     opencflite = callPackage ../os-specific/darwin/opencflite {};
 
+    swift-corefoundation = callPackage ../os-specific/darwin/swift-corefoundation { inherit (apple-source-releases) libpthread; };
+
     xcode = callPackage ../os-specific/darwin/xcode {};
 
     osx_sdk = callPackage ../os-specific/darwin/osx-sdk {};