Unverified Commit f9f094e6 authored by Daniël de Kok's avatar Daniël de Kok Committed by GitHub
Browse files

Merge pull request #120588 from Atemu/ethminer-free

ethminer: provide a CUDA-free version
parents 7f5bf274 3c678b70
Loading
Loading
Loading
Loading
+14 −8
Original line number Diff line number Diff line
{
  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;
  };
}
+3 −1
Original line number Diff line number Diff line
@@ -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 { };