2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, gbenchmark, gtest }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "ethash";
|
2021-09-26 12:46:18 +00:00
|
|
|
version = "0.7.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src =
|
|
|
|
fetchFromGitHub {
|
|
|
|
owner = "chfast";
|
|
|
|
repo = "ethash";
|
|
|
|
rev = "v${version}";
|
2021-09-26 12:46:18 +00:00
|
|
|
sha256 = "sha256-ba8SBtJd0ERunO9KpJZkutkO6ZnZOEGzWn2IjO1Uu28=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
];
|
|
|
|
|
|
|
|
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"
|
|
|
|
];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "PoW algorithm for Ethereum 1.0 based on Dagger-Hashimoto";
|
|
|
|
homepage = "https://github.com/ethereum/ethash";
|
2021-03-12 07:09:13 +00:00
|
|
|
platforms = platforms.unix;
|
2021-05-20 23:08:51 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
};
|
|
|
|
}
|