Xiyue Deng <[email protected]> writes: > Sean Whitton <[email protected]> writes: > >> Hello, >> >> On Thu 19 Jun 2025 at 05:16pm -07, Xiyue Deng wrote: >> >>> Sean Whitton <[email protected]> writes: >>> >>>> Hello, >>>> >>>> On Wed 18 Jun 2025 at 07:07pm -07, Xiyue Deng wrote: >>>> >>>>> Ah didn't think about that. I think it's better than using control.in >>>>> in general, though there are the "unused" warning on other packages >>>>> (using "?=" doesn't seem to help). >>>> >>>> I don't follow. >>>> >>> >>> Excerpt from build log (basically it shows a warning of substitution >>> variable unused for all binary packages except emacs-common where it's >>> used.) >> >> Ah, I see. Could you define it as the empty string for those packages >> and then add a dummy entry to Provides ? >> > > It turns out debian/substvars and debian/<package>.substvars are indeed > regenerated during build. So I figured I can just update > debian/emacs-common.substvars with the generated contents right before > dh_gencontrol, and it worked. > > Updated in my branch[1]. Hope the builtin package info public > interfaces will be accepted upstream soon. >
It looks like the upstream discussion[1] may still go on for a while: the direction has consensus, while the details of the functions are still under discussion. In the meantime, I wonder whether we can move forward on the Debian side and have this in Trixie (with an unblock request), which will help users who upgrade from Bookworm avoid surprises when older versions of addons are installed. My branch[2] is updated to the latest version of upstream bug. Patches are also attached. > [...] [1] https://debbugs.gnu.org/78844 [2] https://salsa.debian.org/manphiz/deb-emacs/-/compare/deb%2Femacs%2Fd%2Fsid%2Fmaster...generate-provide-package-list?from_project_id=83361 -- Regards, Xiyue Deng
From 067400bde573a2b690abbc541addfb8f3cb04604 Mon Sep 17 00:00:00 2001 From: Xiyue Deng <[email protected]> Date: Mon, 16 Jun 2025 17:09:48 -0700 Subject: [PATCH 1/4] Add script to generate substvars for Emacs builtin packages --- .../generate-bundled-package-provide-list.el | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 debian/generate-bundled-package-provide-list.el diff --git a/debian/generate-bundled-package-provide-list.el b/debian/generate-bundled-package-provide-list.el new file mode 100644 index 00000000000..f6968a8db16 --- /dev/null +++ b/debian/generate-bundled-package-provide-list.el @@ -0,0 +1,96 @@ +;; Emacs script to generate a package provide list -*- lexical-binding:t -*- + +(defvar package-skip-list + '("elpa-emacs") + "A list of package that should be skipped in the provide list") + +(defvar emacs-provided-package-versions nil + "An alist of Debian package name to version. +You should call the function version to get the values instead.") + +(when (not (fboundp 'package-versioned-builtin-packages)) + (defun package-versioned-builtin-packages () + "Return a list of all the versioned built-in packages. +The return value is a list of names of built-in packages represented as +symbols." + (mapcar #'car package--builtin-versions))) + +(when (not (fboundp 'package-builtin-package-version)) + (defun package-builtin-package-version (package) + "Return the version of a built-in PACKAGE given by its symbol. +The return value is a list of integers representing the version of +PACKAGE, in the format returned by `version-to-list', or nil if the +package is built-in but has no version or is not a built-in package." + (alist-get package package--builtin-versions))) + +(defun package-version-list-to-string (package-version-list) + "Convert a package version list to version string acceptable in Debian." + (when package-version-list + (let ((count 0) + version-list) + (dolist (item package-version-list) + (progn + (if (< item 0) + (progn + ;; This roughly matches the mapping in + ;; version-regexp-alist. + (cl-case item + (-1 (push "~rc" version-list)) + (-2 (push "~beta" version-list)) + (-3 (push "~alpha" version-list)) + (-4 (push "~snapshot" version-list)) + (t (error "Unknown version: %d" item))) + ;; no "." between prerelease name and number + (setq count 0)) + (when (> count 0) + (push "." version-list)) + (push (number-to-string item) version-list) + (cl-incf count)))) + (string-join (nreverse version-list))))) + +(defun emacs-provided-package-versions () + "Returns the calculated EMACS-PROVIDED-PACKAGE-VERSIONS." + (if emacs-provided-package-versions + emacs-provided-package-versions + (mapc (lambda (package-name) + (let* ((debian-package-name (concat "elpa-" + (symbol-name package-name))) + (debian-package-version (package-version-list-to-string + (package-builtin-package-version + package-name)))) + (when (not (member debian-package-name package-skip-list)) + (push `(,debian-package-name . ,debian-package-version) + emacs-provided-package-versions)))) + (package-versioned-builtin-packages)) + (sort emacs-provided-package-versions))) + +(princ "# Package name and version on each line in comments for tracking.\n#\n") +(let (provides-substvars-list + replaces-substvars-list + (count 0)) + (mapc (lambda (package-version) + (let* ((name (car package-version)) + (version (cdr package-version)) + (provides-entry-string (concat name + (when version + (format " (= %s)" version)) + ",")) + (replaces-entry-string (concat name + (when version + (format " (<< %s)" version)) + ","))) + (princ (format "# %s\n" provides-entry-string)) + (when (> count 0) + (push " " provides-substvars-list) + (push " " replaces-substvars-list)) + (push provides-entry-string provides-substvars-list) + (push replaces-entry-string replaces-substvars-list) + (cl-incf count))) + (emacs-provided-package-versions)) + (let ((debian-provides-substvars-string + (string-join (nreverse provides-substvars-list))) + (debian-replaces-substvars-string + (string-join (nreverse replaces-substvars-list)))) + (princ (format "emacs:Provides=%s\n" debian-provides-substvars-string)) + (princ (format "emacs:Breaks=%s\n" debian-replaces-substvars-string)) + (princ (format "emacs:Replaces=%s\n" debian-replaces-substvars-string)))) -- 2.47.2
From 611ec6e5f12e4fe6ae06a0eee46e1fa0770c5e70 Mon Sep 17 00:00:00 2001 From: Xiyue Deng <[email protected]> Date: Wed, 18 Jun 2025 13:28:04 -0700 Subject: [PATCH 2/4] Add rule to generate debian/emacs-common-substvars in debian/rules --- debian/rules | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index 18de17ac996..084b0a5dd0e 100755 --- a/debian/rules +++ b/debian/rules @@ -221,7 +221,11 @@ check-vars: .PHONY: check-autogen check-autogen: $(persistent_autogen_files) $(nonpersistent_autogen_files) -debian-sync: $(persistent_autogen_files) +.PHONY: debian/emacs-common-substvars +debian/emacs-common-substvars: + /usr/bin/emacs -Q --script debian/generate-bundled-package-provide-list.el > debian/emacs-common-substvars + +debian-sync: $(persistent_autogen_files) debian/emacs-common-substvars # so dh pattern rule doesn't try to handle this target true @@ -613,6 +617,10 @@ override_dh_auto_install: $(autogen_install_files) rm -rf $(install_dir_nox) rm -rf $(install_dir_lucid) +# Add generated emacs:Provides to substvars +execute_before_dh_gencontrol: + cat debian/emacs-common-substvars >> debian/emacs-common.substvars + # Install the per-user systemd unit in a disabled state by default. override_dh_installsystemduser: dh_installsystemduser --no-enable -- 2.47.2
From bc10a73b8a9c6c5b995c40eed8e8f68ebc9b9d73 Mon Sep 17 00:00:00 2001 From: Xiyue Deng <[email protected]> Date: Wed, 25 Jun 2025 10:55:48 -0700 Subject: [PATCH 3/4] Generate debian/emacs-common-substvars --- debian/emacs-common-substvars | 81 +++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 debian/emacs-common-substvars diff --git a/debian/emacs-common-substvars b/debian/emacs-common-substvars new file mode 100644 index 00000000000..d8bc408d80c --- /dev/null +++ b/debian/emacs-common-substvars @@ -0,0 +1,81 @@ +# Package name and version on each line in comments for tracking. +# +# elpa-allout (= 2.3), +# elpa-allout-widgets (= 1.0), +# elpa-ansi-color (= 3.4.2), +# elpa-antlr-mode (= 2.2.3), +# elpa-auth-source-pass (= 5.0.0), +# elpa-backtrace (= 1.0), +# elpa-bind-key (= 2.4.1), +# elpa-cc-mode (= 5.33.1), +# elpa-cedet (= 2.0), +# elpa-cfengine (= 1.4), +# elpa-cl-generic (= 1.0), +# elpa-cl-lib (= 1.0), +# elpa-cl-print (= 1.0), +# elpa-compat (= 30.1.9999), +# elpa-ede (= 2.0), +# elpa-ediff (= 2.81.6), +# elpa-editorconfig (= 0.11.0), +# elpa-eglot (= 1.17.30), +# elpa-eieio (= 1.4), +# elpa-eieio-core (= 1.4), +# elpa-eldoc (= 1.15.0), +# elpa-epg (= 1.0.0), +# elpa-erc (= 5.6.0.30.1), +# elpa-eshell (= 2.4.2), +# elpa-external-completion (= 0.1), +# elpa-faceup (= 0.0.6), +# elpa-feedmail (= 11), +# elpa-find-cmd (= 0.6), +# elpa-flymake (= 1.3.7), +# elpa-flymake-proc (= 1.0), +# elpa-foldout (= 1.10), +# elpa-gnus (= 5.13), +# elpa-idlwave (= 6.1.22), +# elpa-image-dired (= 0.5), +# elpa-info-xref (= 3), +# elpa-isearchb (= 1.5), +# elpa-js (= 9), +# elpa-json (= 1.5), +# elpa-jsonrpc (= 1.0.25), +# elpa-let-alist (= 1.0.6), +# elpa-map (= 3.3.1), +# elpa-meta-mode (= 1.0), +# elpa-mh-e (= 8.6~snapshot), +# elpa-mixal-mode (= 0.4), +# elpa-nadvice (= 1.0), +# elpa-ntlm (= 2.1.0), +# elpa-org (= 9.7.11), +# elpa-package (= 1.1.0), +# elpa-peg (= 1.0.1), +# elpa-project (= 0.11.1), +# elpa-ps-mode (= 1.1.9), +# elpa-pulse (= 1.0), +# elpa-python (= 0.28), +# elpa-ruby-mode (= 1.2), +# elpa-ruby-ts-mode (= 0.2), +# elpa-semantic (= 2.2), +# elpa-seq (= 2.24), +# elpa-so-long (= 1.1.2), +# elpa-soap-client (= 3.2.3), +# elpa-sql (= 3.6), +# elpa-srecode (= 1.2), +# elpa-svg (= 1.1), +# elpa-tabulated-list (= 1.0), +# elpa-thunk (= 1.0), +# elpa-tildify (= 4.6.1), +# elpa-track-changes (= 1.2), +# elpa-tramp (= 2.7.1.30.1), +# elpa-transient (= 0.7.2.2), +# elpa-use-package (= 2.4.6), +# elpa-vera-mode (= 2.28), +# elpa-verilog-mode (= 2024.3.1.121933719), +# elpa-viper (= 3.14.2), +# elpa-which-key (= 3.6.0), +# elpa-whitespace (= 13.2.2), +# elpa-window-tool-bar (= 0.2.1), +# elpa-xref (= 1.7.0), +emacs:Provides=elpa-allout (= 2.3), elpa-allout-widgets (= 1.0), elpa-ansi-color (= 3.4.2), elpa-antlr-mode (= 2.2.3), elpa-auth-source-pass (= 5.0.0), elpa-backtrace (= 1.0), elpa-bind-key (= 2.4.1), elpa-cc-mode (= 5.33.1), elpa-cedet (= 2.0), elpa-cfengine (= 1.4), elpa-cl-generic (= 1.0), elpa-cl-lib (= 1.0), elpa-cl-print (= 1.0), elpa-compat (= 30.1.9999), elpa-ede (= 2.0), elpa-ediff (= 2.81.6), elpa-editorconfig (= 0.11.0), elpa-eglot (= 1.17.30), elpa-eieio (= 1.4), elpa-eieio-core (= 1.4), elpa-eldoc (= 1.15.0), elpa-epg (= 1.0.0), elpa-erc (= 5.6.0.30.1), elpa-eshell (= 2.4.2), elpa-external-completion (= 0.1), elpa-faceup (= 0.0.6), elpa-feedmail (= 11), elpa-find-cmd (= 0.6), elpa-flymake (= 1.3.7), elpa-flymake-proc (= 1.0), elpa-foldout (= 1.10), elpa-gnus (= 5.13), elpa-idlwave (= 6.1.22), elpa-image-dired (= 0.5), elpa-info-xref (= 3), elpa-isearchb (= 1.5), elpa-js (= 9), elpa-json (= 1.5), elpa-jsonrpc (= 1.0.25), elpa-let-alist (= 1.0.6), elpa-map (= 3.3.1), elpa-meta-mode (= 1.0), elpa-mh-e (= 8.6~snapshot), elpa-mixal-mode (= 0.4), elpa-nadvice (= 1.0), elpa-ntlm (= 2.1.0), elpa-org (= 9.7.11), elpa-package (= 1.1.0), elpa-peg (= 1.0.1), elpa-project (= 0.11.1), elpa-ps-mode (= 1.1.9), elpa-pulse (= 1.0), elpa-python (= 0.28), elpa-ruby-mode (= 1.2), elpa-ruby-ts-mode (= 0.2), elpa-semantic (= 2.2), elpa-seq (= 2.24), elpa-so-long (= 1.1.2), elpa-soap-client (= 3.2.3), elpa-sql (= 3.6), elpa-srecode (= 1.2), elpa-svg (= 1.1), elpa-tabulated-list (= 1.0), elpa-thunk (= 1.0), elpa-tildify (= 4.6.1), elpa-track-changes (= 1.2), elpa-tramp (= 2.7.1.30.1), elpa-transient (= 0.7.2.2), elpa-use-package (= 2.4.6), elpa-vera-mode (= 2.28), elpa-verilog-mode (= 2024.3.1.121933719), elpa-viper (= 3.14.2), elpa-which-key (= 3.6.0), elpa-whitespace (= 13.2.2), elpa-window-tool-bar (= 0.2.1), elpa-xref (= 1.7.0), +emacs:Breaks=elpa-allout (<< 2.3), elpa-allout-widgets (<< 1.0), elpa-ansi-color (<< 3.4.2), elpa-antlr-mode (<< 2.2.3), elpa-auth-source-pass (<< 5.0.0), elpa-backtrace (<< 1.0), elpa-bind-key (<< 2.4.1), elpa-cc-mode (<< 5.33.1), elpa-cedet (<< 2.0), elpa-cfengine (<< 1.4), elpa-cl-generic (<< 1.0), elpa-cl-lib (<< 1.0), elpa-cl-print (<< 1.0), elpa-compat (<< 30.1.9999), elpa-ede (<< 2.0), elpa-ediff (<< 2.81.6), elpa-editorconfig (<< 0.11.0), elpa-eglot (<< 1.17.30), elpa-eieio (<< 1.4), elpa-eieio-core (<< 1.4), elpa-eldoc (<< 1.15.0), elpa-epg (<< 1.0.0), elpa-erc (<< 5.6.0.30.1), elpa-eshell (<< 2.4.2), elpa-external-completion (<< 0.1), elpa-faceup (<< 0.0.6), elpa-feedmail (<< 11), elpa-find-cmd (<< 0.6), elpa-flymake (<< 1.3.7), elpa-flymake-proc (<< 1.0), elpa-foldout (<< 1.10), elpa-gnus (<< 5.13), elpa-idlwave (<< 6.1.22), elpa-image-dired (<< 0.5), elpa-info-xref (<< 3), elpa-isearchb (<< 1.5), elpa-js (<< 9), elpa-json (<< 1.5), elpa-jsonrpc (<< 1.0.25), elpa-let-alist (<< 1.0.6), elpa-map (<< 3.3.1), elpa-meta-mode (<< 1.0), elpa-mh-e (<< 8.6~snapshot), elpa-mixal-mode (<< 0.4), elpa-nadvice (<< 1.0), elpa-ntlm (<< 2.1.0), elpa-org (<< 9.7.11), elpa-package (<< 1.1.0), elpa-peg (<< 1.0.1), elpa-project (<< 0.11.1), elpa-ps-mode (<< 1.1.9), elpa-pulse (<< 1.0), elpa-python (<< 0.28), elpa-ruby-mode (<< 1.2), elpa-ruby-ts-mode (<< 0.2), elpa-semantic (<< 2.2), elpa-seq (<< 2.24), elpa-so-long (<< 1.1.2), elpa-soap-client (<< 3.2.3), elpa-sql (<< 3.6), elpa-srecode (<< 1.2), elpa-svg (<< 1.1), elpa-tabulated-list (<< 1.0), elpa-thunk (<< 1.0), elpa-tildify (<< 4.6.1), elpa-track-changes (<< 1.2), elpa-tramp (<< 2.7.1.30.1), elpa-transient (<< 0.7.2.2), elpa-use-package (<< 2.4.6), elpa-vera-mode (<< 2.28), elpa-verilog-mode (<< 2024.3.1.121933719), elpa-viper (<< 3.14.2), elpa-which-key (<< 3.6.0), elpa-whitespace (<< 13.2.2), elpa-window-tool-bar (<< 0.2.1), elpa-xref (<< 1.7.0), +emacs:Replaces=elpa-allout (<< 2.3), elpa-allout-widgets (<< 1.0), elpa-ansi-color (<< 3.4.2), elpa-antlr-mode (<< 2.2.3), elpa-auth-source-pass (<< 5.0.0), elpa-backtrace (<< 1.0), elpa-bind-key (<< 2.4.1), elpa-cc-mode (<< 5.33.1), elpa-cedet (<< 2.0), elpa-cfengine (<< 1.4), elpa-cl-generic (<< 1.0), elpa-cl-lib (<< 1.0), elpa-cl-print (<< 1.0), elpa-compat (<< 30.1.9999), elpa-ede (<< 2.0), elpa-ediff (<< 2.81.6), elpa-editorconfig (<< 0.11.0), elpa-eglot (<< 1.17.30), elpa-eieio (<< 1.4), elpa-eieio-core (<< 1.4), elpa-eldoc (<< 1.15.0), elpa-epg (<< 1.0.0), elpa-erc (<< 5.6.0.30.1), elpa-eshell (<< 2.4.2), elpa-external-completion (<< 0.1), elpa-faceup (<< 0.0.6), elpa-feedmail (<< 11), elpa-find-cmd (<< 0.6), elpa-flymake (<< 1.3.7), elpa-flymake-proc (<< 1.0), elpa-foldout (<< 1.10), elpa-gnus (<< 5.13), elpa-idlwave (<< 6.1.22), elpa-image-dired (<< 0.5), elpa-info-xref (<< 3), elpa-isearchb (<< 1.5), elpa-js (<< 9), elpa-json (<< 1.5), elpa-jsonrpc (<< 1.0.25), elpa-let-alist (<< 1.0.6), elpa-map (<< 3.3.1), elpa-meta-mode (<< 1.0), elpa-mh-e (<< 8.6~snapshot), elpa-mixal-mode (<< 0.4), elpa-nadvice (<< 1.0), elpa-ntlm (<< 2.1.0), elpa-org (<< 9.7.11), elpa-package (<< 1.1.0), elpa-peg (<< 1.0.1), elpa-project (<< 0.11.1), elpa-ps-mode (<< 1.1.9), elpa-pulse (<< 1.0), elpa-python (<< 0.28), elpa-ruby-mode (<< 1.2), elpa-ruby-ts-mode (<< 0.2), elpa-semantic (<< 2.2), elpa-seq (<< 2.24), elpa-so-long (<< 1.1.2), elpa-soap-client (<< 3.2.3), elpa-sql (<< 3.6), elpa-srecode (<< 1.2), elpa-svg (<< 1.1), elpa-tabulated-list (<< 1.0), elpa-thunk (<< 1.0), elpa-tildify (<< 4.6.1), elpa-track-changes (<< 1.2), elpa-tramp (<< 2.7.1.30.1), elpa-transient (<< 0.7.2.2), elpa-use-package (<< 2.4.6), elpa-vera-mode (<< 2.28), elpa-verilog-mode (<< 2024.3.1.121933719), elpa-viper (<< 3.14.2), elpa-which-key (<< 3.6.0), elpa-whitespace (<< 13.2.2), elpa-window-tool-bar (<< 0.2.1), elpa-xref (<< 1.7.0), -- 2.47.2
From cbc785c8c72513bc49f695ecdc3420a9a66da25a Mon Sep 17 00:00:00 2001 From: Xiyue Deng <[email protected]> Date: Wed, 18 Jun 2025 13:29:16 -0700 Subject: [PATCH 4/4] Add substvars to emacs-common in debian/control --- debian/control | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 86cd8976b46..2a1364ffd54 100644 --- a/debian/control +++ b/debian/control @@ -191,8 +191,12 @@ Breaks: emacs-gtk (<< 1:25), emacs-lucid (<< 1:25), emacs-nox (<< 1:25), + ${emacs:Breaks} Replaces: - emacs-bin-common (<< 1:28) + emacs-bin-common (<< 1:28), + ${emacs:Replaces} +Provides: + ${emacs:Provides} Description: GNU Emacs editor's shared, architecture independent infrastructure GNU Emacs is the extensible self-documenting text editor. This package contains the architecture independent infrastructure -- 2.47.2
signature.asc
Description: PGP signature

