Gentoo Archives: gentoo-dev

From: "Ulrich Müller" <ulm@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] [PATCH v2 2/3] elisp-common.eclass: Update documentation.
Date: Fri, 20 Dec 2019 13:44:13
Message-Id: w6gmubnnmcl.fsf@kph.uni-mainz.de
In Reply to: [gentoo-dev] [PATCH 0/3] elisp{,-common}.eclass update for emacs-vcs consolidation by "Ulrich Müller"
1 After the package split between emacs and emacs-vcs is gone, packages
2 can depend on app-editors/emacs directly.
3
4 Deprecate function elisp-need-emacs; ebuilds should assign variable
5 NEED_EMACS instead.
6
7 Signed-off-by: Ulrich Müller <ulm@g.o>
8 ---
9 eclass/elisp-common.eclass | 45 ++++++++++++++++++++++----------------
10 1 file changed, 26 insertions(+), 19 deletions(-)
11
12 diff --git a/eclass/elisp-common.eclass b/eclass/elisp-common.eclass
13 index 8e5d70046bc..aac50fc65f0 100644
14 --- a/eclass/elisp-common.eclass
15 +++ b/eclass/elisp-common.eclass
16 @@ -23,26 +23,25 @@
17 # When relying on the emacs USE flag, you need to add
18 #
19 # @CODE
20 -# emacs? ( virtual/emacs )
21 +# emacs? ( >=app-editors/emacs-23.1:* )
22 # @CODE
23 #
24 # to your DEPEND/RDEPEND line and use the functions provided here to
25 # bring the files to the correct locations.
26 #
27 -# If your package requires a minimum Emacs version, e.g. Emacs 24, then
28 -# the dependency should be on >=virtual/emacs-24 instead. Because the
29 -# user can select the Emacs executable with eselect, you should also
30 -# make sure that the active Emacs version is sufficient. This can be
31 -# tested with function elisp-need-emacs(), which would typically be
32 -# called from pkg_setup(), as in the following example:
33 +# If your package requires a minimum Emacs version, e.g. Emacs 26.1,
34 +# then the dependency should be on >=app-editors/emacs-26.1:* instead.
35 +# Because the user can select the Emacs executable with eselect, you
36 +# should also make sure that the active Emacs version is sufficient.
37 +# The eclass will automatically ensure this if you assign variable
38 +# NEED_EMACS with the Emacs version, as in the following example:
39 #
40 # @CODE
41 -# elisp-need-emacs 24 || die "Emacs version too low"
42 +# NEED_EMACS=26.1
43 # @CODE
44 #
45 -# Please note that such tests should be limited to packages that are
46 -# known to fail with lower Emacs versions; the standard case is to
47 -# depend on virtual/emacs without version.
48 +# Please note that this should be done only for packages that are known
49 +# to fail with lower Emacs versions.
50 #
51 # @ROFF .SS
52 # src_compile() usage:
53 @@ -134,6 +133,20 @@
54 # the differing name as second argument.
55 #
56 # @ROFF .SS
57 +# pkg_setup() usage:
58 +#
59 +# If your ebuild uses the elisp-compile eclass function to compile
60 +# its elisp files (see above), then you don't need a pkg_setup phase,
61 +# because elisp-compile and elisp-make-autoload-file do their own sanity
62 +# checks. On the other hand, if the elisp files are compiled by the
63 +# package's build system, then there is often no check for the Emacs
64 +# version. In this case, you can add an explicit check in pkg_setup:
65 +#
66 +# @CODE
67 +# elisp-check-emacs-version
68 +# @CODE
69 +#
70 +# @ROFF .SS
71 # pkg_postinst() / pkg_postrm() usage:
72 #
73 # After that you need to recreate the start-up file of Emacs after
74 @@ -151,10 +164,6 @@
75 #
76 # When having optional Emacs support, you should prepend "use emacs &&"
77 # to above calls of elisp-site-regen().
78 -# Don't use "has_version virtual/emacs"! When unmerging the state of
79 -# the emacs USE flag is taken from the package database and not from the
80 -# environment, so it is no problem when you unset USE=emacs between
81 -# merge and unmerge of a package.
82
83 case ${EAPI:-0} in
84 4|5|6) inherit eapi7-ver ;;
85 @@ -258,12 +267,10 @@ elisp-check-emacs-version() {
86 fi
87 }
88
89 -# @FUNCTION: elisp-need-emacs
90 -# @USAGE: <version>
91 -# @RETURN: 0 if true, 1 if false, 2 if trouble
92 -# @DESCRIPTION:
93 # Test if the eselected Emacs version is at least the major version
94 # of GNU Emacs specified as argument.
95 +# Return 0 if true, 1 if false, 2 if trouble.
96 +# Deprecated, use elisp-check-emacs-version instead.
97
98 elisp-need-emacs() {
99 local need_emacs=$1 have_emacs
100 --
101 2.24.1

Attachments

File name MIME type
signature.asc application/pgp-signature