git: e10c49f8cfc9 - main - lang/solidity: update to 0.8.26 release.

From: Alex Dupre <ale_at_FreeBSD.org>
Date: Thu, 23 May 2024 11:31:20 UTC
The branch main has been updated by ale:

URL: https://cgit.FreeBSD.org/ports/commit/?id=e10c49f8cfc9740ffdba30c6d3b0c909268b991a

commit e10c49f8cfc9740ffdba30c6d3b0c909268b991a
Author:     Alex Dupre <ale@FreeBSD.org>
AuthorDate: 2024-05-23 11:30:34 +0000
Commit:     Alex Dupre <ale@FreeBSD.org>
CommitDate: 2024-05-23 11:31:16 +0000

    lang/solidity: update to 0.8.26 release.
---
 lang/solidity/Makefile                             | 13 +++++-----
 lang/solidity/distinfo                             |  6 ++---
 lang/solidity/files/jsoncpp.cmake                  |  2 --
 lang/solidity/files/patch-CMakeLists.txt           | 16 +++++++++++++
 .../solidity/files/patch-cmake_nlohmann-json.cmake | 28 ++++++++++++++++++++++
 lang/solidity/files/patch-libevmasm_Assembly.cpp   |  8 +++----
 lang/solidity/files/patch-libsolutil_JSON.cpp      | 15 ------------
 7 files changed, 58 insertions(+), 30 deletions(-)

diff --git a/lang/solidity/Makefile b/lang/solidity/Makefile
index fafc81b169db..523ebe84c177 100644
--- a/lang/solidity/Makefile
+++ b/lang/solidity/Makefile
@@ -1,5 +1,5 @@
 PORTNAME=	solidity
-PORTVERSION=	0.8.25
+PORTVERSION=	0.8.26
 CATEGORIES=	lang
 MASTER_SITES=	https://github.com/ethereum/solidity/releases/download/v${PORTVERSION}/
 DISTNAME=	${PORTNAME}_${PORTVERSION}
@@ -15,8 +15,8 @@ NOT_FOR_ARCHS_REASON=	solidity currently does not support big endian systems
 
 BUILD_DEPENDS=	boost-libs>=0:devel/boost-libs \
 		libfmt>=0:devel/libfmt \
+		nlohmann-json>=0:devel/nlohmann-json \
 		range-v3>=0:devel/range-v3
-LIB_DEPENDS=	libjsoncpp.so:devel/jsoncpp
 
 USES=		cmake compiler:c++14-lang cpe
 CPE_VENDOR=	${PORTNAME}lang
@@ -33,9 +33,10 @@ CVC4_CMAKE_OFF=	USE_CVC4
 CVC4_BROKEN=	solidity uses cvc4 which has been succeeded by cvc5
 
 CMAKE_ARGS+=	-DUSE_LD_GOLD=OFF -DTESTS=OFF \
+		-DUSE_SYSTEM_LIBRARIES=ON \
 		-DRANGE_V3_INCLUDE_DIR="${LOCALBASE}/include" \
-		-DJSONCPP_INCLUDE_DIR:STRING="${LOCALBASE}/include/jsoncpp" \
-		-DJSONCPP_LIB_DIR:STRING="${LOCALBASE}/lib" \
+		-DNLOHMANN_JSON_INCLUDE_DIR="${LOCALBASE}/include" \
+		-DSTRICT_NLOHMANN_JSON_VERSION=OFF \
 		-DSTRICT_Z3_VERSION=OFF
 
 PLIST_FILES=	bin/solc \
@@ -48,7 +49,7 @@ CXXFLAGS+=	-Wno-unqualified-std-cast-call
 .endif
 
 pre-patch:
-		@${CP} ${FILESDIR}/fmtlib.cmake ${FILESDIR}/jsoncpp.cmake ${WRKSRC}/cmake/
-		@${REINPLACE_CMD} '/EthCcache/d' ${WRKSRC}/CMakeLists.txt
+		@${CP} ${FILESDIR}/fmtlib.cmake ${WRKSRC}/cmake/
+		#@${REINPLACE_CMD} '/EthCcache/d' ${WRKSRC}/CMakeLists.txt
 
 .include <bsd.port.mk>
