goperf: unstable-2022-09-20 -> unstable-2023-11-08, add updateScript
the unstable git updater does not bump the go-module vendor hash, hence the crimes
This commit is contained in:
parent
06d89dac20
commit
fc65d16b79
@ -1,19 +1,32 @@
|
|||||||
{ lib
|
{ lib
|
||||||
, buildGoModule
|
, buildGoModule
|
||||||
, fetchgit
|
, fetchgit
|
||||||
|
, writeShellScript
|
||||||
|
, unstableGitUpdater
|
||||||
|
, sd
|
||||||
}:
|
}:
|
||||||
|
|
||||||
buildGoModule rec {
|
buildGoModule rec {
|
||||||
pname = "goperf";
|
pname = "goperf";
|
||||||
version = "unstable-2022-09-20";
|
version = "unstable-2023-11-08";
|
||||||
|
|
||||||
src = fetchgit {
|
src = fetchgit {
|
||||||
url = "https://go.googlesource.com/perf";
|
url = "https://go.googlesource.com/perf";
|
||||||
rev = "e8d778a60d07b209c499efb221f76d51f63c6042";
|
rev = "cb71e802ccb878a069712546879bf26489f0f300";
|
||||||
hash = "sha256-UuP528n5uAWMJCakc8MP8wlmA6SwMO/IaIqR88pqL7c=";
|
hash = "sha256-1NvrelLsy9lrepttXXnggc0oycC6EgJgU80iXDu3IoI=";
|
||||||
};
|
};
|
||||||
|
|
||||||
vendorHash = "sha256-ZIkH3LBzrvqWEN6m4fpU2cmOXup9LLU3FiFooJJtiOk=";
|
vendorHash = "sha256-dJQHqIR6v0yYbxplytkdA98IHtdxnsvi9X6kIESCsB8=";
|
||||||
|
|
||||||
|
passthru.updateScript = writeShellScript "update-goperf" ''
|
||||||
|
export UPDATE_NIX_ATTR_PATH=goperf
|
||||||
|
${lib.escapeShellArgs (unstableGitUpdater { inherit (src) url; })}
|
||||||
|
set -x
|
||||||
|
oldhash="$(nix-instantiate . --eval --strict -A "goperf.go-modules.drvAttrs.outputHash" | cut -d'"' -f2)"
|
||||||
|
newhash="$(nix-build -A goperf.go-modules --no-out-link 2>&1 | tail -n3 | grep 'got:' | cut -d: -f2- | xargs echo || true)"
|
||||||
|
fname="$(nix-instantiate --eval -E 'with import ./. {}; (builtins.unsafeGetAttrPos "version" goperf).file' | cut -d'"' -f2)"
|
||||||
|
${lib.getExe sd} --string-mode "$oldhash" "$newhash" "$fname"
|
||||||
|
'';
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "Tools and packages for analyzing Go benchmark results";
|
description = "Tools and packages for analyzing Go benchmark results";
|
||||||
|
Loading…
Reference in New Issue
Block a user