Merge bitcoin/bitcoin#29708: depends: build libnatpmp with CMake

3c1ae3ee33 depends: switch libnatpmp to CMake (Cory Fields)
72ba7b5d26 depends: libnatpmp f2433bec24ca3d3f22a8a7840728a3ac177f94ba (fanquake)

Pull request description:

  This picks up one of the changes from https://github.com/bitcoin/bitcoin/pull/29232, which is a switch to building libnatpmp with CMake. It includes an update to the most recent version of libnatpmp (f2433bec24), which includes (https://github.com/miniupnp/libnatpmp/pull/43).

  From an initial look I couldn't find any significant difference between the Autotools and CMake produced libs.

ACKs for top commit:
  m3dwards:
    ACK 3c1ae3ee33
  hebasto:
    ACK 3c1ae3ee33.
  TheCharlatan:
    ACK 3c1ae3ee33

Tree-SHA512: 1dd9d9933a5fceb9f8c4e1d68cd5cb4456a10a6dd27a6f6316f14493f9d2efad981ef8be9570c09ca82d45163aebd7f4cb2b2449989ec6084268ddba9a564c83
This commit is contained in:
merge-script 2024-04-25 21:07:52 +08:00
commit 10f5022072
No known key found for this signature in database
GPG Key ID: 2EEB9F5CC09526C1
3 changed files with 9 additions and 30 deletions

View File

@ -1,26 +1,20 @@
package=libnatpmp
$(package)_version=07004b97cf691774efebe70404cf22201e4d330d
$(package)_version=f2433bec24ca3d3f22a8a7840728a3ac177f94ba
$(package)_download_path=https://github.com/miniupnp/libnatpmp/archive
$(package)_file_name=$($(package)_version).tar.gz
$(package)_sha256_hash=9321953ceb39d07c25463e266e50d0ae7b64676bb3a986d932b18881ed94f1fb
$(package)_patches=no_libtool.patch
$(package)_sha256_hash=ef84979950dfb3556705b63c9cd6c95501b75e887fba466234b187f3c9029669
$(package)_build_subdir=build
define $(package)_set_vars
$(package)_build_opts=CC="$($(package)_cc)"
$(package)_build_opts_mingw32=CPPFLAGS=-DNATPMP_STATICLIB
$(package)_build_env+=CFLAGS="$($(package)_cflags) $($(package)_cppflags)" AR="$($(package)_ar)"
endef
define $(package)_preprocess_cmds
patch -p1 < $($(package)_patch_dir)/no_libtool.patch
define $(package)_config_cmds
$($(package)_cmake) -S .. -B .
endef
define $(package)_build_cmds
$(MAKE) libnatpmp.a $($(package)_build_opts)
$(MAKE) natpmp
endef
define $(package)_stage_cmds
mkdir -p $($(package)_staging_prefix_dir)/include $($(package)_staging_prefix_dir)/lib &&\
install *.h $($(package)_staging_prefix_dir)/include &&\
mkdir -p $($(package)_staging_prefix_dir)/include $($(package)_staging_prefix_dir)/lib && \
install ../natpmp.h ../natpmp_declspec.h $($(package)_staging_prefix_dir)/include && \
install libnatpmp.a $($(package)_staging_prefix_dir)/lib
endef

View File

@ -1,15 +0,0 @@
diff -ruN libnatpmp-07004b97cf691774efebe70404cf22201e4d330d/Makefile libnatpmp-07004b97cf691774efebe70404cf22201e4d330d.new/Makefile
--- libnatpmp-07004b97cf691774efebe70404cf22201e4d330d/Makefile 2022-07-05 07:49:50.000000000 +0000
+++ libnatpmp-07004b97cf691774efebe70404cf22201e4d330d.new/Makefile 2024-01-23 20:59:35.674821779 +0000
@@ -197,11 +197,7 @@
$(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS)
$(STATICLIB): $(LIBOBJS)
-ifneq (, $(findstring darwin, $(OS)))
- $(LIBTOOL) -static -o $@ $?
-else
$(AR) crs $@ $?
-endif
$(SHAREDLIB): $(LIBOBJS)
ifneq (, $(findstring darwin, $(OS)))

View File

@ -35,7 +35,7 @@ You can find installation instructions in the `build-*.md` file for your platfor
### Networking
| Dependency | Releases | Version used | Minimum required | Runtime |
| --- | --- | --- | --- | --- |
| [libnatpmp](../depends/packages/libnatpmp.mk) | [link](https://github.com/miniupnp/libnatpmp/) | commit [07004b9...](https://github.com/bitcoin/bitcoin/pull/25917) | | 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 |
### Notifications