2020-04-24 23:36:52 +00:00
|
|
|
{
|
2021-01-15 22:18:51 +00:00
|
|
|
lib,
|
2021-05-03 20:48:10 +00:00
|
|
|
stdenv,
|
2020-04-24 23:36:52 +00:00
|
|
|
fetchFromGitHub,
|
|
|
|
opencl-headers,
|
|
|
|
cmake,
|
|
|
|
jsoncpp,
|
2021-12-26 17:43:05 +00:00
|
|
|
boost16x,
|
2020-04-24 23:36:52 +00:00
|
|
|
makeWrapper,
|
|
|
|
cudatoolkit,
|
2021-05-03 20:48:10 +00:00
|
|
|
cudaSupport,
|
2020-04-24 23:36:52 +00:00
|
|
|
mesa,
|
|
|
|
ethash,
|
|
|
|
opencl-info,
|
|
|
|
ocl-icd,
|
|
|
|
openssl,
|
|
|
|
pkg-config,
|
|
|
|
cli11
|
2021-06-06 07:54:09 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-06-06 07:54:09 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "ethminer";
|
2021-05-03 20:48:10 +00:00
|
|
|
version = "0.19.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src =
|
|
|
|
fetchFromGitHub {
|
|
|
|
owner = "ethereum-mining";
|
|
|
|
repo = "ethminer";
|
|
|
|
rev = "v${version}";
|
2021-05-03 20:48:10 +00:00
|
|
|
sha256 = "1kyff3vx2r4hjpqah9qk99z6dwz7nsnbnhhl6a76mdhjmgp1q646";
|
2020-04-24 23:36:52 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
# NOTE: dbus is broken
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DHUNTER_ENABLED=OFF"
|
|
|
|
"-DETHASHCUDA=ON"
|
|
|
|
"-DAPICORE=ON"
|
|
|
|
"-DETHDBUS=OFF"
|
|
|
|
"-DCMAKE_BUILD_TYPE=Release"
|
2021-06-06 07:54:09 +00:00
|
|
|
] ++ (if cudaSupport then [
|
|
|
|
"-DCUDA_PROPAGATE_HOST_FLAGS=off"
|
|
|
|
] else [
|
2021-05-03 20:48:10 +00:00
|
|
|
"-DETHASHCUDA=OFF" # on by default
|
2021-06-06 07:54:09 +00:00
|
|
|
]);
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
pkg-config
|
|
|
|
makeWrapper
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
cli11
|
2021-12-26 17:43:05 +00:00
|
|
|
boost16x # 1.7x support is broken, see https://github.com/ethereum-mining/ethminer/issues/2393
|
2020-04-24 23:36:52 +00:00
|
|
|
opencl-headers
|
|
|
|
mesa
|
|
|
|
ethash
|
|
|
|
opencl-info
|
|
|
|
ocl-icd
|
|
|
|
openssl
|
|
|
|
jsoncpp
|
2021-05-03 20:48:10 +00:00
|
|
|
] ++ lib.optionals cudaSupport [
|
|
|
|
cudatoolkit
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2021-08-11 14:56:57 +00:00
|
|
|
patches = [
|
|
|
|
# global context library is separated from libethash
|
|
|
|
./add-global-context.patch
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
preConfigure = ''
|
|
|
|
sed -i 's/_lib_static//' libpoolprotocols/CMakeLists.txt
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/ethminer --prefix LD_LIBRARY_PATH : /run/opengl-driver/lib
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2021-05-03 20:48:10 +00:00
|
|
|
description = "Ethereum miner with OpenCL${lib.optionalString cudaSupport ", CUDA"} and stratum support";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/ethereum-mining/ethminer";
|
|
|
|
platforms = [ "x86_64-linux" ];
|
2021-05-20 23:08:51 +00:00
|
|
|
maintainers = with maintainers; [ atemu ];
|
2021-05-03 20:48:10 +00:00
|
|
|
license = licenses.gpl3Only;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|