nixpkgs/pkgs/development/tools/build-managers/gn/default.nix

50 lines
1.3 KiB
Nix
Raw Normal View History

{ stdenv, lib, fetchgit, fetchzip, fetchpatch, darwin
, git, ninja, python }:
2017-07-08 21:12:33 +02:00
stdenv.mkDerivation rec {
name = "gn-${version}";
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-04-25 03:54:36 +02:00
postPatch = ''
# FIXME Needed with old Apple SDKs
substituteInPlace base/mac/foundation_util.mm \
--replace "NSArray<NSString*>*" "NSArray*"
'';
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 = ''
python build/gen.py --no-sysroot
ninja -j $NIX_BUILD_CORES -C out gn
2018-04-25 03:54:36 +02:00
'';
installPhase = ''
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";
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 ];
};
}