Skip to content

Commit f5618c7

Browse files
committed
depends: add upstream CMake patch to miniupnpc
1 parent 6866b57 commit f5618c7

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

depends/packages/miniupnpc.mk

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ $(package)_version=2.2.7
33
$(package)_download_path=https://miniupnp.tuxfamily.org/files/
44
$(package)_file_name=$(package)-$($(package)_version).tar.gz
55
$(package)_sha256_hash=b0c3a27056840fd0ec9328a5a9bac3dc5e0ec6d2e8733349cf577b0aa1e70ac1
6-
$(package)_patches=dont_leak_info.patch no_libtool.patch fix_windows_build.patch
6+
$(package)_patches=dont_leak_info.patch no_libtool.patch fix_windows_build.patch cmake_get_src_addr.patch
77

88
define $(package)_set_vars
99
$(package)_build_opts=CC="$($(package)_cc)"
@@ -14,7 +14,8 @@ endef
1414
define $(package)_preprocess_cmds
1515
patch -p1 < $($(package)_patch_dir)/dont_leak_info.patch && \
1616
patch -p1 < $($(package)_patch_dir)/no_libtool.patch && \
17-
patch -p1 < $($(package)_patch_dir)/fix_windows_build.patch
17+
patch -p1 < $($(package)_patch_dir)/fix_windows_build.patch && \
18+
patch -p1 < $($(package)_patch_dir)/cmake_get_src_addr.patch
1819
endef
1920

2021
define $(package)_build_cmds
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
commit cb2026239c2a3aff393952ccb0ee1c448189402d
2+
Author: fanquake <[email protected]>
3+
Date: Fri Mar 22 14:03:54 2024 +0000
4+
5+
build: add MINIUPNPC_GET_SRC_ADDR to CMake build
6+
7+
This mirrors the autotools build.
8+
9+
See https://github.com/miniupnp/miniupnp/pull/721.
10+
11+
diff --git a/CMakeLists.txt b/CMakeLists.txt
12+
index 1aa95a8..0cacf3e 100644
13+
--- a/CMakeLists.txt
14+
+++ b/CMakeLists.txt
15+
@@ -31,6 +31,7 @@ endif ()
16+
if (NOT WIN32)
17+
target_compile_definitions(miniupnpc-private INTERFACE
18+
MINIUPNPC_SET_SOCKET_TIMEOUT
19+
+ MINIUPNPC_GET_SRC_ADDR
20+
_BSD_SOURCE _DEFAULT_SOURCE)
21+
if (NOT APPLE AND NOT CMAKE_SYSTEM_NAME MATCHES ".*BSD" AND NOT CMAKE_SYSTEM_NAME STREQUAL "SunOS")
22+
# add_definitions (-D_POSIX_C_SOURCE=200112L)

0 commit comments

Comments
 (0)