libjpeg: add pkg-config file for libjpeg
authorOlivier Schonken <olivier.schonken@gmail.com>
Mon, 23 Oct 2017 13:17:43 +0000 (15:17 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Mon, 8 Jan 2018 21:01:04 +0000 (22:01 +0100)
Signed-off-by: Olivier Schonken <olivier.schonken@gmail.com>
[Thomas: change to automatically set the version in the generated .pc file.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/libjpeg/libjpeg.mk
package/libjpeg/libjpeg.pc.in [new file with mode: 0644]

index e5bd4544798029dbc0cf1f65f1177ee81737d33f..95663a9e00f7f79dbb9e115738c04a70028960c4 100644 (file)
@@ -18,5 +18,14 @@ endef
 
 LIBJPEG_POST_INSTALL_TARGET_HOOKS += LIBJPEG_REMOVE_USELESS_TOOLS
 
+define LIBJPEG_INSTALL_STAGING_PC
+       $(INSTALL) -D -m 0644 package/libjpeg/libjpeg.pc.in \
+               $(STAGING_DIR)/usr/lib/pkgconfig/libjpeg.pc
+       version=`sed -e '/^PACKAGE_VERSION/!d;s/PACKAGE_VERSION = \(.*\)/\1/' $(@D)/Makefile` ; \
+               $(SED) "s/@PACKAGE_VERSION@/$${version}/" $(STAGING_DIR)/usr/lib/pkgconfig/libjpeg.pc
+endef
+
+LIBJPEG_POST_INSTALL_STAGING_HOOKS += LIBJPEG_INSTALL_STAGING_PC
+
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))
diff --git a/package/libjpeg/libjpeg.pc.in b/package/libjpeg/libjpeg.pc.in
new file mode 100644 (file)
index 0000000..59220ca
--- /dev/null
@@ -0,0 +1,10 @@
+prefix=/usr
+exec_prefix=/usr
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: libjpeg
+Description: A JPEG codec that provides the libjpeg API
+Version: @PACKAGE_VERSION@
+Libs: -L${libdir} -ljpeg
+Cflags: -I${includedir}