diff --git a/srcpkgs/monero/patches/system-miniupnpc.patch b/srcpkgs/monero/patches/system-miniupnpc.patch new file mode 100644 index 00000000000..1e93d5b1bc0 --- /dev/null +++ b/srcpkgs/monero/patches/system-miniupnpc.patch @@ -0,0 +1,101 @@ +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -430,6 +430,14 @@ include_directories("${CMAKE_CURRENT_BINARY_DIR}/translations") + + add_subdirectory(external) + ++# Final setup for miniupnpc ++if(UPNP_STATIC OR IOS) ++ add_definitions("-DUPNP_STATIC") ++else() ++ add_definitions("-DUPNP_DYNAMIC") ++ include_directories(${UPNP_INCLUDE}) ++endif() ++ + # Final setup for libunbound + include_directories(${UNBOUND_INCLUDE}) + link_directories(${UNBOUND_LIBRARY_DIRS}) +diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt +index 1fc4d64c..b4f712ee 100644 +--- external/CMakeLists.txt ++++ external/CMakeLists.txt +@@ -34,21 +34,42 @@ + # We always compile if we are building statically to reduce static dependency issues... + # ...except for FreeBSD, because FreeBSD is a special case that doesn't play well with + # others. ++if(NOT IOS) ++ find_package(Miniupnpc QUIET) ++endif() + +-find_package(Miniupnpc REQUIRED) ++# If we have the correct shared version and we're not building static, use it ++if(STATIC OR IOS) ++ set(USE_SHARED_MINIUPNPC false) ++elseif(MINIUPNP_FOUND AND MINIUPNPC_VERSION_1_7_OR_HIGHER) ++ set(USE_SHARED_MINIUPNPC true) ++endif() + +-message(STATUS "Using in-tree miniupnpc") ++if(USE_SHARED_MINIUPNPC) ++ message(STATUS "Using shared miniupnpc found at ${MINIUPNP_INCLUDE_DIR}") + +-add_subdirectory(miniupnp/miniupnpc) ++ set(UPNP_STATIC false PARENT_SCOPE) ++ set(UPNP_INCLUDE ${MINIUPNP_INCLUDE_DIR} PARENT_SCOPE) ++ set(UPNP_LIBRARIES ${MINIUPNP_LIBRARY} PARENT_SCOPE) ++else() ++ if(STATIC) ++ message(STATUS "Using miniupnpc from local source tree for static build") ++ else() ++ message(STATUS "Using miniupnpc from local source tree (/external/miniupnp/miniupnpc)") ++ endif() + +-set_property(TARGET libminiupnpc-static PROPERTY FOLDER "external") +-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() ++ add_subdirectory(miniupnp/miniupnpc) ++ ++ set_property(TARGET libminiupnpc-static PROPERTY FOLDER "external") ++ 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() + +-set(UPNP_LIBRARIES "libminiupnpc-static" PARENT_SCOPE) ++ set(UPNP_STATIC true PARENT_SCOPE) ++ set(UPNP_LIBRARIES "libminiupnpc-static" PARENT_SCOPE) ++endif() + + find_package(Unbound) + +diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl +index 9b21705e..76340a22 100644 +--- src/p2p/net_node.inl ++++ src/p2p/net_node.inl +@@ -49,9 +49,16 @@ + #include "storages/levin_abstract_invoke2.h" + #include "cryptonote_core/cryptonote_core.h" + +-#include +-#include +-#include ++// We have to look for miniupnpc headers in different places, dependent on if its compiled or external ++#ifdef UPNP_STATIC ++ #include ++ #include ++ #include ++#else ++ #include "miniupnpc.h" ++ #include "upnpcommands.h" ++ #include "upnperrors.h" ++#endif + + #undef MONERO_DEFAULT_LOG_CATEGORY + #define MONERO_DEFAULT_LOG_CATEGORY "net.p2p" +-- +2.17.0 + diff --git a/srcpkgs/monero/template b/srcpkgs/monero/template index 75c457da52d..41efa71065b 100644 --- a/srcpkgs/monero/template +++ b/srcpkgs/monero/template @@ -1,10 +1,10 @@ # Template file for 'monero' pkgname=monero -version=0.12.0.0 -revision=3 +version=0.12.1.0 +revision=1 conf_files="/etc/monerod.conf" build_style=cmake -hostmakedepends="pkg-config git qt5-host-tools" +hostmakedepends="pkg-config qt5-host-tools" configure_args="-DBUILD_GUI_DEPS=ON -DHAVE_LIBRESSL=1" makedepends="libressl-devel boost-devel libldns-devel libunwind-devel readline-devel unbound-devel miniupnpc-devel libldns-devel expat-devel @@ -15,10 +15,10 @@ make_dirs=" /var/log/monero 0755 monero monero" short_desc="Private, secure, untraceable, decentralised digital currency" maintainer="Helmut Pozimski " -license="3-clause-BSD" +license="BSD-3-Clause" homepage="https://getmonero.org" distfiles="https://github.com/monero-project/monero/archive/v${version}.tar.gz" -checksum=5e8303900a39e296c4ebaa41d957ab9ee04e915704e1049f82a9cbd4eedc8ffb +checksum=e5f32361ce39a9849a262afb1d5ce211f593c486dcca7bb0af60fcc26ee52b35 if [ "$CROSS_BUILD" ]; then configure_args+=" -DTHREADS_PTHREAD_ARG=OFF"