summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
Diffstat (limited to 'eclass')
-rw-r--r--eclass/Manifest.gzbin38157 -> 38161 bytes
-rw-r--r--eclass/elisp-common.eclass35
-rw-r--r--eclass/elisp.eclass6
3 files changed, 40 insertions, 1 deletions
diff --git a/eclass/Manifest.gz b/eclass/Manifest.gz
index 5dbbc4252cf6..0e641809214b 100644
--- a/eclass/Manifest.gz
+++ b/eclass/Manifest.gz
Binary files differ
diff --git a/eclass/elisp-common.eclass b/eclass/elisp-common.eclass
index 1f60d3c337b9..ff1b2d0da0f3 100644
--- a/eclass/elisp-common.eclass
+++ b/eclass/elisp-common.eclass
@@ -132,6 +132,17 @@
# "50${PN}-gentoo.el". If your subdirectory is not named ${PN}, give
# the differing name as second argument.
#
+# For the simple case that only the package's subdirectory needs to be
+# added to the load-path, function elisp-make-site-file() will create
+# and install a site-init file that does just that:
+#
+# @CODE
+# elisp-make-site-file "${SITEFILE}"
+# @CODE
+#
+# Again, this must be called in src_install(). See the function's
+# documentation for more details on its usage.
+#
# @SUBSECTION pkg_setup() usage:
#
# If your ebuild uses the elisp-compile eclass function to compile
@@ -601,6 +612,30 @@ elisp-site-file-install() {
eend ${ret} "elisp-site-file-install: doins failed" || die
}
+# @FUNCTION: elisp-make-site-file
+# @USAGE: <filename> [subdirectory] [line]...
+# @DESCRIPTION:
+# Create and install a site-init file for the package. By default,
+# this will add the package's SITELISP subdirectory to Emacs' load-path:
+#
+# @CODE
+# (add-to-list 'load-path "@SITELISP@")
+# @CODE
+#
+# Additional arguments are appended as lines to the destination file.
+# Any @SITELISP@, @SITEETC@, and @EMACSMODULES@ tokens in these
+# arguments are replaced, as described for elisp-site-file-install.
+
+elisp-make-site-file() {
+ [[ $1 == [0-9][0-9]*-gentoo.el ]] \
+ || die "elisp-make-site-file: bad name of site-init file"
+
+ local f="${T}/$1" my_pn="${2:-${PN}}"
+ shift; shift
+ printf "%s\n" "(add-to-list 'load-path \"@SITELISP@\")" "$@" >"${f}" || die
+ elisp-site-file-install "${f}" "${my_pn}"
+}
+
# @FUNCTION: elisp-site-regen
# @DESCRIPTION:
# Regenerate the site-gentoo.el file, based on packages' site
diff --git a/eclass/elisp.eclass b/eclass/elisp.eclass
index 1ac1a2dbfabf..72e623a12179 100644
--- a/eclass/elisp.eclass
+++ b/eclass/elisp.eclass
@@ -166,7 +166,11 @@ elisp_src_test() {
elisp_src_install() {
elisp-install ${PN} *.el *.elc
if [[ -n ${SITEFILE} ]]; then
- elisp-site-file-install "${FILESDIR}/${SITEFILE}"
+ if [[ -f "${FILESDIR}/${SITEFILE}" ]]; then
+ elisp-site-file-install "${FILESDIR}/${SITEFILE}"
+ else
+ elisp-make-site-file "${SITEFILE}"
+ fi
fi
if [[ -n ${ELISP_TEXINFO} ]]; then
set -- ${ELISP_TEXINFO}