2022-10-09 10:40:00 +00:00
|
|
|
{ stdenv, lib, fetchpatch
|
|
|
|
, fetchFromGitHub, cmake, libmicrohttpd, openssl
|
2022-07-04 09:27:24 +00:00
|
|
|
, opencl-headers, ocl-icd, hwloc
|
2017-12-11 08:42:44 +00:00
|
|
|
, devDonationLevel ? "0.0"
|
2018-03-28 04:54:22 +00:00
|
|
|
, openclSupport ? true
|
2017-12-11 03:22:47 +00:00
|
|
|
}:
|
|
|
|
|
2022-07-04 09:27:24 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2022-03-07 11:37:20 +00:00
|
|
|
pname = "xmr-stak";
|
2019-12-10 02:07:07 +00:00
|
|
|
version = "2.10.8";
|
2017-12-11 03:22:47 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "fireice-uk";
|
|
|
|
repo = "xmr-stak";
|
2019-09-08 23:38:31 +00:00
|
|
|
rev = version;
|
2019-12-10 02:07:07 +00:00
|
|
|
sha256 = "0ilx5mhh91ks7dwvykfyynh53l6vkkignjpwkkss8ss6b2k8gdbj";
|
2017-12-11 03:22:47 +00:00
|
|
|
};
|
|
|
|
|
2023-02-19 19:23:32 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = "-O3";
|
2017-12-11 03:22:47 +00:00
|
|
|
|
2022-10-09 10:40:00 +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-04 09:27:24 +00:00
|
|
|
cmakeFlags = [ "-DCUDA_ENABLE=OFF" ]
|
2017-12-12 13:27:49 +00:00
|
|
|
++ lib.optional (!openclSupport) "-DOpenCL_ENABLE=OFF";
|
2017-12-11 03:22:47 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
2022-10-09 10:40:00 +00:00
|
|
|
buildInputs = [ libmicrohttpd openssl hwloc ]
|
2017-12-12 13:27:49 +00:00
|
|
|
++ lib.optionals openclSupport [ opencl-headers ocl-icd ];
|
2017-12-11 03:22:47 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace xmrstak/donate-level.hpp \
|
2017-12-11 08:42:44 +00:00
|
|
|
--replace 'fDevDonationLevel = 2.0' 'fDevDonationLevel = ${devDonationLevel}'
|
2017-12-11 03:22:47 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Unified All-in-one Monero miner";
|
|
|
|
homepage = "https://github.com/fireice-uk/xmr-stak";
|
|
|
|
license = licenses.gpl3Plus;
|
2019-08-06 18:06:22 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2022-08-03 12:13:56 +00:00
|
|
|
maintainers = with maintainers; [ bfortz ];
|
2017-12-11 03:22:47 +00:00
|
|
|
};
|
|
|
|
}
|