Skip to contentSkip to conversation

package/libnspr: add pkg-config file

PATCH Superseded Yann E. MORIN 2 participants 4 messages Aug 18, 2012 – Aug 21, 2012

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 package/libnspr: add pkg-config file

Some packages use pkg-config to check for libnspr. libnspr does bundle a .pc file, but it is not installed.

Simply install it (using patch from Debian).

---
 package/libnspr/libnspr.mk |   16 ++++++++++++++++
 package/libnspr/nspr.pc.in |   10 ++++++++++
 2 files changed, 26 insertions(+), 0 deletions(-)
 create mode 100644 package/libnspr/nspr.pc.in
package/libnspr/libnspr.mk +16 -0
index 689caa4..736984d 100644
@@ -16,4 +16,20 @@ LIBNSPR_CONF_OPT  = --host=$(GNU_HOST_NAME)
 LIBNSPR_CONF_OPT += --$(if $(BR2_ARCH_IS_64),en,dis)able-64bit
 LIBNSPR_CONF_OPT += --$(if $(BR2_INET_IPV6),en,dis)able-ipv6
 
+define LIBNSPR_INSTALL_STAGING_PC
+	$(INSTALL) -D -m 0644 $(TOPDIR)/package/libnspr/nspr.pc.in \
+		$(STAGING_DIR)/usr/lib/pkgconfig/nspr.pc
+	$(SED) 's/@VERSION@/$(LIBNSPR_VERSION)/g;' \
+		$(STAGING_DIR)/usr/lib/pkgconfig/nspr.pc
+endef
+LIBNSPR_POST_INSTALL_STAGING_HOOKS += LIBNSPR_INSTALL_STAGING_PC
+
+define LIBNSPR_INSTALL_TARGET_PC
+	$(INSTALL) -D -m 0644 $(TOPDIR)/package/libnspr/nspr.pc.in \
+		$(TARGET_DIR)/usr/lib/pkgconfig/nspr.pc
+	$(SED) 's/@VERSION@/$(LIBNSPR_VERSION)/g;' \
+		$(TARGET_DIR)/usr/lib/pkgconfig/nspr.pc
+endef
+LIBNSPR_POST_INSTALL_TARGET_HOOKS += LIBNSPR_INSTALL_TARGET_PC
+
 $(eval $(autotools-package))
package/libnspr/nspr.pc.in new file +10 -0
new file mode 100644
index 0000000..3719260
@@ -0,0 +1,10 @@
+prefix=/usr
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include/nspr
+
+Name: NSPR
+Description: The Netscape Portable Runtime
+Version: @VERSION@
+Libs: -L${exec_prefix}/lib -lplds4 -lplc4 -lnspr4 -lpthread -ldl 
+Cflags: -I${prefix}/include/nspr
Signature · 1 line
1.7.2.5
#1 lore raw

PATCH 2/2 package/libnss: also install a pkg-config file

Some packages use pkg-config to check for libnss.

Add our own .pc file (vampirised from Debian).

---
 package/libnss/libnss.mk |    8 ++++++++
 package/libnss/nss.pc.in |   11 +++++++++++
 2 files changed, 19 insertions(+), 0 deletions(-)
 create mode 100644 package/libnss/nss.pc.in
package/libnss/libnss.mk +8 -0
index f7fd682..84fc149 100644
@@ -49,6 +49,10 @@ define LIBNSS_INSTALL_STAGING_CMDS
 		$(@D)/$(LIBNSS_DISTDIR)/public/nss/*
 	$(INSTALL) -m 755 -t $(STAGING_DIR)/usr/lib/ \
 		$(@D)/$(LIBNSS_DISTDIR)/lib/*.a
+	$(INSTALL) -D -m 0644 $(TOPDIR)/package/libnss/nss.pc.in \
+		$(STAGING_DIR)/usr/lib/pkgconfig/nss.pc
+	$(SED) 's/@VERSION@/$(LIBNSS_VERSION)/g;' \
+		$(STAGING_DIR)/usr/lib/pkgconfig/nss.pc
 endef
 
 define LIBNSS_INSTALL_TARGET_CMDS
@@ -59,6 +63,10 @@ define LIBNSS_INSTALL_TARGET_CMDS
 		$(@D)/$(LIBNSS_DISTDIR)/public/nss/*
 	$(INSTALL) -m 755 -t $(TARGET_DIR)/usr/lib/ \
 		$(@D)/$(LIBNSS_DISTDIR)/lib/*.a
+	$(INSTALL) -D -m 0644 $(TOPDIR)/package/libnss/nss.pc.in \
+		$(TARGET_DIR)/usr/lib/pkgconfig/nss.pc
+	$(SED) 's/@VERSION@/$(LIBNSS_VERSION)/g;' \
+		$(TARGET_DIR)/usr/lib/pkgconfig/nss.pc
 endef
 
 define LIBNSS_CLEAN_CMDS
package/libnss/nss.pc.in new file +11 -0
new file mode 100644
index 0000000..e27783f
@@ -0,0 +1,11 @@
+prefix=/usr
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include/nss
+
+Name: NSS
+Description: Mozilla Network Security Services
+Version: @VERSION@
+Requires: nspr
+Libs: -L${libdir} -lnss3 -lnssutil3 -lsmime3 -lssl3
+Cflags: -I${includedir}
Signature · 1 line
1.7.2.5
#2 lore raw

PATCH 1/2 package/libnspr: add pkg-config file

In reply to Yann E. MORIN

Le Sat, 18 Aug 2012 14:55:42 +0200,
"Yann E. MORIN" <[email protected]> a ?crit :

Quoted 2 lines

Some packages use pkg-config to check for libnspr. libnspr does bundle a .pc file, but it is not installed.

Here you're saying that libnspr bundles a .pc file... but

package/libnspr/nspr.pc.in

Quoted 5 lines
package/libnspr/nspr.pc.in new file +0 -0
new file mode 100644
index 0000000..3719260

here you're adding it to Buildroot. I'm confused. Could you explain? :-)

Thanks!

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#3 lore raw

PATCH 1/2 package/libnspr: add pkg-config file

Thomas, All,

Quoted 8 lines · On Tuesday 21 August 2012 11:14:39 Thomas Petazzoni wrote:

Le Sat, 18 Aug 2012 14:55:42 +0200,
"Yann E. MORIN" <[email protected]> a ?crit :

Quoted 2 lines

Some packages use pkg-config to check for libnspr. libnspr does bundle a .pc file, but it is not installed.

Here you're saying that libnspr bundles a .pc file... but

Quoted 7 lines

package/libnspr/nspr.pc.in

Quoted 5 lines
package/libnspr/nspr.pc.in new file +0 -0
new file mode 100644
index 0000000..3719260

here you're adding it to Buildroot. I'm confused. Could you explain? :-)

Bah, I guess I was cafeine-deprived when I wrote this... libnspr does *not* bundle a .pc file. I don't know where I saw one: I just re-extracted the sources, and there's clearly no pkg-config file in there...

I'll reword the commit message and resubmit.

Thanks for the review.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'