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 cctools, 6 ninja, 7 python3, 8 }: 9 10 stdenv.mkDerivation { 11 pname = "gn"; 12 - version = "0-unstable-2025-04-28"; 13 14 src = fetchgit { 15 # Note: The TAR-Archives (+archive/${rev}.tar.gz) are not deterministic! 16 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="; 21 leaveDotGit = true; 22 deepClone = true; 23 postFetch = ''
··· 5 cctools, 6 ninja, 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=", 19 }: 20 21 stdenv.mkDerivation { 22 pname = "gn"; 23 + inherit version; 24 25 src = fetchgit { 26 # Note: The TAR-Archives (+archive/${rev}.tar.gz) are not deterministic! 27 url = "https://gn.googlesource.com/gn"; 28 + inherit rev hash; 29 leaveDotGit = true; 30 deepClone = true; 31 postFetch = ''
+1 -1
pkgs/by-name/gn/gn/update.sh
··· 18 commit_date=$(TZ= date --date "$commit_time" --iso-8601) 19 version="0-unstable-$commit_date" 20 21 - update-source-version --rev="$rev" --version-key="version" "gn" "$version"
··· 18 commit_date=$(TZ= date --date "$commit_time" --iso-8601) 19 version="0-unstable-$commit_date" 20 21 + update-source-version --rev="$rev" --version-key="_version" "gn" "$version"