Gentoo Archives: gentoo-commits

From: "Ulrich Mueller (ulm)" <ulm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in eclass: elisp-common.eclass elisp.eclass
Date: Sat, 22 Sep 2007 21:02:16
Message-Id: E1IZBXe-0000ZU-KC@stork.gentoo.org
1 ulm 07/09/22 20:25:30
2
3 Modified: elisp-common.eclass elisp.eclass
4 Log:
5 Sync eclasses from Emacs overlay (revision 645).
6
7 elisp.eclass:
8 Die if elisp-install or elisp-site-file-install fails.
9 Add man comments for variables SIMPLE_ELISP, DOCS, and NEED_EMACS.
10
11 elisp-common.eclass:
12 New variable EMACS_BATCH_CLEAN, analog to the XEmacs eclasses.
13 Remove redundant pushd/popd commands in elisp-site-file-install;
14 don't die, return status instead.
15 Quote all instances of $@ and $*.
16 Don't use ${status}; it is reserved in zsh.
17 Call insinto and doins in a subshell to avoid pollution of calling
18 environment.
19 Remove superfluous dodir in elisp-install.
20 Set no-byte-compile and provide site-gentoo in site-gentoo.el.
21 Move comment for elisp-comp so that it will appear in the man page.
22
23 Revision Changes Path
24 1.28 eclass/elisp-common.eclass
25
26 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/elisp-common.eclass?rev=1.28&view=markup
27 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/elisp-common.eclass?rev=1.28&content-type=text/plain
28 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/elisp-common.eclass?r1=1.27&r2=1.28
29
30 Index: elisp-common.eclass
31 ===================================================================
32 RCS file: /var/cvsroot/gentoo-x86/eclass/elisp-common.eclass,v
33 retrieving revision 1.27
34 retrieving revision 1.28
35 diff -u -r1.27 -r1.28
36 --- elisp-common.eclass 27 Aug 2007 19:41:03 -0000 1.27
37 +++ elisp-common.eclass 22 Sep 2007 20:25:30 -0000 1.28
38 @@ -1,6 +1,6 @@
39 # Copyright 1999-2007 Gentoo Foundation
40 # Distributed under the terms of the GNU General Public License v2
41 -# $Header: /var/cvsroot/gentoo-x86/eclass/elisp-common.eclass,v 1.27 2007/08/27 19:41:03 ulm Exp $
42 +# $Header: /var/cvsroot/gentoo-x86/eclass/elisp-common.eclass,v 1.28 2007/09/22 20:25:30 ulm Exp $
43 #
44 # Copyright 2007 Christian Faulhammer <opfer@g.o>
45 # Copyright 2002-2004 Matthew Kennedy <mkennedy@g.o>
46 @@ -129,6 +129,9 @@
47
48 SITELISP=/usr/share/emacs/site-lisp
49 SITEFILE=50${PN}-gentoo.el
50 +EMACS=/usr/bin/emacs
51 +# The following works for Emacs versions 18-23, don't change it.
52 +EMACS_BATCH_CLEAN="${EMACS} -batch -q --no-site-file"
53
54 # @FUNCTION: elisp-compile
55 # @USAGE: <list of elisp files>
56 @@ -137,7 +140,7 @@
57
58 elisp-compile() {
59 einfo "Compiling GNU Emacs Elisp files ..."
60 - /usr/bin/emacs -batch -q --no-site-file -f batch-byte-compile $*
61 + ${EMACS_BATCH_CLEAN} -f batch-byte-compile "$@"
62 }
63
64 # @FUNCTION: elisp-emacs-version
65 @@ -145,9 +148,9 @@
66 # Output version of currently active Emacs.
67
68 elisp-emacs-version() {
69 - # The following will work for at least versions 18-22.
70 + # The following will work for at least versions 18-23.
71 echo "(princ emacs-version)" >"${T}"/emacs-version.el
72 - /usr/bin/emacs -batch -q --no-site-file -l "${T}"/emacs-version.el
73 + ${EMACS_BATCH_CLEAN} -l "${T}"/emacs-version.el
74 }
75
76 # @FUNCTION: elisp-make-autoload-file
77 @@ -177,7 +180,7 @@
78 ;;; ${f##*/} ends here
79 EOF
80
81 - /usr/bin/emacs -batch -q --no-site-file \
82 + ${EMACS_BATCH_CLEAN} \
83 --eval "(setq make-backup-files nil)" \
84 --eval "(setq generated-autoload-file (expand-file-name \"${f}\"))" \
85 -f batch-update-autoloads "${@-.}"
86 @@ -189,12 +192,13 @@
87 # Install files in SITELISP directory.
88
89 elisp-install() {
90 - local subdir=$1
91 - einfo "Installing Elisp files for GNU Emacs support ..."
92 - dodir "${SITELISP}/${subdir}"
93 - insinto "${SITELISP}/${subdir}"
94 + local subdir="$1"
95 shift
96 - doins $@
97 + einfo "Installing Elisp files for GNU Emacs support ..."
98 + ( # subshell to avoid pollution of calling environment
99 + insinto "${SITELISP}/${subdir}"
100 + doins "$@"
101 + )
102 }
103
104 # @FUNCTION: elisp-site-file-install
105 @@ -203,14 +207,14 @@
106 # Install Emacs site-init file in SITELISP directory.
107
108 elisp-site-file-install() {
109 - local sitefile=$1 my_pn=${2:-${PN}}
110 + local sf="$1" my_pn="${2:-${PN}}"
111 einfo "Installing site initialisation file for GNU Emacs ..."
112 - pushd "${S}"
113 - cp ${sitefile} "${T}"
114 - sed -i "s:@SITELISP@:${SITELISP}/${my_pn}:g" "${T}/$(basename ${sitefile})"
115 - insinto ${SITELISP}
116 - doins "${T}/$(basename ${sitefile})" || die "failed to install site file"
117 - popd
118 + cp "${sf}" "${T}"
119 + sed -i "s:@SITELISP@:${SITELISP}/${my_pn}:g" "${T}/$(basename "${sf}")"
120 + ( # subshell to avoid pollution of calling environment
121 + insinto "${SITELISP}"
122 + doins "${T}/$(basename "${sf}")"
123 + )
124 }
125
126 # @FUNCTION: elisp-site-regen
127 @@ -240,6 +244,11 @@
128
129 cat <<-EOF >>"${T}"/site-gentoo.el
130
131 + (provide 'site-gentoo)
132 +
133 + ;; Local Variables:
134 + ;; no-byte-compile: t
135 + ;; End:
136 ;;; site-gentoo.el ends here
137 EOF
138
139 @@ -279,19 +288,20 @@
140 # @USAGE: <list of elisp files>
141 # @DESCRIPTION:
142 # Byte-compile interdependent Emacs Lisp files.
143 -# Originally taken from GNU autotools.
144 +#
145 +# This function byte-compiles all ".el" files which are part of its
146 +# arguments, using GNU Emacs, and puts the resulting ".elc" files into the
147 +# current directory, so disregarding the original directories used in ".el"
148 +# arguments.
149 +#
150 +# This function manages in such a way that all Emacs Lisp files to be
151 +# compiled are made visible between themselves, in the event they require or
152 +# load one another.
153
154 elisp-comp() {
155 # Copyright 1995 Free Software Foundation, Inc.
156 # François Pinard <pinard@×××××××××××××.ca>, 1995.
157 - # This script byte-compiles all `.el' files which are part of its
158 - # arguments, using GNU Emacs, and put the resulting `.elc' files into
159 - # the current directory, so disregarding the original directories used
160 - # in `.el' arguments.
161 - #
162 - # This script manages in such a way that all Emacs LISP files to
163 - # be compiled are made visible between themselves, in the event
164 - # they require or load-library one another.
165 + # Originally taken from GNU autotools.
166
167 test $# -gt 0 || return 1
168
169 @@ -304,16 +314,15 @@
170
171 tempdir=elc.$$
172 mkdir ${tempdir}
173 - cp $* ${tempdir}
174 + cp "$@" ${tempdir}
175 pushd ${tempdir}
176
177 echo "(add-to-list 'load-path \"../\")" > script
178 - ${EMACS} -batch -q --no-site-file --no-init-file -l script \
179 - -f batch-byte-compile *.el
180 - local status=$?
181 + ${EMACS_BATCH_CLEAN} -l script -f batch-byte-compile *.el
182 + local ret=$?
183 mv *.elc ..
184
185 popd
186 rm -fr ${tempdir}
187 - return ${status}
188 + return ${ret}
189 }
190
191
192
193 1.23 eclass/elisp.eclass
194
195 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/elisp.eclass?rev=1.23&view=markup
196 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/elisp.eclass?rev=1.23&content-type=text/plain
197 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/elisp.eclass?r1=1.22&r2=1.23
198
199 Index: elisp.eclass
200 ===================================================================
201 RCS file: /var/cvsroot/gentoo-x86/eclass/elisp.eclass,v
202 retrieving revision 1.22
203 retrieving revision 1.23
204 diff -u -r1.22 -r1.23
205 --- elisp.eclass 27 Aug 2007 19:41:03 -0000 1.22
206 +++ elisp.eclass 22 Sep 2007 20:25:30 -0000 1.23
207 @@ -1,6 +1,6 @@
208 # Copyright 1999-2007 Gentoo Foundation
209 # Distributed under the terms of the GNU General Public License v2
210 -# $Header: /var/cvsroot/gentoo-x86/eclass/elisp.eclass,v 1.22 2007/08/27 19:41:03 ulm Exp $
211 +# $Header: /var/cvsroot/gentoo-x86/eclass/elisp.eclass,v 1.23 2007/09/22 20:25:30 ulm Exp $
212 #
213 # Copyright 2007 Christian Faulhammer <opfer@g.o>
214 # Copyright 2002-2003 Matthew Kennedy <mkennedy@g.o>
215 @@ -18,15 +18,21 @@
216 # Emacs support for other than pure elisp packages is handled by
217 # elisp-common.eclass where you won't have a dependency on Emacs itself.
218 # All elisp-* functions are documented there.
219 -#
220 +
221 +# @ECLASS-VARIABLE: SIMPLE_ELISP
222 +# @DESCRIPTION:
223 # Setting SIMPLE_ELISP=t in an ebuild means, that the package's source
224 # is a single (in whatever way) compressed elisp file with the file name
225 # ${PN}-${PV}. This eclass will then redefine ${S}, and move
226 # ${PN}-${PV}.el to ${PN}.el in src_unpack().
227 -#
228 +
229 +# @ECLASS-VARIABLE: DOCS
230 +# @DESCRIPTION:
231 # DOCS="blah.txt ChangeLog" is automatically used to install the given
232 # files by dodoc in src_install().
233 -#
234 +
235 +# @ECLASS-VARIABLE: NEED_EMACS
236 +# @DESCRIPTION:
237 # If you need anything different from Emacs 21, use the NEED_EMACS
238 # variable before inheriting elisp.eclass. Set it to the major version
239 # your package uses and the dependency will be adjusted.
240 @@ -63,8 +69,9 @@
241 }
242
243 elisp_src_install() {
244 - elisp-install ${PN} *.el *.elc
245 - elisp-site-file-install "${FILESDIR}/${SITEFILE}"
246 + elisp-install ${PN} *.el *.elc || die "elisp-install failed"
247 + elisp-site-file-install "${FILESDIR}/${SITEFILE}" \
248 + || die "elisp-site-file-install failed"
249 if [ -n "${DOCS}" ]; then
250 dodoc ${DOCS} || die "dodoc failed"
251 fi
252
253
254
255 --
256 gentoo-commits@g.o mailing list