Source: libgphoto2
Version: 2.5.31-2.1
Severity: wishlist
Tags: patch

I noticed that libgphoto2 was blocking some of the rebuilds that are needed
for the 64-bit time_t transition, and was itself not buildable because it
was waiting for graphviz. This has now been resolved, but if libgphoto2 had
fewer build-dependencies, then it could have been built sooner.

Please consider applying the attached patches, also available as
<https://salsa.debian.org/debian-phototools-team/libgphoto2/-/merge_requests/7>.

I have confirmed (using diffoscope) that building with -Pnodoc,nocheck
skips installation of various build-dependencies, and skips production
of the -dev-doc package, but does not otherwise affect the package's
contents.

Thanks,
    smcv
>From 21d265c1b839fcfa0933ddb963788b7f5f9662f1 Mon Sep 17 00:00:00 2001
From: Simon McVittie <s...@debian.org>
Date: Thu, 21 Mar 2024 17:29:31 +0000
Subject: [PATCH 1/3] d/control: Only require graphviz for Architecture: all
 builds

This reduces the length of dependency chains for bootstrapping or
re-bootstrapping architectures, for example during the 64-bit time_t
transition.
---
 debian/control | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/debian/control b/debian/control
index 5847c3c3e..fe7539ff4 100644
--- a/debian/control
+++ b/debian/control
@@ -5,7 +5,6 @@ Maintainer: Debian PhotoTools Maintainers <pkg-phototools-de...@alioth-lists.deb
 Uploaders:
  Ferenc Wágner <wf...@debian.org>,
 Build-Depends: dpkg-dev (>= 1.22.5), debhelper-compat (= 13),
-               graphviz,
                libcurl4-openssl-dev,
                libexif-dev,
                libgd-dev,
@@ -20,6 +19,7 @@ Build-Depends: dpkg-dev (>= 1.22.5), debhelper-compat (= 13),
                zlib1g-dev
 Build-Depends-Indep:
  doxygen,
+ graphviz,
 Build-Conflicts: liblockdev1-dev
 Rules-Requires-Root: no
 Standards-Version: 4.6.2
-- 
2.43.0

>From c1605a2af5e0f048fafc6fee788506db4633e6ba Mon Sep 17 00:00:00 2001
From: Simon McVittie <s...@debian.org>
Date: Thu, 21 Mar 2024 17:30:05 +0000
Subject: [PATCH 2/3] d/control, d/rules: Only run rdfind and symlinks if we
 built documentation

---
 debian/control | 4 ++--
 debian/rules   | 4 ++++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/debian/control b/debian/control
index fe7539ff4..652ed43a5 100644
--- a/debian/control
+++ b/debian/control
@@ -14,12 +14,12 @@ Build-Depends: dpkg-dev (>= 1.22.5), debhelper-compat (= 13),
                libusb-1.0-0-dev,
                libxml2-dev,
                pkg-config,
-               rdfind,
-               symlinks,
                zlib1g-dev
 Build-Depends-Indep:
  doxygen,
  graphviz,
+ rdfind,
+ symlinks,
 Build-Conflicts: liblockdev1-dev
 Rules-Requires-Root: no
 Standards-Version: 4.6.2
diff --git a/debian/rules b/debian/rules
index b3fcf7ce8..b3c9ee7f0 100755
--- a/debian/rules
+++ b/debian/rules
@@ -6,6 +6,8 @@ DOC_IMG=$(CURDIR)/debian/libgphoto2-dev-doc/usr/share/doc/libgphoto2-6t64/libgph
 
 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
 
+built_binaries := $(shell dh_listpackages)
+
 ### soname version - libgphoto2-major:
 major=6t64
 
@@ -27,9 +29,11 @@ override_dh_install:
 		mkdir -p debian/libgphoto2-port12t64/lib/udev && \
 		mv debian/tmp/usr/lib/udev/check-mtp-device \
 			debian/libgphoto2-port12t64/lib/udev/check-mtp-device
+ifneq ($(filter %-doc,$(built_binaries)),)
 	# Using rdfind and symlinks to transform duplicated files in softlinks
 	rdfind -makesymlinks true -makeresultsfile false $(DOC_IMG)
 	symlinks -cr $(DOC_IMG)
+endif
 
 ifeq ($(DEB_HOST_ARCH_OS),linux)
 override_dh_installudev:
-- 
2.43.0

>From 4e750496fdbfb0fa64bc2d92b52bf6b3a5dad14b Mon Sep 17 00:00:00 2001
From: Simon McVittie <s...@debian.org>
Date: Thu, 21 Mar 2024 17:31:05 +0000
Subject: [PATCH 3/3] d/control: Don't build -dev-doc package under nodoc
 build-profile

This allows the -l10n package to be built without also needing to build
developer documentation.
---
 debian/control | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/debian/control b/debian/control
index 652ed43a5..268997c39 100644
--- a/debian/control
+++ b/debian/control
@@ -16,10 +16,10 @@ Build-Depends: dpkg-dev (>= 1.22.5), debhelper-compat (= 13),
                pkg-config,
                zlib1g-dev
 Build-Depends-Indep:
- doxygen,
- graphviz,
- rdfind,
- symlinks,
+ doxygen <!nodoc>,
+ graphviz <!nodoc>,
+ rdfind <!nodoc>,
+ symlinks <!nodoc>,
 Build-Conflicts: liblockdev1-dev
 Rules-Requires-Root: no
 Standards-Version: 4.6.2
@@ -45,6 +45,7 @@ Description: gphoto2 digital camera library (development files)
  This package contains the development files.
 
 Package: libgphoto2-dev-doc
+Build-Profiles: <!nodoc>
 Section: doc
 Architecture: all
 Multi-Arch: foreign
-- 
2.43.0

Reply via email to