2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, cmake, fetchFromGitHub, zlib, libxml2, libpng
|
2018-06-27 20:36:00 +01:00
|
|
|
, CoreServices, CoreGraphics, ImageIO, ninja }:
|
2016-10-13 05:31:58 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
googletest = fetchFromGitHub {
|
|
|
|
owner = "google";
|
|
|
|
repo = "googletest";
|
|
|
|
rev = "43359642a1c16ad3f4fc575c7edd0cb935810815";
|
|
|
|
sha256 = "0y4xaah62fjr3isaryc3vfz3mn9xflr00vchdimj8785milxga4q";
|
|
|
|
};
|
|
|
|
|
|
|
|
linenoise = fetchFromGitHub {
|
|
|
|
owner = "antirez";
|
|
|
|
repo = "linenoise";
|
|
|
|
rev = "c894b9e59f02203dbe4e2be657572cf88c4230c3";
|
|
|
|
sha256 = "0wasql7ph5g473zxhc2z47z3pjp42q0dsn4gpijwzbxawid71b4w";
|
|
|
|
};
|
2019-08-13 22:52:01 +01:00
|
|
|
in stdenv.mkDerivation {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "xcbuild";
|
2017-10-11 06:17:15 +01:00
|
|
|
|
2018-06-27 20:36:00 +01:00
|
|
|
# Once a version is released that includes
|
|
|
|
# https://github.com/facebook/xcbuild/commit/183c087a6484ceaae860c6f7300caf50aea0d710,
|
2017-10-11 06:17:15 +01:00
|
|
|
# we can stop doing this -pre thing.
|
|
|
|
version = "0.1.2-pre";
|
2016-10-13 05:31:58 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "facebook";
|
|
|
|
repo = "xcbuild";
|
2017-10-11 06:17:15 +01:00
|
|
|
rev = "32b9fbeb69bfa2682bd0351ec2f14548aaedd554";
|
|
|
|
sha256 = "1xxwg2849jizxv0g1hy0b1m3i7iivp9bmc4f5pi76swsn423d41m";
|
2016-10-13 05:31:58 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
prePatch = ''
|
|
|
|
rmdir ThirdParty/*
|
|
|
|
cp -r --no-preserve=all ${googletest} ThirdParty/googletest
|
|
|
|
cp -r --no-preserve=all ${linenoise} ThirdParty/linenoise
|
|
|
|
'';
|
|
|
|
|
2021-01-23 12:26:19 +00:00
|
|
|
postPatch = lib.optionalString (!stdenv.isDarwin) ''
|
2019-08-07 16:22:18 +01:00
|
|
|
# Avoid a glibc >= 2.25 deprecation warning that gets fatal via -Werror.
|
2017-02-22 15:58:45 +00:00
|
|
|
sed 1i'#include <sys/sysmacros.h>' \
|
|
|
|
-i Libraries/xcassets/Headers/xcassets/Slot/SystemVersion.h
|
2021-01-23 12:26:19 +00:00
|
|
|
'' + lib.optionalString stdenv.isDarwin ''
|
2019-08-07 16:22:18 +01:00
|
|
|
# Apple Open Sourced LZFSE, but not libcompression, and it isn't
|
|
|
|
# part of an impure framework we can add
|
2019-08-06 04:48:29 +01:00
|
|
|
substituteInPlace Libraries/libcar/Sources/Rendition.cpp \
|
|
|
|
--replace "#if HAVE_LIBCOMPRESSION" "#if 0"
|
2017-02-22 15:58:45 +00:00
|
|
|
'';
|
|
|
|
|
2016-10-13 05:31:58 +01:00
|
|
|
# TODO: instruct cmake not to put it in /usr, rather than cleaning up
|
|
|
|
postInstall = ''
|
|
|
|
mv $out/usr/* $out
|
|
|
|
rmdir $out/usr
|
2021-03-29 19:56:35 +01:00
|
|
|
cp liblinenoise.* $out/lib/
|
2016-10-13 05:31:58 +01:00
|
|
|
'';
|
|
|
|
|
2018-10-05 21:25:10 +01:00
|
|
|
NIX_CFLAGS_COMPILE = "-Wno-error";
|
2017-01-19 21:21:00 +00:00
|
|
|
|
2017-08-27 18:42:21 +01:00
|
|
|
cmakeFlags = [ "-GNinja" ];
|
|
|
|
|
2020-12-31 07:48:55 +00:00
|
|
|
nativeBuildInputs = [ cmake ninja ];
|
|
|
|
buildInputs = [ zlib libxml2 libpng ]
|
2021-01-23 12:26:19 +00:00
|
|
|
++ lib.optionals stdenv.isDarwin [ CoreServices CoreGraphics ImageIO ];
|
2016-12-15 17:07:54 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2016-12-15 17:07:54 +00:00
|
|
|
description = "Xcode-compatible build tool";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/facebook/xcbuild";
|
2016-12-15 17:07:54 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ copumpkin matthewbauer ];
|
2018-11-08 20:00:50 +00:00
|
|
|
license = with licenses; [ bsd2 bsd3 ];
|
2016-12-15 17:07:54 +00:00
|
|
|
};
|
2016-06-26 05:45:55 +01:00
|
|
|
}
|