Skip to content

[libnatpmp] Add new port - #53998

Merged
Billy O'Neal (BillyONeal) merged 4 commits into
microsoft:masterfrom
Kiptoo-Deus:add-libnatpmp-port
Sep 23, 2026
Merged

Billy O'Neal (BillyONeal) merged 4 commits into
microsoft:masterfrom
Kiptoo-Deus:add-libnatpmp-port

Conversation

@Kiptoo-Deus

@Kiptoo-Deus Joel Kiptoo (Kiptoo-Deus) commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Adds a port for libnatpmp, a client-side NAT traversal library implementing NAT-PMP (BSD-3-Clause). Resolves #52796.

Versioning. Upstream has no git tags, and its VERSION file still reads 20120821 while the repository was last updated in April 2025. The port pins commit 134fc89e with "version-date": "2025-04-03". Other distributions version this library by date for the same reason — Arch, for instance, packages it as 20230423.

No CMake package config. Upstream's CMakeLists.txt installs no export set and generates no config file, so vcpkg_cmake_config_fixup is not called. Consumers use the natpmp pkg-config module, which vcpkg's automatically generated usage text already reports correctly.

The natpmpc executable upstream installs is relocated to tools/libnatpmp/ via vcpkg_copy_tools.

  • Changes comply with the maintainer guide.
  • The packaged project is mature and ready for broad sharing with vcpkg users
    • Has a release at least 6 months old or 6 months of demonstrated public development — no tagged releases exist, but the project has been under continuous public development since 2007, with commits through April 2025.
  • The packaged project shows strong association with the chosen port name. Check this box if at least one of the following criteria is met:
    • The project is amongst the first web search results for "libnatpmp" — the upstream repository and its homepage both appear, and the library is packaged by Debian, Ubuntu, Alpine, Arch, FreeBSD and Homebrew. (Screenshot to follow.)
  • Optional dependencies of the build are all controlled by the port — upstream has no optional dependencies.
  • The versioning scheme in vcpkg.json matches what upstream says.
  • The license declaration in vcpkg.json matches what upstream says — LICENSE reads "BSD 3-Clause License, Copyright (c) 2007-2022, Thomas BERNARD".
  • The installed as the "copyright" file matches what upstream says.
  • The source code of the component installed comes from an authoritative source.
  • The generated "usage text" is brief and accurate — no usage file added, as the automatically generated pkg-config usage is correct.
  • The version database is fixed by rerunning ./vcpkg x-add-version --all and committing the result.
  • Exactly one version is added in each modified versions file.

@Kiptoo-Deus

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

@BillyONeal Billy O'Neal (BillyONeal) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GPT 5.6 Sol reports:

The supported Windows static package cannot be consumed. The installed upstream natpmp_declspec.h defaults public APIs to __declspec(dllimport) on Windows unless NATPMP_STATICLIB is defined, but neither the installed metadata nor direct usage supplies that definition. Consequently, both Release and Debug consumers fail to link through direct usage and pkg-config.

Would you consider merging Kiptoo-Deus#1 which fixes this?

Thanks for the new port!

[libnatpmp] Imbue static linkage in installed header
@Kiptoo-Deus

Copy link
Copy Markdown
Contributor Author

Thanks Billy O'Neal (@BillyONeal)! Merged your fix (Kiptoo-Deus#1). CI is green across all triplets, including the Windows static ones. Ready for another look when you have time.

@BillyONeal Billy O'Neal (BillyONeal) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@BillyONeal
Billy O'Neal (BillyONeal) merged commit fe56720 into microsoft:master Sep 23, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[New Port Request] libnatpmp

2 participants