From: "Ulrich Müller" <ulm@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/proj/emacs:master commit in: eclass/
Date: Tue, 4 Aug 2020 14:37:15 +0000 (UTC) [thread overview]
Message-ID: <1595704125.ee0c4d0b14c9ece913d340fe5a074e1f63726fc6.ulm@gentoo> (raw)
commit: ee0c4d0b14c9ece913d340fe5a074e1f63726fc6
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 25 19:08:45 2020 +0000
Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Sat Jul 25 19:08:45 2020 +0000
URL: https://gitweb.gentoo.org/repo/proj/emacs.git/commit/?id=ee0c4d0b
elisp-common.eclass: Support installation of dynamic modules.
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>
eclass/elisp-common.eclass | 42 ++++++++++++++++++++++++++++++++++++------
1 file changed, 36 insertions(+), 6 deletions(-)
diff --git a/eclass/elisp-common.eclass b/eclass/elisp-common.eclass
index 6fa2bbe..0bf6c01 100644
--- a/eclass/elisp-common.eclass
+++ b/eclass/elisp-common.eclass
@@ -180,6 +180,12 @@ SITELISP=/usr/share/emacs/site-lisp
# Directory where packages install miscellaneous (not Lisp) files.
SITEETC=/usr/share/emacs/etc
+# @ECLASS-VARIABLE: EMACSMODULES
+# @DESCRIPTION:
+# Directory where packages install dynamically loaded modules.
+# May contain a @libdir@ token which will be replaced by $(get_libdir).
+EMACSMODULES=/usr/@libdir@/emacs/modules
+
# @ECLASS-VARIABLE: EMACS
# @DESCRIPTION:
# Path of Emacs executable.
@@ -362,17 +368,37 @@ elisp-install() {
eend $? "elisp-install: doins failed" || die
}
+# @FUNCTION: elisp-modules-install
+# @USAGE: <subdirectory> <list of files>
+# @DESCRIPTION:
+# Install dynamic modules in EMACSMODULES directory.
+
+elisp-modules-install() {
+ local subdir="$1"
+ shift
+ # Don't bother inheriting multilib.eclass for get_libdir(), but
+ # error out in old EAPIs that don't support it natively.
+ [[ ${EAPI} == [45] ]] \
+ && die "${ECLASS}: Dynamic modules not supported in EAPI ${EAPI}"
+ ebegin "Installing dynamic modules for GNU Emacs support"
+ ( # subshell to avoid pollution of calling environment
+ exeinto "${EMACSMODULES//@libdir@/$(get_libdir)}/${subdir}"
+ doexe "$@"
+ )
+ eend $? "elisp-modules-install: doins failed" || die
+}
+
# @FUNCTION: elisp-site-file-install
# @USAGE: <site-init file> [subdirectory]
# @DESCRIPTION:
# Install Emacs site-init file in SITELISP directory. Automatically
-# inserts a standard comment header with the name of the package (unless
-# it is already present). Tokens @SITELISP@ and @SITEETC@ are replaced
-# by the path to the package's subdirectory in SITELISP and SITEETC,
-# respectively.
+# inserts a standard comment header with the name of the package
+# (unless it is already present). Tokens @SITELISP@, @SITEETC@, and
+# @EMACSMODULES@ are replaced by the path to the package's subdirectory
+# in SITELISP, SITEETC, and EMACSMODULES, respectively.
elisp-site-file-install() {
- local sf="${1##*/}" my_pn="${2:-${PN}}" ret
+ local sf="${1##*/}" my_pn="${2:-${PN}}" modules ret
local header=";;; ${PN} site-lisp configuration"
[[ ${sf} == [0-9][0-9]*-gentoo*.el ]] \
@@ -381,9 +407,13 @@ elisp-site-file-install() {
sf="${T}/${sf}"
ebegin "Installing site initialisation file for GNU Emacs"
[[ $1 = "${sf}" ]] || cp "$1" "${sf}"
+ [[ ${EAPI} == [45] ]] && grep -q "@EMACSMODULES@" "${sf}" \
+ && die "${ECLASS}: Dynamic modules not supported in EAPI ${EAPI}"
+ modules=${EMACSMODULES//@libdir@/$(get_libdir)}
sed -i -e "1{:x;/^\$/{n;bx;};/^;.*${PN}/I!s:^:${header}\n\n:;1s:^:\n:;}" \
-e "s:@SITELISP@:${EPREFIX}${SITELISP}/${my_pn}:g" \
- -e "s:@SITEETC@:${EPREFIX}${SITEETC}/${my_pn}:g;\$q" "${sf}"
+ -e "s:@SITEETC@:${EPREFIX}${SITEETC}/${my_pn}:g" \
+ -e "s:@EMACSMODULES@:${EPREFIX}${modules}/${my_pn}:g;\$q" "${sf}"
( # subshell to avoid pollution of calling environment
insinto "${SITELISP}/site-gentoo.d"
doins "${sf}"
next reply other threads:[~2020-08-04 14:37 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-04 14:37 Ulrich Müller [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-12-29 9:23 [gentoo-commits] repo/proj/emacs:master commit in: eclass/ Ulrich Müller
2024-12-16 18:46 Ulrich Müller
2024-09-02 15:31 Ulrich Müller
2024-09-02 15:18 Ulrich Müller
2024-09-02 15:18 Ulrich Müller
2023-10-22 10:01 Ulrich Müller
2023-10-20 12:18 Ulrich Müller
2022-10-20 8:05 Ulrich Müller
2022-10-20 8:05 Ulrich Müller
2022-04-03 18:29 Ulrich Müller
2022-04-03 18:02 Ulrich Müller
2022-03-24 6:44 Ulrich Müller
2021-07-28 7:53 Ulrich Müller
2021-04-20 18:13 Ulrich Müller
2021-04-13 7:43 Ulrich Müller
2021-04-13 7:27 Ulrich Müller
2021-04-13 7:15 Ulrich Müller
2021-04-13 7:15 Ulrich Müller
2021-04-13 7:12 Ulrich Müller
2021-04-13 7:12 Ulrich Müller
2021-04-12 19:09 Ulrich Müller
2021-04-12 19:09 Ulrich Müller
2021-03-22 9:00 Ulrich Müller
2020-09-25 17:58 Ulrich Müller
2020-02-22 11:42 Ulrich Müller
2019-12-22 12:34 Ulrich Müller
2019-12-21 18:54 Ulrich Müller
2019-12-21 18:30 Ulrich Müller
2019-09-09 8:25 Ulrich Müller
2019-08-17 22:08 Ulrich Müller
2018-06-01 18:07 Ulrich Müller
2018-06-01 18:07 Ulrich Müller
2018-02-22 13:25 Ulrich Müller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1595704125.ee0c4d0b14c9ece913d340fe5a074e1f63726fc6.ulm@gentoo \
--to=ulm@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox