gn: make src version overridable

Co-authored-by: emilylange <git@emilylange.de>
Signed-off-by: Marcin Serwin <marcin@serwin.dev>

+14 -6
+13 -5
pkgs/by-name/gn/gn/package.nix
··· 5 5 cctools, 6 6 ninja, 7 7 python3, 8 + 9 + # Note: Please use the recommended version for Chromium stable, i.e. from 10 + # <nixpkgs>/pkgs/applications/networking/browsers/chromium/info.json 11 + version ? 12 + # This is a workaround for update-source-version to be able to update this 13 + let 14 + _version = "0-unstable-2025-04-28"; 15 + in 16 + _version, 17 + rev ? "85cc21e94af590a267c1c7a47020d9b420f8a033", 18 + hash ? "sha256-SYpWYvGGNLMZPR1LdKKgubbv+4QcxRw8EYp7cNI5wQQ=", 8 19 }: 9 20 10 21 stdenv.mkDerivation { 11 22 pname = "gn"; 12 - version = "0-unstable-2025-04-28"; 23 + inherit version; 13 24 14 25 src = fetchgit { 15 26 # Note: The TAR-Archives (+archive/${rev}.tar.gz) are not deterministic! 16 27 url = "https://gn.googlesource.com/gn"; 17 - # Note: Please use the recommended version for Chromium stable, i.e. from 18 - # <nixpkgs>/pkgs/applications/networking/browsers/chromium/info.json 19 - rev = "85cc21e94af590a267c1c7a47020d9b420f8a033"; 20 - hash = "sha256-SYpWYvGGNLMZPR1LdKKgubbv+4QcxRw8EYp7cNI5wQQ="; 28 + inherit rev hash; 21 29 leaveDotGit = true; 22 30 deepClone = true; 23 31 postFetch = ''
+1 -1
pkgs/by-name/gn/gn/update.sh
··· 18 18 commit_date=$(TZ= date --date "$commit_time" --iso-8601) 19 19 version="0-unstable-$commit_date" 20 20 21 - update-source-version --rev="$rev" --version-key="version" "gn" "$version" 21 + update-source-version --rev="$rev" --version-key="_version" "gn" "$version"