nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at python-updates 103 lines 2.0 kB view raw
1{ 2 lib, 3 buildFHSEnv, 4 fetchFromGitHub, 5 ocl-icd, 6 openssl, 7 re2, 8 libevent, 9 git, 10 versionCheckHook, 11 zlib, 12 expat, 13 scons, 14 stdenv, 15 extraPkgs ? [ ], 16}: 17let 18 pname = "fah-client"; 19 version = "8.5.3"; 20 21 cbangSrc = fetchFromGitHub { 22 owner = "cauldrondevelopmentllc"; 23 repo = "cbang"; 24 tag = "bastet-v${version}"; 25 hash = "sha256-RU13qT9UQ1uNsRNBaEGSWTgNmE3f72veabl2OmKK6Z0="; 26 }; 27 28 fah-client = stdenv.mkDerivation { 29 inherit pname version; 30 31 src = fetchFromGitHub { 32 owner = "FoldingAtHome"; 33 repo = "fah-client-bastet"; 34 tag = "v${version}"; 35 hash = "sha256-PBguylWnYU5iTzrjWA1B5Iwb57JpoWGPSpjgNJP3aoI="; 36 }; 37 38 nativeBuildInputs = [ 39 scons 40 re2 41 libevent 42 git 43 ]; 44 45 buildInputs = [ openssl ]; 46 47 postUnpack = '' 48 export CBANG_HOME=$NIX_BUILD_TOP/cbang 49 50 cp -r --no-preserve=mode ${cbangSrc} $CBANG_HOME 51 ''; 52 53 preBuild = '' 54 scons -C $CBANG_HOME 55 ''; 56 57 installPhase = '' 58 runHook preInstall 59 60 mkdir -p $out/{bin,share/applications} 61 62 cp fah-client $out/bin/fah-client 63 64 cp install/lin/fah-client.desktop.in $out/share/applications/fah-client.desktop 65 sed \ 66 -e "s|Icon=.*|Icon=$out/share/feh-client/images/fahlogo.png|g" \ 67 -e "s|%(PACKAGE_URL)s|https://github.com/FoldingAtHome/fah-client-bastet|g" \ 68 -i $out/share/applications/fah-client.desktop 69 70 runHook postInstall 71 ''; 72 73 nativeInstallCheckInputs = [ 74 versionCheckHook 75 ]; 76 doInstallCheck = true; 77 78 }; 79in 80buildFHSEnv { 81 inherit pname version; 82 83 targetPkgs = 84 _: 85 [ 86 fah-client 87 ocl-icd 88 zlib 89 expat 90 ] 91 ++ extraPkgs; 92 93 runScript = "/bin/fah-client"; 94 95 meta = { 96 description = "Folding@home client"; 97 homepage = "https://foldingathome.org/"; 98 license = lib.licenses.gpl3; 99 mainProgram = "fah-client"; 100 maintainers = [ lib.maintainers.GaetanLepage ]; 101 platforms = [ "x86_64-linux" ]; 102 }; 103}