gn1924: init at 2021-08-08, use generic derivation generator

Split into "current" version, as used by most things (aka gn),
and "gn1924", which uses a more recent version of gn which is
incompatible with the currently packaged version of v8 in nixpkgs.

We can't win, but I need a newer version of gn for envoy.

Note that the newer gn matches the version in Chromium's DEPS for
v93.0.4577.82, the current Linux stable build as of September.

+70 -56
+2 -56
pkgs/development/tools/build-managers/gn/default.nix
··· 1 - { stdenv, lib, fetchgit, darwin, writeText 2 - , ninja, python3 3 - }: 4 5 - let 6 # Note: Please use the recommended version for Chromium, e.g.: 7 # https://git.archlinux.org/svntogit/packages.git/tree/trunk/chromium-gn-version.sh?h=packages/gn 8 rev = "fd3d768bcfd44a8d9639fe278581bd9851d0ce3a"; 9 revNum = "1718"; # git describe HEAD --match initial-commit | cut -d- -f3 10 version = "2020-03-09"; 11 sha256 = "1asc14y8by7qcn10vbk467hvx93s30pif8r0brissl0sihsaqazr"; 12 - 13 - revShort = builtins.substring 0 7 rev; 14 - lastCommitPosition = writeText "last_commit_position.h" '' 15 - #ifndef OUT_LAST_COMMIT_POSITION_H_ 16 - #define OUT_LAST_COMMIT_POSITION_H_ 17 - 18 - #define LAST_COMMIT_POSITION_NUM ${revNum} 19 - #define LAST_COMMIT_POSITION "${revNum} (${revShort})" 20 - 21 - #endif // OUT_LAST_COMMIT_POSITION_H_ 22 - ''; 23 - 24 - in stdenv.mkDerivation { 25 - pname = "gn-unstable"; 26 - inherit version; 27 - 28 - src = fetchgit { 29 - # Note: The TAR-Archives (+archive/${rev}.tar.gz) are not deterministic! 30 - url = "https://gn.googlesource.com/gn"; 31 - inherit rev sha256; 32 - }; 33 - 34 - nativeBuildInputs = [ ninja python3 ]; 35 - buildInputs = lib.optionals stdenv.isDarwin (with darwin; with apple_sdk.frameworks; [ 36 - libobjc 37 - cctools 38 - 39 - # frameworks 40 - ApplicationServices 41 - Foundation 42 - AppKit 43 - ]); 44 - 45 - buildPhase = '' 46 - python build/gen.py --no-last-commit-position 47 - ln -s ${lastCommitPosition} out/last_commit_position.h 48 - ninja -j $NIX_BUILD_CORES -C out gn 49 - ''; 50 - 51 - installPhase = '' 52 - install -vD out/gn "$out/bin/gn" 53 - ''; 54 - 55 - setupHook = ./setup-hook.sh; 56 - 57 - meta = with lib; { 58 - description = "A meta-build system that generates build files for Ninja"; 59 - homepage = "https://gn.googlesource.com/gn"; 60 - license = licenses.bsd3; 61 - platforms = platforms.unix; 62 - maintainers = with maintainers; [ stesie matthewbauer primeos ]; 63 - }; 64 }
··· 1 + { callPackage, ... } @ args: 2 3 + callPackage ./generic.nix args { 4 # Note: Please use the recommended version for Chromium, e.g.: 5 # https://git.archlinux.org/svntogit/packages.git/tree/trunk/chromium-gn-version.sh?h=packages/gn 6 rev = "fd3d768bcfd44a8d9639fe278581bd9851d0ce3a"; 7 revNum = "1718"; # git describe HEAD --match initial-commit | cut -d- -f3 8 version = "2020-03-09"; 9 sha256 = "1asc14y8by7qcn10vbk467hvx93s30pif8r0brissl0sihsaqazr"; 10 }
+60
pkgs/development/tools/build-managers/gn/generic.nix
···
··· 1 + { stdenv, lib, fetchgit, darwin, writeText 2 + , ninja, python3 3 + , ... 4 + }: 5 + 6 + { rev, revNum, version, sha256 }: 7 + 8 + let 9 + revShort = builtins.substring 0 7 rev; 10 + lastCommitPosition = writeText "last_commit_position.h" '' 11 + #ifndef OUT_LAST_COMMIT_POSITION_H_ 12 + #define OUT_LAST_COMMIT_POSITION_H_ 13 + 14 + #define LAST_COMMIT_POSITION_NUM ${revNum} 15 + #define LAST_COMMIT_POSITION "${revNum} (${revShort})" 16 + 17 + #endif // OUT_LAST_COMMIT_POSITION_H_ 18 + ''; 19 + 20 + in stdenv.mkDerivation { 21 + pname = "gn-unstable"; 22 + inherit version; 23 + 24 + src = fetchgit { 25 + # Note: The TAR-Archives (+archive/${rev}.tar.gz) are not deterministic! 26 + url = "https://gn.googlesource.com/gn"; 27 + inherit rev sha256; 28 + }; 29 + 30 + nativeBuildInputs = [ ninja python3 ]; 31 + buildInputs = lib.optionals stdenv.isDarwin (with darwin; with apple_sdk.frameworks; [ 32 + libobjc 33 + cctools 34 + 35 + # frameworks 36 + ApplicationServices 37 + Foundation 38 + AppKit 39 + ]); 40 + 41 + buildPhase = '' 42 + python build/gen.py --no-last-commit-position 43 + ln -s ${lastCommitPosition} out/last_commit_position.h 44 + ninja -j $NIX_BUILD_CORES -C out gn 45 + ''; 46 + 47 + installPhase = '' 48 + install -vD out/gn "$out/bin/gn" 49 + ''; 50 + 51 + setupHook = ./setup-hook.sh; 52 + 53 + meta = with lib; { 54 + description = "A meta-build system that generates build files for Ninja"; 55 + homepage = "https://gn.googlesource.com/gn"; 56 + license = licenses.bsd3; 57 + platforms = platforms.unix; 58 + maintainers = with maintainers; [ stesie matthewbauer primeos ]; 59 + }; 60 + }
+8
pkgs/development/tools/build-managers/gn/rev1924.nix
···
··· 1 + { callPackage, ... } @ args: 2 + 3 + callPackage ./generic.nix args { 4 + rev = "24e2f7df92641de0351a96096fb2c490b2436bb8"; 5 + revNum = "1924"; # git describe HEAD --match initial-commit | cut -d- -f3 6 + version = "2021-08-08"; 7 + sha256 = "1lwkyhfhw0zd7daqz466n7x5cddf0danr799h4jg3s0yvd4galjl"; 8 + }