From d5ebc8cb4b8889cb13837626da7537bcc4126229 Mon Sep 17 00:00:00 2001 From: Bertrand Jacquin Date: Wed, 17 Jul 2024 22:55:40 +0100 Subject: net-p2p/monero: update patches for boost 1.8.5 and miniupnpc 2.2.8 --- .../monero-0.18.3.3-Drop-in-tree-miniupnpc.patch | 60 -------- ...nero-0.18.3.3-Use-gentoo-dev-libs-randomx.patch | 18 --- .../monero-0.18.3.3-Use-gentoo-versioning.patch | 37 ----- ...mon-support-boost-filesystem-copy_options.patch | 166 +++++++++++++++++++++ ...trib-fix-compilation-error-for-boost-1.85.patch | 21 +++ ...-add-support-for-miniupnpc-API-version-18.patch | 44 ++++++ ...nero-0.18.3.3-upnp-drop-in-tree-miniupnpc.patch | 60 ++++++++ .../files/monero-0.18.3.3-upnp-fix-warning.patch | 31 ++++ ...nero-0.18.3.3-use-gentoo-dev-libs-randomx.patch | 18 +++ .../monero-0.18.3.3-use-gentoo-versioning.patch | 37 +++++ .../files/monero-9999-Drop-in-tree-miniupnpc.patch | 60 -------- .../monero-9999-Use-gentoo-dev-libs-randomx.patch | 18 --- ...-add-support-for-miniupnpc-API-version-18.patch | 44 ++++++ .../monero-9999-upnp-drop-in-tree-miniupnpc.patch | 60 ++++++++ .../files/monero-9999-upnp-fix-warning.patch | 31 ++++ .../monero-9999-use-gentoo-dev-libs-randomx.patch | 18 +++ 16 files changed, 530 insertions(+), 193 deletions(-) delete mode 100644 net-p2p/monero/files/monero-0.18.3.3-Drop-in-tree-miniupnpc.patch delete mode 100644 net-p2p/monero/files/monero-0.18.3.3-Use-gentoo-dev-libs-randomx.patch delete mode 100644 net-p2p/monero/files/monero-0.18.3.3-Use-gentoo-versioning.patch create mode 100644 net-p2p/monero/files/monero-0.18.3.3-common-support-boost-filesystem-copy_options.patch create mode 100644 net-p2p/monero/files/monero-0.18.3.3-contrib-fix-compilation-error-for-boost-1.85.patch create mode 100644 net-p2p/monero/files/monero-0.18.3.3-upnp-add-support-for-miniupnpc-API-version-18.patch create mode 100644 net-p2p/monero/files/monero-0.18.3.3-upnp-drop-in-tree-miniupnpc.patch create mode 100644 net-p2p/monero/files/monero-0.18.3.3-upnp-fix-warning.patch create mode 100644 net-p2p/monero/files/monero-0.18.3.3-use-gentoo-dev-libs-randomx.patch create mode 100644 net-p2p/monero/files/monero-0.18.3.3-use-gentoo-versioning.patch delete mode 100644 net-p2p/monero/files/monero-9999-Drop-in-tree-miniupnpc.patch delete mode 100644 net-p2p/monero/files/monero-9999-Use-gentoo-dev-libs-randomx.patch create mode 100644 net-p2p/monero/files/monero-9999-upnp-add-support-for-miniupnpc-API-version-18.patch create mode 100644 net-p2p/monero/files/monero-9999-upnp-drop-in-tree-miniupnpc.patch create mode 100644 net-p2p/monero/files/monero-9999-upnp-fix-warning.patch create mode 100644 net-p2p/monero/files/monero-9999-use-gentoo-dev-libs-randomx.patch (limited to 'net-p2p/monero/files') diff --git a/net-p2p/monero/files/monero-0.18.3.3-Drop-in-tree-miniupnpc.patch b/net-p2p/monero/files/monero-0.18.3.3-Drop-in-tree-miniupnpc.patch deleted file mode 100644 index 4959cf9c..00000000 --- a/net-p2p/monero/files/monero-0.18.3.3-Drop-in-tree-miniupnpc.patch +++ /dev/null @@ -1,60 +0,0 @@ -From dc3a18789e8c8ef6252bd94546bf8cd6184a56eb Mon Sep 17 00:00:00 2001 -From: Bertrand Jacquin -Date: Sun, 17 Jun 2018 22:34:11 +0100 -Subject: [PATCH] Drop in-tree miniupnpc - -Since 6b8539803184 ("Build: update CMake and p2p for in-tree -miniupnp"), a hard dependency is made on miniupnpc which is a git -submodule not part of the archive available upstream. ---- - external/CMakeLists.txt | 19 +++---------------- - src/p2p/net_node.inl | 6 +++--- - 2 files changed, 6 insertions(+), 19 deletions(-) - -diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt -index 5b7f69a56843..fc40455064f4 100644 ---- a/external/CMakeLists.txt -+++ b/external/CMakeLists.txt -@@ -36,22 +36,9 @@ - # others. - - find_package(Miniupnpc REQUIRED) -- --message(STATUS "Using in-tree miniupnpc") --set(UPNPC_NO_INSTALL TRUE CACHE BOOL "Disable miniupnp installation" FORCE) --add_subdirectory(miniupnp/miniupnpc) --set_property(TARGET libminiupnpc-static PROPERTY FOLDER "external") --set_property(TARGET libminiupnpc-static PROPERTY POSITION_INDEPENDENT_CODE ON) --if(MSVC) -- set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -wd4244 -wd4267") --elseif(NOT MSVC) -- set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-undef -Wno-unused-result -Wno-unused-value") --endif() --if(CMAKE_SYSTEM_NAME MATCHES "NetBSD") -- set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -D_NETBSD_SOURCE") --endif() -- --set(UPNP_LIBRARIES "libminiupnpc-static" PARENT_SCOPE) -+set(UPNP_STATIC false PARENT_SCOPE) -+set(UPNP_INCLUDE ${MINIUPNP_INCLUDE_DIR} PARENT_SCOPE) -+set(UPNP_LIBRARIES ${MINIUPNP_LIBRARY} PARENT_SCOPE) - - find_package(Unbound) - -diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl -index f33ce977de07..3d0c05a19da2 100644 ---- a/src/p2p/net_node.inl -+++ b/src/p2p/net_node.inl -@@ -60,9 +60,9 @@ - #include "cryptonote_core/cryptonote_core.h" - #include "net/parse.h" - --#include --#include --#include -+#include -+#include -+#include - - #undef MONERO_DEFAULT_LOG_CATEGORY - #define MONERO_DEFAULT_LOG_CATEGORY "net.p2p" diff --git a/net-p2p/monero/files/monero-0.18.3.3-Use-gentoo-dev-libs-randomx.patch b/net-p2p/monero/files/monero-0.18.3.3-Use-gentoo-dev-libs-randomx.patch deleted file mode 100644 index 178e83ff..00000000 --- a/net-p2p/monero/files/monero-0.18.3.3-Use-gentoo-dev-libs-randomx.patch +++ /dev/null @@ -1,18 +0,0 @@ -From a007bfe93c3e71a166206abd30a91dc3637983c8 Mon Sep 17 00:00:00 2001 -From: Bertrand Jacquin -Date: Wed, 6 Nov 2019 01:23:52 +0000 -Subject: [PATCH] Use gentoo dev-libs/randomx - ---- - external/CMakeLists.txt | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt -index fc40455064f4..5536debe8e2b 100644 ---- a/external/CMakeLists.txt -+++ b/external/CMakeLists.txt -@@ -56,4 +56,3 @@ endif() - add_subdirectory(db_drivers) - add_subdirectory(easylogging++) - add_subdirectory(qrcodegen) --add_subdirectory(randomx EXCLUDE_FROM_ALL) diff --git a/net-p2p/monero/files/monero-0.18.3.3-Use-gentoo-versioning.patch b/net-p2p/monero/files/monero-0.18.3.3-Use-gentoo-versioning.patch deleted file mode 100644 index c2c563e1..00000000 --- a/net-p2p/monero/files/monero-0.18.3.3-Use-gentoo-versioning.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 9e2da6c420843a4928b0fb42a41bafcfb4b95ee3 Mon Sep 17 00:00:00 2001 -From: Bertrand Jacquin -Date: Sat, 15 Jun 2019 00:15:54 +0100 -Subject: [PATCH] Use gentoo versioning - ---- - cmake/Version.cmake | 18 +++--------------- - 1 file changed, 3 insertions(+), 15 deletions(-) - -diff --git a/cmake/Version.cmake b/cmake/Version.cmake -index e9ed9fba159b..5df4bc1ab7f3 100644 ---- a/cmake/Version.cmake -+++ b/cmake/Version.cmake -@@ -31,20 +31,8 @@ function (write_version tag) - configure_file("${CMAKE_CURRENT_LIST_DIR}/../src/version.cpp.in" "${CMAKE_BINARY_DIR}/version.cpp") - endfunction () - --find_package(Git QUIET) --if ("$Format:$" STREQUAL "") -- # We're in a tarball; use hard-coded variables. -- set(VERSION_IS_RELEASE "true") -- write_version("release") --elseif (GIT_FOUND OR Git_FOUND) -- message(STATUS "Found Git: ${GIT_EXECUTABLE}") -- include(GitVersion) -- get_version_tag_from_git("${GIT_EXECUTABLE}") -- write_version("${VERSIONTAG}") --else() -- message(STATUS "WARNING: Git was not found!") -- set(VERSION_IS_RELEASE "false") -- write_version("unknown") --endif () -+set(VERSION_IS_RELEASE "true") -+write_version("release") -+ - add_custom_target(genversion ALL - DEPENDS "${CMAKE_BINARY_DIR}/version.cpp") diff --git a/net-p2p/monero/files/monero-0.18.3.3-common-support-boost-filesystem-copy_options.patch b/net-p2p/monero/files/monero-0.18.3.3-common-support-boost-filesystem-copy_options.patch new file mode 100644 index 00000000..970c873d --- /dev/null +++ b/net-p2p/monero/files/monero-0.18.3.3-common-support-boost-filesystem-copy_options.patch @@ -0,0 +1,166 @@ +From fcc20f5496fe97c01321963359631c4b22c4f0cf Mon Sep 17 00:00:00 2001 +From: 0xFFFC0000 <0xFFFC0000@proton.me> +Date: Tue, 30 Apr 2024 23:20:10 +0000 +Subject: [PATCH] common: support boost filesystem copy_options. + Co-authored-by: selsta + +--- + src/common/boost_serialization_helper.h | 3 ++- + src/common/util.cpp | 18 ++++++++++++++++++ + src/common/util.h | 2 ++ + src/p2p/net_peerlist.cpp | 3 ++- + src/wallet/wallet2.cpp | 4 ++-- + tests/unit_tests/wallet_storage.cpp | 13 +++++++------ + 6 files changed, 33 insertions(+), 10 deletions(-) + +diff --git a/src/common/boost_serialization_helper.h b/src/common/boost_serialization_helper.h +index 4a903107f3cb..1eca39f407b9 100644 +--- a/src/common/boost_serialization_helper.h ++++ b/src/common/boost_serialization_helper.h +@@ -35,6 +35,7 @@ + #include + #include + ++#include "common/util.h" + + namespace tools + { +@@ -110,7 +111,7 @@ namespace tools + catch(...) + { + // if failed, try reading in unportable mode +- boost::filesystem::copy_file(file_path, file_path + ".unportable", boost::filesystem::copy_option::overwrite_if_exists); ++ tools::copy_file(file_path, file_path + ".unportable"); + data_file.close(); + data_file.open( file_path, std::ios_base::binary | std::ios_base::in); + if(data_file.fail()) +diff --git a/src/common/util.cpp b/src/common/util.cpp +index 4b5e2adb8a49..d5f35ea7aed2 100644 +--- a/src/common/util.cpp ++++ b/src/common/util.cpp +@@ -115,6 +115,24 @@ static int flock_exnb(int fd) + + namespace tools + { ++ ++ void copy_file(const std::string& from, const std::string& to) ++ { ++ using boost::filesystem::path; ++ #if BOOST_VERSION < 107400 ++ // Remove this preprocessor if/else when we are bumping the boost version. ++ boost::filesystem::copy_file( ++ path(from), ++ path(to), ++ boost::filesystem::copy_option::overwrite_if_exists); ++ #else ++ boost::filesystem::copy_file( ++ path(from), ++ path(to), ++ boost::filesystem::copy_options::overwrite_existing); ++ #endif ++ } ++ + std::function signal_handler::m_handler; + + private_file::private_file() noexcept : m_handle(), m_filename() {} +diff --git a/src/common/util.h b/src/common/util.h +index f489594e8901..cfc0fb6923c4 100644 +--- a/src/common/util.h ++++ b/src/common/util.h +@@ -67,6 +67,8 @@ namespace tools + } + }; + ++ void copy_file(const std::string& from, const std::string& to); ++ + //! A file restricted to process owner AND process. Deletes file on destruction. + class private_file { + std::unique_ptr m_handle; +diff --git a/src/p2p/net_peerlist.cpp b/src/p2p/net_peerlist.cpp +index 3e132c91faef..c803b0cda695 100644 +--- a/src/p2p/net_peerlist.cpp ++++ b/src/p2p/net_peerlist.cpp +@@ -42,6 +42,7 @@ + #include + + #include "net_peerlist_boost_serialization.h" ++#include "common/util.h" + + + namespace nodetool +@@ -200,7 +201,7 @@ namespace nodetool + if (!out) + { + // if failed, try reading in unportable mode +- boost::filesystem::copy_file(path, path + ".unportable", boost::filesystem::copy_option::overwrite_if_exists); ++ tools::copy_file(path, path + ".unportable"); + src_file.close(); + src_file.open( path , std::ios_base::binary | std::ios_base::in); + if(src_file.fail()) +diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp +index f34b1098804e..f8aea71c1a77 100644 +--- a/src/wallet/wallet2.cpp ++++ b/src/wallet/wallet2.cpp +@@ -6208,7 +6208,7 @@ void wallet2::load(const std::string& wallet_, const epee::wipeable_string& pass + catch (...) + { + LOG_PRINT_L0("Failed to open portable binary, trying unportable"); +- if (use_fs) boost::filesystem::copy_file(m_wallet_file, m_wallet_file + ".unportable", boost::filesystem::copy_option::overwrite_if_exists); ++ if (use_fs) tools::copy_file(m_wallet_file, m_wallet_file + ".unportable"); + std::stringstream iss; + iss.str(""); + iss << cache_data; +@@ -6230,7 +6230,7 @@ void wallet2::load(const std::string& wallet_, const epee::wipeable_string& pass + catch (...) + { + LOG_PRINT_L0("Failed to open portable binary, trying unportable"); +- if (use_fs) boost::filesystem::copy_file(m_wallet_file, m_wallet_file + ".unportable", boost::filesystem::copy_option::overwrite_if_exists); ++ if (use_fs) tools::copy_file(m_wallet_file, m_wallet_file + ".unportable"); + std::stringstream iss; + iss.str(""); + iss << cache_file_buf; +diff --git a/tests/unit_tests/wallet_storage.cpp b/tests/unit_tests/wallet_storage.cpp +index dacaff9602ec..bf33936ed4ab 100644 +--- a/tests/unit_tests/wallet_storage.cpp ++++ b/tests/unit_tests/wallet_storage.cpp +@@ -31,6 +31,7 @@ + + #include "file_io_utils.h" + #include "wallet/wallet2.h" ++#include "common/util.h" + + using namespace boost::filesystem; + using namespace epee::file_io_utils; +@@ -47,8 +48,8 @@ TEST(wallet_storage, store_to_file2file) + ASSERT_TRUE(is_file_exist(source_wallet_file.string())); + ASSERT_TRUE(is_file_exist(source_wallet_file.string() + ".keys")); + +- copy_file(source_wallet_file, interm_wallet_file, copy_option::overwrite_if_exists); +- copy_file(source_wallet_file.string() + ".keys", interm_wallet_file.string() + ".keys", copy_option::overwrite_if_exists); ++ tools::copy_file(source_wallet_file.string(), interm_wallet_file.string()); ++ tools::copy_file(source_wallet_file.string() + ".keys", interm_wallet_file.string() + ".keys"); + + ASSERT_TRUE(is_file_exist(interm_wallet_file.string())); + ASSERT_TRUE(is_file_exist(interm_wallet_file.string() + ".keys")); +@@ -138,8 +139,8 @@ TEST(wallet_storage, change_password_same_file) + ASSERT_TRUE(is_file_exist(source_wallet_file.string())); + ASSERT_TRUE(is_file_exist(source_wallet_file.string() + ".keys")); + +- copy_file(source_wallet_file, interm_wallet_file, copy_option::overwrite_if_exists); +- copy_file(source_wallet_file.string() + ".keys", interm_wallet_file.string() + ".keys", copy_option::overwrite_if_exists); ++ tools::copy_file(source_wallet_file.string(), interm_wallet_file.string()); ++ tools::copy_file(source_wallet_file.string() + ".keys", interm_wallet_file.string() + ".keys"); + + ASSERT_TRUE(is_file_exist(interm_wallet_file.string())); + ASSERT_TRUE(is_file_exist(interm_wallet_file.string() + ".keys")); +@@ -177,8 +178,8 @@ TEST(wallet_storage, change_password_different_file) + ASSERT_TRUE(is_file_exist(source_wallet_file.string())); + ASSERT_TRUE(is_file_exist(source_wallet_file.string() + ".keys")); + +- copy_file(source_wallet_file, interm_wallet_file, copy_option::overwrite_if_exists); +- copy_file(source_wallet_file.string() + ".keys", interm_wallet_file.string() + ".keys", copy_option::overwrite_if_exists); ++ tools::copy_file(source_wallet_file.string(), interm_wallet_file.string()); ++ tools::copy_file(source_wallet_file.string() + ".keys", interm_wallet_file.string() + ".keys"); + + ASSERT_TRUE(is_file_exist(interm_wallet_file.string())); + ASSERT_TRUE(is_file_exist(interm_wallet_file.string() + ".keys")); diff --git a/net-p2p/monero/files/monero-0.18.3.3-contrib-fix-compilation-error-for-boost-1.85.patch b/net-p2p/monero/files/monero-0.18.3.3-contrib-fix-compilation-error-for-boost-1.85.patch new file mode 100644 index 00000000..17de8ba3 --- /dev/null +++ b/net-p2p/monero/files/monero-0.18.3.3-contrib-fix-compilation-error-for-boost-1.85.patch @@ -0,0 +1,21 @@ +From 304dcf85701e5d57b9420722c772ce4c5a51394f Mon Sep 17 00:00:00 2001 +From: 0xFFFC0000 <0xFFFC0000@proton.me> +Date: Wed, 1 May 2024 12:29:00 +0000 +Subject: [PATCH] contrib: fix compilation error for boost 1.85 + +--- + contrib/epee/include/storages/portable_storage_val_converters.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/contrib/epee/include/storages/portable_storage_val_converters.h b/contrib/epee/include/storages/portable_storage_val_converters.h +index 96b0c024c53c..5eb9acffd262 100644 +--- a/contrib/epee/include/storages/portable_storage_val_converters.h ++++ b/contrib/epee/include/storages/portable_storage_val_converters.h +@@ -37,6 +37,7 @@ + #include "misc_log_ex.h" + + #include ++#include + #include + #include + diff --git a/net-p2p/monero/files/monero-0.18.3.3-upnp-add-support-for-miniupnpc-API-version-18.patch b/net-p2p/monero/files/monero-0.18.3.3-upnp-add-support-for-miniupnpc-API-version-18.patch new file mode 100644 index 00000000..9bd84b74 --- /dev/null +++ b/net-p2p/monero/files/monero-0.18.3.3-upnp-add-support-for-miniupnpc-API-version-18.patch @@ -0,0 +1,44 @@ +From 7a6f6a175183880f0045b301af5c6ada2d416734 Mon Sep 17 00:00:00 2001 +From: Bertrand Jacquin +Date: Wed, 17 Jul 2024 20:05:38 +0100 +Subject: [PATCH] upnp: add support for miniupnpc API version 18 + +miniupnpc 2.2.8 updated API to version 18, with breaking change to +UPNP_GetValidIGD(). + +See: https://github.com/miniupnp/miniupnp/commit/c0a50ce33e3b99ce8a96fd43049bb5b53ffac62f +See: http://miniupnp.free.fr/files/changelog.php?file=miniupnpc-2.2.8.tar.gz +--- + src/p2p/net_node.inl | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl +index 0528e0bc7988..64772f2b1144 100644 +--- a/src/p2p/net_node.inl ++++ b/src/p2p/net_node.inl +@@ -2989,7 +2989,12 @@ namespace nodetool + UPNPUrls urls; + IGDdatas igdData; + char lanAddress[64]; ++#if MINIUPNPC_API_VERSION < 18 + result = UPNP_GetValidIGD(deviceList, &urls, &igdData, lanAddress, sizeof lanAddress); ++#else ++ char wanAddress[64]; ++ result = UPNP_GetValidIGD(deviceList, &urls, &igdData, lanAddress, sizeof lanAddress, wanAddress, sizeof wanAddress); ++#endif + freeUPNPDevlist(deviceList); + if (result > 0) { + if (result == 1) { +@@ -3057,7 +3062,12 @@ namespace nodetool + UPNPUrls urls; + IGDdatas igdData; + char lanAddress[64]; ++#if MINIUPNPC_API_VERSION < 18 + result = UPNP_GetValidIGD(deviceList, &urls, &igdData, lanAddress, sizeof lanAddress); ++#else ++ char wanAddress[64]; ++ result = UPNP_GetValidIGD(deviceList, &urls, &igdData, lanAddress, sizeof lanAddress, wanAddress, sizeof wanAddress); ++#endif + freeUPNPDevlist(deviceList); + if (result > 0) { + if (result == 1) { diff --git a/net-p2p/monero/files/monero-0.18.3.3-upnp-drop-in-tree-miniupnpc.patch b/net-p2p/monero/files/monero-0.18.3.3-upnp-drop-in-tree-miniupnpc.patch new file mode 100644 index 00000000..e85b7430 --- /dev/null +++ b/net-p2p/monero/files/monero-0.18.3.3-upnp-drop-in-tree-miniupnpc.patch @@ -0,0 +1,60 @@ +From d2a4776ab6ce808e0333f3c21e276e5cca49b7ba Mon Sep 17 00:00:00 2001 +From: Bertrand Jacquin +Date: Sun, 17 Jun 2018 22:34:11 +0100 +Subject: [PATCH] upnp: drop in-tree miniupnpc + +Since 6b8539803184 ("Build: update CMake and p2p for in-tree +miniupnp"), a hard dependency is made on miniupnpc which is a git +submodule not part of the archive available upstream. +--- + external/CMakeLists.txt | 19 +++---------------- + src/p2p/net_node.inl | 6 +++--- + 2 files changed, 6 insertions(+), 19 deletions(-) + +diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt +index 5b7f69a56843..fc40455064f4 100644 +--- a/external/CMakeLists.txt ++++ b/external/CMakeLists.txt +@@ -36,22 +36,9 @@ + # others. + + find_package(Miniupnpc REQUIRED) +- +-message(STATUS "Using in-tree miniupnpc") +-set(UPNPC_NO_INSTALL TRUE CACHE BOOL "Disable miniupnp installation" FORCE) +-add_subdirectory(miniupnp/miniupnpc) +-set_property(TARGET libminiupnpc-static PROPERTY FOLDER "external") +-set_property(TARGET libminiupnpc-static PROPERTY POSITION_INDEPENDENT_CODE ON) +-if(MSVC) +- set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -wd4244 -wd4267") +-elseif(NOT MSVC) +- set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-undef -Wno-unused-result -Wno-unused-value") +-endif() +-if(CMAKE_SYSTEM_NAME MATCHES "NetBSD") +- set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -D_NETBSD_SOURCE") +-endif() +- +-set(UPNP_LIBRARIES "libminiupnpc-static" PARENT_SCOPE) ++set(UPNP_STATIC false PARENT_SCOPE) ++set(UPNP_INCLUDE ${MINIUPNP_INCLUDE_DIR} PARENT_SCOPE) ++set(UPNP_LIBRARIES ${MINIUPNP_LIBRARY} PARENT_SCOPE) + + find_package(Unbound) + +diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl +index 30e3d31b9d85..0528e0bc7988 100644 +--- a/src/p2p/net_node.inl ++++ b/src/p2p/net_node.inl +@@ -60,9 +60,9 @@ + #include "cryptonote_core/cryptonote_core.h" + #include "net/parse.h" + +-#include +-#include +-#include ++#include ++#include ++#include + + #undef MONERO_DEFAULT_LOG_CATEGORY + #define MONERO_DEFAULT_LOG_CATEGORY "net.p2p" diff --git a/net-p2p/monero/files/monero-0.18.3.3-upnp-fix-warning.patch b/net-p2p/monero/files/monero-0.18.3.3-upnp-fix-warning.patch new file mode 100644 index 00000000..672123ab --- /dev/null +++ b/net-p2p/monero/files/monero-0.18.3.3-upnp-fix-warning.patch @@ -0,0 +1,31 @@ +From cdd500a9dfcdd944d18c3a9d3715775fec7c9e48 Mon Sep 17 00:00:00 2001 +From: Bertrand Jacquin +Date: Wed, 17 Jul 2024 21:03:33 +0100 +Subject: [PATCH] upnp: fix warning + + CMake Warning (dev) at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:438 (message): + The package name passed to `find_package_handle_standard_args` (MiniUPnPc) + does not match the name of the calling package (Miniupnpc). This can lead + to problems in calling code that expects `find_package` result variables + (e.g., `_FOUND`) to follow a certain pattern. + Call Stack (most recent call first): + cmake/FindMiniupnpc.cmake:39 (find_package_handle_standard_args) + external/CMakeLists.txt:38 (find_package) + This warning is for project developers. Use -Wno-dev to suppress it. +--- + cmake/FindMiniupnpc.cmake | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/cmake/FindMiniupnpc.cmake b/cmake/FindMiniupnpc.cmake +index ad2004afcca2..7f4bb6828cfb 100644 +--- a/cmake/FindMiniupnpc.cmake ++++ b/cmake/FindMiniupnpc.cmake +@@ -37,7 +37,7 @@ set(MINIUPNP_STATIC_LIBRARIES ${MINIUPNP_STATIC_LIBRARY}) + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args( +- MiniUPnPc DEFAULT_MSG ++ Miniupnpc DEFAULT_MSG + MINIUPNP_INCLUDE_DIR + MINIUPNP_LIBRARY + ) diff --git a/net-p2p/monero/files/monero-0.18.3.3-use-gentoo-dev-libs-randomx.patch b/net-p2p/monero/files/monero-0.18.3.3-use-gentoo-dev-libs-randomx.patch new file mode 100644 index 00000000..2579590e --- /dev/null +++ b/net-p2p/monero/files/monero-0.18.3.3-use-gentoo-dev-libs-randomx.patch @@ -0,0 +1,18 @@ +From a007bfe93c3e71a166206abd30a91dc3637983c8 Mon Sep 17 00:00:00 2001 +From: Bertrand Jacquin +Date: Wed, 6 Nov 2019 01:23:52 +0000 +Subject: [PATCH] use gentoo dev-libs/randomx + +--- + external/CMakeLists.txt | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt +index fc40455064f4..5536debe8e2b 100644 +--- a/external/CMakeLists.txt ++++ b/external/CMakeLists.txt +@@ -56,4 +56,3 @@ endif() + add_subdirectory(db_drivers) + add_subdirectory(easylogging++) + add_subdirectory(qrcodegen) +-add_subdirectory(randomx EXCLUDE_FROM_ALL) diff --git a/net-p2p/monero/files/monero-0.18.3.3-use-gentoo-versioning.patch b/net-p2p/monero/files/monero-0.18.3.3-use-gentoo-versioning.patch new file mode 100644 index 00000000..f7b6661e --- /dev/null +++ b/net-p2p/monero/files/monero-0.18.3.3-use-gentoo-versioning.patch @@ -0,0 +1,37 @@ +From 9e2da6c420843a4928b0fb42a41bafcfb4b95ee3 Mon Sep 17 00:00:00 2001 +From: Bertrand Jacquin +Date: Sat, 15 Jun 2019 00:15:54 +0100 +Subject: [PATCH] use gentoo versioning + +--- + cmake/Version.cmake | 18 +++--------------- + 1 file changed, 3 insertions(+), 15 deletions(-) + +diff --git a/cmake/Version.cmake b/cmake/Version.cmake +index e9ed9fba159b..5df4bc1ab7f3 100644 +--- a/cmake/Version.cmake ++++ b/cmake/Version.cmake +@@ -31,20 +31,8 @@ function (write_version tag) + configure_file("${CMAKE_CURRENT_LIST_DIR}/../src/version.cpp.in" "${CMAKE_BINARY_DIR}/version.cpp") + endfunction () + +-find_package(Git QUIET) +-if ("$Format:$" STREQUAL "") +- # We're in a tarball; use hard-coded variables. +- set(VERSION_IS_RELEASE "true") +- write_version("release") +-elseif (GIT_FOUND OR Git_FOUND) +- message(STATUS "Found Git: ${GIT_EXECUTABLE}") +- include(GitVersion) +- get_version_tag_from_git("${GIT_EXECUTABLE}") +- write_version("${VERSIONTAG}") +-else() +- message(STATUS "WARNING: Git was not found!") +- set(VERSION_IS_RELEASE "false") +- write_version("unknown") +-endif () ++set(VERSION_IS_RELEASE "true") ++write_version("release") ++ + add_custom_target(genversion ALL + DEPENDS "${CMAKE_BINARY_DIR}/version.cpp") diff --git a/net-p2p/monero/files/monero-9999-Drop-in-tree-miniupnpc.patch b/net-p2p/monero/files/monero-9999-Drop-in-tree-miniupnpc.patch deleted file mode 100644 index 23c13dcf..00000000 --- a/net-p2p/monero/files/monero-9999-Drop-in-tree-miniupnpc.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 016ecdb58767bc1f44dcc3a00d79b44a739672eb Mon Sep 17 00:00:00 2001 -From: Bertrand Jacquin -Date: Sun, 17 Jun 2018 22:34:11 +0100 -Subject: [PATCH] Drop in-tree miniupnpc - -Since 6b8539803184 ("Build: update CMake and p2p for in-tree -miniupnp"), a hard dependency is made on miniupnpc which is a git -submodule not part of the archive available upstream. ---- - external/CMakeLists.txt | 19 +++---------------- - src/p2p/net_node.inl | 6 +++--- - 2 files changed, 6 insertions(+), 19 deletions(-) - -diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt -index 8deadc7ba63d..85db7880bd05 100644 ---- a/external/CMakeLists.txt -+++ b/external/CMakeLists.txt -@@ -36,22 +36,9 @@ - # others. - - find_package(Miniupnpc REQUIRED) -- --message(STATUS "Using in-tree miniupnpc") --set(UPNPC_NO_INSTALL TRUE CACHE BOOL "Disable miniupnp installation" FORCE) --add_subdirectory(miniupnp/miniupnpc) --set_property(TARGET libminiupnpc-static PROPERTY FOLDER "external") --set_property(TARGET libminiupnpc-static PROPERTY POSITION_INDEPENDENT_CODE ON) --if(MSVC) -- set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -wd4244 -wd4267") --elseif(NOT MSVC) -- set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-undef -Wno-unused-result -Wno-unused-value") --endif() --if(CMAKE_SYSTEM_NAME MATCHES "NetBSD") -- set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -D_NETBSD_SOURCE") --endif() -- --set(UPNP_LIBRARIES "libminiupnpc-static" PARENT_SCOPE) -+set(UPNP_STATIC false PARENT_SCOPE) -+set(UPNP_INCLUDE ${MINIUPNP_INCLUDE_DIR} PARENT_SCOPE) -+set(UPNP_LIBRARIES ${MINIUPNP_LIBRARY} PARENT_SCOPE) - - find_package(Unbound) - -diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl -index 815c1b354ef2..40205f50ca8b 100644 ---- a/src/p2p/net_node.inl -+++ b/src/p2p/net_node.inl -@@ -58,9 +58,9 @@ - #include "cryptonote_core/cryptonote_core.h" - #include "net/parse.h" - --#include --#include --#include -+#include -+#include -+#include - - #undef MONERO_DEFAULT_LOG_CATEGORY - #define MONERO_DEFAULT_LOG_CATEGORY "net.p2p" diff --git a/net-p2p/monero/files/monero-9999-Use-gentoo-dev-libs-randomx.patch b/net-p2p/monero/files/monero-9999-Use-gentoo-dev-libs-randomx.patch deleted file mode 100644 index a30def3a..00000000 --- a/net-p2p/monero/files/monero-9999-Use-gentoo-dev-libs-randomx.patch +++ /dev/null @@ -1,18 +0,0 @@ -From ceb7f16d984c555cdeadda818516d2359857f8a5 Mon Sep 17 00:00:00 2001 -From: Bertrand Jacquin -Date: Wed, 6 Nov 2019 01:23:52 +0000 -Subject: [PATCH] Use gentoo dev-libs/randomx - ---- - external/CMakeLists.txt | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt -index 85db7880bd05..802fd6fd2525 100644 ---- a/external/CMakeLists.txt -+++ b/external/CMakeLists.txt -@@ -56,4 +56,3 @@ endif() - add_subdirectory(db_drivers) - add_subdirectory(easylogging++) - add_subdirectory(qrcodegen) --add_subdirectory(randomx EXCLUDE_FROM_ALL) diff --git a/net-p2p/monero/files/monero-9999-upnp-add-support-for-miniupnpc-API-version-18.patch b/net-p2p/monero/files/monero-9999-upnp-add-support-for-miniupnpc-API-version-18.patch new file mode 100644 index 00000000..782a10b4 --- /dev/null +++ b/net-p2p/monero/files/monero-9999-upnp-add-support-for-miniupnpc-API-version-18.patch @@ -0,0 +1,44 @@ +From a027bb81013d7864179b75a26dd0774ad232d644 Mon Sep 17 00:00:00 2001 +From: Bertrand Jacquin +Date: Wed, 17 Jul 2024 20:05:38 +0100 +Subject: [PATCH] upnp: add support for miniupnpc API version 18 + +miniupnpc 2.2.8 updated API to version 18, with breaking change to +UPNP_GetValidIGD(). + +See: https://github.com/miniupnp/miniupnp/commit/c0a50ce33e3b99ce8a96fd43049bb5b53ffac62f +See: http://miniupnp.free.fr/files/changelog.php?file=miniupnpc-2.2.8.tar.gz +--- + src/p2p/net_node.inl | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl +index a5a1e0f8cec2..4212f3c63cf1 100644 +--- a/src/p2p/net_node.inl ++++ b/src/p2p/net_node.inl +@@ -2985,7 +2985,12 @@ namespace nodetool + UPNPUrls urls; + IGDdatas igdData; + char lanAddress[64]; ++#if MINIUPNPC_API_VERSION < 18 + result = UPNP_GetValidIGD(deviceList, &urls, &igdData, lanAddress, sizeof lanAddress); ++#else ++ char wanAddress[64]; ++ result = UPNP_GetValidIGD(deviceList, &urls, &igdData, lanAddress, sizeof lanAddress, wanAddress, sizeof wanAddress); ++#endif + freeUPNPDevlist(deviceList); + if (result > 0) { + if (result == 1) { +@@ -3053,7 +3058,12 @@ namespace nodetool + UPNPUrls urls; + IGDdatas igdData; + char lanAddress[64]; ++#if MINIUPNPC_API_VERSION < 18 + result = UPNP_GetValidIGD(deviceList, &urls, &igdData, lanAddress, sizeof lanAddress); ++#else ++ char wanAddress[64]; ++ result = UPNP_GetValidIGD(deviceList, &urls, &igdData, lanAddress, sizeof lanAddress, wanAddress, sizeof wanAddress); ++#endif + freeUPNPDevlist(deviceList); + if (result > 0) { + if (result == 1) { diff --git a/net-p2p/monero/files/monero-9999-upnp-drop-in-tree-miniupnpc.patch b/net-p2p/monero/files/monero-9999-upnp-drop-in-tree-miniupnpc.patch new file mode 100644 index 00000000..686c09f4 --- /dev/null +++ b/net-p2p/monero/files/monero-9999-upnp-drop-in-tree-miniupnpc.patch @@ -0,0 +1,60 @@ +From 7408ad27855f9952b7f373c3f1458d0ef2904d4a Mon Sep 17 00:00:00 2001 +From: Bertrand Jacquin +Date: Sun, 17 Jun 2018 22:34:11 +0100 +Subject: [PATCH] upnp: drop in-tree miniupnpc + +Since 6b8539803184 ("Build: update CMake and p2p for in-tree +miniupnp"), a hard dependency is made on miniupnpc which is a git +submodule not part of the archive available upstream. +--- + external/CMakeLists.txt | 19 +++---------------- + src/p2p/net_node.inl | 6 +++--- + 2 files changed, 6 insertions(+), 19 deletions(-) + +diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt +index 45c0e4f14a1b..c46c3750f3c3 100644 +--- a/external/CMakeLists.txt ++++ b/external/CMakeLists.txt +@@ -36,22 +36,9 @@ + # others. + + find_package(Miniupnpc REQUIRED) +- +-message(STATUS "Using in-tree miniupnpc") +-set(UPNPC_NO_INSTALL TRUE CACHE BOOL "Disable miniupnp installation" FORCE) +-add_subdirectory(miniupnp/miniupnpc) +-set_property(TARGET libminiupnpc-static PROPERTY FOLDER "external") +-set_property(TARGET libminiupnpc-static PROPERTY POSITION_INDEPENDENT_CODE ON) +-if(MSVC) +- set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -wd4244 -wd4267") +-elseif(NOT MSVC) +- set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-undef -Wno-unused-result -Wno-unused-value") +-endif() +-if(CMAKE_SYSTEM_NAME MATCHES "NetBSD") +- set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -D_NETBSD_SOURCE") +-endif() +- +-set(UPNP_LIBRARIES "libminiupnpc-static" PARENT_SCOPE) ++set(UPNP_STATIC false PARENT_SCOPE) ++set(UPNP_INCLUDE ${MINIUPNP_INCLUDE_DIR} PARENT_SCOPE) ++set(UPNP_LIBRARIES ${MINIUPNP_LIBRARY} PARENT_SCOPE) + + find_package(Unbound) + +diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl +index 662e598e8a1b..a5a1e0f8cec2 100644 +--- a/src/p2p/net_node.inl ++++ b/src/p2p/net_node.inl +@@ -58,9 +58,9 @@ + #include "cryptonote_core/cryptonote_core.h" + #include "net/parse.h" + +-#include +-#include +-#include ++#include ++#include ++#include + + #undef MONERO_DEFAULT_LOG_CATEGORY + #define MONERO_DEFAULT_LOG_CATEGORY "net.p2p" diff --git a/net-p2p/monero/files/monero-9999-upnp-fix-warning.patch b/net-p2p/monero/files/monero-9999-upnp-fix-warning.patch new file mode 100644 index 00000000..e45a4278 --- /dev/null +++ b/net-p2p/monero/files/monero-9999-upnp-fix-warning.patch @@ -0,0 +1,31 @@ +From fca5d21cbe9ee129fdb1c88ca468d604891ecf5c Mon Sep 17 00:00:00 2001 +From: Bertrand Jacquin +Date: Wed, 17 Jul 2024 21:03:33 +0100 +Subject: [PATCH] upnp: fix warning + + CMake Warning (dev) at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:438 (message): + The package name passed to `find_package_handle_standard_args` (MiniUPnPc) + does not match the name of the calling package (Miniupnpc). This can lead + to problems in calling code that expects `find_package` result variables + (e.g., `_FOUND`) to follow a certain pattern. + Call Stack (most recent call first): + cmake/FindMiniupnpc.cmake:39 (find_package_handle_standard_args) + external/CMakeLists.txt:38 (find_package) + This warning is for project developers. Use -Wno-dev to suppress it. +--- + cmake/FindMiniupnpc.cmake | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/cmake/FindMiniupnpc.cmake b/cmake/FindMiniupnpc.cmake +index ad2004afcca2..7f4bb6828cfb 100644 +--- a/cmake/FindMiniupnpc.cmake ++++ b/cmake/FindMiniupnpc.cmake +@@ -37,7 +37,7 @@ set(MINIUPNP_STATIC_LIBRARIES ${MINIUPNP_STATIC_LIBRARY}) + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args( +- MiniUPnPc DEFAULT_MSG ++ Miniupnpc DEFAULT_MSG + MINIUPNP_INCLUDE_DIR + MINIUPNP_LIBRARY + ) diff --git a/net-p2p/monero/files/monero-9999-use-gentoo-dev-libs-randomx.patch b/net-p2p/monero/files/monero-9999-use-gentoo-dev-libs-randomx.patch new file mode 100644 index 00000000..58f9d6a8 --- /dev/null +++ b/net-p2p/monero/files/monero-9999-use-gentoo-dev-libs-randomx.patch @@ -0,0 +1,18 @@ +From ceb7f16d984c555cdeadda818516d2359857f8a5 Mon Sep 17 00:00:00 2001 +From: Bertrand Jacquin +Date: Wed, 6 Nov 2019 01:23:52 +0000 +Subject: [PATCH] use gentoo dev-libs/randomx + +--- + external/CMakeLists.txt | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt +index 85db7880bd05..802fd6fd2525 100644 +--- a/external/CMakeLists.txt ++++ b/external/CMakeLists.txt +@@ -56,4 +56,3 @@ endif() + add_subdirectory(db_drivers) + add_subdirectory(easylogging++) + add_subdirectory(qrcodegen) +-add_subdirectory(randomx EXCLUDE_FROM_ALL) -- cgit v1.2.3