@@ -1,78 +0,0 @@
1−{ lib, gccStdenv, fetchzip, boost, cmake, ncurses, python3, coreutils
2−, z3Support ? true, z3 ? null, cvc4Support ? true, cvc4 ? null
3−, cln ? null, gmp ? null
4−}:
5−
6−# compiling source/libsmtutil/CVC4Interface.cpp breaks on clang on Darwin,
7−# general commandline tests fail at abiencoderv2_no_warning/ on clang on NixOS
8−
9−assert z3Support -> z3 != null && lib.versionAtLeast z3.version "4.6.0";
10−assert cvc4Support -> cvc4 != null && cln != null && gmp != null;
11−
12−let
13− jsoncppVersion = "1.9.4";
14− jsoncppUrl = "https://github.com/open-source-parsers/jsoncpp/archive/${jsoncppVersion}.tar.gz";
15− jsoncpp = fetchzip {
16− url = jsoncppUrl;
17− sha256 = "0qnx5y6c90fphl9mj9d20j2dfgy6s5yr5l0xnzid0vh71zrp6jwv";
18− };
19−in
20−gccStdenv.mkDerivation rec {
21−
22− pname = "solc";
23− version = "0.7.4";
24−
25− # upstream suggests avoid using archive generated by github
26− src = fetchzip {
27− url = "https://github.com/ethereum/solidity/releases/download/v${version}/solidity_${version}.tar.gz";
28− sha256 = "02261l54jdbvxk612z7zsyvmchy1rx4lf27b3f616sd7r56krpkg";
29− };
30−
31− postPatch = ''
32− substituteInPlace cmake/jsoncpp.cmake \
33− --replace "${jsoncppUrl}" ${jsoncpp}
34− '';
35−
36− cmakeFlags = [
37− "-DBoost_USE_STATIC_LIBS=OFF"
38− ] ++ lib.optionals (!z3Support) [
39− "-DUSE_Z3=OFF"
40− ] ++ lib.optionals (!cvc4Support) [
41− "-DUSE_CVC4=OFF"
42− ];
43−
44− nativeBuildInputs = [ cmake ];
45− buildInputs = [ boost ]
46− ++ lib.optionals z3Support [ z3 ]
47− ++ lib.optionals cvc4Support [ cvc4 cln gmp ];
48− checkInputs = [ ncurses python3 ];
49−
50− # Test fails on darwin for unclear reason
51− doCheck = gccStdenv.hostPlatform.isLinux;
52−
53− checkPhase = ''
54− while IFS= read -r -d ''' dir
55− do
56− LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$(pwd)/$dir
57− export LD_LIBRARY_PATH
58− done < <(find . -type d -print0)
59−
60− pushd ..
61− # IPC tests need aleth avaliable, so we disable it
62− sed -i "s/IPC_ENABLED=true/IPC_ENABLED=false\nIPC_FLAGS=\"--no-ipc\"/" ./scripts/tests.sh
63− for i in ./scripts/*.sh ./scripts/*.py ./test/*.sh; do
64− patchShebangs "$i"
65− done
66− TERM=xterm ./scripts/tests.sh
67− popd
68− '';
69−
70− meta = with lib; {
71− description = "Compiler for Ethereum smart contract language Solidity";
72− homepage = "https://github.com/ethereum/solidity";
73− license = licenses.gpl3;
74− platforms = with platforms; linux; # darwin is currently broken
75− maintainers = with maintainers; [ dbrock akru lionello sifmelcara ];
76− inherit version;
77− };
78−}