forked from mirrors/nixpkgs
4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
81 lines
1.5 KiB
Nix
81 lines
1.5 KiB
Nix
{
|
|
lib,
|
|
clangStdenv,
|
|
fetchFromGitHub,
|
|
opencl-headers,
|
|
cmake,
|
|
jsoncpp,
|
|
boost,
|
|
makeWrapper,
|
|
cudatoolkit,
|
|
mesa,
|
|
ethash,
|
|
opencl-info,
|
|
ocl-icd,
|
|
openssl,
|
|
pkg-config,
|
|
cli11
|
|
}:
|
|
|
|
# Note that this requires clang < 9.0 to build, and currently
|
|
# clangStdenv provides clang 7.1 which satisfies the requirement.
|
|
let stdenv = clangStdenv;
|
|
|
|
in stdenv.mkDerivation rec {
|
|
pname = "ethminer";
|
|
version = "0.18.0";
|
|
|
|
src =
|
|
fetchFromGitHub {
|
|
owner = "ethereum-mining";
|
|
repo = "ethminer";
|
|
rev = "v${version}";
|
|
sha256 = "10b6s35axmx8kyzn2vid6l5nnzcaf4nkk7f5f7lg3cizv6lsj707";
|
|
fetchSubmodules = true;
|
|
};
|
|
|
|
# NOTE: dbus is broken
|
|
cmakeFlags = [
|
|
"-DHUNTER_ENABLED=OFF"
|
|
"-DETHASHCUDA=ON"
|
|
"-DAPICORE=ON"
|
|
"-DETHDBUS=OFF"
|
|
"-DCMAKE_BUILD_TYPE=Release"
|
|
];
|
|
|
|
nativeBuildInputs = [
|
|
cmake
|
|
pkg-config
|
|
makeWrapper
|
|
];
|
|
|
|
buildInputs = [
|
|
cli11
|
|
boost
|
|
opencl-headers
|
|
mesa
|
|
cudatoolkit
|
|
ethash
|
|
opencl-info
|
|
ocl-icd
|
|
openssl
|
|
jsoncpp
|
|
];
|
|
|
|
preConfigure = ''
|
|
sed -i 's/_lib_static//' libpoolprotocols/CMakeLists.txt
|
|
'';
|
|
|
|
postInstall = ''
|
|
wrapProgram $out/bin/ethminer --prefix LD_LIBRARY_PATH : /run/opengl-driver/lib
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Ethereum miner with OpenCL, CUDA and stratum support";
|
|
homepage = "https://github.com/ethereum-mining/ethminer";
|
|
platforms = [ "x86_64-linux" ];
|
|
maintainers = with maintainers; [ nand0p ];
|
|
license = licenses.gpl2;
|
|
};
|
|
}
|