about summary refs log tree commit diff
path: root/pkgs/by-name/pa
diff options
context:
space:
mode:
authorNeverBehave <gayhub@never.pet>2023-10-14 22:28:37 -0700
committerNeverBehave <git@never.pet>2023-12-10 23:59:41 -0800
commitf20753f6d61f67330bfa0aac3d29fe88d7a6204b (patch)
treee3143a273e617c4291beb454228cf485b9cafcef /pkgs/by-name/pa
parente97b3e4186bcadf0ef1b6be22b8558eab1cdeb5d (diff)
downloadnixlib-f20753f6d61f67330bfa0aac3d29fe88d7a6204b.tar
nixlib-f20753f6d61f67330bfa0aac3d29fe88d7a6204b.tar.gz
nixlib-f20753f6d61f67330bfa0aac3d29fe88d7a6204b.tar.bz2
nixlib-f20753f6d61f67330bfa0aac3d29fe88d7a6204b.tar.lz
nixlib-f20753f6d61f67330bfa0aac3d29fe88d7a6204b.tar.xz
nixlib-f20753f6d61f67330bfa0aac3d29fe88d7a6204b.tar.zst
nixlib-f20753f6d61f67330bfa0aac3d29fe88d7a6204b.zip
passmark-performancetest: init at 11.0.1002
Update default.nix

Co-authored-by: Zhaofeng Li <hello@zhaofeng.li>

addressing comments and use new format

Co-authored-by: Nick Cao <nickcao@nichi.co>
Diffstat (limited to 'pkgs/by-name/pa')
-rw-r--r--pkgs/by-name/pa/passmark-performancetest/package.nix67
1 files changed, 67 insertions, 0 deletions
diff --git a/pkgs/by-name/pa/passmark-performancetest/package.nix b/pkgs/by-name/pa/passmark-performancetest/package.nix
new file mode 100644
index 000000000000..5fbb4f3199c8
--- /dev/null
+++ b/pkgs/by-name/pa/passmark-performancetest/package.nix
@@ -0,0 +1,67 @@
+{ lib
+, stdenv
+, fetchurl
+, curl
+, unzip
+, ncurses5
+, dmidecode
+, coreutils
+, util-linux
+, autoPatchelfHook
+, makeWrapper
+}:
+let
+  sources = {
+    "x86_64-linux" = {
+      url = "https://web.archive.org/web/20231205092714/https://www.passmark.com/downloads/pt_linux_x64.zip";
+      hash = "sha256-q9H+/V4fkSwJJEp+Vs+MPvndi5DInx5MQCzAv965IJg=";
+    };
+    "aarch64-linux" = {
+      url = "https://web.archive.org/web/20231205092807/https://www.passmark.com/downloads/pt_linux_arm64.zip";
+      hash = "sha256-7fmd2fukJ56e0BJFJe3SitGlordyIFbNjIzQv+u6Zuw=";
+    };
+  };
+in
+stdenv.mkDerivation rec {
+  version = "11.0.1002";
+  pname = "passmark-performancetest";
+
+  src = fetchurl (sources.${stdenv.system} or (throw "Unsupported system for PassMark performance test"));
+
+  dontConfigure = true;
+  dontBuild = true;
+
+  nativeBuildInputs = [ unzip autoPatchelfHook makeWrapper ];
+
+  buildInputs = [
+    stdenv.cc.cc.lib
+    curl
+    ncurses5
+  ];
+
+  installPhase = ''
+    runHook preInstall
+    install -Dm555 pt_linux_* "$out/bin/performancetest"
+    runHook postInstall
+  '';
+
+  # Prefix since program will call sudo
+  postFixup = ''
+    wrapProgram $out/bin/performancetest \
+        --prefix PATH ":" ${lib.makeBinPath [
+          dmidecode
+          coreutils
+          util-linux
+        ]}
+  '';
+
+  meta = with lib; {
+    description = "A software tool that allows everybody to quickly assess the performance of their computer and compare it to a number of standard 'baseline' computer systems.";
+    homepage = "https://www.passmark.com";
+    sourceProvenance = with sourceTypes; [ binaryNativeCode ];
+    license = licenses.unfree;
+    maintainers = with maintainers; [ neverbehave ];
+    platforms = builtins.attrNames sources;
+    mainProgram = "performancetest";
+  };
+}