2018-09-07 20:04:22 +02:00
|
|
|
{ stdenv, lib, fetchgit, fetchzip, fetchpatch, darwin
|
|
|
|
, git, ninja, python }:
|
2017-07-08 21:12:33 +02:00
|
|
|
|
2018-09-07 20:04:22 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2018-05-24 06:37:33 +02:00
|
|
|
name = "gn-${version}";
|
2018-09-07 20:04:22 +02:00
|
|
|
version = "20180830";
|
|
|
|
|
|
|
|
src = fetchgit {
|
|
|
|
url = "https://gn.googlesource.com/gn";
|
|
|
|
rev = "106b823805adcc043b2bfe5bc21d58f160a28a7b";
|
|
|
|
leaveDotGit = true; # gen.py uses "git describe" to generate last_commit_position.h
|
|
|
|
deepClone = true;
|
2018-09-15 22:29:48 +02:00
|
|
|
sha256 = "00xl7rfcwyig23q6qnqzv13lvzm3n30di242zcz2m9rdlfspiayb";
|
2018-09-07 20:04:22 +02:00
|
|
|
};
|
2018-04-25 03:54:36 +02:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# FIXME Needed with old Apple SDKs
|
|
|
|
substituteInPlace base/mac/foundation_util.mm \
|
|
|
|
--replace "NSArray<NSString*>*" "NSArray*"
|
|
|
|
'';
|
|
|
|
|
2018-09-07 20:04:22 +02:00
|
|
|
nativeBuildInputs = [ ninja python git ];
|
|
|
|
buildInputs = lib.optionals stdenv.isDarwin (with darwin; with apple_sdk.frameworks; [
|
2018-04-25 03:54:36 +02:00
|
|
|
libobjc
|
|
|
|
cctools
|
|
|
|
|
|
|
|
# frameworks
|
|
|
|
ApplicationServices
|
|
|
|
Foundation
|
|
|
|
AppKit
|
|
|
|
]);
|
|
|
|
|
|
|
|
buildPhase = ''
|
2018-09-07 20:04:22 +02:00
|
|
|
python build/gen.py --no-sysroot
|
|
|
|
ninja -j $NIX_BUILD_CORES -C out gn
|
2018-04-25 03:54:36 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2018-09-07 20:04:22 +02:00
|
|
|
install -vD out/gn "$out/bin/gn"
|
2018-04-25 03:54:36 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A meta-build system that generates NinjaBuild files";
|
2018-09-07 20:04:22 +02:00
|
|
|
homepage = https://gn.googlesource.com/gn;
|
2018-04-25 03:54:36 +02:00
|
|
|
license = licenses.bsd3;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ stesie matthewbauer ];
|
|
|
|
};
|
|
|
|
}
|