nixpkgs/pkgs/tools/misc/geekbench/6.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

78 lines
1.8 KiB
Nix
Raw Permalink Normal View History

2023-03-10 17:44:34 +00:00
{
lib,
stdenv,
fetchurl,
autoPatchelfHook,
addDriverRunpath,
2023-03-10 17:44:34 +00:00
makeWrapper,
ocl-icd,
vulkan-loader,
}:
let
inherit (stdenv.hostPlatform.uname) processor;
2024-01-23 11:02:37 +00:00
version = "6.3.0";
sources = {
"x86_64-linux" = {
url = "https://cdn.geekbench.com/Geekbench-${version}-Linux.tar.gz";
2024-01-23 11:02:37 +00:00
hash = "sha256-AXJ5mXGc1RWnIkB13KtIdt7vKETEXowunzQZciQDnzs=";
};
"aarch64-linux" = {
url = "https://cdn.geekbench.com/Geekbench-${version}-LinuxARMPreview.tar.gz";
2024-01-23 11:02:37 +00:00
hash = "sha256-fbf01qa9wx3k9j8AEqv38fAM3F9tZOcnpH/wa/9rawQ=";
};
};
geekbench_avx2 = lib.optionalString stdenv.hostPlatform.isx86_64 "geekbench_avx2";
in
stdenv.mkDerivation {
inherit version;
2023-03-10 17:44:34 +00:00
pname = "geekbench";
src = fetchurl (
sources.${stdenv.system} or (throw "unsupported system ${stdenv.hostPlatform.system}")
);
2023-03-10 17:44:34 +00:00
dontConfigure = true;
dontBuild = true;
nativeBuildInputs = [
autoPatchelfHook
makeWrapper
];
buildInputs = [ (lib.getLib stdenv.cc.cc) ];
2023-05-07 13:53:01 +00:00
2023-03-10 17:44:34 +00:00
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp -r geekbench.plar geekbench-workload.plar geekbench6 geekbench_${processor} ${geekbench_avx2} $out/bin
2023-03-10 17:44:34 +00:00
for f in geekbench6 geekbench_${processor} ${geekbench_avx2} ; do
2023-03-10 17:44:34 +00:00
wrapProgram $out/bin/$f \
--prefix LD_LIBRARY_PATH : "${
lib.makeLibraryPath [
addDriverRunpath.driverLink
2023-03-10 17:44:34 +00:00
ocl-icd
vulkan-loader
]
}"
done
runHook postInstall
'';
meta = with lib; {
description = "Cross-platform benchmark";
homepage = "https://geekbench.com/";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
license = licenses.unfree;
maintainers = with maintainers; [
michalrus
asininemonkey
];
platforms = builtins.attrNames sources;
2023-03-10 17:44:34 +00:00
mainProgram = "geekbench6";
};
}