about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/tools/goperf/default.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-12-07 14:04:47 +0100
committerAlyssa Ross <hi@alyssa.is>2023-12-07 14:04:47 +0100
commitba08e4e99b00a6916c4360de7288a7bfcef85328 (patch)
tree347c8b6ad50fcaafc08e50f1307a861378650440 /nixpkgs/pkgs/development/tools/goperf/default.nix
parent190fd93d11701ad81af757be6260df9635bdb41a (diff)
parent2c7f3c0fb7c08a0814627611d9d7d45ab6d75335 (diff)
downloadnixlib-ba08e4e99b00a6916c4360de7288a7bfcef85328.tar
nixlib-ba08e4e99b00a6916c4360de7288a7bfcef85328.tar.gz
nixlib-ba08e4e99b00a6916c4360de7288a7bfcef85328.tar.bz2
nixlib-ba08e4e99b00a6916c4360de7288a7bfcef85328.tar.lz
nixlib-ba08e4e99b00a6916c4360de7288a7bfcef85328.tar.xz
nixlib-ba08e4e99b00a6916c4360de7288a7bfcef85328.tar.zst
nixlib-ba08e4e99b00a6916c4360de7288a7bfcef85328.zip
Merge branch 'nixos-unstable' of https://github.com/NixOS/nixpkgs
Diffstat (limited to 'nixpkgs/pkgs/development/tools/goperf/default.nix')
-rw-r--r--nixpkgs/pkgs/development/tools/goperf/default.nix38
1 files changed, 38 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/tools/goperf/default.nix b/nixpkgs/pkgs/development/tools/goperf/default.nix
new file mode 100644
index 000000000000..ed1a6c1a23b7
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/goperf/default.nix
@@ -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 ];
+  };
+}