2023-03-15 16:39:30 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, autoPatchelfHook
|
2024-07-31 10:19:44 +00:00
|
|
|
, addDriverRunpath
|
2023-03-15 16:39:30 +00:00
|
|
|
, makeWrapper
|
|
|
|
, ocl-icd
|
|
|
|
, vulkan-loader
|
|
|
|
}:
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
let
|
|
|
|
inherit (stdenv.hostPlatform.uname) processor;
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "6.3.0";
|
2023-10-09 19:29:22 +00:00
|
|
|
sources = {
|
|
|
|
"x86_64-linux" = {
|
|
|
|
url = "https://cdn.geekbench.com/Geekbench-${version}-Linux.tar.gz";
|
2024-05-15 15:35:15 +00:00
|
|
|
hash = "sha256-AXJ5mXGc1RWnIkB13KtIdt7vKETEXowunzQZciQDnzs=";
|
2023-10-09 19:29:22 +00:00
|
|
|
};
|
|
|
|
"aarch64-linux" = {
|
|
|
|
url = "https://cdn.geekbench.com/Geekbench-${version}-LinuxARMPreview.tar.gz";
|
2024-05-15 15:35:15 +00:00
|
|
|
hash = "sha256-fbf01qa9wx3k9j8AEqv38fAM3F9tZOcnpH/wa/9rawQ=";
|
2023-10-09 19:29:22 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
geekbench_avx2 = lib.optionalString stdenv.isx86_64 "geekbench_avx2";
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
inherit version;
|
2023-03-15 16:39:30 +00:00
|
|
|
pname = "geekbench";
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
src = fetchurl (sources.${stdenv.system} or (throw "unsupported system ${stdenv.hostPlatform.system}"));
|
2023-03-15 16:39:30 +00:00
|
|
|
|
|
|
|
dontConfigure = true;
|
|
|
|
dontBuild = true;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ autoPatchelfHook makeWrapper ];
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
buildInputs = [ stdenv.cc.cc.lib ];
|
|
|
|
|
2023-03-15 16:39:30 +00:00
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p $out/bin
|
2023-10-09 19:29:22 +00:00
|
|
|
cp -r geekbench.plar geekbench-workload.plar geekbench6 geekbench_${processor} ${geekbench_avx2} $out/bin
|
2023-03-15 16:39:30 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
for f in geekbench6 geekbench_${processor} ${geekbench_avx2} ; do
|
2023-03-15 16:39:30 +00:00
|
|
|
wrapProgram $out/bin/$f \
|
|
|
|
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [
|
2024-07-31 10:19:44 +00:00
|
|
|
addDriverRunpath.driverLink
|
2023-03-15 16:39:30 +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;
|
2024-05-15 15:35:15 +00:00
|
|
|
maintainers = with maintainers; [ michalrus asininemonkey ];
|
2023-10-09 19:29:22 +00:00
|
|
|
platforms = builtins.attrNames sources;
|
2023-03-15 16:39:30 +00:00
|
|
|
mainProgram = "geekbench6";
|
|
|
|
};
|
|
|
|
}
|