about summary refs log tree commit diff
path: root/pkgs/by-name/pa/passmark-performancetest/package.nix
blob: 5fbb4f3199c8413bc936ca5db54771951cf52ba7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
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";
  };
}