Skip to content

dh_gnome_clean: Add --variable-substitution to use dh substitutions in control

Debhelper 13 supports variable sobstitution for many files, but not for the control files, as these are generally not meant to be generated.

However in the GNOME packages we do it, and having a debian/control.in opens us some more possibilities like the ability to generate some hardcoded (for example the API version of a package) values on clean.

As per this, introduce the --variable-substitution parameter to dh_gnome_clean that when used (on debhelper >= 13) will parse the control file using the supported debhelper substitutions.


Will allow, exporting debian/rules a MUTTER_API_VERSION=7 and enabling the --variable-substitution parameter to get the result below.
The only not-too nice bit is the ${Dollar} presence, but this could be removed (by leaving the various ${misc:Depends} around as they are) using debian/debhelper!41.


diff --git a/debian/control.in b/debian/control.in
index 2158521c3..8e8b97ee1 100644
--- a/debian/control.in
+++ b/debian/control.in
@@ -81,10 +81,10 @@ Architecture: any
 Depends: adwaita-icon-theme,
          gnome-settings-daemon-common,
          gsettings-desktop-schemas (>= 3.37.2),
-         mutter-common (>= ${source:Version}),
+         mutter-common (>= ${Dollar}{source:Version}),
          zenity,
-         ${misc:Depends},
-         ${shlibs:Depends}
+         ${Dollar}{misc:Depends},
+         ${Dollar}{shlibs:Depends}
 Provides: x-window-manager
 Suggests: gnome-control-center (>= 1:3.25.2),
           xdg-user-dirs
@@ -101,14 +101,14 @@ Description: Example window manager using GNOME's window manager library
  This package contains the mutter executable. It can be used as a
  standalone window manager, but is primarily intended for debugging.
 
-Package: gir1.2-mutter-6
+Package: gir1.2-mutter-${env:MUTTER_API_VERSION}
 Section: introspection
 Architecture: any
 Multi-Arch: same
-Depends: libmutter-6-0 (= ${binary:Version}),
-         ${gir:Depends},
-         ${misc:Depends},
-         ${shlibs:Depends}
+Depends: libmutter-${env:MUTTER_API_VERSION}-0 (= ${Dollar}{binary:Version}),
+         ${Dollar}{gir:Depends},
+         ${Dollar}{misc:Depends},
+         ${Dollar}{shlibs:Depends}
 Description: GObject introspection data for Mutter
  Mutter is a Wayland display server and X11 window manager and
  compositor library. It contains functionality related to, among other
@@ -122,16 +122,16 @@ Description: GObject introspection data for Mutter
  This package contains the GObject introspection data which may be
  used to generate dynamic bindings.
 
-Package: libmutter-6-0
+Package: libmutter-${env:MUTTER_API_VERSION}-0
 Section: libs
 Architecture: any
 Multi-Arch: same
-Pre-Depends: ${misc:Pre-Depends}
+Pre-Depends: ${Dollar}{misc:Pre-Depends}
 Depends: adwaita-icon-theme,
          gsettings-desktop-schemas (>= 3.37.2),
-         mutter-common (>= ${source:Version}),
-         ${misc:Depends},
-         ${shlibs:Depends}
+         mutter-common (>= ${Dollar}{source:Version}),
+         ${Dollar}{misc:Depends},
+         ${Dollar}{shlibs:Depends}
 Breaks: apparmor (<< 2.13.3-5~),
         gnome-control-center (<< 1:3.25.2),
         gnome-settings-daemon (<< 3.31.91),
@@ -149,11 +149,11 @@ Description: window manager library from the Mutter window manager
  This package contains the window manager shared library, used by mutter
  itself, and gnome-shell.
 
-Package: libmutter-6-dev
+Package: libmutter-${env:MUTTER_API_VERSION}-dev
 Section: libdevel
 Architecture: any
 Multi-Arch: same
-Depends: gir1.2-mutter-6 (= ${binary:Version}),
+Depends: gir1.2-mutter-${env:MUTTER_API_VERSION} (= ${Dollar}{binary:Version}),
          gsettings-desktop-schemas-dev (>= 3.37.2),
          libatk1.0-dev,
          libcairo2-dev,
@@ -167,7 +167,7 @@ Depends: gir1.2-mutter-6 (= ${binary:Version}),
          libgtk-3-dev,
          libinput-dev (>= 1.7),
          libjson-glib-dev,
-         libmutter-6-0 (= ${binary:Version}),
+         libmutter-${env:MUTTER_API_VERSION}-0 (= ${Dollar}{binary:Version}),
          libpango1.0-dev,
          libudev-dev,
          libwayland-dev,
@@ -178,7 +178,7 @@ Depends: gir1.2-mutter-6 (= ${binary:Version}),
          libxfixes-dev,
          libxi-dev,
          libxrandr-dev,
-         ${misc:Depends}
+         ${Dollar}{misc:Depends}
 Conflicts: libmutter-0-dev,
            libmutter-1-dev,
            libmutter-2-dev,
@@ -198,7 +198,7 @@ Package: mutter-common
 Section: misc
 Architecture: all
 Multi-Arch: foreign
-Depends: ${misc:Depends}
+Depends: ${Dollar}{misc:Depends}
 Description: shared files for the Mutter window manager
  Mutter is a Wayland display server and X11 window manager and
  compositor library. It contains functionality related to, among other
Edited by Marco Trevisan

Merge request reports

Loading