diff options
author | Alexander Krupenkin <mail@akru.me> | 2018-05-02 12:27:47 +0300 |
---|---|---|
committer | Alexander Krupenkin <mail@akru.me> | 2018-05-02 12:27:47 +0300 |
commit | a40020ed5f1bd466d3463a0d0aaabd821b7d5aed (patch) | |
tree | b5fe893706cc0015410c29a923bb4891ffa75a18 /pkgs/development | |
parent | 599ecd583fae0cafe61bc6780734a86ee1f93127 (diff) | |
download | nixlib-a40020ed5f1bd466d3463a0d0aaabd821b7d5aed.tar nixlib-a40020ed5f1bd466d3463a0d0aaabd821b7d5aed.tar.gz nixlib-a40020ed5f1bd466d3463a0d0aaabd821b7d5aed.tar.bz2 nixlib-a40020ed5f1bd466d3463a0d0aaabd821b7d5aed.tar.lz nixlib-a40020ed5f1bd466d3463a0d0aaabd821b7d5aed.tar.xz nixlib-a40020ed5f1bd466d3463a0d0aaabd821b7d5aed.tar.zst nixlib-a40020ed5f1bd466d3463a0d0aaabd821b7d5aed.zip |
solc: 0.4.20 -> 0.4.23
Diffstat (limited to 'pkgs/development')
3 files changed, 115 insertions, 13 deletions
diff --git a/pkgs/development/compilers/solc/default.nix b/pkgs/development/compilers/solc/default.nix index 4c79fb15c5cb..d94ce75e3f55 100644 --- a/pkgs/development/compilers/solc/default.nix +++ b/pkgs/development/compilers/solc/default.nix @@ -1,7 +1,9 @@ -{ stdenv, fetchzip, fetchurl, boost, cmake, z3 }: +{ stdenv, fetchzip, fetchFromGitHub, boost, cmake, z3 }: let - version = "0.4.20"; + version = "0.4.23"; + rev = "124ca40dc525a987a88176c6e5170978e82fa290"; + sha256 = "07l8rfqh95yrdmbxc4pfb77s06k5v65dk3rgdqscqmwchkndrmm0"; jsoncppURL = https://github.com/open-source-parsers/jsoncpp/archive/1.7.7.tar.gz; jsoncpp = fetchzip { url = jsoncppURL; @@ -12,33 +14,45 @@ in stdenv.mkDerivation { name = "solc-${version}"; - # Cannot use `fetchFromGitHub' because of submodules - src = fetchurl { - url = "https://github.com/ethereum/solidity/releases/download/v${version}/solidity_${version}.tar.gz"; - sha256 = "0jyqnykj537ksfsf2m6ww9vganmpa6yd5fmlfpa5qm1076kq7zd6"; + src = fetchFromGitHub { + owner = "ethereum"; + repo = "solidity"; + inherit rev sha256; }; - patchPhase = '' + patches = [ + ./patches/boost-shared-libs.patch + ./patches/shared-libs-install.patch + ]; + + postPatch = '' + touch prerelease.txt + echo >commit_hash.txt "${rev}" substituteInPlace cmake/jsoncpp.cmake \ - --replace '${jsoncppURL}' ${jsoncpp} + --replace "${jsoncppURL}" ${jsoncpp} substituteInPlace cmake/EthCompilerSettings.cmake \ - --replace 'add_compile_options(-Werror)' "" + --replace "add_compile_options(-Werror)" "" ''; cmakeFlags = [ "-DBoost_USE_STATIC_LIBS=OFF" + "-DBUILD_SHARED_LIBS=ON" + "-DINSTALL_LLLC=ON" + "-DTESTS=OFF" ]; nativeBuildInputs = [ cmake ]; buildInputs = [ boost z3 ]; - meta = { + outputs = [ "out" "dev" ]; + + meta = with stdenv.lib; { description = "Compiler for Ethereum smart contract language Solidity"; longDescription = "This package also includes `lllc', the LLL compiler."; homepage = https://github.com/ethereum/solidity; - license = stdenv.lib.licenses.gpl3; - platforms = with stdenv.lib.platforms; linux ++ darwin; - maintainers = [ stdenv.lib.maintainers.dbrock ]; + license = licenses.gpl3; + platforms = with platforms; linux ++ darwin; + maintainers = with maintainers; [ dbrock akru ]; inherit version; }; } diff --git a/pkgs/development/compilers/solc/patches/boost-shared-libs.patch b/pkgs/development/compilers/solc/patches/boost-shared-libs.patch new file mode 100644 index 000000000000..499fc46c6caf --- /dev/null +++ b/pkgs/development/compilers/solc/patches/boost-shared-libs.patch @@ -0,0 +1,24 @@ +diff --git a/libsolidity/CMakeLists.txt b/libsolidity/CMakeLists.txt +index 97b01c83..0bdec4b4 100644 +--- a/libsolidity/CMakeLists.txt ++++ b/libsolidity/CMakeLists.txt +@@ -28,7 +28,7 @@ else() + endif() + + add_library(solidity ${sources} ${headers}) +-target_link_libraries(solidity PUBLIC evmasm devcore) ++target_link_libraries(solidity PUBLIC evmasm devcore ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY}) + + if (${Z3_FOUND}) + target_link_libraries(solidity PUBLIC ${Z3_LIBRARY}) +diff --git a/lllc/CMakeLists.txt b/lllc/CMakeLists.txt +index 5c480093..d6538ee2 100644 +--- a/lllc/CMakeLists.txt ++++ b/lllc/CMakeLists.txt +@@ -1,5 +1,5 @@ + add_executable(lllc main.cpp) +-target_link_libraries(lllc PRIVATE lll) ++target_link_libraries(lllc PRIVATE lll ${Boost_SYSTEM_LIBRARY}) + + if (INSTALL_LLLC) + include(GNUInstallDirs) diff --git a/pkgs/development/compilers/solc/patches/shared-libs-install.patch b/pkgs/development/compilers/solc/patches/shared-libs-install.patch new file mode 100644 index 000000000000..732797e5ae7d --- /dev/null +++ b/pkgs/development/compilers/solc/patches/shared-libs-install.patch @@ -0,0 +1,64 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4ac56b43..dacf3853 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -48,6 +48,19 @@ add_subdirectory(libevmasm) + add_subdirectory(libsolidity) + add_subdirectory(libsolc) + ++install(DIRECTORY libdevcore/ ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libdevcore ++ FILES_MATCHING PATTERN "*.h") ++install(DIRECTORY libevmasm/ ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libevmasm ++ FILES_MATCHING PATTERN "*.h") ++install(DIRECTORY libsolidity/ ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libsolidity ++ FILES_MATCHING PATTERN "*.h") ++install(DIRECTORY liblll/ ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/liblll ++ FILES_MATCHING PATTERN "*.h") ++ + if (NOT EMSCRIPTEN) + add_subdirectory(solc) + add_subdirectory(liblll) +diff --git a/libdevcore/CMakeLists.txt b/libdevcore/CMakeLists.txt +index fa7e3f48..1f9f52b4 100644 +--- a/libdevcore/CMakeLists.txt ++++ b/libdevcore/CMakeLists.txt +@@ -6,3 +6,4 @@ target_link_libraries(devcore PRIVATE jsoncpp ${Boost_FILESYSTEM_LIBRARIES} ${Bo + target_include_directories(devcore PUBLIC "${CMAKE_SOURCE_DIR}") + target_include_directories(devcore SYSTEM PUBLIC ${Boost_INCLUDE_DIRS}) + add_dependencies(devcore solidity_BuildInfo.h) ++install(TARGETS devcore LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) +diff --git a/libevmasm/CMakeLists.txt b/libevmasm/CMakeLists.txt +index 86192c1b..e7f15e93 100644 +--- a/libevmasm/CMakeLists.txt ++++ b/libevmasm/CMakeLists.txt +@@ -3,3 +3,4 @@ file(GLOB headers "*.h") + + add_library(evmasm ${sources} ${headers}) + target_link_libraries(evmasm PUBLIC jsoncpp devcore) ++install(TARGETS evmasm LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) +diff --git a/liblll/CMakeLists.txt b/liblll/CMakeLists.txt +index 4cdc073a..b61f03c7 100644 +--- a/liblll/CMakeLists.txt ++++ b/liblll/CMakeLists.txt +@@ -3,3 +3,4 @@ file(GLOB headers "*.h") + + add_library(lll ${sources} ${headers}) + target_link_libraries(lll PUBLIC evmasm devcore) ++install(TARGETS lll LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) +diff --git a/libsolidity/CMakeLists.txt b/libsolidity/CMakeLists.txt +index 97b01c83..e876177e 100644 +--- a/libsolidity/CMakeLists.txt ++++ b/libsolidity/CMakeLists.txt +@@ -28,7 +28,8 @@ else() + endif() + + add_library(solidity ${sources} ${headers}) + target_link_libraries(solidity PUBLIC evmasm devcore ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY}) ++install(TARGETS solidity LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + + if (${Z3_FOUND}) + target_link_libraries(solidity PUBLIC ${Z3_LIBRARY}) |