gn: make src version overridable

Co-authored-by: emilylange <git@emilylange.de>
Signed-off-by: Marcin Serwin <marcin@serwin.dev>
This commit is contained in:
Marcin Serwin
2025-08-09 08:53:43 +02:00
co-authored by emilylange
parent d654f142e7
commit e2e3860a20
2 changed files with 14 additions and 6 deletions
+13 -5
View File
@@ -5,19 +5,27 @@
cctools,
ninja,
python3,
# Note: Please use the recommended version for Chromium stable, i.e. from
# <nixpkgs>/pkgs/applications/networking/browsers/chromium/info.json
version ?
# This is a workaround for update-source-version to be able to update this
let
_version = "0-unstable-2025-04-28";
in
_version,
rev ? "85cc21e94af590a267c1c7a47020d9b420f8a033",
hash ? "sha256-SYpWYvGGNLMZPR1LdKKgubbv+4QcxRw8EYp7cNI5wQQ=",
}:
stdenv.mkDerivation {
pname = "gn";
version = "0-unstable-2025-04-28";
inherit version;
src = fetchgit {
# Note: The TAR-Archives (+archive/${rev}.tar.gz) are not deterministic!
url = "https://gn.googlesource.com/gn";
# Note: Please use the recommended version for Chromium stable, i.e. from
# <nixpkgs>/pkgs/applications/networking/browsers/chromium/info.json
rev = "85cc21e94af590a267c1c7a47020d9b420f8a033";
hash = "sha256-SYpWYvGGNLMZPR1LdKKgubbv+4QcxRw8EYp7cNI5wQQ=";
inherit rev hash;
leaveDotGit = true;
deepClone = true;
postFetch = ''
+1 -1
View File
@@ -18,4 +18,4 @@ commit_time=$(
commit_date=$(TZ= date --date "$commit_time" --iso-8601)
version="0-unstable-$commit_date"
update-source-version --rev="$rev" --version-key="version" "gn" "$version"
update-source-version --rev="$rev" --version-key="_version" "gn" "$version"