about summary refs log tree commit diff
path: root/pkgs/applications/misc
diff options
context:
space:
mode:
authorartuuge <artuuge@gmail.com>2016-06-28 08:41:24 +0200
committerartuuge <artuuge@gmail.com>2016-07-01 19:14:00 +0200
commit83fd63995af5447a25ae79494b7ba29cd9ff0441 (patch)
treedc056dc1a4f4c84d11887615ac35896396da50d3 /pkgs/applications/misc
parent7d67a4da99b1c83ae7c9405d8f35a9727778982e (diff)
downloadnixlib-83fd63995af5447a25ae79494b7ba29cd9ff0441.tar
nixlib-83fd63995af5447a25ae79494b7ba29cd9ff0441.tar.gz
nixlib-83fd63995af5447a25ae79494b7ba29cd9ff0441.tar.bz2
nixlib-83fd63995af5447a25ae79494b7ba29cd9ff0441.tar.lz
nixlib-83fd63995af5447a25ae79494b7ba29cd9ff0441.tar.xz
nixlib-83fd63995af5447a25ae79494b7ba29cd9ff0441.tar.zst
nixlib-83fd63995af5447a25ae79494b7ba29cd9ff0441.zip
cpp_ethereum: init at 1.2.9
jsoncpp: 1.6.5 -> 1.7.2
libjson_rpc_cpp: 0.2.1 -> 0.6.0
argtable: init at 3.0.1
libcpuid: init at 0.2.2
Diffstat (limited to 'pkgs/applications/misc')
-rw-r--r--pkgs/applications/misc/webthree-umbrella/default.nix152
1 files changed, 152 insertions, 0 deletions
diff --git a/pkgs/applications/misc/webthree-umbrella/default.nix b/pkgs/applications/misc/webthree-umbrella/default.nix
new file mode 100644
index 000000000000..bfdafc3ce398
--- /dev/null
+++ b/pkgs/applications/misc/webthree-umbrella/default.nix
@@ -0,0 +1,152 @@
+{ stdenv
+, fetchgit
+, cmake
+, boost
+, gmp
+, jsoncpp
+, leveldb
+, cryptopp
+, libcpuid
+, miniupnpc
+, libjson_rpc_cpp
+, curl
+, libmicrohttpd
+, mesa
+
+, opencl-headers ? null
+
+, withAMD ? false
+, amdappsdk ? null
+
+, withBeignet ? false
+, beignet ? null
+
+, withCUDA ? false
+, nvidia_x11 ? null
+
+, withGUI ? false
+, qtwebengine ? null
+, qtbase ? null
+, qtdeclarative ? null
+
+, withProfiling ? false
+, gperftools ? null
+
+, withEVMJIT ? false
+, llvm ? null
+, zlib ? null
+, ncurses ? null
+
+, extraCmakeFlags ? []
+}:
+
+assert withAMD -> (amdappsdk != null);
+assert withBeignet -> (beignet != null);
+assert withCUDA -> (nvidia_x11 != null);
+assert stdenv.lib.findSingle (x: x) true false [ withAMD withBeignet withCUDA ];
+
+assert withGUI -> (qtwebengine != null) && (qtbase != null) && (qtdeclarative != null);
+assert withProfiling -> (gperftools != null);
+assert withEVMJIT -> (llvm != null) && (zlib != null) && (ncurses != null);
+
+let
+  withOpenCL = (stdenv.lib.any (x: x) [ withAMD withBeignet withCUDA ]);
+in
+
+assert withOpenCL -> (opencl-headers != 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";
+  };
+
+  patchPhase = stdenv.lib.optional withBeignet ''
+    sed -i -re 's#NAMES\ (OpenCL.*)#NAMES\ libcl.so\ \1#g' webthree-helpers/cmake/FindOpenCL.cmake
+  '';
+
+  cmakeFlags = with stdenv.lib; concatStringsSep " " (flatten [
+    "-DCMAKE_BUILD_TYPE=Release"
+    "-DGUI=${toString withGUI}"
+    "-DETHASHCL=${toString withOpenCL}"
+    "-DPROFILING=${toString withProfiling}"
+    "-DEVMJIT=${toString withEVMJIT}"
+    (optional withOpenCL "-DCMAKE_INCLUDE_PATH=${opencl-headers}/include")
+    (optional withAMD "-DCMAKE_LIBRARY_PATH=${amdappsdk}/lib")
+    (optional withBeignet "-DCMAKE_LIBRARY_PATH=${beignet}/lib/beignet")
+    (optional withCUDA "-DCMAKE_LIBRARY_PATH=${nvidia_x11}/lib")
+    (optional withEVMJIT "-DCMAKE_PREFIX_PATH=${llvm}")
+    extraCmakeFlags
+  ]);
+
+  configurePhase = ''
+    export BOOST_INCLUDEDIR=${boost}/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
+    (optional withOpenCL opencl-headers)
+    (optional withAMD amdappsdk)
+    (optional withBeignet beignet)
+    (optional withCUDA nvidia_x11)
+    (optional withGUI [
+      qtwebengine
+      qtbase
+      qtdeclarative
+    ])
+    (optional withProfiling gperftools)
+    (optional withEVMJIT [
+      llvm
+      zlib
+      ncurses
+    ])
+  ];
+
+  runPath = with stdenv.lib; concatStringsSep ":" (flatten [
+    (makeLibraryPath (flatten [ stdenv.cc.cc buildInputs ]))
+    (optional withBeignet "${beignet}/lib/beignet")
+  ]);
+
+  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;
+  };
+}