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
|
2024-04-21 15:54:59 +00:00
|
|
|
, re2
|
|
|
|
, libevent
|
|
|
|
, git
|
|
|
|
, zlib
|
|
|
|
, expat
|
2024-01-02 11:29:13 +00:00
|
|
|
, scons
|
|
|
|
, stdenv
|
|
|
|
, extraPkgs ? [ ]
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
let
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "8.3.7";
|
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}";
|
2024-04-21 15:54:59 +00:00
|
|
|
sha256 = "sha256-acAImItdkgo6PBFL6Vu/caIdcnvp/3VEW2lgVDgKy9g=";
|
2024-01-02 11:29:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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}";
|
2024-04-21 15:54:59 +00:00
|
|
|
sha256 = "sha256-d+LY/R4TAko+2e2W76KEBQ8fXj0hzzmBOm+c4tksXMA=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
nativeBuildInputs = [ scons re2 libevent git ];
|
2024-01-02 11:29:13 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2024-02-07 01:22:34 +00:00
|
|
|
mkdir -p $out/{bin,share/applications}
|
2024-01-02 11:29:13 +00:00
|
|
|
|
|
|
|
cp fah-client $out/bin/fah-client
|
|
|
|
|
2024-02-07 01:22:34 +00:00
|
|
|
cp install/lin/fah-client.desktop.in $out/share/applications/fah-client.desktop
|
|
|
|
sed \
|
|
|
|
-e "s|Icon=.*|Icon=$out/share/feh-client/images/fahlogo.png|g" \
|
|
|
|
-e "s|%(PACKAGE_URL)s|https://github.com/FoldingAtHome/fah-client-bastet|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-04-21 15:54:59 +00:00
|
|
|
targetPkgs = _: [ fah-client ocl-icd zlib expat ] ++ 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" ];
|
|
|
|
};
|
|
|
|
}
|