diff --git a/lang/solidity/distinfo b/lang/solidity/distinfo
index 49e1f199473b..4cb79c2542bc 100644
--- a/lang/solidity/distinfo
+++ b/lang/solidity/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1710488506
-SHA256 (solidity_0.8.25.tar.gz) = def54b5f8385ef70e102d28321d074e7f3798e9688586452c7939e6733ab273f
-SIZE (solidity_0.8.25.tar.gz) = 3404228
+TIMESTAMP = 1716285738
+SHA256 (solidity_0.8.26.tar.gz) = 5d48c9a38e101eb494bc58e20cf3786a8910d89c2ca0073ab04738edd30cf03a
+SIZE (solidity_0.8.26.tar.gz) = 3211986
diff --git a/lang/solidity/files/jsoncpp.cmake b/lang/solidity/files/jsoncpp.cmake
deleted file mode 100644
index 20695766aabd..000000000000
--- a/lang/solidity/files/jsoncpp.cmake
+++ /dev/null
@@ -1,2 +0,0 @@
-include_directories(${JSONCPP_INCLUDE_DIR})
-link_directories(${JSONCPP_LIB_DIR})
diff --git a/lang/solidity/files/patch-CMakeLists.txt b/lang/solidity/files/patch-CMakeLists.txt
new file mode 100644
index 000000000000..10c9cdbbc0e1
--- /dev/null
+++ b/lang/solidity/files/patch-CMakeLists.txt
@@ -0,0 +1,16 @@
+--- CMakeLists.txt.orig	2024-05-21 09:44:13 UTC
++++ CMakeLists.txt
+@@ -44,12 +44,9 @@ mark_as_advanced(STRICT_NLOHMANN_JSON_VERSION)
+ mark_as_advanced(ONLY_BUILD_SOLIDITY_LIBRARIES)
+ mark_as_advanced(STRICT_NLOHMANN_JSON_VERSION)
+ 
+-# Setup cccache.
+-include(EthCcache)
+-
+ # Let's find our dependencies
+ include(EthDependencies)
+-if (NOT USE_SYSTEM_LIBRARIES)
++if (USE_SYSTEM_LIBRARIES)
+   include(fmtlib)
+   include(nlohmann-json)
+   include(range-v3)
diff --git a/lang/solidity/files/patch-cmake_nlohmann-json.cmake b/lang/solidity/files/patch-cmake_nlohmann-json.cmake
new file mode 100644
index 000000000000..5c04956c04de
--- /dev/null
+++ b/lang/solidity/files/patch-cmake_nlohmann-json.cmake
@@ -0,0 +1,28 @@
+--- cmake/nlohmann-json.cmake.orig	2024-05-23 11:23:51 UTC
++++ cmake/nlohmann-json.cmake
+@@ -1,21 +1,7 @@
+-include(ExternalProject)
+-
+-ExternalProject_Add(nlohmann-json-project
+-        DOWNLOAD_DIR "${CMAKE_SOURCE_DIR}/deps/nlohmann/nlohmann"
+-        DOWNLOAD_NAME json.hpp
+-        DOWNLOAD_NO_EXTRACT 1
+-        URL https://github.com/nlohmann/json/releases/download/v3.11.3/json.hpp
+-        URL_HASH SHA256=9bea4c8066ef4a1c206b2be5a36302f8926f7fdc6087af5d20b417d0cf103ea6
+-        CMAKE_COMMAND true
+-        BUILD_COMMAND true
+-        INSTALL_COMMAND true
+-)
+-
+ # Create nlohmann-json imported library
+ add_library(nlohmann-json INTERFACE IMPORTED)
+-file(MAKE_DIRECTORY ${CMAKE_SOURCE_DIR}/deps/nlohmann)  # Must exist.
+ set_target_properties(nlohmann-json PROPERTIES
+         INTERFACE_COMPILE_OPTIONS "\$<\$<CXX_COMPILER_ID:MSVC>:/permissive->"
+-        INTERFACE_SYSTEM_INCLUDE_DIRECTORIES  ${CMAKE_SOURCE_DIR}/deps/nlohmann
+-        INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_SOURCE_DIR}/deps/nlohmann)
+-add_dependencies(nlohmann-json nlohmann-json-project)
+\ No newline at end of file
++        INTERFACE_SYSTEM_INCLUDE_DIRECTORIES  ${NLOHMANN_JSON_INCLUDE_DIR}
++        INTERFACE_INCLUDE_DIRECTORIES ${NLOHMANN_JSON_INCLUDE_DIR})
++add_dependencies(nlohmann-json nlohmann-json-project)
diff --git a/lang/solidity/files/patch-libevmasm_Assembly.cpp b/lang/solidity/files/patch-libevmasm_Assembly.cpp
index e82803281e1e..21c549fb8adc 100644
--- a/lang/solidity/files/patch-libevmasm_Assembly.cpp
+++ b/lang/solidity/files/patch-libevmasm_Assembly.cpp
@@ -1,8 +1,8 @@
---- libevmasm/Assembly.cpp.orig	2023-07-19 09:24:46 UTC
+--- libevmasm/Assembly.cpp.orig	2024-05-21 09:44:13 UTC
 +++ libevmasm/Assembly.cpp
-@@ -47,6 +47,8 @@ using namespace solidity::evmasm;
- using namespace solidity::langutil;
- using namespace solidity::util;
+@@ -54,6 +54,8 @@ std::map<std::string, std::shared_ptr<std::string cons
+ 
+ std::map<std::string, std::shared_ptr<std::string const>> Assembly::s_sharedSourceNames;
  
 +#undef MSIZE // remove MSIZE definition from <sys/params.h>, included by boost 1.66.0
 +
diff --git a/lang/solidity/files/patch-libsolutil_JSON.cpp b/lang/solidity/files/patch-libsolutil_JSON.cpp
deleted file mode 100644
index 2e3b0ebb87a2..000000000000
--- a/lang/solidity/files/patch-libsolutil_JSON.cpp
+++ /dev/null
@@ -1,15 +0,0 @@
---- libsolutil/JSON.cpp.orig	2020-12-16 17:41:40 UTC
-+++ libsolutil/JSON.cpp
-@@ -32,10 +32,12 @@
- 
- using namespace std;
- 
-+/*
- static_assert(
- 	(JSONCPP_VERSION_MAJOR == 1) && (JSONCPP_VERSION_MINOR == 9) && (JSONCPP_VERSION_PATCH == 3),
- 	"Unexpected jsoncpp version: " JSONCPP_VERSION_STRING ". Expecting 1.9.3."
- );
-+*/
- 
- namespace solidity::util
- {