Skip to content

Commit 3ef6563

Browse files
committed
depends: use ar rather than libtool for miniupnpc/libnatpmp
1 parent 874c8bd commit 3ef6563

File tree

4 files changed

+38
-4
lines changed

4 files changed

+38
-4
lines changed

depends/packages/libnatpmp.mk

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,18 @@ $(package)_version=07004b97cf691774efebe70404cf22201e4d330d
33
$(package)_download_path=https://github.com/miniupnp/libnatpmp/archive
44
$(package)_file_name=$($(package)_version).tar.gz
55
$(package)_sha256_hash=9321953ceb39d07c25463e266e50d0ae7b64676bb3a986d932b18881ed94f1fb
6+
$(package)_patches=no_libtool.patch
67

78
define $(package)_set_vars
89
$(package)_build_opts=CC="$($(package)_cc)"
910
$(package)_build_opts_mingw32=CPPFLAGS=-DNATPMP_STATICLIB
10-
$(package)_build_opts_darwin=LIBTOOL="$($(package)_libtool)"
1111
$(package)_build_env+=CFLAGS="$($(package)_cflags) $($(package)_cppflags)" AR="$($(package)_ar)"
1212
endef
1313

14+
define $(package)_preprocess_cmds
15+
patch -p1 < $($(package)_patch_dir)/no_libtool.patch
16+
endef
17+
1418
define $(package)_build_cmds
1519
$(MAKE) libnatpmp.a $($(package)_build_opts)
1620
endef

depends/packages/miniupnpc.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@ $(package)_version=2.2.2
33
$(package)_download_path=https://miniupnp.tuxfamily.org/files/
44
$(package)_file_name=$(package)-$($(package)_version).tar.gz
55
$(package)_sha256_hash=888fb0976ba61518276fe1eda988589c700a3f2a69d71089260d75562afd3687
6-
$(package)_patches=dont_leak_info.patch respect_mingw_cflags.patch
6+
$(package)_patches=dont_leak_info.patch respect_mingw_cflags.patch no_libtool.patch
77

88
# Next time this package is updated, ensure that _WIN32_WINNT is still properly set.
99
# See discussion in https://github.com/bitcoin/bitcoin/pull/25964.
1010
define $(package)_set_vars
1111
$(package)_build_opts=CC="$($(package)_cc)"
12-
$(package)_build_opts_darwin=LIBTOOL="$($(package)_libtool)"
1312
$(package)_build_opts_mingw32=-f Makefile.mingw CFLAGS="$($(package)_cflags) -D_WIN32_WINNT=0x0601"
1413
$(package)_build_env+=CFLAGS="$($(package)_cflags) $($(package)_cppflags)" AR="$($(package)_ar)"
1514
endef
1615

1716
define $(package)_preprocess_cmds
1817
patch -p1 < $($(package)_patch_dir)/dont_leak_info.patch && \
19-
patch -p1 < $($(package)_patch_dir)/respect_mingw_cflags.patch
18+
patch -p1 < $($(package)_patch_dir)/respect_mingw_cflags.patch && \
19+
patch -p1 < $($(package)_patch_dir)/no_libtool.patch
2020
endef
2121

2222
define $(package)_build_cmds
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
diff -ruN libnatpmp-07004b97cf691774efebe70404cf22201e4d330d/Makefile libnatpmp-07004b97cf691774efebe70404cf22201e4d330d.new/Makefile
2+
--- libnatpmp-07004b97cf691774efebe70404cf22201e4d330d/Makefile 2022-07-05 07:49:50.000000000 +0000
3+
+++ libnatpmp-07004b97cf691774efebe70404cf22201e4d330d.new/Makefile 2024-01-23 20:59:35.674821779 +0000
4+
@@ -197,11 +197,7 @@
5+
$(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS)
6+
7+
$(STATICLIB): $(LIBOBJS)
8+
-ifneq (, $(findstring darwin, $(OS)))
9+
- $(LIBTOOL) -static -o $@ $?
10+
-else
11+
$(AR) crs $@ $?
12+
-endif
13+
14+
$(SHAREDLIB): $(LIBOBJS)
15+
ifneq (, $(findstring darwin, $(OS)))
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
diff -ruN miniupnpc-2.2.2/Makefile miniupnpc-2.2.2.new/Makefile
2+
--- miniupnpc-2.2.2/Makefile 2020-11-27 18:25:02.000000000 +0000
3+
+++ miniupnpc-2.2.2.new/Makefile 2024-01-23 20:58:08.387188527 +0000
4+
@@ -298,11 +298,7 @@
5+
makedepend -Y -- $(CFLAGS) -- $(SRCS) 2>/dev/null
6+
7+
$(LIBRARY): $(LIBOBJS)
8+
-ifneq (, $(findstring darwin, $(OS)))
9+
- $(LIBTOOL) -static -o $@ $?
10+
-else
11+
$(AR) crs $@ $?
12+
-endif
13+
14+
$(SHAREDLIBRARY): $(LIBOBJS)
15+
ifneq (, $(findstring darwin, $(OS)))

0 commit comments

Comments
 (0)