2019-12-14 14:56:28 +00:00
|
|
|
{
|
2021-01-11 07:54:33 +00:00
|
|
|
lib,
|
2021-04-25 12:04:23 +01:00
|
|
|
stdenv,
|
2020-12-20 06:57:25 +00:00
|
|
|
clangStdenv,
|
2019-12-14 14:56:28 +00:00
|
|
|
fetchFromGitHub,
|
|
|
|
opencl-headers,
|
|
|
|
cmake,
|
|
|
|
jsoncpp,
|
|
|
|
boost,
|
|
|
|
makeWrapper,
|
|
|
|
cudatoolkit,
|
2021-04-25 11:46:56 +01:00
|
|
|
cudaSupport,
|
2019-12-14 14:56:28 +00:00
|
|
|
mesa,
|
|
|
|
ethash,
|
|
|
|
opencl-info,
|
|
|
|
ocl-icd,
|
|
|
|
openssl,
|
|
|
|
pkg-config,
|
|
|
|
cli11
|
2021-04-25 12:04:23 +01:00
|
|
|
}@args:
|
2019-03-21 21:39:53 +00:00
|
|
|
|
2020-12-20 06:57:25 +00:00
|
|
|
# Note that this requires clang < 9.0 to build, and currently
|
|
|
|
# clangStdenv provides clang 7.1 which satisfies the requirement.
|
2021-04-25 12:04:23 +01:00
|
|
|
let stdenv = if cudaSupport then clangStdenv else args.stdenv;
|
2020-12-20 06:57:25 +00:00
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
2019-03-21 21:39:53 +00:00
|
|
|
pname = "ethminer";
|
2021-01-18 21:47:24 +00:00
|
|
|
version = "0.19.0";
|
2019-03-21 21:39:53 +00:00
|
|
|
|
|
|
|
src =
|
|
|
|
fetchFromGitHub {
|
|
|
|
owner = "ethereum-mining";
|
|
|
|
repo = "ethminer";
|
|
|
|
rev = "v${version}";
|
2021-01-18 21:47:24 +00:00
|
|
|
sha256 = "1kyff3vx2r4hjpqah9qk99z6dwz7nsnbnhhl6a76mdhjmgp1q646";
|
2019-03-21 21:39:53 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
# NOTE: dbus is broken
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DHUNTER_ENABLED=OFF"
|
|
|
|
"-DETHASHCUDA=ON"
|
|
|
|
"-DAPICORE=ON"
|
|
|
|
"-DETHDBUS=OFF"
|
|
|
|
"-DCMAKE_BUILD_TYPE=Release"
|
2021-04-25 11:46:56 +01:00
|
|
|
] ++ lib.optionals (!cudaSupport) [
|
|
|
|
"-DETHASHCUDA=OFF" # on by default
|
2019-03-21 21:39:53 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
pkg-config
|
|
|
|
makeWrapper
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
cli11
|
|
|
|
boost
|
|
|
|
opencl-headers
|
|
|
|
mesa
|
|
|
|
ethash
|
|
|
|
opencl-info
|
|
|
|
ocl-icd
|
|
|
|
openssl
|
|
|
|
jsoncpp
|
2021-04-25 11:46:56 +01:00
|
|
|
] ++ lib.optionals cudaSupport [
|
|
|
|
cudatoolkit
|
2019-03-21 21:39:53 +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-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2021-04-25 11:46:56 +01:00
|
|
|
description = "Ethereum miner with OpenCL${lib.optionalString cudaSupport ", CUDA"} and stratum support";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/ethereum-mining/ethminer";
|
2019-03-21 21:39:53 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2021-04-25 11:36:07 +01:00
|
|
|
maintainers = with maintainers; [ nand0p atemu ];
|
2021-04-25 14:18:23 +01:00
|
|
|
license = licenses.gpl3Only;
|
2021-04-25 12:03:33 +01:00
|
|
|
broken = cudaSupport;
|
2019-03-21 21:39:53 +00:00
|
|
|
};
|
|
|
|
}
|