Skip to contentSkip to conversation

libjpeg: add pkg-config file for libjpeg

PATCH New Olivier Schonken 2 participants 2 messages Oct 23, 2017 – Jan 8, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libjpeg: add pkg-config file for libjpeg

---
This change is necessary to successfully build cups-filters with either libjpeg-turbo or libjpeg

 package/libjpeg/libjpeg.mk |  7 +++++++
 package/libjpeg/libjpeg.pc | 10 ++++++++++
 2 files changed, 17 insertions(+)
 create mode 100644 package/libjpeg/libjpeg.pc
package/libjpeg/libjpeg.mk +7 -0
index e5bd454479..9e8380f44c 100644
@@ -16,6 +16,13 @@ define LIBJPEG_REMOVE_USELESS_TOOLS
 	rm -f $(addprefix $(TARGET_DIR)/usr/bin/,cjpeg djpeg jpegtran rdjpgcom wrjpgcom)
 endef
 
+define LIBJPEG_INSTALL_STAGING_PC
+	$(INSTALL) -D package/libjpeg/libjpeg.pc \
+		$(STAGING_DIR)/usr/lib/pkgconfig/libjpeg.pc
+endef
+
+LIBJPEG_POST_INSTALL_STAGING_HOOKS += LIBJPEG_INSTALL_STAGING_PC
+
 LIBJPEG_POST_INSTALL_TARGET_HOOKS += LIBJPEG_REMOVE_USELESS_TOOLS
 
 $(eval $(autotools-package))
package/libjpeg/libjpeg.pc new file +10 -0
new file mode 100644
index 0000000000..41cd21ce64
@@ -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: 9.2.0
+Libs: -L${libdir} -ljpeg
+Cflags: -I${includedir}
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/1 libjpeg: add pkg-config file for libjpeg

Hello,

Quoted 16 lines · Olivier Schonken

---
This change is necessary to successfully build cups-filters with either libjpeg-turbo or libjpeg

 package/libjpeg/libjpeg.mk |  7 +++++++
 package/libjpeg/libjpeg.pc | 10 ++++++++++
 2 files changed, 17 insertions(+)
 create mode 100644 package/libjpeg/libjpeg.pc
package/libjpeg/libjpeg.mk +0 -0
index e5bd454479..9e8380f44c 100644
@@ -16,6 +16,13 @@ define LIBJPEG_REMOVE_USELESS_TOOLS
 	rm -f $(addprefix $(TARGET_DIR)/usr/bin/,cjpeg djpeg jpegtran rdjpgcom wrjpgcom)

package/libjpeg/libjpeg.mk define LIBJPEG_REMOVE_USELESS_TOOLS · line 26

Quoted 10 lines
package/libjpeg/libjpeg.mk +7 -0
 endef
 
+define LIBJPEG_INSTALL_STAGING_PC
+	$(INSTALL) -D package/libjpeg/libjpeg.pc \
+		$(STAGING_DIR)/usr/lib/pkgconfig/libjpeg.pc
+endef
+
+LIBJPEG_POST_INSTALL_STAGING_HOOKS += LIBJPEG_INSTALL_STAGING_PC
+
 LIBJPEG_POST_INSTALL_TARGET_HOOKS += LIBJPEG_REMOVE_USELESS_TOOLS

It is better to group the hook registration with the definition of the hook itself, so I've tweaked this.

Quoted 8 lines
package/libjpeg/libjpeg.mk +0 -0
 $(eval $(autotools-package))
package/libjpeg/libjpeg.pc new file +0 -0
new file mode 100644
index 0000000000..41cd21ce64

package/libjpeg/libjpeg.pc line 8

Quoted 8 lines
package/libjpeg/libjpeg.pc new file +8 -0
@@ -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: 9.2.0

I was not totally happy with this hardcoded version, so I've changed that to some SED logic in the .mk file to get the version from the libjpeg source code.

I hesitated doing a patch to libjpeg instead, but I'm not sure upstream would have accepted it, and it would have meant keeping autoreconf forever.

So, I've applied your patch after some tweaks. Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com