Control: tags -1 patch

Hi,

It looks like the gsettings-backend dependency was introduced since
Emacs 29.1.  Tried to debug this a little, and it looks like the
dependencies was pulled in through ${misc:Depends} due to the GSettings
schema file[1].  With helps from folks on IRC, we found that this file
was installed only in PGTK mode[2], so technically this is not required
by other modes and should be safe to be moved from emacs-common to
emacs-pgtk.

I have prepared a MR[3] (patch also attached) as an attempt and verified
that it moved the "dconf-gsettings-backend | gsettings-backend" from
emacs-common to emacs-pgtk.  I'll try to use this locally with emacs-nox
to further verify that it doesn't cause any issues.

Meanwhile, would be great to have people review the patch.  TIA!

[1] Search for
    "/usr/share/glib-2.0/schemas/org.gnu.emacs.defaults.gschema.xml" on
    https://packages.debian.org/sid/all/emacs-common/filelist

[2] 
https://salsa.debian.org/rlb/deb-emacs/-/blob/deb/emacs/d/sid/master/Makefile.in?ref_type=heads#L1334-1337

[3] https://salsa.debian.org/rlb/deb-emacs/-/merge_requests/12

-- 
Xiyue Deng
>From f52a28d269f9e9698347c3a7a4c7d3cc531c166c Mon Sep 17 00:00:00 2001
From: Xiyue Deng <manp...@gmail.com>
Date: Wed, 13 Mar 2024 10:22:46 -0700
Subject: [PATCH] Install GSettings schema in pgtk build only (Closes:
 #1050393)

* In PGTK build it generates the GSettings schema file
"/usr/share/glib-2.0/schemas/org.gnu.emacs.defaults.gschema.xml" which
is not needed in other variant.
* Move the file from emacs-common to emacs-pgtk, and adds proper
breaks/replaces/conflicts to ensure a smooth upgrade.
---
 debian/changelog |  7 +++++++
 debian/control   | 10 ++++++++--
 debian/rules     |  9 ++++++++-
 3 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index c53984fc648..960672b6297 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+emacs (1:29.2+1-3) UNRELEASED; urgency=medium
+
+  * Team upload.
+  * Install GSettings schema in pgtk build only (Closes: #1050393)
+
+ -- Xiyue Deng <manp...@gmail.com>  Wed, 13 Mar 2024 10:22:10 -0700
+
 emacs (1:29.2+1-2) unstable; urgency=medium
 
   * Fix Breaks/Replaces by prepending missing epoch (Closes: #1064851)
diff --git a/debian/control b/debian/control
index e168717089f..a2b65b26329 100644
--- a/debian/control
+++ b/debian/control
@@ -138,8 +138,13 @@ Provides: editor, emacs, emacsen, info-browser, mail-reader, news-reader
 Recommends: fonts-noto-color-emoji
 Suggests: emacs-common-non-dfsg
 Conflicts: emacs-gtk, emacs-lucid, emacs-nox
-Replaces: emacs-gtk, emacs-lucid, emacs-nox, emacs-bin-common (<< 1:29.2)
-Breaks: emacs-bin-common (<< 1:29.2)
+Replaces:
+ emacs-gtk,
+ emacs-lucid,
+ emacs-nox,
+ emacs-bin-common (<< 1:29.2),
+ emacs-common (<< 1:29.2+1-3),
+Breaks: emacs-bin-common (<< 1:29.2), emacs-common (<< 1:29.2+1-3)
 Description: GNU Emacs editor (with GTK+ Wayland GUI support)
  GNU Emacs is the extensible self-documenting text editor.  This
  package contains a version of Emacs with a graphical user interface
@@ -184,6 +189,7 @@ Breaks:
  emacs-gtk (<< 1:25),
  emacs-lucid (<< 1:25),
  emacs-nox (<< 1:25),
+ emacs-pgtk (<< 1:29.2+1-3),
 Replaces:
  emacs-bin-common (<< 1:28)
 Description: GNU Emacs editor's shared, architecture independent infrastructure
diff --git a/debian/rules b/debian/rules
index 38965316f3d..8448d7c9be3 100755
--- a/debian/rules
+++ b/debian/rules
@@ -425,6 +425,9 @@ override_dh_auto_install: $(autogen_install_files)
 	  cp -a $(install_dir_pgtk)/* $(pkgdir_common)
 
 	  rm -r $(pkgdir_common)/usr/bin
+	  # PGTK builds a GSettings schema that is PGTK specific and
+	  # should not be shipped in emacs-common
+	  rm -r $(pkgdir_common)/usr/share/glib-2.0
 	  rm \
 	    $(pkgdir_common)/$(libexec_dir_emacs)/hexl \
 	    $(pkgdir_common)/$(libexec_dir_emacs)/emacs-*.pdmp \
@@ -548,7 +551,7 @@ override_dh_auto_install: $(autogen_install_files)
 
         ##################################################
         # emacs-pgtk
-        ifneq (,$(findstring emacs, $(shell dh_listpackages)))
+        ifneq (,$(findstring emacs-pgtk, $(shell dh_listpackages)))
 	  $(call install_common_binpkg_bits,$(install_dir_pgtk),$(pkgdir_pgtk),emacs-pgtk,pgtk)
 
           # install desktop entries
@@ -557,6 +560,10 @@ override_dh_auto_install: $(autogen_install_files)
 	    debian/emacs.desktop \
 	    debian/emacs-term.desktop \
 	    $(pkgdir_pgtk)/usr/share/applications/
+	  # install GSettings schema
+	  install -d $(pkgdir_pgtk)/usr/share/glib-2.0
+	  cp -a $(install_dir_pgtk)/usr/share/glib-2.0/* \
+	    $(pkgdir_pgtk)/usr/share/glib-2.0
         endif
 
         ##################################################
-- 
2.39.2

Reply via email to