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

Add natpmp.pc.in (pkg-config) #32

Open
AmarOk1412 opened this issue May 19, 2023 · 6 comments
Open

Add natpmp.pc.in (pkg-config) #32

AmarOk1412 opened this issue May 19, 2023 · 6 comments
Assignees

Comments

@AmarOk1412
Copy link

Hi,

To discover libraries, various systems uses pkg-config. For now, libnatpmp is not discoverable with this method.

pkg-config --libs natpmp          
Package natpmp was not found in the pkg-config search path.
Perhaps you should add the directory containing `natpmp.pc'
to the PKG_CONFIG_PATH environment variable
No package 'natpmp' found
@miniupnp miniupnp self-assigned this May 21, 2023
@wdlkmpx
Copy link

wdlkmpx commented Jun 18, 2023

the Makefile creates and installs natpmp.pc, now it really depends on how you install it

Distros install to a certain dir with make DESTDIR=xxx install, this doesn't work as expected in libnatpmp, only the .pc file is installed where it should, all the other files are installed to the system

INSTALLPREFIX ?= $(PREFIX)/usr

This is the DESTDIR = INSTALLPREFIX, fixing this issue is easy but may confuse people

@wdlkmpx
Copy link

wdlkmpx commented Jun 18, 2023

If you want a standard behavior, the CMake stuff now implements (almost everything)

natpmp.pc.in was created, it's the input file for cmake to replace strings, that's probably what you want to use then

So both cmake & the Makefile (not cmake) create natpmp.pc in different ways, but the contents are essentially the same

@Apteryks
Copy link

the Makefile creates and installs natpmp.pc, now it really depends on how you install it

@wdlkmpx How? Using the release from https://miniupnp.tuxfamily.org/files/libnatpmp-20230423.tar.gz, I don't see any .pc or .pc.in file in it, and installing with 'make install INSTALLPREFIX=$MY_PREFIX' doesn't install any .pc file to anywhere under $MY_PREFIX.

@miniupnp
Copy link
Owner

@Apteryks
Copy link

That seems to be installed only since recently, and for the CMake build system, right?

@Apteryks
Copy link

I just tested it; the .pc is installed correctly with CMake, but it seems the version it gets from CMake is outdated; it comes from:

https://github.com/miniupnp/libnatpmp/blob/master/VERSION

and is currently defined to 20120821:

$ cat /gnu/store/a7nhb5ylp36mh6j1716if9hk7lamw5b5-libnatpmp-20230423-0.6a850fd/lib/pkgconfig/natpmp.pc
prefix=/gnu/store/a7nhb5ylp36mh6j1716if9hk7lamw5b5-libnatpmp-20230423-0.6a850fd
exec_prefix=${prefix}
libdir=/gnu/store/a7nhb5ylp36mh6j1716if9hk7lamw5b5-libnatpmp-20230423-0.6a850fd/lib
includedir=/gnu/store/a7nhb5ylp36mh6j1716if9hk7lamw5b5-libnatpmp-20230423-0.6a850fd/include

Name: libnatpmp
Description: NAT-PMP client library
Version: 20120821
Libs: -L${libdir} -lnatpmp
Cflags: -I${includedir}

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

4 participants