Bug#1069210: dh-elpa: Support nested directory in elpa installation
Package: dh-elpa
Version: 2.0.17
Severity: wishlist
Hi,
Currently dh-elpa installs all *.el files directly under the root of
ELPA installation directory. This handles most ELPA packages without
issues, though there are some packages that starts to use nested
directory structures, e.g. auctex[1].
Therefore I'd like to propose to add nested directory support in
dh-elpa. I have a draft implementation that adds support for
recursively create symlink in subdirectories as well as recursive
byte-compiling. You can check it out in my salsa repo[2], and the
patches are also attached. I have tested with the work-in-progress
auctex which seems to work, but it would be good to know whether there
are any aspects that I missed from the dh-elpa handling.
Any comments are welcome.
[1] When installing elpa.gnu.org auctex will have a nested `style/'
directory, though for the auctex packaged in Debian has not been
elpafied (which I'm trying to experiment in
https://bugs.debian.org/1056939)
[2] https://salsa.debian.org/manphiz/dh-elpa/-/tree/nested-directory-support?ref_type=heads
-- System Information:
Debian Release: 12.5
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 6.1.0-20-amd64 (SMP w/16 CPU threads; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages dh-elpa depends on:
ii debhelper 13.11.4
ii emacs 1:29.3+1-2~bpo12+0manphiz1
ii emacs-gtk [emacs] 1:29.3+1-2~bpo12+0manphiz1
ii libarray-utils-perl 0.5-3
ii libconfig-tiny-perl 2.28-2
ii libdebian-source-perl 0.122
ii libdpkg-perl 1.21.22
ii libfile-find-rule-perl 0.34-3
ii libtext-glob-perl 0.11-3
ii perl 5.36.0-7+deb12u1
dh-elpa recommends no packages.
dh-elpa suggests no packages.
-- no debconf information
>From 2df1f0d70c62e322618e7ed64515b33566c2f5f2 Mon Sep 17 00:00:00 2001
From: Xiyue Deng <manphiz@gmail.com>
Date: Mon, 15 Apr 2024 13:03:16 -0700
Subject: [PATCH 1/3] Byte compile recursively during install to handle nested
directories
* This handles addons that have source files under nested directories
in ELPA install directories.
---
helper/install | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/helper/install b/helper/install
index 39db695..eb68ef5 100755
--- a/helper/install
+++ b/helper/install
@@ -58,7 +58,8 @@ echo "install/${ELPA_DIR}: byte-compiling for ${FLAVOR}"
${FLAVOR} --quick --batch -l package \
--eval "(setq package-user-dir \"/nonexistent\")" \
--eval "(add-to-list 'package-directory-list \"$src_dir\")" \
- -f package-initialize -f batch-byte-compile ./*.el > Install.log 2>&1
+ -f package-initialize \
+ --eval "(byte-recompile-directory \".\" 0)" > Install.log 2>&1
if test $? -ne 0
then
cat Install.log
--
2.39.2
>From 5729f59dfa29bf9acda3959ff00aab179744e6d0 Mon Sep 17 00:00:00 2001
From: Xiyue Deng <manphiz@gmail.com>
Date: Wed, 17 Apr 2024 14:06:42 -0700
Subject: [PATCH 2/3] Create symlink from elpa-src to elpa recursively
* Instead of using `ln -s', use `cp -rs' so that directories are
handled recursively.
* In remove we use `rmdir --ignore-fail-on-non-empty' so this was
handled automatically as well.
---
helper/install | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/helper/install b/helper/install
index eb68ef5..8d748c8 100755
--- a/helper/install
+++ b/helper/install
@@ -50,7 +50,7 @@ echo "install/${ELPA_DIR}: byte-compiling for ${FLAVOR}"
# policy). This makes complation easy, and also allows find-function
# and find-library to work properly. Also link all other top level
# files and directories into the flavor directory
-(cd "${elc_dir}" && ln -sf "${el_dir}"* .)
+(cd "${elc_dir}" && cp -rsf "${el_dir}"* .)
# Byte compile them
(cd "${elc_dir}"
--
2.39.2
>From b15e026ce0d4166d427aca14d3451eb9b60fb1c9 Mon Sep 17 00:00:00 2001
From: Xiyue Deng <manphiz@gmail.com>
Date: Wed, 17 Apr 2024 14:17:41 -0700
Subject: [PATCH 3/3] Update d/changelog
---
debian/changelog | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/debian/changelog b/debian/changelog
index 161b05c..20026ae 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -13,7 +13,13 @@ dh-elpa (2.1.2) UNRELEASED; urgency=medium
* Add transient to the list of packages packaged separately as well as
provided with emacs.
- -- Xiyue Deng <manphiz@gmail.com> Sat, 06 Apr 2024 16:41:14 -0700
+ [ Xiyue Deng ]
+ * Add support for nested directory in elpa installation.
+ - Byte compile recursively during install to handle nested
+ directories.
+ - Create symlink from elpa-src to elpa recursively.
+
+ -- Xiyue Deng <manphiz@gmail.com> Wed, 17 Apr 2024 14:16:00 -0700
dh-elpa (2.1.1) experimental; urgency=medium
--
2.39.2
Reply to: