From 81e02cf02d183ad17f01cdfec9d26caa6c938bc6 Mon Sep 17 00:00:00 2001 From: Fernando J Pando Date: Thu, 21 Mar 2019 17:42:26 -0400 Subject: [PATCH] ethash: init at 0.4.2 - Tested on NixOS --- pkgs/development/libraries/ethash/default.nix | 58 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 60 insertions(+) create mode 100644 pkgs/development/libraries/ethash/default.nix diff --git a/pkgs/development/libraries/ethash/default.nix b/pkgs/development/libraries/ethash/default.nix new file mode 100644 index 000000000000..da2fd13465f2 --- /dev/null +++ b/pkgs/development/libraries/ethash/default.nix @@ -0,0 +1,58 @@ +{ stdenv, fetchFromGitHub, cmake, boost, cryptopp, opencl-headers, opencl-info, + openmpi, ocl-icd, mesa, gbenchmark, gtest }: + +stdenv.mkDerivation rec { + pname = "ethash"; + version = "0.4.2"; + + src = + fetchFromGitHub { + owner = "chfast"; + repo = "ethash"; + rev = "v${version}"; + sha256 = "0qiixvxbpl2gz7jh1qs8lmyk7wzv6ffnl7kckqgrpgm547nnn8zy"; + }; + + nativeBuildInputs = [ + cmake + ]; + + buildInputs = [ + boost + cryptopp + opencl-headers + opencl-info + openmpi + ocl-icd + mesa + ]; + + checkInputs = [ + gbenchmark + gtest + ]; + + #preConfigure = '' + # sed -i 's/GTest::main//' test/unittests/CMakeLists.txt + # cat test/unittests/CMakeLists.txt + # ln -sfv ${gtest.src}/googletest gtest + #''; + + # NOTE: disabling tests due to gtest issue + cmakeFlags = [ + "-DHUNTER_ENABLED=OFF" + "-DETHASH_BUILD_TESTS=OFF" + #"-Dbenchmark_DIR=${gbenchmark}/lib/cmake/benchmark" + #"-DGTest_DIR=${gtest.dev}/lib/cmake/GTest" + #"-DGTest_DIR=${gtest.src}/googletest" + #"-DCMAKE_PREFIX_PATH=${gtest.dev}/lib/cmake" + ]; + + meta = with stdenv.lib; { + description = "PoW algorithm for Ethereum 1.0 based on Dagger-Hashimoto"; + homepage = https://github.com/ethereum/ethash; + platforms = [ "x86_64-linux" ]; + maintainers = with maintainers; [ nand0p ]; + license = licenses.asl20; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f4586e299d6e..e2e94823b638 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2011,6 +2011,8 @@ in colormake = callPackage ../development/tools/build-managers/colormake { }; + ethash = callPackage ../development/libraries/ethash { }; + cpuminer = callPackage ../tools/misc/cpuminer { }; cpuminer-multi = callPackage ../tools/misc/cpuminer-multi { };