Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

natpmp.h refers to natpmp_declspec.h, which is not installed #41

Open
Apteryks opened this issue Aug 18, 2023 · 2 comments
Open

natpmp.h refers to natpmp_declspec.h, which is not installed #41

Apteryks opened this issue Aug 18, 2023 · 2 comments

Comments

@Apteryks
Copy link

Hello,

As mentioned in the title, 'make install' installs a lone natpmp.h header that refers to a missing natpmp_declspec.h. That's been known to Gentoo since 2014 but apparently not reported (see: https://bugs.gentoo.org/506832).

The workaround is to specify the HEADERS=natpmp.h natpmp_declspec.h make flag.

@Apteryks
Copy link
Author

The CMake build system also has that problem, it seems.

@Apteryks
Copy link
Author

Here's the Guix package with the substitutions that make it correct for me:

(define-public libnatpmp
  ;; Install the latest commit as it provides a pkg-config (.pc) file.
  (let ((base-version "20230423")
        (commit "6a850fd2bd9b08e6edc886382a1dbae2a7df55ec")
        (revision "0"))
    (package
      (name "libnatpmp")
      (version (git-version base-version revision commit))
      (source (origin
                (method git-fetch)
                (uri (git-reference
                      (url "https://github.com/miniupnp/libnatpmp")
                      (commit commit)))
                (file-name (git-file-name name version))
                (sha256
                 (base32
                  "18hf9a3i3mncl3w80nzi1684iac3by86bv0hgmbm1v2w8gbfjyw0"))))
      (build-system cmake-build-system)
      (arguments
       (list
        #:tests? #f                     ;no test suite
        #:configure-flags #~(list "-DBUILD_SHARED_LIBS=ON")
        #:phases
        #~(modify-phases %standard-phases
            (add-after 'unpack 'patch-build-system
              ;; Have CMake install the natpmp_declspec.h missing header file
              ;; that is referenced by natpmp.h (see:
              ;; https://github.com/miniupnp/libnatpmp/issues/41).
              (lambda _
                (substitute* "CMakeLists.txt"
                  (("install\\(FILES natpmp.h")
                   "install(FILES natpmp.h natpmp_declspec.h"))))
            (add-after 'unpack 'fix-version
              (lambda _
                (with-output-to-file "VERSION"
                  (lambda ()
                    (display #$base-version))))))))
      (native-inputs (list which))
      (home-page "https://miniupnp.tuxfamily.org/libnatpmp.html")
      (synopsis "C library implementing NAT-PMP")
      (description
       "@code{libnatpmp} is a portable and asynchronous implementation of
the Network Address Translation - Port Mapping Protocol (NAT-PMP)
written in the C programming language.")
      (license license:bsd-3))))

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

No branches or pull requests

1 participant