diff --git a/pkgs/development/compilers/solc/default.nix b/pkgs/development/compilers/solc/default.nix index 283d036d412c..af9ddb872f9c 100644 --- a/pkgs/development/compilers/solc/default.nix +++ b/pkgs/development/compilers/solc/default.nix @@ -1,9 +1,9 @@ { stdenv, fetchzip, fetchFromGitHub, boost, cmake, z3 }: let - version = "0.5.0"; - rev = "1d4f565a64988a3400847d2655ca24f73f234bc6"; - sha256 = "0phzk2whvgrrf8xpl5pz886glhd5s40y1hbbvq9q3fxf6vc3lisy"; + version = "0.5.1"; + rev = "c8a2cb62832afb2dc09ccee6fd42c1516dfdb981"; + sha256 = "0d6mfnixlr9m5yr3r4p6cv6vwrrivcamyar5d0f9rvir9w9ypzrr"; jsoncppURL = https://github.com/open-source-parsers/jsoncpp/archive/1.8.4.tar.gz; jsoncpp = fetchzip { url = jsoncppURL; @@ -28,11 +28,6 @@ stdenv.mkDerivation { echo >commit_hash.txt "${rev}" substituteInPlace cmake/jsoncpp.cmake \ --replace "${jsoncppURL}" ${jsoncpp} - - # To allow non-standard CMAKE_INSTALL_LIBDIR (fixed in upstream, not yet released) - substituteInPlace cmake/jsoncpp.cmake \ - --replace "\''${CMAKE_INSTALL_LIBDIR}" "lib" \ - --replace "# Build static lib but suitable to be included in a shared lib." "-DCMAKE_INSTALL_LIBDIR=lib" ''; cmakeFlags = [ @@ -42,7 +37,7 @@ stdenv.mkDerivation { ]; doCheck = stdenv.hostPlatform.isLinux && stdenv.hostPlatform == stdenv.buildPlatform; - checkPhase = "LD_LIBRARY_PATH=./libsolc:./libsolidity:./liblll:./libevmasm:./libdevcore:$LD_LIBRARY_PATH " + + checkPhase = "LD_LIBRARY_PATH=./libsolc:./libsolidity:./liblll:./libevmasm:./libdevcore:./libyul:./liblangutil:$LD_LIBRARY_PATH " + "./test/soltest -p -- --no-ipc --no-smt --testpath ../test"; nativeBuildInputs = [ cmake ]; @@ -56,7 +51,7 @@ stdenv.mkDerivation { homepage = https://github.com/ethereum/solidity; license = licenses.gpl3; platforms = with platforms; linux ++ darwin; - maintainers = with maintainers; [ dbrock akru ]; + maintainers = with maintainers; [ dbrock akru lionello ]; inherit version; }; } diff --git a/pkgs/development/compilers/solc/patches/shared-libs-install.patch b/pkgs/development/compilers/solc/patches/shared-libs-install.patch index 70162bfbcb6a..fa30655e04e8 100644 --- a/pkgs/development/compilers/solc/patches/shared-libs-install.patch +++ b/pkgs/development/compilers/solc/patches/shared-libs-install.patch @@ -2,11 +2,10 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt index 0c05208f..8893648e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -48,6 +48,20 @@ add_subdirectory(libevmasm) +@@ -48,6 +48,25 @@ add_subdirectory(libevmasm) add_subdirectory(libsolidity) add_subdirectory(libsolc) -+ +install(DIRECTORY libdevcore/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libdevcore + FILES_MATCHING PATTERN "*.h") @@ -16,6 +15,12 @@ index 0c05208f..8893648e 100644 +install(DIRECTORY libsolidity/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libsolidity + FILES_MATCHING PATTERN "*.h") ++install(DIRECTORY libyul/ ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libyul ++ FILES_MATCHING PATTERN "*.h") ++install(DIRECTORY liblangutil/ ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/liblangutil ++ FILES_MATCHING PATTERN "*.h") +install(DIRECTORY liblll/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/liblll + FILES_MATCHING PATTERN "*.h") @@ -57,8 +62,23 @@ index 0bdec4b4..e876177e 100644 @@ -29,6 +29,7 @@ endif() add_library(solidity ${sources} ${headers}) - target_link_libraries(solidity PUBLIC evmasm devcore ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY}) + target_link_libraries(solidity PUBLIC yul evmasm langutil 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}) +--- a/libyul/CMakeLists.txt ++++ b/libyul/CMakeLists.txt +@@ -42,3 +42,4 @@ endif() + optimiser/VarDeclPropagator.cpp + ) +-target_link_libraries(yul PUBLIC devcore) ++target_link_libraries(yul PUBLIC evmasm devcore langutil) ++install(TARGETS yul LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) +--- a/liblangutil/CMakeLists.txt ++++ b/liblangutil/CMakeLists.txt +@@ -11,3 +11,4 @@ endif() + + add_library(langutil ${sources}) + target_link_libraries(langutil PUBLIC devcore) ++install(TARGETS langutil LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})