graphite: update branding in updateScript
This commit is contained in:
@@ -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";
|
||||
|
||||
Executable
+14
@@ -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
|
||||
Reference in New Issue
Block a user