[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#971625: libcups2-dev: please include a cups.pc for pkg-config



Package: libcups2-dev
Version: 2.3.3-3
Tags: patch
User: debian-cross@lists.debian.org
Usertags: ftcbfs
Control: affects -1 + src:gnome-settings-daemon

gnome-settings-daemon fails to cross build from source, because it
cannot locate cups. It uses meson to do so an meson attempts multiple
methods. First, it looks for a pkg-config file, but that's missing. Then
it tries cups-config, but those tools are often broken during cross
compilation, so it skips this unless specifically instructed. During
native builds, it locates cups using cups-config. Then it tries cmake
snippets, but those are also missing.

Since pkg-config is well-supported, I think cups should adopt it, too.
I'm attaching a patch that adds a basic cups.pc to the package without
integrating it into the upstream build, because this approach was a lot
simpler and it suffices to show that the solution makes
gnome-settings-daemon cross buildable. Integrating it upstream would
make sense anyhow if upstream agrees. The attached cups.pc is quite
minimal though and does not cover the full functionality that
cups-config provides. If going upstream, it would likely gain a little
more contant. Going upstream would also raise the question of how to
handle cups-config --libs --image. I suppose that this would be turned
into adding a separate cupsimage.pc. Likely, a proper solution involves
discussion with upstream.

Please consider applying and/or upstreaming the attached patch.

Helmut
diff --minimal -Nru cups-2.3.3/debian/changelog cups-2.3.3/debian/changelog
--- cups-2.3.3/debian/changelog	2020-09-03 09:27:04.000000000 +0200
+++ cups-2.3.3/debian/changelog	2020-10-03 11:14:42.000000000 +0200
@@ -1,3 +1,10 @@
+cups (2.3.3-3.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Provide a cups.pc file. (Closes: #-1)
+
+ -- Helmut Grohne <helmut@subdivi.de>  Sat, 03 Oct 2020 11:14:42 +0200
+
 cups (2.3.3-3) unstable; urgency=medium
 
   [ Didier Raboud ]
diff --minimal -Nru cups-2.3.3/debian/clean cups-2.3.3/debian/clean
--- cups-2.3.3/debian/clean	1970-01-01 01:00:00.000000000 +0100
+++ cups-2.3.3/debian/clean	2020-10-03 11:14:42.000000000 +0200
@@ -0,0 +1 @@
+debian/cups.pc
diff --minimal -Nru cups-2.3.3/debian/cups.pc.in cups-2.3.3/debian/cups.pc.in
--- cups-2.3.3/debian/cups.pc.in	1970-01-01 01:00:00.000000000 +0100
+++ cups-2.3.3/debian/cups.pc.in	2020-10-03 11:14:42.000000000 +0200
@@ -0,0 +1,7 @@
+Name: cups
+Description: cups application integration library
+URL: https://www.cups.org/
+Version: @DEB_VERSION_UPSTREAM@
+Cflags:
+Libs: -lcups
+Libs.private:
diff --minimal -Nru cups-2.3.3/debian/rules cups-2.3.3/debian/rules
--- cups-2.3.3/debian/rules	2020-09-03 09:27:04.000000000 +0200
+++ cups-2.3.3/debian/rules	2020-10-03 11:14:42.000000000 +0200
@@ -16,6 +16,7 @@
 export DSOFLAGS = $(shell dpkg-buildflags --get LDFLAGS)
 
 include /usr/share/dpkg/architecture.mk
+include /usr/share/dpkg/pkg-info.mk
 
 %:
 	dh $@ --without autoreconf
@@ -188,6 +189,9 @@
 ifneq (,$(filter libcups2-dev,$(shell dh_listpackages)))
 	# debian/libcups2-dev.install entry cannot rename files on-the-fly
 	cp cups/language-private.h debian/libcups2-dev/usr/include/cups/i18n.h
+	# debian/libcups2-dev.install cannot interpolate before compat 13
+	sed -e 's/@DEB_VERSION_UPSTREAM@/${DEB_VERSION_UPSTREAM}/' < debian/cups.pc.in > debian/cups.pc
+	install -D -m 644 debian/cups.pc debian/libcups2-dev/usr/lib/${DEB_HOST_GNU_TYPE}/pkgconfig/cups.pc
 endif
 
 ifneq (,$(filter cups-daemon,$(shell dh_listpackages)))

Reply to: