1{ stdenv, fetchzip, fetchurl, boost, cmake, z3 }:
2
3let
4 version = "0.4.20";
5 jsoncppURL = https://github.com/open-source-parsers/jsoncpp/archive/1.7.7.tar.gz;
6 jsoncpp = fetchzip {
7 url = jsoncppURL;
8 sha256 = "0jz93zv17ir7lbxb3dv8ph2n916rajs8i96immwx9vb45pqid3n0";
9 };
10in
11
12stdenv.mkDerivation {
13 name = "solc-${version}";
14
15 # Cannot use `fetchFromGitHub' because of submodules
16 src = fetchurl {
17 url = "https://github.com/ethereum/solidity/releases/download/v${version}/solidity_${version}.tar.gz";
18 sha256 = "0jyqnykj537ksfsf2m6ww9vganmpa6yd5fmlfpa5qm1076kq7zd6";
19 };
20
21 patchPhase = ''
22 substituteInPlace cmake/jsoncpp.cmake \
23 --replace '${jsoncppURL}' ${jsoncpp}
24 substituteInPlace cmake/EthCompilerSettings.cmake \
25 --replace 'add_compile_options(-Werror)' ""
26 '';
27
28 cmakeFlags = [
29 "-DBoost_USE_STATIC_LIBS=OFF"
30 ];
31
32 nativeBuildInputs = [ cmake ];
33 buildInputs = [ boost z3 ];
34
35 meta = {
36 description = "Compiler for Ethereum smart contract language Solidity";
37 longDescription = "This package also includes `lllc', the LLL compiler.";
38 homepage = https://github.com/ethereum/solidity;
39 license = stdenv.lib.licenses.gpl3;
40 platforms = with stdenv.lib.platforms; linux ++ darwin;
41 maintainers = [ stdenv.lib.maintainers.dbrock ];
42 inherit version;
43 };
44}