aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/pkgs/applications/misc/cpp-ethereum/default.nix
blob: aed44d1213ce1213fea45ff5b766738eb29953af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
{ stdenv
, fetchFromGitHub
, cmake
, jsoncpp
, libjson-rpc-cpp
, curl
, boost
, leveldb
, cryptopp
, libcpuid
, opencl-headers
, ocl-icd
, miniupnpc
, libmicrohttpd
, gmp
, libGLU, libGL
, extraCmakeFlags ? []
}:
stdenv.mkDerivation rec {
  pname = "cpp-ethereum";
  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
    libGLU libGL
  ];

  dontStrip = true;

  meta = with stdenv.lib; {
    description = "Ethereum C++ client";
    homepage = "https://github.com/ethereum/cpp-ethereum";
    license = licenses.gpl3;
    maintainers = with maintainers; [ artuuge ];
    platforms = platforms.linux;
    broken = true; # 2018-04-10
  };
}