2024-01-02 11:29:13 +00:00
|
|
|
{ lib
|
2023-04-29 16:46:19 +00:00
|
|
|
, buildFHSEnv
|
2024-01-02 11:29:13 +00:00
|
|
|
, fetchFromGitHub
|
2020-04-24 23:36:52 +00:00
|
|
|
, ocl-icd
|
2024-01-02 11:29:13 +00:00
|
|
|
, openssl
|
|
|
|
, scons
|
|
|
|
, stdenv
|
|
|
|
, extraPkgs ? [ ]
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
let
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "8.1.18";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
cbangSrc = fetchFromGitHub {
|
|
|
|
owner = "cauldrondevelopmentllc";
|
|
|
|
repo = "cbang";
|
|
|
|
rev = "bastet-v${version}";
|
|
|
|
hash = "sha256-G0rknVmZiyC4sRTOowFjf7EQ5peGf+HLPPcLWXXFlX4=";
|
|
|
|
};
|
|
|
|
|
|
|
|
fah-client = stdenv.mkDerivation {
|
|
|
|
pname = "fah-client";
|
2020-04-24 23:36:52 +00:00
|
|
|
inherit version;
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "FoldingAtHome";
|
|
|
|
repo = "fah-client-bastet";
|
|
|
|
rev = "v${version}";
|
|
|
|
hash = "sha256-IgT/5NqCwN8N8OObjtASuT4IRb2EN4bdixxUdjiyddI=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
nativeBuildInputs = [ scons ];
|
|
|
|
|
|
|
|
buildInputs = [ openssl ];
|
|
|
|
|
|
|
|
postUnpack = ''
|
|
|
|
export CBANG_HOME=$NIX_BUILD_TOP/cbang
|
|
|
|
|
|
|
|
cp -r --no-preserve=mode ${cbangSrc} $CBANG_HOME
|
|
|
|
'';
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
scons -C $CBANG_HOME
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p $out/{bin,share/applications,share/feh-client}
|
|
|
|
|
|
|
|
cp fah-client $out/bin/fah-client
|
|
|
|
|
|
|
|
cp install/lin/fah-client.desktop $out/share/applications/
|
|
|
|
cp -r images $out/share/feh-client/
|
|
|
|
|
|
|
|
sed -e "s|Icon=.*|Icon=$out/share/feh-client/images/fahlogo.png|g" -i $out/share/applications/fah-client.desktop
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
runHook postInstall
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
in
|
2023-04-29 16:46:19 +00:00
|
|
|
buildFHSEnv {
|
2024-01-02 11:29:13 +00:00
|
|
|
name = fah-client.name;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
targetPkgs = _: [ fah-client ocl-icd ] ++ extraPkgs;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
runScript = "/bin/fah-client";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
extraInstallCommands = ''
|
2024-01-02 11:29:13 +00:00
|
|
|
mv $out/bin/$name $out/bin/fah-client
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Folding@home client";
|
|
|
|
homepage = "https://foldingathome.org/";
|
2024-01-02 11:29:13 +00:00
|
|
|
license = lib.licenses.gpl3;
|
|
|
|
mainProgram = "fah-client";
|
2021-01-17 00:15:33 +00:00
|
|
|
maintainers = [ lib.maintainers.zimbatm ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
}
|