d/control.in: Only use libsysprof-capture-4-dev for shared library
authorSimon McVittie <smcv@debian.org>
Sun, 6 Aug 2023 11:51:25 +0000 (12:51 +0100)
committerSimon McVittie <smcv@debian.org>
Sun, 6 Aug 2023 11:58:58 +0000 (12:58 +0100)
libsysprof-capture-4-dev is currently a virtual package provided by
libsysprof-4-dev, which also includes GTK 4 GUI components and so depends
on libgtk-4-dev. If the Architecture: amd64 build happens to finish before
the Architecture: all build starts, then the Architecture: all build will
fail with an unsatisfiable build-dependency: libsysprof-4-dev Depends on
libgtk-4-dev, which Depends on libgtk-4-common (>= ${source:Version}),
which hasn't been built yet. The result is that libgtk-4-common can't
be built and the builds deadlock. We've been lucky enough to avoid this
until now, but version 4.10.5+ds-1 was not sufficiently lucky and has
become uninstallable and unbuildable.

Because the sysprof integration is part of the architecture-specific
library, we can break this cycle by only installing libsysprof-4-dev when
we are building the architecture-specific library, and excluding it
when we are only building architecture-independent documentation and
common files.

debian/control
debian/control.in
debian/rules

index eae4f6fa26f9de5937a710cc517bb5d801980709..447a8ff6dfdd22a8fef28f5dc8fc4ee439f1cdaa 100644 (file)
@@ -2,7 +2,7 @@ Source: gtk4
 Section: libs
 Priority: optional
 Maintainer: Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org>
-Uploaders: Simon McVittie <smcv@debian.org>, 
+Uploaders: Simon McVittie <smcv@debian.org>, Jeremy Bícha <jbicha@ubuntu.com>, Marco Trevisan (Treviño) <marco@ubuntu.com>
 Build-Depends: adwaita-icon-theme <!nocheck>,
                at-spi2-core <!nocheck>,
                dbus-daemon <!nocheck>,
@@ -43,7 +43,6 @@ Build-Depends: adwaita-icon-theme <!nocheck>,
                librsvg2-dev (>= 2.52.0) [amd64 arm64 armel armhf i386 mips64el mipsel ppc64el s390x powerpc ppc64 riscv64 sparc64 x32],
                libswresample-dev [amd64 arm64 armel armhf i386 mips64el mipsel ppc64el s390x],
                libswscale-dev [amd64 arm64 armel armhf i386 mips64el mipsel ppc64el s390x],
-               libsysprof-capture-4-dev (>= 3.40.1) [linux-any],
                libtiff-dev,
                libvulkan-dev [linux-any],
                libwayland-dev (>= 1.21.0) [linux-any],
@@ -70,6 +69,7 @@ Build-Depends: adwaita-icon-theme <!nocheck>,
                weston [linux-any] <!nocheck>,
                xauth <!nocheck>,
                xvfb <!nocheck>,
+Build-Depends-Arch: libsysprof-capture-4-dev (>= 3.40.1) [linux-any],
 Build-Depends-Indep: gi-docgen <!nodoc>,
                      libcairo2-doc <!nodoc>,
                      libglib2.0-doc <!nodoc>,
index aeceebc493927f7d8743c14d7ad524aa8d773709..e638368298937d583571caca6fc40ecfda3e4b44 100644 (file)
@@ -43,7 +43,6 @@ Build-Depends: adwaita-icon-theme <!nocheck>,
                librsvg2-dev (>= 2.52.0) [amd64 arm64 armel armhf i386 mips64el mipsel ppc64el s390x powerpc ppc64 riscv64 sparc64 x32],
                libswresample-dev [amd64 arm64 armel armhf i386 mips64el mipsel ppc64el s390x],
                libswscale-dev [amd64 arm64 armel armhf i386 mips64el mipsel ppc64el s390x],
-               libsysprof-capture-4-dev (>= 3.40.1) [linux-any],
                libtiff-dev,
                libvulkan-dev [linux-any],
                libwayland-dev (>= 1.21.0) [linux-any],
@@ -70,6 +69,7 @@ Build-Depends: adwaita-icon-theme <!nocheck>,
                weston [linux-any] <!nocheck>,
                xauth <!nocheck>,
                xvfb <!nocheck>,
+Build-Depends-Arch: libsysprof-capture-4-dev (>= 3.40.1) [linux-any],
 Build-Depends-Indep: gi-docgen <!nodoc>,
                      libcairo2-doc <!nodoc>,
                      libglib2.0-doc <!nodoc>,
index 00410fdc06d02abadf96e3153a2fb541cd0ce0dd..a6c975c5019548cdac5c8677f65f3875eb4b03a1 100755 (executable)
@@ -93,14 +93,24 @@ configure_flags_deb += -Dman-pages=false
 endif
 
 ifeq (linux,$(DEB_HOST_ARCH_OS))
-configure_flags_deb += -Dsysprof=enabled
 configure_flags_deb += -Dwayland-backend=true
 else
-configure_flags_deb += -Dsysprof=disabled
 configure_flags_deb += -Dvulkan=disabled
 configure_flags_deb += -Dwayland-backend=false
 endif
 
+# Only enable sysprof if we are actually going to package the shared library.
+# Otherwise, if the Architecture: amd64 buildd happens to build gtk4
+# before the Architecture: all buildd, the Architecture: all buildd
+# will find that there is an unsatisfiable build-dependency:
+# libsysprof-4-dev => libgtk-4-dev => libgtk-4-common (>= ${source:Version}),
+# which has not been built yet.
+ifeq (linux/$(SHARED_PKG),$(DEB_HOST_ARCH_OS)/$(filter $(SHARED_PKG),$(built_binaries)))
+configure_flags_deb += -Dsysprof=enabled
+else
+configure_flags_deb += -Dsysprof=disabled
+endif
+
 ifeq ($(filter %-doc,$(built_binaries)),)
 configure_flags_deb += -Dgtk_doc=false
 else