graphite: update branding in updateScript (#515920)

This commit is contained in:
Peder Bergebakken Sundt
2026-05-08 15:27:22 +00:00
committed by GitHub
2 changed files with 15 additions and 7 deletions
+1 -7
View File
@@ -27,7 +27,6 @@
libxcursor,
libx11,
libxcb,
nix-update-script,
}:
let
@@ -173,12 +172,7 @@ stdenv.mkDerivation (finalAttrs: {
disallowedReferences = [ rustc ];
passthru.updateScript = nix-update-script {
extraArgs = [
"--version=branch"
"--version-regex=(0-unstable-.*)"
];
};
passthru.updateScript = ./update.nu;
meta = {
description = "Open source vector graphics editor and procedural design engine";
+14
View File
@@ -0,0 +1,14 @@
#!/usr/bin/env nix-shell
#!nix-shell -i nu -p nushell nix-update curl common-updater-scripts nix
^nix-update graphite --version=branch --version-regex '(0-unstable-.*)'
let pkg = "./pkgs/by-name/gr/graphite/package.nix"
let rev = (open $pkg | lines | where ($it | str contains 'rev = "') | first | str trim | parse 'rev = "{rev}";' | get 0.rev)
let meta = (http get $"https://raw.githubusercontent.com/GraphiteEditor/Graphite/($rev)/.branding" | lines)
let branding_rev = ($meta | get 0 | path basename | str replace ".tar.gz" "")
let branding_hash = (^nix hash convert --to sri --hash-algo sha256 ($meta | get 1) | str trim)
open $pkg
| str replace --regex 'brandingRev = "[^"]*"' $'brandingRev = "($branding_rev)"'
| str replace --regex 'brandingHash = "[^"]*"' $'brandingHash = "($branding_hash)"'
| save --force $pkg