Substitute GTK_BINVER_DEP as a substvar rather than using sed
authorSimon McVittie <smcv@debian.org>
Thu, 2 Nov 2023 14:22:54 +0000 (14:22 +0000)
committerSimon McVittie <smcv@debian.org>
Thu, 2 Nov 2023 14:22:54 +0000 (14:22 +0000)
This will make it easier to stop making d/control a generated file.

debian/control
debian/control.in
debian/rules

index e70cf55e12550aefa65d1b7574a599db4f46d45b..48066c0a5aa504d32de3be8752e9530a49a0f4f8 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>, Amin Bandali <bandali@ubuntu.com>, Jeremy Bícha <jbicha@ubuntu.com>, Marco Trevisan (Treviño) <marco@ubuntu.com>
+Uploaders: Simon McVittie <smcv@debian.org>, Amin Bandali <bandali@ubuntu.com>, Jeremy Bícha <jbicha@ubuntu.com>
 Build-Depends: adwaita-icon-theme <!nocheck>,
                at-spi2-core <!nocheck>,
                dbus-daemon <!nocheck>,
@@ -89,7 +89,7 @@ Depends: adwaita-icon-theme,
          ${misc:Depends},
          ${shlibs:Depends},
          libgtk-4-common (>= ${source:Version})
-Provides: gtk4-binver-4.0.0
+Provides: ${gtk:Provides}
 Recommends: libgtk-4-bin,
             iso-codes,
             librsvg2-common (>= 2.52.0),
@@ -113,7 +113,7 @@ Section: debian-installer
 Architecture: any
 Depends: ${misc:Depends},
          ${shlibs:Depends}
-Provides: gtk4-binver-4.0.0
+Provides: ${gtk:Provides}
 Description: GTK graphical user interface library - minimal runtime
  This is a udeb, or a microdeb, for the debian-installer.
  .
index b05f748358d17a9ae7978d8d3ed3e00393fac204..5076881d73f9e0ee53715f4d4f62fd77a478f1eb 100644 (file)
@@ -89,7 +89,7 @@ Depends: adwaita-icon-theme,
          ${misc:Depends},
          ${shlibs:Depends},
          @COMMON_PKG@ (>= ${source:Version})
-Provides: @GTK_BINVER_DEP@
+Provides: ${gtk:Provides}
 Recommends: @BIN_PKG@,
             iso-codes,
             librsvg2-common (>= 2.52.0),
@@ -113,7 +113,7 @@ Section: debian-installer
 Architecture: any
 Depends: ${misc:Depends},
          ${shlibs:Depends}
-Provides: @GTK_BINVER_DEP@
+Provides: ${gtk:Provides}
 Description: GTK graphical user interface library - minimal runtime
  This is a udeb, or a microdeb, for the debian-installer.
  .
index a9704ab628297c11290cbe5b716721bd5a90382b..5ff67f457d135d993cd34c04cf90fff526e36585 100755 (executable)
@@ -23,9 +23,6 @@ export LIBDIR := usr/lib/$(DEB_HOST_MULTIARCH)
 # earliest version that this release has backwards binary compatibility for
 export GTK_BINARY_VERSION := 4.0.0
 
-# Gtk binary version virtual Provide
-export GTK_BINVER_DEP := gtk$(APIVER)-binver-$(GTK_BINARY_VERSION)
-
 # relative base directory for configuration
 export CONFDIR := etc/gtk-4.0
 
@@ -57,7 +54,6 @@ debian/%: debian/%.in
        sed \
                -e "s#@SONAME@#$(SONAME)#g" \
                -e "s#@APIVER@#$(APIVER)#g" \
-               -e "s#@GTK_BINVER_DEP@#$(GTK_BINVER_DEP)#g" \
                -e "s#@SHARED_PKG@#$(SHARED_PKG)#g" \
                -e "s#@COMMON_PKG@#$(COMMON_PKG)#g" \
                -e "s#@DEV_PKG@#$(DEV_PKG)#g" \
@@ -332,3 +328,12 @@ override_dh_installdocs:
 override_dh_makeshlibs:
        dh_makeshlibs -p$(SHARED_PKG) -V --add-udeb=$(UDEB_PKG) -X$(MODULES_BASE_PATH) -- -c4
        dh_makeshlibs --remaining-packages -X$(MODULES_BASE_PATH)
+
+override_dh_gencontrol-arch:
+       dh_gencontrol -p$(SHARED_PKG) -- \
+               -Vgtk:Provides=gtk$(APIVER)-binver-$(GTK_BINARY_VERSION)
+ifneq ($(filter %-udeb,$(built_binaries)),)
+       dh_gencontrol -p$(UDEB_PKG) -- \
+               -Vgtk:Provides=gtk$(APIVER)-binver-$(GTK_BINARY_VERSION)
+endif
+       dh_gencontrol --remaining-packages