Merge pull request #120588 from Atemu/ethminer-free

ethminer: provide a CUDA-free version
This commit is contained in:
Daniël de Kok 2021-04-28 08:58:16 +02:00 committed by GitHub
commit f9f094e690
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 9 deletions

View file

@ -1,5 +1,6 @@
{
lib,
stdenv,
clangStdenv,
fetchFromGitHub,
opencl-headers,
@ -8,6 +9,7 @@
boost,
makeWrapper,
cudatoolkit,
cudaSupport,
mesa,
ethash,
opencl-info,
@ -15,22 +17,22 @@
openssl,
pkg-config,
cli11
}:
}@args:
# Note that this requires clang < 9.0 to build, and currently
# clangStdenv provides clang 7.1 which satisfies the requirement.
let stdenv = clangStdenv;
let stdenv = if cudaSupport then clangStdenv else args.stdenv;
in stdenv.mkDerivation rec {
pname = "ethminer";
version = "0.18.0";
version = "0.19.0";
src =
fetchFromGitHub {
owner = "ethereum-mining";
repo = "ethminer";
rev = "v${version}";
sha256 = "10b6s35axmx8kyzn2vid6l5nnzcaf4nkk7f5f7lg3cizv6lsj707";
sha256 = "1kyff3vx2r4hjpqah9qk99z6dwz7nsnbnhhl6a76mdhjmgp1q646";
fetchSubmodules = true;
};
@ -41,6 +43,8 @@ in stdenv.mkDerivation rec {
"-DAPICORE=ON"
"-DETHDBUS=OFF"
"-DCMAKE_BUILD_TYPE=Release"
] ++ lib.optionals (!cudaSupport) [
"-DETHASHCUDA=OFF" # on by default
];
nativeBuildInputs = [
@ -54,12 +58,13 @@ in stdenv.mkDerivation rec {
boost
opencl-headers
mesa
cudatoolkit
ethash
opencl-info
ocl-icd
openssl
jsoncpp
] ++ lib.optionals cudaSupport [
cudatoolkit
];
preConfigure = ''
@ -71,10 +76,11 @@ in stdenv.mkDerivation rec {
'';
meta = with lib; {
description = "Ethereum miner with OpenCL, CUDA and stratum support";
description = "Ethereum miner with OpenCL${lib.optionalString cudaSupport ", CUDA"} and stratum support";
homepage = "https://github.com/ethereum-mining/ethminer";
platforms = [ "x86_64-linux" ];
maintainers = with maintainers; [ nand0p ];
license = licenses.gpl2;
maintainers = with maintainers; [ nand0p atemu ];
license = licenses.gpl3Only;
broken = cudaSupport;
};
}

View file

@ -3485,7 +3485,9 @@ in
ethash = callPackage ../development/libraries/ethash { };
ethminer = callPackage ../tools/misc/ethminer { };
ethminer = callPackage ../tools/misc/ethminer { cudaSupport = config.cudaSupport or true; };
ethminer-cuda = ethminer.override { cudaSupport = true; };
ethminer-free = ethminer.override { cudaSupport = false; };
cuetools = callPackage ../tools/cd-dvd/cuetools { };