From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 14CAB138359 for ; Tue, 4 Aug 2020 14:37:20 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3C69DE0BB5; Tue, 4 Aug 2020 14:37:19 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 142CDE0BB5 for ; Tue, 4 Aug 2020 14:37:18 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 7024E34F20E for ; Tue, 4 Aug 2020 14:37:17 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id D608C253 for ; Tue, 4 Aug 2020 14:37:15 +0000 (UTC) From: "Ulrich Müller" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Ulrich Müller" Message-ID: <1595704125.ee0c4d0b14c9ece913d340fe5a074e1f63726fc6.ulm@gentoo> Subject: [gentoo-commits] repo/proj/emacs:master commit in: eclass/ X-VCS-Repository: repo/proj/emacs X-VCS-Files: eclass/elisp-common.eclass X-VCS-Directories: eclass/ X-VCS-Committer: ulm X-VCS-Committer-Name: Ulrich Müller X-VCS-Revision: ee0c4d0b14c9ece913d340fe5a074e1f63726fc6 X-VCS-Branch: master Date: Tue, 4 Aug 2020 14:37:15 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 0d38a1e0-f1e4-45c6-aee0-7ff3bb99696b X-Archives-Hash: 6b4e332fd0097009f13f3ba27a9a3101 commit: ee0c4d0b14c9ece913d340fe5a074e1f63726fc6 Author: Ulrich Müller gentoo org> AuthorDate: Sat Jul 25 19:08:45 2020 +0000 Commit: Ulrich Müller gentoo 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 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: +# @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: [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}"