Closed Bug 530672 Opened 15 years ago Closed 3 years ago

Provide a pkg-config file (nss.pc)

Categories

(NSS :: Build, enhancement, P5)

enhancement

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: maciej.blizinski, Unassigned)

Details

User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.4) Gecko/20091114 Gentoo Firefox/3.5.4 GTB5
Build Identifier: 

Provide a pkg-config file which can be later used when building applications depending on NSS.

Reproducible: Always




From http://pkg-config.freedesktop.org/wiki/

pkg-config is a helper tool used when compiling applications and libraries. It helps you insert the correct compiler options on the command line so an application can use  gcc -o test test.c `pkg-config --libs --cflags glib-2.0`  for instance, rather than hard-coding values on where to find glib (or other libraries). It is language-agnostic, so it can be used for defining the location of documentation tools, for instance.

Linux distributions already create nss.pc files downstream.  I think it makes sense to create such a file upstream.

This topic has been also discussed on the NSS mailing list:

http://groups.google.com/group/mozilla.dev.tech.crypto/browse_thread/thread/709646e32fc4fad0#

Unless there are licensing issues, perhaps one of the downstream patches can be used. Gentoo provides a patch for nss.pc and nss-config:

http://viewcvs.gentoo.org/viewcvs.py/*checkout*/gentoo-x86/dev-libs/nss/files/nss-3.12.4-gentoo-fixups-1.diff

Ubuntu also offers a patch:
https://launchpad.net/ubuntu/+source/nss/3.12.3.1-0ubuntu2
(Much more code changes, patch includes nss.pc and nss-config.)

If none of those patches can be used, a new patch needs to be written for NSS.
Status: UNCONFIRMED → NEW
Ever confirmed: true
I think that one of the problems with writing a generic nss.pc file is that nss' build system doesn't know where it's going to be installed, what's the prefix, what are the build options and so forth.  Usually, this information is taken from the arguments of the ./configure script.  But perhaps the build system knows at least some of this information and can ask for other.  Or the whole thing could be ported to autotools.
Perhaps the best we can do is to provide an nss.pc file
for a particular OS as a reference.  Then the other platforms
can patch this nss.pc or write their own nss.pc based on the
refefence nss.pc.
(In reply to comment #2)
> Perhaps the best we can do is to provide an nss.pc file
> for a particular OS as a reference.  Then the other platforms
> can patch this nss.pc or write their own nss.pc based on the
> refefence nss.pc.

You all feel free to do as you want with the nss.pc,nss-config code from gentoo patch, If this is landed would just make my life easier, it is generic enough and uses all info based of configure to get the job done.
As far as I can see, all downstream packagers add an nss-config script and a nss.pc file themselves. I would love to see these included upstream, too.

However, if I am not mistaken, "make install" in mozilla/security/nss only installs into mozilla/dist, right? In order to create a sensible .pc file (which necessarily contains the install locations), there would have to be an "install"-like target that actually installs into a real PREFIX, such as /usr/local.

At least in NSS 3.43 their is a pkg-config file now.

$ more /usr/lib/pkgconfig/nss.pc 
prefix=/usr
exec_prefix=${prefix}
libdir=${prefix}/lib
includedir=${prefix}/include/nss

Name: NSS
Description: Network Security Services
Version: 3.43.0
Requires: nspr >= 4.20
Libs: -L${prefix}/lib -lnss3 -lnssutil3 -lsmime3 -lssl3 -lsoftokn3
Cflags: -I${includedir}

So, this bug can be marked as solved.

Severity: normal → S4
Status: NEW → RESOLVED
Closed: 3 years ago
Priority: -- → P5
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.