2022-10-21 18:38:19 +00:00
|
|
|
{ stdenv, lib, fetchpatch
|
|
|
|
, fetchFromGitHub, cmake, libmicrohttpd, openssl
|
2022-07-14 12:49:19 +00:00
|
|
|
, opencl-headers, ocl-icd, hwloc
|
2020-04-24 23:36:52 +00:00
|
|
|
, devDonationLevel ? "0.0"
|
|
|
|
, openclSupport ? true
|
|
|
|
}:
|
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2022-03-30 09:31:56 +00:00
|
|
|
pname = "xmr-stak";
|
2020-04-24 23:36:52 +00:00
|
|
|
version = "2.10.8";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "fireice-uk";
|
|
|
|
repo = "xmr-stak";
|
|
|
|
rev = version;
|
|
|
|
sha256 = "0ilx5mhh91ks7dwvykfyynh53l6vkkignjpwkkss8ss6b2k8gdbj";
|
|
|
|
};
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = "-O3";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
patches = [ (fetchpatch {
|
|
|
|
name = "fix-libmicrohttpd-0-9-71.patch";
|
|
|
|
url = "https://github.com/fireice-uk/xmr-stak/compare/06e08780eab54dbc025ce3f38c948e4eef2726a0...8adb208987f5881946992ab9cd9a45e4e2a4b870.patch";
|
|
|
|
excludes = [ "CMakeLists.txt.user" ];
|
|
|
|
hash = "sha256-Yv0U5EO1P5eikn1fKvUXEwemoUIjjeTjpP9p5J8pbC0=";
|
|
|
|
}) ];
|
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
cmakeFlags = [ "-DCUDA_ENABLE=OFF" ]
|
2020-04-24 23:36:52 +00:00
|
|
|
++ lib.optional (!openclSupport) "-DOpenCL_ENABLE=OFF";
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
2022-10-21 18:38:19 +00:00
|
|
|
buildInputs = [ libmicrohttpd openssl hwloc ]
|
2020-04-24 23:36:52 +00:00
|
|
|
++ lib.optionals openclSupport [ opencl-headers ocl-icd ];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace xmrstak/donate-level.hpp \
|
|
|
|
--replace 'fDevDonationLevel = 2.0' 'fDevDonationLevel = ${devDonationLevel}'
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Unified All-in-one Monero miner";
|
|
|
|
homepage = "https://github.com/fireice-uk/xmr-stak";
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
platforms = [ "x86_64-linux" ];
|
2022-08-12 12:06:08 +00:00
|
|
|
maintainers = with maintainers; [ bfortz ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|