Files
nixpkgs/pkgs/by-name/go/goperf/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

42 lines
1.3 KiB
Nix

{
lib,
buildGoModule,
fetchgit,
writeShellScript,
unstableGitUpdater,
sd,
}:
buildGoModule rec {
pname = "goperf";
version = "0-unstable-2025-09-09";
src = fetchgit {
url = "https://go.googlesource.com/perf";
rev = "7e13e04d9366398b9f5f06290b65b9ce2ba342e9";
hash = "sha256-3teyn2VMldyrshoujh9WggygeSed341yBAdj/dxJGYs=";
};
vendorHash = "sha256-XhvECzGd6nj9PbQioAp93yoO2JQorjOoe/1MqcXjaMY=";
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.goModules.drvAttrs.outputHash" | cut -d'"' -f2)"
newhash="$(nix-build -A goperf.goModules --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; {
description = "Tools and packages for analyzing Go benchmark results";
homepage = "https://cs.opensource.google/go/x/perf";
license = licenses.bsd3;
platforms = platforms.all;
maintainers = with maintainers; [ pbsds ];
};
}