From 48e291acb2da7a52e1fb3feecb326d7168cefe44 Mon Sep 17 00:00:00 2001 From: Antoine Poinsot Date: Tue, 22 Oct 2024 00:24:03 +0200 Subject: [PATCH] depends: drop miniupnpc --- depends/Makefile | 6 +--- depends/README.md | 1 - depends/packages/miniupnpc.mk | 36 ------------------- depends/packages/packages.mk | 2 -- .../miniupnpc/cmake_get_src_addr.patch | 22 ------------ .../patches/miniupnpc/dont_leak_info.patch | 32 ----------------- .../miniupnpc/fix_windows_snprintf.patch | 25 ------------- depends/toolchain.cmake.in | 7 ---- 8 files changed, 1 insertion(+), 130 deletions(-) delete mode 100644 depends/packages/miniupnpc.mk delete mode 100644 depends/patches/miniupnpc/cmake_get_src_addr.patch delete mode 100644 depends/patches/miniupnpc/dont_leak_info.patch delete mode 100644 depends/patches/miniupnpc/fix_windows_snprintf.patch diff --git a/depends/Makefile b/depends/Makefile index f1dc300b7ae5c0..a2a9f6823e52ab 100644 --- a/depends/Makefile +++ b/depends/Makefile @@ -40,7 +40,6 @@ NO_BDB ?= NO_SQLITE ?= NO_WALLET ?= NO_ZMQ ?= -NO_UPNP ?= NO_USDT ?= MULTIPROCESS ?= LTO ?= @@ -157,13 +156,11 @@ bdb_packages_$(NO_BDB) = $(bdb_packages) sqlite_packages_$(NO_SQLITE) = $(sqlite_packages) wallet_packages_$(NO_WALLET) = $(bdb_packages_) $(sqlite_packages_) -upnp_packages_$(NO_UPNP) = $(upnp_packages) - zmq_packages_$(NO_ZMQ) = $(zmq_packages) multiprocess_packages_$(MULTIPROCESS) = $(multiprocess_packages) usdt_packages_$(NO_USDT) = $(usdt_$(host_os)_packages) -packages += $($(host_arch)_$(host_os)_packages) $($(host_os)_packages) $(boost_packages_) $(libevent_packages_) $(qt_packages_) $(wallet_packages_) $(upnp_packages_) $(usdt_packages_) +packages += $($(host_arch)_$(host_os)_packages) $($(host_os)_packages) $(boost_packages_) $(libevent_packages_) $(qt_packages_) $(wallet_packages_) $(usdt_packages_) native_packages += $($(host_arch)_$(host_os)_native_packages) $($(host_os)_native_packages) ifneq ($(zmq_packages_),) @@ -231,7 +228,6 @@ $(host_prefix)/toolchain.cmake : toolchain.cmake.in $(host_prefix)/.stamp_$(fina -e 's|@wallet_packages@|$(wallet_packages_)|' \ -e 's|@bdb_packages@|$(bdb_packages_)|' \ -e 's|@sqlite_packages@|$(sqlite_packages_)|' \ - -e 's|@upnp_packages@|$(upnp_packages_)|' \ -e 's|@usdt_packages@|$(usdt_packages_)|' \ -e 's|@no_harden@|$(NO_HARDEN)|' \ -e 's|@multiprocess@|$(MULTIPROCESS)|' \ diff --git a/depends/README.md b/depends/README.md index 4ef7247ea4e92b..ac32b157b5fda8 100644 --- a/depends/README.md +++ b/depends/README.md @@ -112,7 +112,6 @@ The following can be set when running make: `make FOO=bar` - `NO_WALLET`: Don't download/build/cache libs needed to enable the wallet - `NO_BDB`: Don't download/build/cache BerkeleyDB - `NO_SQLITE`: Don't download/build/cache SQLite -- `NO_UPNP`: Don't download/build/cache packages needed for enabling UPnP - `NO_USDT`: Don't download/build/cache packages needed for enabling USDT tracepoints - `MULTIPROCESS`: Build libmultiprocess (experimental) - `DEBUG`: Disable some optimizations and enable more runtime checking diff --git a/depends/packages/miniupnpc.mk b/depends/packages/miniupnpc.mk deleted file mode 100644 index f9e114b49546f7..00000000000000 --- a/depends/packages/miniupnpc.mk +++ /dev/null @@ -1,36 +0,0 @@ -package=miniupnpc -$(package)_version=2.2.7 -$(package)_download_path=https://miniupnp.tuxfamily.org/files/ -$(package)_file_name=$(package)-$($(package)_version).tar.gz -$(package)_sha256_hash=b0c3a27056840fd0ec9328a5a9bac3dc5e0ec6d2e8733349cf577b0aa1e70ac1 -$(package)_patches=dont_leak_info.patch cmake_get_src_addr.patch fix_windows_snprintf.patch -$(package)_build_subdir=build - -define $(package)_set_vars -$(package)_config_opts = -DUPNPC_BUILD_SAMPLE=OFF -DUPNPC_BUILD_SHARED=OFF -$(package)_config_opts += -DUPNPC_BUILD_STATIC=ON -DUPNPC_BUILD_TESTS=OFF -$(package)_config_opts_mingw32 += -DMINIUPNPC_TARGET_WINDOWS_VERSION=0x0601 -endef - -define $(package)_preprocess_cmds - patch -p1 < $($(package)_patch_dir)/dont_leak_info.patch && \ - patch -p1 < $($(package)_patch_dir)/cmake_get_src_addr.patch && \ - patch -p1 < $($(package)_patch_dir)/fix_windows_snprintf.patch -endef - -define $(package)_config_cmds - $($(package)_cmake) -S .. -B . -endef - -define $(package)_build_cmds - $(MAKE) -endef - -define $(package)_stage_cmds - cmake --install . --prefix $($(package)_staging_prefix_dir) -endef - -define $(package)_postprocess_cmds - rm -rf bin && \ - rm -rf share -endef diff --git a/depends/packages/packages.mk b/depends/packages/packages.mk index 08a91cbcbd012c..61cf66230c7d9e 100644 --- a/depends/packages/packages.mk +++ b/depends/packages/packages.mk @@ -17,8 +17,6 @@ sqlite_packages=sqlite zmq_packages=zeromq -upnp_packages=miniupnpc - multiprocess_packages = libmultiprocess capnp multiprocess_native_packages = native_libmultiprocess native_capnp diff --git a/depends/patches/miniupnpc/cmake_get_src_addr.patch b/depends/patches/miniupnpc/cmake_get_src_addr.patch deleted file mode 100644 index bae1b738f3f319..00000000000000 --- a/depends/patches/miniupnpc/cmake_get_src_addr.patch +++ /dev/null @@ -1,22 +0,0 @@ -commit cb2026239c2a3aff393952ccb0ee1c448189402d -Author: fanquake -Date: Fri Mar 22 14:03:54 2024 +0000 - - build: add MINIUPNPC_GET_SRC_ADDR to CMake build - - This mirrors the autotools build. - - See https://github.com/miniupnp/miniupnp/pull/721. - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 1aa95a8..0cacf3e 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -31,6 +31,7 @@ endif () - if (NOT WIN32) - target_compile_definitions(miniupnpc-private INTERFACE - MINIUPNPC_SET_SOCKET_TIMEOUT -+ MINIUPNPC_GET_SRC_ADDR - _BSD_SOURCE _DEFAULT_SOURCE) - if (NOT APPLE AND NOT CMAKE_SYSTEM_NAME MATCHES ".*BSD" AND NOT CMAKE_SYSTEM_NAME STREQUAL "SunOS") - # add_definitions (-D_POSIX_C_SOURCE=200112L) diff --git a/depends/patches/miniupnpc/dont_leak_info.patch b/depends/patches/miniupnpc/dont_leak_info.patch deleted file mode 100644 index 95a09a26dce1d8..00000000000000 --- a/depends/patches/miniupnpc/dont_leak_info.patch +++ /dev/null @@ -1,32 +0,0 @@ -commit 51f6dd991c29af66fb4f64c6feb2787cce23a1a7 -Author: fanquake -Date: Mon Jan 8 11:21:40 2024 +0000 - - Don't leak OS and miniupnpc version info in User-Agent - -diff --git a/src/minisoap.c b/src/minisoap.c -index 903ac5f..046e0ea 100644 ---- a/src/minisoap.c -+++ b/src/minisoap.c -@@ -90,7 +90,7 @@ int soapPostSubmit(SOCKET fd, - headerssize = snprintf(headerbuf, sizeof(headerbuf), - "POST %s HTTP/%s\r\n" - "Host: %s%s\r\n" -- "User-Agent: " OS_STRING " " UPNP_VERSION_STRING " MiniUPnPc/" MINIUPNPC_VERSION_STRING "\r\n" -+ "User-Agent: " UPNP_VERSION_STRING "\r\n" - "Content-Length: %d\r\n" - #if (UPNP_VERSION_MAJOR == 1) && (UPNP_VERSION_MINOR == 0) - "Content-Type: text/xml\r\n" -diff --git a/src/miniwget.c b/src/miniwget.c -index e76a5e5..0cc36fe 100644 ---- a/src/miniwget.c -+++ b/src/miniwget.c -@@ -444,7 +444,7 @@ miniwget3(const char * host, - "GET %s HTTP/%s\r\n" - "Host: %s:%d\r\n" - "Connection: Close\r\n" -- "User-Agent: " OS_STRING " " UPNP_VERSION_STRING " MiniUPnPc/" MINIUPNPC_VERSION_STRING "\r\n" -+ "User-Agent: " UPNP_VERSION_STRING "\r\n" - - "\r\n", - path, httpversion, host, port); diff --git a/depends/patches/miniupnpc/fix_windows_snprintf.patch b/depends/patches/miniupnpc/fix_windows_snprintf.patch deleted file mode 100644 index ff9e26231e739f..00000000000000 --- a/depends/patches/miniupnpc/fix_windows_snprintf.patch +++ /dev/null @@ -1,25 +0,0 @@ -commit a1e9de80ab99b4c956a6a4e21d3e0de6f7a1014d -Author: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> -Date: Sat Apr 20 15:14:47 2024 +0100 - - Fix macro expression that guards `snprintf` for Windows - - Otherwise, the `snprintf` is still wrongly emulated for the following - cases: - - mingw-w64 6.0.0 or new with ucrt - - mingw-w64 8.0.0 or new with iso c ext - ---- a/src/win32_snprintf.h -+++ b/src/win32_snprintf.h -@@ -23,9 +23,9 @@ - (defined(_MSC_VER) && _MSC_VER < 1900) /* Visual Studio older than 2015 */ || \ - (defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR) && defined(__NO_ISOCEXT)) /* mingw32 without iso c ext */ || \ - (defined(__MINGW64_VERSION_MAJOR) && /* mingw-w64 not ... */ !( \ -- (defined (__USE_MINGW_ANSI_STDIO) && __USE_MINGW_ANSI_STDIO != 0)) /* ... with ansi stdio */ || \ -+ (defined (__USE_MINGW_ANSI_STDIO) && __USE_MINGW_ANSI_STDIO != 0) /* ... with ansi stdio */ || \ - (__MINGW64_VERSION_MAJOR >= 6 && defined(_UCRT)) /* ... at least 6.0.0 with ucrt */ || \ -- (__MINGW64_VERSION_MAJOR >= 8 && !defined(__NO_ISOCEXT)) /* ... at least 8.0.0 with iso c ext */ || \ -+ (__MINGW64_VERSION_MAJOR >= 8 && !defined(__NO_ISOCEXT))) /* ... at least 8.0.0 with iso c ext */ || \ - 0) || \ - 0) - diff --git a/depends/toolchain.cmake.in b/depends/toolchain.cmake.in index 735ebc8ea423f1..37a0c670ddffae 100644 --- a/depends/toolchain.cmake.in +++ b/depends/toolchain.cmake.in @@ -139,13 +139,6 @@ else() set(WITH_SQLITE ON CACHE BOOL "") endif() -set(upnp_packages @upnp_packages@) -if("${upnp_packages}" STREQUAL "") - set(WITH_MINIUPNPC OFF CACHE BOOL "") -else() - set(WITH_MINIUPNPC ON CACHE BOOL "") -endif() - set(usdt_packages @usdt_packages@) if("${usdt_packages}" STREQUAL "") set(WITH_USDT OFF CACHE BOOL "")