diff options
author | David Bremner <david@tethera.net> | 2018-01-06 11:52:33 -0400 |
---|---|---|
committer | David Bremner <david@tethera.net> | 2018-01-06 12:03:34 -0400 |
commit | 1981ba2910fb16c300794f23f49dc16052a24dbd (patch) | |
tree | 4aaf34689253a49ccdb907ed956767f69f22d39d /dh_elpa.in | |
parent | fb230cba3faddf53564ec2fc00193fbaa4deb831 (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
Diffstat (limited to 'dh_elpa.in')
-rwxr-xr-x | dh_elpa.in | 33 |
1 files changed, 16 insertions, 17 deletions
@@ -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", |