2018-04-24 17:04:25 +02:00
|
|
|
{ stdenv, stdenvGcc6, lib
|
2018-07-21 02:44:44 +02:00
|
|
|
, fetchFromGitHub, cmake, libmicrohttpd, openssl
|
2017-12-11 04:22:47 +01:00
|
|
|
, opencl-headers, ocl-icd, hwloc, cudatoolkit
|
2017-12-11 09:42:44 +01:00
|
|
|
, devDonationLevel ? "0.0"
|
2017-12-12 14:27:49 +01:00
|
|
|
, cudaSupport ? false
|
2018-03-28 06:54:22 +02:00
|
|
|
, openclSupport ? true
|
2017-12-11 04:22:47 +01:00
|
|
|
}:
|
|
|
|
|
2018-04-24 17:04:25 +02:00
|
|
|
let
|
|
|
|
stdenv' = if cudaSupport then stdenvGcc6 else stdenv;
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv'.mkDerivation rec {
|
2017-12-11 04:22:47 +01:00
|
|
|
name = "xmr-stak-${version}";
|
2019-03-12 23:02:28 +01:00
|
|
|
version = "2.10.1";
|
2017-12-11 04:22:47 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "fireice-uk";
|
|
|
|
repo = "xmr-stak";
|
2018-03-28 06:54:22 +02:00
|
|
|
rev = "${version}";
|
2019-03-12 23:02:28 +01:00
|
|
|
sha256 = "0381r4nr5cx0zv3dhsvld4ibpp5gq911815h03v92688za3swhng";
|
2017-12-11 04:22:47 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
NIX_CFLAGS_COMPILE = "-O3";
|
|
|
|
|
2017-12-12 14:27:49 +01:00
|
|
|
cmakeFlags = lib.optional (!cudaSupport) "-DCUDA_ENABLE=OFF"
|
|
|
|
++ lib.optional (!openclSupport) "-DOpenCL_ENABLE=OFF";
|
2017-12-11 04:22:47 +01:00
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
2017-12-12 14:27:49 +01:00
|
|
|
buildInputs = [ libmicrohttpd openssl hwloc ]
|
|
|
|
++ lib.optional cudaSupport cudatoolkit
|
|
|
|
++ lib.optionals openclSupport [ opencl-headers ocl-icd ];
|
2017-12-11 04:22:47 +01:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace xmrstak/donate-level.hpp \
|
2017-12-11 09:42:44 +01:00
|
|
|
--replace 'fDevDonationLevel = 2.0' 'fDevDonationLevel = ${devDonationLevel}'
|
2017-12-11 04:22:47 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Unified All-in-one Monero miner";
|
|
|
|
homepage = "https://github.com/fireice-uk/xmr-stak";
|
|
|
|
license = licenses.gpl3Plus;
|
2018-10-19 08:32:22 +02:00
|
|
|
maintainers = with maintainers; [ fpletz bfortz ];
|
2017-12-11 04:22:47 +01:00
|
|
|
};
|
|
|
|
}
|