summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2018-01-06 11:52:33 -0400
committerDavid Bremner <david@tethera.net>2018-01-06 12:03:34 -0400
commit1981ba2910fb16c300794f23f49dc16052a24dbd (patch)
tree4aaf34689253a49ccdb907ed956767f69f22d39d
parentfb230cba3faddf53564ec2fc00193fbaa4deb831 (diff)
replace --elisp-directory with --emacs-loadpath
Rather than joining multiple arguments, just pass through the path provided by the user. And actully use the path for byte compilation
-rw-r--r--debian/changelog2
-rwxr-xr-xdh_elpa.in33
-rwxr-xr-xemacsen-common/install2
3 files changed, 18 insertions, 19 deletions
diff --git a/debian/changelog b/debian/changelog
index dac52f1..a893691 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,7 +7,7 @@ dh-elpa (1.12) UNRELEASED; urgency=medium
[ David Bremner ]
* Use --quick (-Q) for byte compilation. This has the side-effect that
only elpa-* build depencies are automatically handled.
- * Add the --elisp-directory argument to allow manual addition of
+ * Add the --emacs-loadpath argument to allow manual addition of
non-elpa-* byte-compilation dependencies
-- David Bremner <bremner@debian.org> Sat, 06 Jan 2018 11:16:27 -0400
diff --git a/dh_elpa.in b/dh_elpa.in
index 9443294..9d5e034 100755
--- a/dh_elpa.in
+++ b/dh_elpa.in
@@ -42,7 +42,7 @@ List of files to be installed into I<package> as an elpa package.
=cut
init(options => {
- "elisp-directory=s@" => \$dh{ELISP_DIRECTORIES},
+ "emacs-loadpath=s" => \$dh{EMACS_LOADPATH},
"byte-compile!" => \$dh{BYTECOMPILE},
"fix-autoload-date!" => \$dh{FIXAUTOLOADDATE},
});
@@ -61,10 +61,11 @@ to one that is found by the emacs package system.
=over 4
-=item B<--elisp-directory> I<path>
+=item B<--emacs-loadpath> I<path>
-Pass an extra path (e.g. for a non elpa-* dependency) to byte
-compilation. This option may be repeated to specify multiple directories.
+A colon separated list of directories to add to the Emacs load path
+for byte compilation (e.g. for a non elpa-* dependency)
+compilation.
=back
@@ -135,7 +136,7 @@ sub read_package_desc {
my $templatedir = "/usr/share/debhelper/dh_elpa/emacsen-common";
sub maybe_install_helper{
- my ($package,$piece, $mode, $desc)=@_;
+ my ($package,$piece, $mode, $desc, $emacs_loadpath)=@_;
my $file=pkgfile($package,"emacsen-$piece");
my $tmp=tmpdir($package);
@@ -155,8 +156,9 @@ sub maybe_install_helper{
error "elpa version not found";
sed_file (sub {s/#ELPAPACKAGE#/$elpapackage/;
- s/#ELPAVERSION#/$elpaversion/; },
- "$templatedir/$piece", $target);
+ s/#ELPAVERSION#/$elpaversion/;
+ s/#EMACSLOADPATH#/$emacs_loadpath/; },
+ "$templatedir/$piece", $target);
chmod oct($mode), $target;
}
}
@@ -209,12 +211,10 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
my $helper_version = '@HELPER_VERSION@';
my @extra_args = ( $tempdir );
- my @elisp_dirs = ();
+ my $emacs_loadpath = "/usr/share/emacs/site-lisp:";
- if (defined $dh{ELISP_DIRECTORIES}) {
- foreach my $dir (@{$dh{ELISP_DIRECTORIES}}) {
- push @elisp_dirs, '-l', $dir;
- }
+ if (defined $dh{EMACS_LOADPATH}) {
+ $emacs_loadpath .= $dh{EMACS_LOADPATH} . ':'
}
if ($dh{FIXAUTOLOADDATE}) {
@@ -234,7 +234,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
'--eval',"(add-to-list 'package-directory-list \"$dhelpadir\")",
'--eval',"(add-to-list 'package-directory-list \"$elpadir\")",
qw{-f package-initialize -l dh-elpa.el},
- qw{-f dhelpa-batch-install-file}, @elisp_dirs, "$tmp/$elpadir", $pkg_file, @extra_args);
+ qw{-f dhelpa-batch-install-file}, "$tmp/$elpadir", $pkg_file, @extra_args);
} else {
my $stagedir = "$tempdir/$elpapkg";
File::Path::make_path $stagedir ||
@@ -251,7 +251,6 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
'--eval',"(add-to-list 'package-directory-list \"$elpadir\")",
qw{-f package-initialize -l dh-elpa.el},
qw{-f dhelpa-batch-install-directory},
- @elisp_dirs,
"$tmp/$elpadir", $stagedir, @extra_args);
}
@@ -266,9 +265,9 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
if ($dh{BYTECOMPILE}) {
addsubstvar($package, 'misc:Depends', 'emacsen-common');
- maybe_install_helper($package, 'compat', '0644', $desc);
- maybe_install_helper($package, 'install', '0755', $desc);
- maybe_install_helper($package, 'remove', '0755', $desc);
+ maybe_install_helper($package, 'compat', '0644', $desc, $emacs_loadpath);
+ maybe_install_helper($package, 'install', '0755', $desc, $emacs_loadpath);
+ maybe_install_helper($package, 'remove', '0755', $desc, $emacs_loadpath);
if (! $dh{NOSCRIPTS}) {
autoscript($package,"postinst","postinst-emacsen",
diff --git a/emacsen-common/install b/emacsen-common/install
index 6e64ae6..c0f3390 100755
--- a/emacsen-common/install
+++ b/emacsen-common/install
@@ -24,7 +24,7 @@ el_dir=$src_dir/${ELPA_DIR}/
elc_dir=/usr/share/${FLAVOR}/site-lisp/elpa/${ELPA_DIR}/
export EMACSLOADPATH
-EMACSLOADPATH="/usr/share/emacs/site-lisp:"
+EMACSLOADPATH="#EMACSLOADPATH#"
echo install/${ELPA_DIR}: byte-compiling for ${FLAVOR}