@@ -0,0 +1,43 @@
1+{ stdenv, cmake, fetchFromGitHub, zlib, libxml2, libpng, CoreServices, CoreGraphics, ImageIO }:
2+
3+let
4+ googletest = fetchFromGitHub {
5+ owner = "google";
6+ repo = "googletest";
7+ rev = "43359642a1c16ad3f4fc575c7edd0cb935810815";
8+ sha256 = "0y4xaah62fjr3isaryc3vfz3mn9xflr00vchdimj8785milxga4q";
9+ };
10+
11+ linenoise = fetchFromGitHub {
12+ owner = "antirez";
13+ repo = "linenoise";
14+ rev = "c894b9e59f02203dbe4e2be657572cf88c4230c3";
15+ sha256 = "0wasql7ph5g473zxhc2z47z3pjp42q0dsn4gpijwzbxawid71b4w";
16+ };
17+in stdenv.mkDerivation rec {
18+ name = "xcbuild-${stdenv.lib.substring 0 8 version}";
19+ version = "49f8a5923f1381f87ac03ad4c1b138d1d2b74369";
20+
21+ src = fetchFromGitHub {
22+ owner = "facebook";
23+ repo = "xcbuild";
24+ rev = version;
25+ sha256 = "0l107xkh7dab2xc58dqyrrhpd1gp12cpzh0wrx0i9jbh0idbwnk0";
26+ };
27+
28+ prePatch = ''
29+ rmdir ThirdParty/*
30+ cp -r --no-preserve=all ${googletest} ThirdParty/googletest
31+ cp -r --no-preserve=all ${linenoise} ThirdParty/linenoise
32+ '';
33+
34+ enableParallelBuilding = true;
35+
36+ # TODO: instruct cmake not to put it in /usr, rather than cleaning up
37+ postInstall = ''
38+ mv $out/usr/* $out
39+ rmdir $out/usr
40+ '';
41+
42+ buildInputs = [ cmake zlib libxml2 libpng CoreServices CoreGraphics ImageIO ];
43+}