Merge pull request #196196 from pbsds/go-perf
goperf: init at unstable-2023-11-08
This commit is contained in:
commit
4141279b13
38
pkgs/development/tools/goperf/default.nix
Normal file
38
pkgs/development/tools/goperf/default.nix
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
{ lib
|
||||||
|
, buildGoModule
|
||||||
|
, fetchgit
|
||||||
|
, writeShellScript
|
||||||
|
, unstableGitUpdater
|
||||||
|
, sd
|
||||||
|
}:
|
||||||
|
|
||||||
|
buildGoModule rec {
|
||||||
|
pname = "goperf";
|
||||||
|
version = "unstable-2023-11-08";
|
||||||
|
|
||||||
|
src = fetchgit {
|
||||||
|
url = "https://go.googlesource.com/perf";
|
||||||
|
rev = "cb71e802ccb878a069712546879bf26489f0f300";
|
||||||
|
hash = "sha256-1NvrelLsy9lrepttXXnggc0oycC6EgJgU80iXDu3IoI=";
|
||||||
|
};
|
||||||
|
|
||||||
|
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; {
|
||||||
|
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 ];
|
||||||
|
};
|
||||||
|
}
|
@ -3892,6 +3892,8 @@ with pkgs;
|
|||||||
|
|
||||||
gopacked = callPackage ../applications/misc/gopacked { };
|
gopacked = callPackage ../applications/misc/gopacked { };
|
||||||
|
|
||||||
|
goperf = callPackage ../development/tools/goperf { };
|
||||||
|
|
||||||
gotktrix = callPackage ../applications/networking/instant-messengers/gotktrix { };
|
gotktrix = callPackage ../applications/networking/instant-messengers/gotktrix { };
|
||||||
|
|
||||||
graphite-cli = nodePackages.graphite-cli;
|
graphite-cli = nodePackages.graphite-cli;
|
||||||
|
Loading…
Reference in New Issue
Block a user