From: "Ulrich Müller" <ulm@gentoo.org>
To: <gentoo-dev@lists.gentoo.org>
Subject: [gentoo-dev] [PATCH v2 2/3] elisp-common.eclass: Update documentation.
Date: Fri, 20 Dec 2019 14:43:54 +0100 [thread overview]
Message-ID: <w6gmubnnmcl.fsf@kph.uni-mainz.de> (raw)
In-Reply-To: <cover.1576663643.git.ulm@gentoo.org> ("Ulrich \=\?utf-8\?Q\?M\?\= \=\?utf-8\?Q\?\=C3\=BCller\=22's\?\= message of "Wed, 18 Dec 2019 12:08:16 +0100")
[-- Attachment #1: Type: text/plain, Size: 3801 bytes --]
After the package split between emacs and emacs-vcs is gone, packages
can depend on app-editors/emacs directly.
Deprecate function elisp-need-emacs; ebuilds should assign variable
NEED_EMACS instead.
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
---
eclass/elisp-common.eclass | 45 ++++++++++++++++++++++----------------
1 file changed, 26 insertions(+), 19 deletions(-)
diff --git a/eclass/elisp-common.eclass b/eclass/elisp-common.eclass
index 8e5d70046bc..aac50fc65f0 100644
--- a/eclass/elisp-common.eclass
+++ b/eclass/elisp-common.eclass
@@ -23,26 +23,25 @@
# When relying on the emacs USE flag, you need to add
#
# @CODE
-# emacs? ( virtual/emacs )
+# emacs? ( >=app-editors/emacs-23.1:* )
# @CODE
#
# to your DEPEND/RDEPEND line and use the functions provided here to
# bring the files to the correct locations.
#
-# If your package requires a minimum Emacs version, e.g. Emacs 24, then
-# the dependency should be on >=virtual/emacs-24 instead. Because the
-# user can select the Emacs executable with eselect, you should also
-# make sure that the active Emacs version is sufficient. This can be
-# tested with function elisp-need-emacs(), which would typically be
-# called from pkg_setup(), as in the following example:
+# If your package requires a minimum Emacs version, e.g. Emacs 26.1,
+# then the dependency should be on >=app-editors/emacs-26.1:* instead.
+# Because the user can select the Emacs executable with eselect, you
+# should also make sure that the active Emacs version is sufficient.
+# The eclass will automatically ensure this if you assign variable
+# NEED_EMACS with the Emacs version, as in the following example:
#
# @CODE
-# elisp-need-emacs 24 || die "Emacs version too low"
+# NEED_EMACS=26.1
# @CODE
#
-# Please note that such tests should be limited to packages that are
-# known to fail with lower Emacs versions; the standard case is to
-# depend on virtual/emacs without version.
+# Please note that this should be done only for packages that are known
+# to fail with lower Emacs versions.
#
# @ROFF .SS
# src_compile() usage:
@@ -134,6 +133,20 @@
# the differing name as second argument.
#
# @ROFF .SS
+# pkg_setup() usage:
+#
+# If your ebuild uses the elisp-compile eclass function to compile
+# its elisp files (see above), then you don't need a pkg_setup phase,
+# because elisp-compile and elisp-make-autoload-file do their own sanity
+# checks. On the other hand, if the elisp files are compiled by the
+# package's build system, then there is often no check for the Emacs
+# version. In this case, you can add an explicit check in pkg_setup:
+#
+# @CODE
+# elisp-check-emacs-version
+# @CODE
+#
+# @ROFF .SS
# pkg_postinst() / pkg_postrm() usage:
#
# After that you need to recreate the start-up file of Emacs after
@@ -151,10 +164,6 @@
#
# When having optional Emacs support, you should prepend "use emacs &&"
# to above calls of elisp-site-regen().
-# Don't use "has_version virtual/emacs"! When unmerging the state of
-# the emacs USE flag is taken from the package database and not from the
-# environment, so it is no problem when you unset USE=emacs between
-# merge and unmerge of a package.
case ${EAPI:-0} in
4|5|6) inherit eapi7-ver ;;
@@ -258,12 +267,10 @@ elisp-check-emacs-version() {
fi
}
-# @FUNCTION: elisp-need-emacs
-# @USAGE: <version>
-# @RETURN: 0 if true, 1 if false, 2 if trouble
-# @DESCRIPTION:
# Test if the eselected Emacs version is at least the major version
# of GNU Emacs specified as argument.
+# Return 0 if true, 1 if false, 2 if trouble.
+# Deprecated, use elisp-check-emacs-version instead.
elisp-need-emacs() {
local need_emacs=$1 have_emacs
--
2.24.1
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]
next prev parent reply other threads:[~2019-12-20 13:44 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-18 11:08 [gentoo-dev] [PATCH 0/3] elisp{,-common}.eclass update for emacs-vcs consolidation Ulrich Müller
2019-12-18 11:08 ` [gentoo-dev] [PATCH 1/3] elisp-common.eclass: Allow full versions in elisp-need-emacs() Ulrich Müller
2019-12-18 11:08 ` [gentoo-dev] [PATCH 2/3] elisp-common.eclass: Update documentation Ulrich Müller
2019-12-18 11:08 ` [gentoo-dev] [PATCH 3/3] elisp.eclass: Depend on app-editors/emacs directly Ulrich Müller
2019-12-18 11:47 ` [gentoo-dev] [PATCH 0/3] elisp{,-common}.eclass update for emacs-vcs consolidation Michał Górny
2019-12-18 12:01 ` Ulrich Mueller
2019-12-18 12:19 ` Michael Orlitzky
2019-12-18 16:34 ` Ulrich Mueller
2019-12-18 23:28 ` Michael Orlitzky
2019-12-20 1:19 ` Michael Orlitzky
2019-12-21 6:57 ` Ulrich Mueller
2019-12-21 11:27 ` Michael Orlitzky
2019-12-21 11:39 ` Ulrich Mueller
2019-12-21 11:41 ` Michael Orlitzky
2019-12-21 11:50 ` Ulrich Mueller
2019-12-21 11:49 ` Michael Orlitzky
2019-12-21 11:52 ` Ulrich Mueller
2019-12-21 13:31 ` Michael 'veremitz' Everitt
2019-12-20 13:43 ` [gentoo-dev] [PATCH v2 1/3] elisp-common.eclass: New function elisp-check-emacs-version Ulrich Müller
2019-12-20 13:43 ` Ulrich Müller [this message]
2019-12-20 13:44 ` [gentoo-dev] [PATCH v2 3/3] elisp.eclass: Depend on app-editors/emacs directly Ulrich Müller
2019-12-20 22:10 ` Ulrich Mueller
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=w6gmubnnmcl.fsf@kph.uni-mainz.de \
--to=ulm@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