parent
ab9367eb5b
commit
a403a118d1
2 changed files with 55 additions and 44 deletions
|
@ -63,7 +63,7 @@ in
|
||||||
default = [];
|
default = [];
|
||||||
description = lib.mdDoc ''
|
description = lib.mdDoc ''
|
||||||
Extra startup options for the FAHClient. Run
|
Extra startup options for the FAHClient. Run
|
||||||
`FAHClient --help` to find all the available options.
|
`fah-client --help` to find all the available options.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -74,7 +74,7 @@ in
|
||||||
after = [ "network.target" ];
|
after = [ "network.target" ];
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
script = ''
|
script = ''
|
||||||
exec ${cfg.package}/bin/FAHClient ${lib.escapeShellArgs args}
|
exec ${lib.getExe cfg.package} ${lib.escapeShellArgs args}
|
||||||
'';
|
'';
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
DynamicUser = true;
|
DynamicUser = true;
|
||||||
|
|
|
@ -1,59 +1,70 @@
|
||||||
{ lib, stdenv
|
{ lib
|
||||||
, autoPatchelfHook
|
, stdenv
|
||||||
, buildFHSEnv
|
, fetchFromGitHub
|
||||||
, dpkg
|
, scons
|
||||||
, fetchurl
|
, openssl
|
||||||
, gcc-unwrapped
|
|
||||||
, ocl-icd
|
|
||||||
, zlib
|
|
||||||
, extraPkgs ? []
|
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
majMin = lib.versions.majorMinor version;
|
version = "8.1.18";
|
||||||
version = "7.6.21";
|
|
||||||
|
|
||||||
fahclient = stdenv.mkDerivation rec {
|
cbangSrc = fetchFromGitHub {
|
||||||
inherit version;
|
owner = "cauldrondevelopmentllc";
|
||||||
pname = "fahclient";
|
repo = "cbang";
|
||||||
|
rev = "bastet-v${version}";
|
||||||
src = fetchurl {
|
hash = "sha256-G0rknVmZiyC4sRTOowFjf7EQ5peGf+HLPPcLWXXFlX4=";
|
||||||
url = "https://download.foldingathome.org/releases/public/release/fahclient/debian-stable-64bit/v${majMin}/fahclient_${version}_amd64.deb";
|
|
||||||
sha256 = "2827f05f1c311ee6c7eca294e4ffb856c81957e8f5bfc3113a0ed27bb463b094";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [
|
fah-web-client-bastetSrc = fetchFromGitHub {
|
||||||
autoPatchelfHook
|
owner = "foldingathome";
|
||||||
dpkg
|
repo = "fah-web-client-bastet";
|
||||||
];
|
rev = "v${version}";
|
||||||
|
hash = lib.fakeHash;
|
||||||
buildInputs = [
|
|
||||||
gcc-unwrapped.lib
|
|
||||||
zlib
|
|
||||||
];
|
|
||||||
|
|
||||||
unpackPhase = "dpkg-deb -x ${src} ./";
|
|
||||||
installPhase = "cp -ar usr $out";
|
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
buildFHSEnv {
|
stdenv.mkDerivation {
|
||||||
name = fahclient.name;
|
pname = "fah-client";
|
||||||
|
inherit version;
|
||||||
|
|
||||||
targetPkgs = pkgs': [
|
src = fetchFromGitHub {
|
||||||
fahclient
|
owner = "FoldingAtHome";
|
||||||
ocl-icd
|
repo = "fah-client-bastet";
|
||||||
] ++ extraPkgs;
|
rev = "v${version}";
|
||||||
|
hash = "sha256-IgT/5NqCwN8N8OObjtASuT4IRb2EN4bdixxUdjiyddI=";
|
||||||
|
};
|
||||||
|
|
||||||
runScript = "/bin/FAHClient";
|
nativeBuildInputs = [ scons ];
|
||||||
|
|
||||||
extraInstallCommands = ''
|
buildInputs = [ openssl ];
|
||||||
mv $out/bin/$name $out/bin/FAHClient
|
|
||||||
|
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
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "Folding@home client";
|
description = "Folding@home client";
|
||||||
homepage = "https://foldingathome.org/";
|
homepage = "https://foldingathome.org/";
|
||||||
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
|
license = lib.licenses.gpl3;
|
||||||
license = lib.licenses.unfree;
|
|
||||||
maintainers = [ lib.maintainers.zimbatm ];
|
maintainers = [ lib.maintainers.zimbatm ];
|
||||||
platforms = [ "x86_64-linux" ];
|
platforms = [ "x86_64-linux" ];
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue