Merge pull request #46721 from YorikSar/gn

gn: generate last_commit_position.h without git

authored by

Michael Raskin and committed by
GitHub
32632fbb c7a78910

+19 -6
+19 -6
pkgs/development/tools/build-managers/gn/default.nix
··· 1 - { stdenv, lib, fetchgit, fetchzip, fetchpatch, darwin 1 + { stdenv, lib, fetchgit, fetchzip, fetchpatch, darwin, writeText 2 2 , git, ninja, python }: 3 3 4 + let 5 + rev = "106b823805adcc043b2bfe5bc21d58f160a28a7b"; 6 + sha256 = "1a5s6i07s8l4f1bakh3fyaym00xz7zgd49sp6awm10xb7yjh95ba"; 7 + 8 + shortRev = builtins.substring 0 7 rev; 9 + lastCommitPosition = writeText "last_commit_position.h" '' 10 + #ifndef OUT_LAST_COMMIT_POSITION_H_ 11 + #define OUT_LAST_COMMIT_POSITION_H_ 12 + 13 + #define LAST_COMMIT_POSITION "(${shortRev})" 14 + 15 + #endif // OUT_LAST_COMMIT_POSITION_H_ 16 + ''; 17 + 18 + in 4 19 stdenv.mkDerivation rec { 5 20 name = "gn-${version}"; 6 21 version = "20180830"; 7 22 8 23 src = fetchgit { 9 24 url = "https://gn.googlesource.com/gn"; 10 - rev = "106b823805adcc043b2bfe5bc21d58f160a28a7b"; 11 - leaveDotGit = true; # gen.py uses "git describe" to generate last_commit_position.h 12 - deepClone = true; 13 - sha256 = "00xl7rfcwyig23q6qnqzv13lvzm3n30di242zcz2m9rdlfspiayb"; 25 + inherit rev sha256; 14 26 }; 15 27 16 28 postPatch = '' ··· 31 43 ]); 32 44 33 45 buildPhase = '' 34 - python build/gen.py --no-sysroot 46 + python build/gen.py --no-sysroot --no-last-commit-position 47 + ln -s ${lastCommitPosition} out/last_commit_position.h 35 48 ninja -j $NIX_BUILD_CORES -C out gn 36 49 ''; 37 50