nixos/filesystems: don't silently ignore label when device is set (#361418)
[NixPkgs.git] / pkgs / tools / misc / geekbench / 5.nix
blobc7504585dc0f2741a99a3757eed7b825d7366e72
1 { lib
2 , stdenv
3 , fetchurl
4 , autoPatchelfHook
5 , addDriverRunpath
6 , makeWrapper
7 , ocl-icd
8 , vulkan-loader
9 }:
11 let
12   inherit (stdenv.hostPlatform.uname) processor;
13   version = "5.5.1";
14   sources = {
15     "x86_64-linux" = {
16       url = "https://cdn.geekbench.com/Geekbench-${version}-Linux.tar.gz";
17       hash = "sha256-MgN+VcPcjzYP4Wt/uxiNMTh+p1mA5I2M8CgzDjI5xAQ=";
18     };
19     "aarch64-linux" = {
20       url = "https://cdn.geekbench.com/Geekbench-${version}-LinuxARMPreview.tar.gz";
21       hash = "sha256-nrPKnsMqvw6+HGQAKxkQi/6lPEEca1VrDCaJUUuMvW8=";
22     };
23   };
25 stdenv.mkDerivation {
26   inherit version;
27   pname = "geekbench";
29   src = fetchurl (sources.${stdenv.system} or (throw "unsupported system ${stdenv.hostPlatform.system}"));
31   dontConfigure = true;
32   dontBuild = true;
34   nativeBuildInputs = [ autoPatchelfHook makeWrapper ];
36   buildInputs = [ (lib.getLib stdenv.cc.cc) ];
38   installPhase = ''
39     runHook preInstall
41     mkdir -p $out/bin
42     cp -r geekbench.plar geekbench5 geekbench_${processor} $out/bin
44     for f in geekbench5 geekbench_${processor} ; do
45       wrapProgram $out/bin/$f \
46         --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [
47           addDriverRunpath.driverLink
48           ocl-icd
49           vulkan-loader
50        ]}"
51     done
53     runHook postInstall
54   '';
56   meta = with lib; {
57     description = "Cross-platform benchmark";
58     homepage = "https://geekbench.com/";
59     sourceProvenance = with sourceTypes; [ binaryNativeCode ];
60     license = licenses.unfree;
61     maintainers = [ maintainers.michalrus ];
62     platforms = builtins.attrNames sources;
63     mainProgram = "geekbench5";
64   };