depends: miniupnpc 2.2.7

Includes a temporary patch to fix the Windows Autotools build.

See
https://miniupnp.tuxfamily.org/files/changelog.php?file=miniupnpc-2.2.7.tar.gz.
pull/29707/head
fanquake 2 years ago
parent 19865a8350
commit 6866b571ab
No known key found for this signature in database
GPG Key ID: 2EEB9F5CC09526C1

@ -1,30 +1,28 @@
package=miniupnpc package=miniupnpc
$(package)_version=2.2.2 $(package)_version=2.2.7
$(package)_download_path=https://miniupnp.tuxfamily.org/files/ $(package)_download_path=https://miniupnp.tuxfamily.org/files/
$(package)_file_name=$(package)-$($(package)_version).tar.gz $(package)_file_name=$(package)-$($(package)_version).tar.gz
$(package)_sha256_hash=888fb0976ba61518276fe1eda988589c700a3f2a69d71089260d75562afd3687 $(package)_sha256_hash=b0c3a27056840fd0ec9328a5a9bac3dc5e0ec6d2e8733349cf577b0aa1e70ac1
$(package)_patches=dont_leak_info.patch respect_mingw_cflags.patch no_libtool.patch $(package)_patches=dont_leak_info.patch no_libtool.patch fix_windows_build.patch
# Next time this package is updated, ensure that _WIN32_WINNT is still properly set.
# See discussion in https://github.com/bitcoin/bitcoin/pull/25964.
define $(package)_set_vars define $(package)_set_vars
$(package)_build_opts=CC="$($(package)_cc)" $(package)_build_opts=CC="$($(package)_cc)"
$(package)_build_opts_mingw32=-f Makefile.mingw CFLAGS="$($(package)_cflags) -D_WIN32_WINNT=0x0601" $(package)_build_opts_mingw32=-f Makefile.mingw CFLAGS="$($(package)_cflags)"
$(package)_build_env+=CFLAGS="$($(package)_cflags) $($(package)_cppflags)" AR="$($(package)_ar)" $(package)_build_env+=CFLAGS="$($(package)_cflags) $($(package)_cppflags)" AR="$($(package)_ar)"
endef endef
define $(package)_preprocess_cmds define $(package)_preprocess_cmds
patch -p1 < $($(package)_patch_dir)/dont_leak_info.patch && \ patch -p1 < $($(package)_patch_dir)/dont_leak_info.patch && \
patch -p1 < $($(package)_patch_dir)/respect_mingw_cflags.patch && \ patch -p1 < $($(package)_patch_dir)/no_libtool.patch && \
patch -p1 < $($(package)_patch_dir)/no_libtool.patch patch -p1 < $($(package)_patch_dir)/fix_windows_build.patch
endef endef
define $(package)_build_cmds define $(package)_build_cmds
$(MAKE) libminiupnpc.a $($(package)_build_opts) $(MAKE) build/libminiupnpc.a $($(package)_build_opts)
endef endef
define $(package)_stage_cmds define $(package)_stage_cmds
mkdir -p $($(package)_staging_prefix_dir)/include/miniupnpc $($(package)_staging_prefix_dir)/lib &&\ mkdir -p $($(package)_staging_prefix_dir)/include/miniupnpc $($(package)_staging_prefix_dir)/lib &&\
install *.h $($(package)_staging_prefix_dir)/include/miniupnpc &&\ install include/*.h $($(package)_staging_prefix_dir)/include/miniupnpc &&\
install libminiupnpc.a $($(package)_staging_prefix_dir)/lib install build/libminiupnpc.a $($(package)_staging_prefix_dir)/lib
endef endef

@ -1,31 +1,31 @@
commit 8815452257437ba36607d0e2381c01142d1c7bb0 commit 51f6dd991c29af66fb4f64c6feb2787cce23a1a7
Author: fanquake <fanquake@gmail.com> Author: fanquake <fanquake@gmail.com>
Date: Thu Nov 19 10:51:19 2020 +0800 Date: Mon Jan 8 11:21:40 2024 +0000
Don't leak OS and miniupnpc version info in User-Agent Don't leak OS and miniupnpc version info in User-Agent
diff --git a//minisoap.c b/minisoap.c diff --git a/src/minisoap.c b/src/minisoap.c
index 7860667..775580b 100644 index 903ac5f..046e0ea 100644
--- a/minisoap.c --- a/src/minisoap.c
+++ b/minisoap.c +++ b/src/minisoap.c
@@ -90,7 +90,7 @@ int soapPostSubmit(SOCKET fd, @@ -90,7 +90,7 @@ int soapPostSubmit(SOCKET fd,
headerssize = snprintf(headerbuf, sizeof(headerbuf), headerssize = snprintf(headerbuf, sizeof(headerbuf),
"POST %s HTTP/%s\r\n" "POST %s HTTP/%s\r\n"
"Host: %s%s\r\n" "Host: %s%s\r\n"
- "User-Agent: " OS_STRING ", " UPNP_VERSION_STRING ", MiniUPnPc/" MINIUPNPC_VERSION_STRING "\r\n" - "User-Agent: " OS_STRING " " UPNP_VERSION_STRING " MiniUPnPc/" MINIUPNPC_VERSION_STRING "\r\n"
+ "User-Agent: " UPNP_VERSION_STRING "\r\n" + "User-Agent: " UPNP_VERSION_STRING "\r\n"
"Content-Length: %d\r\n" "Content-Length: %d\r\n"
#if (UPNP_VERSION_MAJOR == 1) && (UPNP_VERSION_MINOR == 0)
"Content-Type: text/xml\r\n" "Content-Type: text/xml\r\n"
"SOAPAction: \"%s\"\r\n" diff --git a/src/miniwget.c b/src/miniwget.c
diff --git a/miniwget.c b/miniwget.c index e76a5e5..0cc36fe 100644
index d5b7970..05aeb9c 100644 --- a/src/miniwget.c
--- a/miniwget.c +++ b/src/miniwget.c
+++ b/miniwget.c
@@ -444,7 +444,7 @@ miniwget3(const char * host, @@ -444,7 +444,7 @@ miniwget3(const char * host,
"GET %s HTTP/%s\r\n" "GET %s HTTP/%s\r\n"
"Host: %s:%d\r\n" "Host: %s:%d\r\n"
"Connection: Close\r\n" "Connection: Close\r\n"
- "User-Agent: " OS_STRING ", " UPNP_VERSION_STRING ", MiniUPnPc/" MINIUPNPC_VERSION_STRING "\r\n" - "User-Agent: " OS_STRING " " UPNP_VERSION_STRING " MiniUPnPc/" MINIUPNPC_VERSION_STRING "\r\n"
+ "User-Agent: " UPNP_VERSION_STRING "\r\n" + "User-Agent: " UPNP_VERSION_STRING "\r\n"
"\r\n", "\r\n",

@ -0,0 +1,143 @@
build: Temporary patch to make Windows compile
--- a/Makefile.mingw
+++ b/Makefile.mingw
@@ -9,10 +9,12 @@
#
SRCDIR = src
INCDIR = include
+BUILD = build
CC ?= gcc
SETUP_COMPILER_FLAG?=
DLLWRAP = dllwrap
+MKDIR = mkdir -p
WINDRES = windres
SH = /bin/sh
ZIP = zip
@@ -26,24 +28,25 @@ CFLAGS ?= -Os
CFLAGS += -Wall
CFLAGS += -W -Wstrict-prototypes
-CPPFLAGS += -DNDEBUG -D_WIN32_WINNT=0x501
+CPPFLAGS += -DNDEBUG -D_WIN32_WINNT=0x601
CPPFLAGS += -Iinclude
CPPFLAGS += -I.
+CPPFLAGS += -I$(BUILD)
# -liphlpapi is needed for GetBestRoute() and GetIpAddrTable()
LDLIBS = -lws2_32 -liphlpapi
PYTHON=\utils\python25\python
-OBJS=miniwget.o minixml.o igd_desc_parse.o minisoap.o \
+OBJS=$(addprefix $(BUILD)/,miniwget.o minixml.o igd_desc_parse.o minisoap.o \
minissdpc.o \
miniupnpc.o upnpreplyparse.o upnpcommands.o upnperrors.o \
connecthostport.o portlistingparse.o receivedata.o \
- upnpdev.o addr_is_reserved.o
+ upnpdev.o addr_is_reserved.o)
OBJSDLL=$(addprefix dll-, $(OBJS)) winres.o
-BINARIES=upnpc-static.exe upnpc-shared.exe \
+BINARIES=$(addprefix $(BUILD)/,upnpc-static.exe upnpc-shared.exe \
upnp-listdevices-static.exe upnp-listdevices-shared.exe \
miniupnpc.dll libminiupnpc.a \
- testminixml.exe
+ testminixml.exe)
ifneq ($(GITHUB_SHA),)
COMMITREF=$(GITHUB_SHA)
else
@@ -76,11 +79,12 @@ clean:
$(RM) miniupnpc.dll miniupnpc.lib miniupnpc.dll.def
$(RM) libminiupnpc.a
$(RM) $(DISTFILE)
+ $(RM) -r build/
$(DISTFILE): $(BINARIES)
$(ZIP) $@ *.exe *.dll *.lib *.def *.a LICENSE README Changelog.txt
-libminiupnpc.a: $(OBJS)
+$(BUILD)/libminiupnpc.a: $(OBJS)
$(AR) cr $@ $?
pythonmodule: libminiupnpc.a
@@ -97,13 +101,13 @@ miniupnpc.dll: miniupnpc.def $(OBJSDLL)
miniupnpc.lib: miniupnpc.dll
-%.o: $(SRCDIR)/%.c
+$(BUILD)/%.o: $(SRCDIR)/%.c
$(CC) $(CFLAGS) $(CPPFLAGS) -DMINIUPNP_STATICLIB -c -o $@ $<
-dll-%.o: $(SRCDIR)/%.c
+$(BUILD)/dll-%.o: $(SRCDIR)/%.c
$(CC) $(CFLAGS) $(CPPFLAGS) -DMINIUPNP_EXPORTS -c -o $@ $<
-%-shared.o: $(SRCDIR)/%.c
+$(BUILD)/%-shared.o: $(SRCDIR)/%.c
$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
# --enable-stdcall-fixup
@@ -131,7 +135,8 @@ miniupnpcstrings.h: miniupnpcstrings.h.in wingenminiupnpcstrings.exe VERSION
rc_version.h: miniupnpcstrings.h
else
-miniupnpcstrings.h: miniupnpcstrings.h.in VERSION
+$(BUILD)/miniupnpcstrings.h: miniupnpcstrings.h.in VERSION
+ @$(MKDIR) $(@D)
sed 's|OS_STRING ".*"|OS_STRING "Windows/Mingw32"|' $< | \
sed 's|MINIUPNPC_VERSION_STRING ".*"|MINIUPNPC_VERSION_STRING "$(shell cat VERSION)"|' > $@
@@ -143,7 +148,7 @@ rc_version.h: VERSION
mv $@.tmp $@
endif
-miniupnpc.pc: VERSION
+$(BUILD)/miniupnpc.pc: VERSION
$(RM) $@
echo "prefix=$(INSTALLPREFIX)" >> $@
echo "exec_prefix=\$${prefix}" >> $@
@@ -156,32 +161,32 @@ miniupnpc.pc: VERSION
echo "Libs: -L\$${libdir} -lminiupnpc" >> $@
echo "Cflags: -I\$${includedir}" >> $@
-winres.o: miniupnpc.rc rc_version.h
+$(BUILD)/winres.o: miniupnpc.rc rc_version.h
$(WINDRES) -D INTERNAL_NAME=\\\"miniupnpc.dll\\0\\\" -i $< -o $@
testminixml.exe: testminixml.o minixml.o igd_desc_parse.o
$(CC) -static -o $@ $^
-minixml.o: $(SRCDIR)/minixml.c $(SRCDIR)/minixml.h
+$(BUILD)/minixml.o: $(SRCDIR)/minixml.c $(SRCDIR)/minixml.h
-upnpc.o: include/miniwget.h $(SRCDIR)/minisoap.h include/miniupnpc.h include/igd_desc_parse.h
-upnpc.o: include/upnpreplyparse.h include/upnpcommands.h include/upnperrors.h miniupnpcstrings.h
+$(BUILD)/upnpc.o: include/miniwget.h $(SRCDIR)/minisoap.h include/miniupnpc.h include/igd_desc_parse.h
+$(BUILD)/upnpc.o: include/upnpreplyparse.h include/upnpcommands.h include/upnperrors.h miniupnpcstrings.h
-miniwget.o: $(SRCDIR)/miniwget.c include/miniwget.h miniupnpcstrings.h $(SRCDIR)/connecthostport.h
+$(BUILD)/miniwget.o: $(SRCDIR)/miniwget.c include/miniwget.h $(BUILD)/miniupnpcstrings.h $(SRCDIR)/connecthostport.h
-minisoap.o: $(SRCDIR)/minisoap.c $(SRCDIR)/minisoap.h miniupnpcstrings.h
+$(BUILD)/minisoap.o: $(SRCDIR)/minisoap.c $(SRCDIR)/minisoap.h $(BUILD)/miniupnpcstrings.h
-miniupnpc.o: $(SRCDIR)/miniupnpc.c include/miniupnpc.h $(SRCDIR)/minisoap.h \
+$(BUILD)/miniupnpc.o: $(SRCDIR)/miniupnpc.c include/miniupnpc.h $(SRCDIR)/minisoap.h \
include/miniwget.h $(SRCDIR)/minixml.h $(SRCDIR)/addr_is_reserved.h
-igd_desc_parse.o: $(SRCDIR)/igd_desc_parse.c include/igd_desc_parse.h
+$(BUILD)/igd_desc_parse.o: $(SRCDIR)/igd_desc_parse.c include/igd_desc_parse.h
-upnpreplyparse.o: $(SRCDIR)/upnpreplyparse.c include/upnpreplyparse.h $(SRCDIR)/minixml.h
+$(BUILD)/upnpreplyparse.o: $(SRCDIR)/upnpreplyparse.c include/upnpreplyparse.h $(SRCDIR)/minixml.h
-upnpcommands.o: $(SRCDIR)/upnpcommands.c include/upnpcommands.h include/upnpreplyparse.h \
+$(BUILD)/upnpcommands.o: $(SRCDIR)/upnpcommands.c include/upnpcommands.h include/upnpreplyparse.h \
include/miniupnpc.h include/portlistingparse.h
-minissdpc.o: $(SRCDIR)/minissdpc.c $(SRCDIR)/minissdpc.h $(SRCDIR)/receivedata.h
+$(BUILD)/minissdpc.o: $(SRCDIR)/minissdpc.c $(SRCDIR)/minissdpc.h $(SRCDIR)/receivedata.h
-upnpdev.o: $(SRCDIR)/upnpdev.c include/upnpdev.h
+$(BUILD)/upnpdev.o: $(SRCDIR)/upnpdev.c include/upnpdev.h

@ -1,23 +0,0 @@
commit fec515a7ac9991a0ee91068fda046b54b191155e
Author: fanquake <fanquake@gmail.com>
Date: Wed Jul 27 15:52:37 2022 +0100
build: respect CFLAGS in makefile.mingw
Similar to the other Makefile.
Cherry-pick of https://github.com/miniupnp/miniupnp/pull/619.
diff --git a/Makefile.mingw b/Makefile.mingw
index 2bff7bd..88430d2 100644
--- a/Makefile.mingw
+++ b/Makefile.mingw
@@ -19,7 +19,7 @@ else
RM = rm -f
endif
#CFLAGS = -Wall -g -DDEBUG -D_WIN32_WINNT=0X501
-CFLAGS = -Wall -W -Wstrict-prototypes -Os -DNDEBUG -D_WIN32_WINNT=0X501
+CFLAGS ?= -Wall -W -Wstrict-prototypes -Os -DNDEBUG -D_WIN32_WINNT=0X501
LDLIBS = -lws2_32 -liphlpapi
# -lwsock32
# -liphlpapi is needed for GetBestRoute() and GetIpAddrTable()

@ -36,7 +36,7 @@ You can find installation instructions in the `build-*.md` file for your platfor
| Dependency | Releases | Version used | Minimum required | Runtime | | Dependency | Releases | Version used | Minimum required | Runtime |
| --- | --- | --- | --- | --- | | --- | --- | --- | --- | --- |
| [libnatpmp](../depends/packages/libnatpmp.mk) | [link](https://github.com/miniupnp/libnatpmp/) | commit [f2433be...](https://github.com/bitcoin/bitcoin/pull/29708) | | No | | [libnatpmp](../depends/packages/libnatpmp.mk) | [link](https://github.com/miniupnp/libnatpmp/) | commit [f2433be...](https://github.com/bitcoin/bitcoin/pull/29708) | | No |
| [MiniUPnPc](../depends/packages/miniupnpc.mk) | [link](https://miniupnp.tuxfamily.org/) | [2.2.2](https://github.com/bitcoin/bitcoin/pull/20421) | 2.1 | No | | [MiniUPnPc](../depends/packages/miniupnpc.mk) | [link](https://miniupnp.tuxfamily.org/) | [2.2.7](https://github.com/bitcoin/bitcoin/pull/29707) | 2.1 | No |
### Notifications ### Notifications
| Dependency | Releases | Version used | Minimum required | Runtime | | Dependency | Releases | Version used | Minimum required | Runtime |

Loading…
Cancel
Save