diff --git a/pkgs/applications/misc/cpp-ethereum/default.nix b/pkgs/applications/misc/cpp-ethereum/default.nix new file mode 100644 index 000000000000..3cc334c6765b --- /dev/null +++ b/pkgs/applications/misc/cpp-ethereum/default.nix @@ -0,0 +1,84 @@ +{ stdenv +, fetchFromGitHub +, cmake +, jsoncpp +, libjson_rpc_cpp +, curl +, boost +, leveldb +, cryptopp +, libcpuid +, opencl-headers +, ocl-icd +, miniupnpc +, libmicrohttpd +, gmp +, mesa +, extraCmakeFlags ? [] +}: +stdenv.mkDerivation rec { + name = "cpp-ethereum-${version}"; + version = "1.3.0"; + + src = fetchFromGitHub { + owner = "ethereum"; + repo = "cpp-ethereum"; + rev = "62ab9522e58df9f28d2168ea27999a214b16ea96"; + sha256 = "1fxgpqhmjhpv0zzs1m3yf9h8mh25dqpa7pmcfy7f9qiqpfdr4zq9"; + }; + + cmakeFlags = [ "-DCMAKE_BUILD_TYPE=Release" extraCmakeFlags ]; + + configurePhase = '' + export BOOST_INCLUDEDIR=${boost.dev}/include + export BOOST_LIBRARYDIR=${boost.out}/lib + + mkdir -p Build/Install + pushd Build + + cmake .. -DCMAKE_INSTALL_PREFIX=$(pwd)/Install $cmakeFlags + ''; + + enableParallelBuilding = true; + + runPath = with stdenv.lib; makeLibraryPath ([ stdenv.cc.cc ] ++ buildInputs); + + installPhase = '' + make install + + mkdir -p $out + + for f in Install/lib/*.so* $(find Install/bin -executable -type f); do + patchelf --set-rpath $runPath:$out/lib $f + done + + cp -r Install/* $out + ''; + + buildInputs = [ + cmake + jsoncpp + libjson_rpc_cpp + curl + boost + leveldb + cryptopp + libcpuid + opencl-headers + ocl-icd + miniupnpc + libmicrohttpd + gmp + mesa + ]; + + dontStrip = true; + + meta = with stdenv.lib; { + decription = "Ethereum C++ client"; + homepage = https://github.com/ethereum/cpp-ethereum; + license = licenses.gpl3; + maintainers = with maintainers; [ artuuge ]; + platforms = platforms.linux; + }; +} diff --git a/pkgs/applications/misc/webthree-umbrella/default.nix b/pkgs/applications/misc/webthree-umbrella/default.nix deleted file mode 100644 index 8876b64ed0c9..000000000000 --- a/pkgs/applications/misc/webthree-umbrella/default.nix +++ /dev/null @@ -1,115 +0,0 @@ -{ stdenv -, fetchgit -, cmake -, boost -, gmp -, jsoncpp -, leveldb -, cryptopp -, libcpuid -, miniupnpc -, libjson_rpc_cpp -, curl -, libmicrohttpd -, mesa - -, withOpenCL ? false -, opencl-headers ? null -, ocl-icd ? null - -, withGUI ? false -, qtwebengine ? null -, qtbase ? null -, qtdeclarative ? null - -, withProfiling ? false -, gperftools ? null - -, withEVMJIT ? false -, llvm ? null -, zlib ? null -, ncurses ? null - -, extraCmakeFlags ? [] -}: - -assert withOpenCL -> (opencl-headers != null) && (ocl-icd != null); -assert withGUI -> (qtwebengine != null) && (qtbase != null) && (qtdeclarative != null); -assert withProfiling -> (gperftools != null); -assert withEVMJIT -> (llvm != null) && (zlib != null) && (ncurses != null); - -stdenv.mkDerivation rec { - name = "cpp-ethereum-${version}"; - version = "1.2.9"; - - src = fetchgit { - url = https://github.com/ethereum/webthree-umbrella.git; - rev = "850479b159a0bfa316fd261ab96b0a043acd766c"; - sha256 = "0k8w8gqzy71x77p0p85r38gfdnzrlzk2yvb3ablml9ppg4qb4ch5"; - }; - - cmakeFlags = with stdenv.lib; concatStringsSep " " (flatten [ - "-DGUI=${toString withGUI}" - "-DETHASHCL=${toString withOpenCL}" - "-DPROFILING=${toString withProfiling}" - "-DEVMJIT=${toString withEVMJIT}" - (optional withOpenCL [ - "-DCMAKE_INCLUDE_PATH=${opencl-headers}/include" - "-DCMAKE_LIBRARY_PATH=${ocl-icd}/lib" - ]) - (optional withEVMJIT "-DCMAKE_PREFIX_PATH=${llvm}") - extraCmakeFlags - ]); - - configurePhase = '' - export BOOST_INCLUDEDIR=${boost.dev}/include - export BOOST_LIBRARYDIR=${boost.out}/lib - - mkdir -p Build/Install - pushd Build - - cmake .. -DCMAKE_INSTALL_PREFIX=$(pwd)/Install $cmakeFlags - ''; - - buildInputs = with stdenv.lib; [ - cmake - boost - gmp - jsoncpp - leveldb - cryptopp - libcpuid - miniupnpc - libjson_rpc_cpp - curl - libmicrohttpd - mesa - ] ++ optionals withOpenCL [ opencl-headers ocl-icd ] - ++ optionals withGUI [ qtwebengine qtbase qtdeclarative ] - ++ optional withProfiling gperftools - ++ optionals withEVMJIT [ llvm zlib ncurses ]; - - runPath = with stdenv.lib; (makeLibraryPath (flatten [ stdenv.cc.cc buildInputs ])); - - installPhase = '' - make install - - mkdir -p $out - - for f in Install/lib/*.so* $(find Install/bin -executable -type f); do - patchelf --set-rpath $runPath:$out/lib $f - done - - cp -r Install/* $out - ''; - - dontStrip = true; - - meta = with stdenv.lib; { - decription = "Umbrella project for the Ethereum C++ implementation"; - homepage = https://github.com/ethereum/webthree-umbrella.git; - license = licenses.gpl3; - maintainers = with maintainers; [ artuuge ]; - platforms = platforms.linux; - }; -} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d6a1d44ae9db..4ea7d7f066f5 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -12175,15 +12175,7 @@ in convchain = callPackage ../tools/graphics/convchain {}; - cpp_ethereum = callPackage ../applications/misc/webthree-umbrella { - withOpenCL = true; - - # withEVMJIT = true; - # inherit (pkgs.llvmPackages_38) llvm; - - # withGUI = true; - # inherit (pkgs.qt5) qtwebengine qtbase qtdeclarative; - }; + cpp_ethereum = callPackage ../applications/misc/cpp-ethereum { }; csdp = callPackage ../applications/science/math/csdp { liblapack = liblapackWithoutAtlas;