This is an automated email from the ASF dual-hosted git repository. szaszm pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git
commit 8e9d6eb494327e92e9053fdb63916ad134483c2f Author: Martin Zink <[email protected]> AuthorDate: Tue Sep 12 16:00:26 2023 +0200 MINIFICPP-2102 update Sol2 to v3.3.0 Closes #1649 Signed-off-by: Marton Szasz <[email protected]> --- cmake/Sol2.cmake | 18 +++++++++++------- thirdparty/sol2/add-missing-include.patch | 11 ----------- thirdparty/sol2/fix_bitlib_compatibility.patch | 12 ++++++++++++ 3 files changed, 23 insertions(+), 18 deletions(-) diff --git a/cmake/Sol2.cmake b/cmake/Sol2.cmake index aa8042cc7..e5989a3ac 100644 --- a/cmake/Sol2.cmake +++ b/cmake/Sol2.cmake @@ -19,16 +19,20 @@ set(SOL2_INCLUDE_DIR "${CMAKE_BINARY_DIR}/_deps/sol2/" CACHE STRING "" FORCE) if(NOT EXISTS "${SOL2_INCLUDE_DIR}/sol.hpp") - file(DOWNLOAD "https://github.com/ThePhD/sol2/releases/download/v3.2.2/sol.hpp" "${SOL2_INCLUDE_DIR}/sol/sol.hpp" - EXPECTED_HASH SHA256=4aba3e893497591901af1bdff923b8b6725951a9df519a6003e5d0498b4cef69) + file(DOWNLOAD "https://github.com/ThePhD/sol2/releases/download/v3.3.0/sol.hpp" "${SOL2_INCLUDE_DIR}/sol/sol.hpp" + EXPECTED_HASH SHA256=e095a961a5189863745e6c101124fce944af991f3d4726a1e82c5b4a885a187f) + configure_file("${SOL2_INCLUDE_DIR}/sol/sol.hpp" "${SOL2_INCLUDE_DIR}/sol/sol.hpp" NEWLINE_STYLE LF) - file(DOWNLOAD "https://github.com/ThePhD/sol2/releases/download/v3.2.2/config.hpp" "${SOL2_INCLUDE_DIR}/sol/config.hpp" - EXPECTED_HASH SHA256=1a768cd8fdc8efeb993a4952b79204b79ac3d4bd69f55abcb605c5eba4e48b11) + file(DOWNLOAD "https://github.com/ThePhD/sol2/releases/download/v3.3.0/config.hpp" "${SOL2_INCLUDE_DIR}/sol/config.hpp" + EXPECTED_HASH SHA256=6c283673a16f0eeb3c56f8b8d72ccf7ed3f048816dbd2584ac58564c61315f02) + configure_file("${SOL2_INCLUDE_DIR}/sol/config.hpp" "${SOL2_INCLUDE_DIR}/sol/config.hpp" NEWLINE_STYLE LF) - file(DOWNLOAD "https://github.com/ThePhD/sol2/releases/download/v3.2.2/forward.hpp" "${SOL2_INCLUDE_DIR}/sol/forward.hpp" - EXPECTED_HASH SHA256=491c59790c242f8ec766deb35a18a5aae34772da3393c1b8f0719f5c50d01fdf) + file(DOWNLOAD "https://github.com/ThePhD/sol2/releases/download/v3.3.0/forward.hpp" "${SOL2_INCLUDE_DIR}/sol/forward.hpp" + EXPECTED_HASH SHA256=8fc34d74e9b4b8baa381f5e6ab7b6f6b44114cd355c718505495943ff6b85740) + configure_file("${SOL2_INCLUDE_DIR}/sol/forward.hpp" "${SOL2_INCLUDE_DIR}/sol/forward.hpp" NEWLINE_STYLE LF) - set(PC "${Patch_EXECUTABLE}" --binary -p1 -i "${CMAKE_SOURCE_DIR}/thirdparty/sol2/add-missing-include.patch" "${SOL2_INCLUDE_DIR}/sol/sol.hpp") + # Some platform simply define LUA_COMPAT_BITLIB or LUA_COMPAT_5_2 without setting them to explicitly 1 + set(PC "${Patch_EXECUTABLE}" -p1 -i "${CMAKE_SOURCE_DIR}/thirdparty/sol2/fix_bitlib_compatibility.patch" "${SOL2_INCLUDE_DIR}/sol/sol.hpp") execute_process(COMMAND ${PC} RESULT_VARIABLE patch_result_code) if(NOT patch_result_code EQUAL "0") diff --git a/thirdparty/sol2/add-missing-include.patch b/thirdparty/sol2/add-missing-include.patch deleted file mode 100644 index af606091d..000000000 --- a/thirdparty/sol2/add-missing-include.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -rupN orig/sol.c patched/sol.c ---- orig/sol.hpp 2021-08-17 15:18:25.136058619 +0200 -+++ patched/sol.hpp 2021-08-17 15:18:15.588063649 +0200 -@@ -9746,6 +9746,7 @@ namespace sol { - #include <algorithm> - #include <sstream> - #include <optional> -+#include <limits> - - namespace sol { - namespace detail { diff --git a/thirdparty/sol2/fix_bitlib_compatibility.patch b/thirdparty/sol2/fix_bitlib_compatibility.patch new file mode 100644 index 000000000..1d83678a9 --- /dev/null +++ b/thirdparty/sol2/fix_bitlib_compatibility.patch @@ -0,0 +1,12 @@ +diff -rupN orig/sol.c patched/sol.c +--- orig/sol.hpp 2021-08-17 15:18:25.136058619 +0200 ++++ patched/sol.hpp 2021-08-17 15:18:15.588063649 +0200 +@@ -3107,7 +3107,7 @@ struct pre_main { + #else + // Lua 5.2 only (deprecated in 5.3 (503)) (Can be turned on with Compat flags) + // Lua 5.2, or other versions of Lua with the compat flag, or Lua that is not 5.2 with the specific define (5.4.1 either removed it entirely or broke it) +- #if (SOL_LUA_VERSION_I_ == 502) || (defined(LUA_COMPAT_BITLIB) && (LUA_COMPAT_BITLIB != 0)) || (SOL_LUA_VERSION_I_ < 504 && (defined(LUA_COMPAT_5_2) && (LUA_COMPAT_5_2 != 0))) ++ #if (SOL_LUA_VERSION_I_ == 502) || (defined(LUA_COMPAT_BITLIB)) || (SOL_LUA_VERSION_I_ < 504 && (defined(LUA_COMPAT_5_2))) + #define SOL_LUA_BIT32_LIB_I_ SOL_ON + #else + #define SOL_LUA_BIT32_LIB_I_ SOL_DEFAULT_OFF
