git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #39852 from akru/solidity-shared-libs

solc: 0.4.20 -> 0.4.23

commit59ddcfac4120d3fc3852391c35eb56e8313f0451 authorJoachim F <joachifm@users.noreply.github.com> dateWed 2 May 2018, 13:46 (9 years ago) parentac75ebfa40020e
3 files changed+115−13
pkgs/development/compilers/solc/default.nix+27−13 pkgs/development/compilers/solc/patches/boost-shared-libs.patch+24 pkgs/development/compilers/solc/patches/shared-libs-install.patch+64
pkgs/development/compilers/solc/default.nix+27−13
@@ -1,7 +1,9 @@
1−{ stdenv, fetchzip, fetchurl, boost, cmake, z3 }:
1+{ stdenv, fetchzip, fetchFromGitHub, boost, cmake, z3 }:
22
33let
4− version = "0.4.20";
4+ version = "0.4.23";
5+ rev = "124ca40dc525a987a88176c6e5170978e82fa290";
6+ sha256 = "07l8rfqh95yrdmbxc4pfb77s06k5v65dk3rgdqscqmwchkndrmm0";
57 jsoncppURL = https://github.com/open-source-parsers/jsoncpp/archive/1.7.7.tar.gz;
68 jsoncpp = fetchzip {
79 url = jsoncppURL;
@@ -12,33 +14,45 @@ in
1214stdenv.mkDerivation {
1315 name = "solc-${version}";
1416
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";
17+ src = fetchFromGitHub {
18+ owner = "ethereum";
19+ repo = "solidity";
20+ inherit rev sha256;
1921 };
2022
21− patchPhase = ''
23+ patches = [
24+ ./patches/boost-shared-libs.patch
25+ ./patches/shared-libs-install.patch
26+ ];
27+
28+ postPatch = ''
29+ touch prerelease.txt
30+ echo >commit_hash.txt "${rev}"
2231 substituteInPlace cmake/jsoncpp.cmake \
23− --replace '${jsoncppURL}' ${jsoncpp}
32+ --replace "${jsoncppURL}" ${jsoncpp}
2433 substituteInPlace cmake/EthCompilerSettings.cmake \
25− --replace 'add_compile_options(-Werror)' ""
34+ --replace "add_compile_options(-Werror)" ""
2635 '';
2736
2837 cmakeFlags = [
2938 "-DBoost_USE_STATIC_LIBS=OFF"
39+ "-DBUILD_SHARED_LIBS=ON"
40+ "-DINSTALL_LLLC=ON"
41+ "-DTESTS=OFF"
3042 ];
3143
3244 nativeBuildInputs = [ cmake ];
3345 buildInputs = [ boost z3 ];
3446
35− meta = {
47+ outputs = [ "out" "dev" ];
48+
49+ meta = with stdenv.lib; {
3650 description = "Compiler for Ethereum smart contract language Solidity";
3751 longDescription = "This package also includes `lllc', the LLL compiler.";
3852 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 ];
53+ license = licenses.gpl3;
54+ platforms = with platforms; linux ++ darwin;
55+ maintainers = with maintainers; [ dbrock akru ];
4256 inherit version;
4357 };
4458}
pkgs/development/compilers/solc/patches/boost-shared-libs.patchnew file+24
@@ -0,0 +1,24 @@
1+diff --git a/libsolidity/CMakeLists.txt b/libsolidity/CMakeLists.txt
2+index 97b01c83..0bdec4b4 100644
3+--- a/libsolidity/CMakeLists.txt
4++++ b/libsolidity/CMakeLists.txt
5+@@ -28,7 +28,7 @@ else()
6+ endif()
7+
8+ add_library(solidity ${sources} ${headers})
9+-target_link_libraries(solidity PUBLIC evmasm devcore)
10++target_link_libraries(solidity PUBLIC evmasm devcore ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY})
11+
12+ if (${Z3_FOUND})
13+ target_link_libraries(solidity PUBLIC ${Z3_LIBRARY})
14+diff --git a/lllc/CMakeLists.txt b/lllc/CMakeLists.txt
15+index 5c480093..d6538ee2 100644
16+--- a/lllc/CMakeLists.txt
17++++ b/lllc/CMakeLists.txt
18+@@ -1,5 +1,5 @@
19+ add_executable(lllc main.cpp)
20+-target_link_libraries(lllc PRIVATE lll)
21++target_link_libraries(lllc PRIVATE lll ${Boost_SYSTEM_LIBRARY})
22+
23+ if (INSTALL_LLLC)
24+ include(GNUInstallDirs)
pkgs/development/compilers/solc/patches/shared-libs-install.patchnew file+64
@@ -0,0 +1,64 @@
1+diff --git a/CMakeLists.txt b/CMakeLists.txt
2+index 4ac56b43..dacf3853 100644
3+--- a/CMakeLists.txt
4++++ b/CMakeLists.txt
5+@@ -48,6 +48,19 @@ add_subdirectory(libevmasm)
6+ add_subdirectory(libsolidity)
7+ add_subdirectory(libsolc)
8+
9++install(DIRECTORY libdevcore/
10++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libdevcore
11++ FILES_MATCHING PATTERN "*.h")
12++install(DIRECTORY libevmasm/
13++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libevmasm
14++ FILES_MATCHING PATTERN "*.h")
15++install(DIRECTORY libsolidity/
16++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libsolidity
17++ FILES_MATCHING PATTERN "*.h")
18++install(DIRECTORY liblll/
19++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/liblll
20++ FILES_MATCHING PATTERN "*.h")
21++
22+ if (NOT EMSCRIPTEN)
23+ add_subdirectory(solc)
24+ add_subdirectory(liblll)
25+diff --git a/libdevcore/CMakeLists.txt b/libdevcore/CMakeLists.txt
26+index fa7e3f48..1f9f52b4 100644
27+--- a/libdevcore/CMakeLists.txt
28++++ b/libdevcore/CMakeLists.txt
29+@@ -6,3 +6,4 @@ target_link_libraries(devcore PRIVATE jsoncpp ${Boost_FILESYSTEM_LIBRARIES} ${Bo
30+ target_include_directories(devcore PUBLIC "${CMAKE_SOURCE_DIR}")
31+ target_include_directories(devcore SYSTEM PUBLIC ${Boost_INCLUDE_DIRS})
32+ add_dependencies(devcore solidity_BuildInfo.h)
33++install(TARGETS devcore LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
34+diff --git a/libevmasm/CMakeLists.txt b/libevmasm/CMakeLists.txt
35+index 86192c1b..e7f15e93 100644
36+--- a/libevmasm/CMakeLists.txt
37++++ b/libevmasm/CMakeLists.txt
38+@@ -3,3 +3,4 @@ file(GLOB headers "*.h")
39+
40+ add_library(evmasm ${sources} ${headers})
41+ target_link_libraries(evmasm PUBLIC jsoncpp devcore)
42++install(TARGETS evmasm LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
43+diff --git a/liblll/CMakeLists.txt b/liblll/CMakeLists.txt
44+index 4cdc073a..b61f03c7 100644
45+--- a/liblll/CMakeLists.txt
46++++ b/liblll/CMakeLists.txt
47+@@ -3,3 +3,4 @@ file(GLOB headers "*.h")
48+
49+ add_library(lll ${sources} ${headers})
50+ target_link_libraries(lll PUBLIC evmasm devcore)
51++install(TARGETS lll LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
52+diff --git a/libsolidity/CMakeLists.txt b/libsolidity/CMakeLists.txt
53+index 97b01c83..e876177e 100644
54+--- a/libsolidity/CMakeLists.txt
55++++ b/libsolidity/CMakeLists.txt
56+@@ -28,7 +28,8 @@ else()
57+ endif()
58+
59+ add_library(solidity ${sources} ${headers})
60+ target_link_libraries(solidity PUBLIC evmasm devcore ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY})
61++install(TARGETS solidity LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
62+
63+ if (${Z3_FOUND})
64+ target_link_libraries(solidity PUBLIC ${Z3_LIBRARY})