Gentoo Archives: gentoo-commits

From: "Ulrich Mueller (ulm)" <ulm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-editors/emacs-cvs: emacs-cvs-23.0.60_pre20081226.ebuild emacs-cvs-23.0.9999.ebuild ChangeLog metadata.xml emacs-cvs-23.0.9999-r1.ebuild emacs-cvs-23.0.60_pre20090125.ebuild
Date: Sun, 25 Jan 2009 19:25:21
Message-Id: E1LRAbd-0002V9-DL@stork.gentoo.org
1 ulm 09/01/25 19:25:17
2
3 Modified: emacs-cvs-23.0.60_pre20081226.ebuild
4 emacs-cvs-23.0.9999.ebuild ChangeLog metadata.xml
5 Added: emacs-cvs-23.0.9999-r1.ebuild
6 emacs-cvs-23.0.60_pre20090125.ebuild
7 Log:
8 New snapshot. Unified ebuild for live CVS, snapshot and pretest versions.
9 (Portage version: 2.2_rc23/cvs/Linux i686)
10
11 Revision Changes Path
12 1.4 app-editors/emacs-cvs/emacs-cvs-23.0.60_pre20081226.ebuild
13
14 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-editors/emacs-cvs/emacs-cvs-23.0.60_pre20081226.ebuild?rev=1.4&view=markup
15 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-editors/emacs-cvs/emacs-cvs-23.0.60_pre20081226.ebuild?rev=1.4&content-type=text/plain
16 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-editors/emacs-cvs/emacs-cvs-23.0.60_pre20081226.ebuild?r1=1.3&r2=1.4
17
18 Index: emacs-cvs-23.0.60_pre20081226.ebuild
19 ===================================================================
20 RCS file: /var/cvsroot/gentoo-x86/app-editors/emacs-cvs/emacs-cvs-23.0.60_pre20081226.ebuild,v
21 retrieving revision 1.3
22 retrieving revision 1.4
23 diff -u -r1.3 -r1.4
24 --- emacs-cvs-23.0.60_pre20081226.ebuild 4 Jan 2009 19:15:44 -0000 1.3
25 +++ emacs-cvs-23.0.60_pre20081226.ebuild 25 Jan 2009 19:25:17 -0000 1.4
26 @@ -1,6 +1,6 @@
27 # Copyright 1999-2009 Gentoo Foundation
28 # Distributed under the terms of the GNU General Public License v2
29 -# $Header: /var/cvsroot/gentoo-x86/app-editors/emacs-cvs/emacs-cvs-23.0.60_pre20081226.ebuild,v 1.3 2009/01/04 19:15:44 ulm Exp $
30 +# $Header: /var/cvsroot/gentoo-x86/app-editors/emacs-cvs/emacs-cvs-23.0.60_pre20081226.ebuild,v 1.4 2009/01/25 19:25:17 ulm Exp $
31
32 WANT_AUTOCONF="latest"
33 WANT_AUTOMAKE="latest"
34 @@ -134,7 +134,7 @@
35 einfo "Configuring to build with GIMP Toolkit (GTK+)"
36 myconf="${myconf} --with-x-toolkit=gtk"
37 elif use Xaw3d; then
38 - einfo "Configuring to build with Xaw3d (Athena) toolkit"
39 + einfo "Configuring to build with Xaw3d (Athena/Lucid) toolkit"
40 myconf="${myconf} --with-x-toolkit=athena"
41 elif use motif; then
42 einfo "Configuring to build with Motif toolkit"
43
44
45
46 1.20 app-editors/emacs-cvs/emacs-cvs-23.0.9999.ebuild
47
48 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-editors/emacs-cvs/emacs-cvs-23.0.9999.ebuild?rev=1.20&view=markup
49 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-editors/emacs-cvs/emacs-cvs-23.0.9999.ebuild?rev=1.20&content-type=text/plain
50 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-editors/emacs-cvs/emacs-cvs-23.0.9999.ebuild?r1=1.19&r2=1.20
51
52 Index: emacs-cvs-23.0.9999.ebuild
53 ===================================================================
54 RCS file: /var/cvsroot/gentoo-x86/app-editors/emacs-cvs/emacs-cvs-23.0.9999.ebuild,v
55 retrieving revision 1.19
56 retrieving revision 1.20
57 diff -u -r1.19 -r1.20
58 --- emacs-cvs-23.0.9999.ebuild 23 Jan 2009 06:50:35 -0000 1.19
59 +++ emacs-cvs-23.0.9999.ebuild 25 Jan 2009 19:25:17 -0000 1.20
60 @@ -1,6 +1,6 @@
61 # Copyright 1999-2009 Gentoo Foundation
62 # Distributed under the terms of the GNU General Public License v2
63 -# $Header: /var/cvsroot/gentoo-x86/app-editors/emacs-cvs/emacs-cvs-23.0.9999.ebuild,v 1.19 2009/01/23 06:50:35 ulm Exp $
64 +# $Header: /var/cvsroot/gentoo-x86/app-editors/emacs-cvs/emacs-cvs-23.0.9999.ebuild,v 1.20 2009/01/25 19:25:17 ulm Exp $
65
66 ECVS_AUTH="pserver"
67 ECVS_SERVER="cvs.savannah.gnu.org:/sources/emacs"
68 @@ -149,7 +149,7 @@
69 einfo "Configuring to build with GIMP Toolkit (GTK+)"
70 myconf="${myconf} --with-x-toolkit=gtk"
71 elif use Xaw3d; then
72 - einfo "Configuring to build with Xaw3d (Athena) toolkit"
73 + einfo "Configuring to build with Xaw3d (Athena/Lucid) toolkit"
74 myconf="${myconf} --with-x-toolkit=athena"
75 elif use motif; then
76 einfo "Configuring to build with Motif toolkit"
77
78
79
80 1.233 app-editors/emacs-cvs/ChangeLog
81
82 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-editors/emacs-cvs/ChangeLog?rev=1.233&view=markup
83 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-editors/emacs-cvs/ChangeLog?rev=1.233&content-type=text/plain
84 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-editors/emacs-cvs/ChangeLog?r1=1.232&r2=1.233
85
86 Index: ChangeLog
87 ===================================================================
88 RCS file: /var/cvsroot/gentoo-x86/app-editors/emacs-cvs/ChangeLog,v
89 retrieving revision 1.232
90 retrieving revision 1.233
91 diff -u -r1.232 -r1.233
92 --- ChangeLog 23 Jan 2009 06:50:35 -0000 1.232
93 +++ ChangeLog 25 Jan 2009 19:25:17 -0000 1.233
94 @@ -1,6 +1,14 @@
95 # ChangeLog for app-editors/emacs-cvs
96 # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
97 -# $Header: /var/cvsroot/gentoo-x86/app-editors/emacs-cvs/ChangeLog,v 1.232 2009/01/23 06:50:35 ulm Exp $
98 +# $Header: /var/cvsroot/gentoo-x86/app-editors/emacs-cvs/ChangeLog,v 1.233 2009/01/25 19:25:17 ulm Exp $
99 +
100 +*emacs-cvs-23.0.9999-r1 (25 Jan 2009)
101 +*emacs-cvs-23.0.60_pre20090125 (25 Jan 2009)
102 +
103 + 25 Jan 2009; Ulrich Mueller <ulm@g.o>
104 + +emacs-cvs-23.0.60_pre20090125.ebuild, +emacs-cvs-23.0.9999-r1.ebuild:
105 + New snapshot. Unified ebuild for live CVS, snapshot and pretest versions.
106 + Change EAPI to 2 for SLOT dependencies and IUSE defaults.
107
108 23 Jan 2009; Ulrich Mueller <ulm@g.o> emacs-cvs-23.0.9999.ebuild:
109 Remove patch for sparc-fbsd since it was applied upstream, bug 159584.
110
111
112
113 1.6 app-editors/emacs-cvs/metadata.xml
114
115 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-editors/emacs-cvs/metadata.xml?rev=1.6&view=markup
116 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-editors/emacs-cvs/metadata.xml?rev=1.6&content-type=text/plain
117 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-editors/emacs-cvs/metadata.xml?r1=1.5&r2=1.6
118
119 Index: metadata.xml
120 ===================================================================
121 RCS file: /var/cvsroot/gentoo-x86/app-editors/emacs-cvs/metadata.xml,v
122 retrieving revision 1.5
123 retrieving revision 1.6
124 diff -u -r1.5 -r1.6
125 --- metadata.xml 5 Jan 2009 21:49:06 -0000 1.5
126 +++ metadata.xml 25 Jan 2009 19:25:17 -0000 1.6
127 @@ -3,7 +3,7 @@
128 <pkgmetadata>
129 <herd>emacs</herd>
130 <longdescription>
131 - GNU Emacs is an extensible, customizable text editor—and more. At its core
132 + GNU Emacs is an extensible, customizable text editor - and more. At its core
133 is an interpreter for Emacs Lisp, a dialect of the Lisp programming language
134 with extensions to support text editing. The features of GNU Emacs include:
135 * Content-sensitive editing modes, including syntax coloring, for a wide
136
137
138
139 1.1 app-editors/emacs-cvs/emacs-cvs-23.0.9999-r1.ebuild
140
141 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-editors/emacs-cvs/emacs-cvs-23.0.9999-r1.ebuild?rev=1.1&view=markup
142 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-editors/emacs-cvs/emacs-cvs-23.0.9999-r1.ebuild?rev=1.1&content-type=text/plain
143
144 Index: emacs-cvs-23.0.9999-r1.ebuild
145 ===================================================================
146 # Copyright 1999-2009 Gentoo Foundation
147 # Distributed under the terms of the GNU General Public License v2
148 # $Header: /var/cvsroot/gentoo-x86/app-editors/emacs-cvs/emacs-cvs-23.0.9999-r1.ebuild,v 1.1 2009/01/25 19:25:17 ulm Exp $
149
150 EAPI=2
151
152 WANT_AUTOCONF="latest"
153 WANT_AUTOMAKE="latest"
154
155 inherit autotools elisp-common eutils flag-o-matic
156
157 if [ "${PV##*.}" = "9999" ]; then
158 ECVS_AUTH="pserver"
159 ECVS_SERVER="cvs.savannah.gnu.org:/sources/emacs"
160 ECVS_MODULE="emacs"
161 ECVS_BRANCH="HEAD"
162 ECVS_LOCALNAME="emacs"
163 inherit cvs
164 SRC_URI=""
165 FULL_VERSION=""
166 S="${WORKDIR}/${ECVS_LOCALNAME}"
167 else
168 SRC_URI="mirror://gentoo/emacs-${PV}.tar.gz
169 ftp://alpha.gnu.org/gnu/emacs/pretest/emacs-${PV}.tar.gz"
170 # FULL_VERSION keeps the full version number, which is needed in
171 # order to determine some path information correctly for copy/move
172 # operations later on
173 FULL_VERSION="${PV%_*}"
174 S="${WORKDIR}/emacs-${FULL_VERSION}"
175 fi
176
177 DESCRIPTION="The extensible, customizable, self-documenting real-time display editor"
178 HOMEPAGE="http://www.gnu.org/software/emacs/"
179
180 LICENSE="GPL-3 FDL-1.3 BSD as-is X11 W3C"
181 SLOT="23"
182 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sparc ~sparc-fbsd ~x86 ~x86-fbsd"
183 IUSE="alsa dbus gif gpm gtk gzip-el hesiod jpeg kerberos m17n-lib motif png spell sound source svg tiff toolkit-scroll-bars X Xaw3d xft +xpm"
184 RESTRICT="strip"
185
186 RDEPEND="sys-libs/ncurses
187 >=app-admin/eselect-emacs-1.2
188 net-libs/liblockfile
189 hesiod? ( net-dns/hesiod )
190 kerberos? ( virtual/krb5 )
191 spell? ( || ( app-text/ispell app-text/aspell ) )
192 alsa? ( media-libs/alsa-lib )
193 gpm? ( sys-libs/gpm )
194 dbus? ( sys-apps/dbus )
195 X? (
196 x11-libs/libXmu
197 x11-libs/libXt
198 x11-misc/xbitmaps
199 x11-misc/emacs-desktop
200 gif? ( media-libs/giflib )
201 jpeg? ( media-libs/jpeg )
202 png? ( media-libs/libpng )
203 svg? ( >=gnome-base/librsvg-2.0 )
204 tiff? ( media-libs/tiff )
205 xpm? ( x11-libs/libXpm )
206 xft? (
207 media-libs/fontconfig
208 media-libs/freetype
209 x11-libs/libXft
210 m17n-lib? (
211 >=dev-libs/libotf-0.9.4
212 >=dev-libs/m17n-lib-1.5.1
213 )
214 )
215 gtk? ( x11-libs/gtk+:2 )
216 !gtk? (
217 Xaw3d? ( x11-libs/Xaw3d )
218 !Xaw3d? ( motif? ( x11-libs/openmotif ) )
219 )
220 )"
221
222 DEPEND="${RDEPEND}
223 dev-util/pkgconfig
224 gzip-el? ( app-arch/gzip )"
225
226 EMACS_SUFFIX="emacs-${SLOT}"
227 SITEFILE="20${PN}-${SLOT}-gentoo.el"
228
229 src_prepare() {
230 if [ -z "${FULL_VERSION}" ]; then
231 FULL_VERSION=$(grep 'defconst[ ]*emacs-version' lisp/version.el \
232 | sed -e 's/^[^"]*"\([^"]*\)".*$/\1/')
233 [ "${FULL_VERSION}" ] || die "Cannot determine current Emacs version"
234 echo
235 einfo "Emacs CVS branch: ${ECVS_BRANCH}"
236 einfo "Emacs version number: ${FULL_VERSION}"
237 [ "${FULL_VERSION%.*}" = ${PV%.*} ] \
238 || die "Upstream version number changed to ${FULL_VERSION}"
239 echo
240 fi
241
242 sed -i -e "s:/usr/lib/crtbegin.o:$(`tc-getCC` -print-file-name=crtbegin.o):g" \
243 -e "s:/usr/lib/crtend.o:$(`tc-getCC` -print-file-name=crtend.o):g" \
244 "${S}"/src/s/freebsd.h || die "unable to sed freebsd.h settings"
245
246 if ! use alsa; then
247 # ALSA is detected even if not requested by its USE flag.
248 # Suppress it by supplying pkg-config with a wrong library name.
249 sed -i -e "/ALSA_MODULES=/s/alsa/DiSaBlEaLsA/" configure.in \
250 || die "unable to sed configure.in"
251 fi
252 if ! use gzip-el; then
253 # Emacs' build system automatically detects the gzip binary and
254 # compresses el files. We don't want that so confuse it with a
255 # wrong binary name
256 sed -i -e "s/ gzip/ PrEvEnTcOmPrEsSiOn/" configure.in \
257 || die "unable to sed configure.in"
258 fi
259
260 eautoreconf
261 }
262
263 src_configure() {
264 ALLOWED_FLAGS=""
265 strip-flags
266 #unset LDFLAGS
267 replace-flags -O[3-9] -O2
268
269 local myconf
270
271 if use alsa && ! use sound; then
272 echo
273 einfo "Although sound USE flag is disabled you chose to have alsa,"
274 einfo "so sound is switched on anyway."
275 echo
276 myconf="${myconf} --with-sound"
277 else
278 myconf="${myconf} $(use_with sound)"
279 fi
280
281 if use X; then
282 myconf="${myconf} --with-x"
283 myconf="${myconf} $(use_with toolkit-scroll-bars)"
284 myconf="${myconf} $(use_with gif) $(use_with jpeg)"
285 myconf="${myconf} $(use_with png) $(use_with svg rsvg)"
286 myconf="${myconf} $(use_with tiff) $(use_with xpm)"
287 myconf="${myconf} $(use_with xft freetype) $(use_with xft)"
288
289 if use xft; then
290 myconf="${myconf} $(use_with m17n-lib libotf)"
291 myconf="${myconf} $(use_with m17n-lib m17n-flt)"
292 else
293 myconf="${myconf} --without-libotf --without-m17n-flt"
294 use m17n-lib && einfo \
295 "USE flag \"m17n-lib\" has no effect because xft is not set."
296 fi
297
298 # GTK+ is the default toolkit if USE=gtk is chosen with other
299 # possibilities. Emacs upstream thinks this should be standard
300 # policy on all distributions
301 if use gtk; then
302 einfo "Configuring to build with GIMP Toolkit (GTK+)"
303 myconf="${myconf} --with-x-toolkit=gtk"
304 elif use Xaw3d; then
305 einfo "Configuring to build with Xaw3d (Athena/Lucid) toolkit"
306 myconf="${myconf} --with-x-toolkit=athena"
307 elif use motif; then
308 einfo "Configuring to build with Motif toolkit"
309 myconf="${myconf} --with-x-toolkit=motif"
310 else
311 einfo "Configuring to build with no toolkit"
312 myconf="${myconf} --with-x-toolkit=no"
313 fi
314
315 local f tk=
316 for f in gtk Xaw3d motif; do
317 use ${f} || continue
318 [ "${tk}" ] \
319 && ewarn "USE flag \"${f}\" ignored (superseded by \"${tk}\")"
320 tk="${tk}${tk:+ }${f}"
321 done
322 else
323 myconf="${myconf} --without-x"
324 fi
325
326 myconf="${myconf} $(use_with hesiod)"
327 myconf="${myconf} $(use_with kerberos) $(use_with kerberos kerberos5)"
328 myconf="${myconf} $(use_with gpm) $(use_with dbus)"
329
330 econf \
331 --program-suffix=-${EMACS_SUFFIX} \
332 --infodir=/usr/share/info/${EMACS_SUFFIX} \
333 ${myconf} || die "econf emacs failed"
334 }
335
336 src_compile() {
337 export SANDBOX_ON=0 # for the unbelievers, see Bug #131505
338 if [ "${PV##*.}" = "9999" ]; then
339 emake CC="$(tc-getCC)" bootstrap || die "make bootstrap failed"
340 # cleanup, otherwise emacs will be dumped again in src_install
341 (cd src; emake versionclean)
342 fi
343 emake CC="$(tc-getCC)" || die "emake failed"
344 }
345
346 src_install () {
347 local i m
348
349 emake install DESTDIR="${D}" || die "make install failed"
350
351 rm "${D}"/usr/bin/emacs-${FULL_VERSION}-${EMACS_SUFFIX} \
352 || die "removing duplicate emacs executable failed"
353 mv "${D}"/usr/bin/emacs-${EMACS_SUFFIX} "${D}"/usr/bin/${EMACS_SUFFIX} \
354 || die "moving Emacs executable failed"
355
356 # move info documentation to the correct place
357 for i in "${D}"/usr/share/info/${EMACS_SUFFIX}/*; do
358 mv "${i}" "${i}.info" || die "mv info failed"
359 done
360
361 # move man pages to the correct place
362 for m in "${D}"/usr/share/man/man1/* ; do
363 mv "${m}" "${m%.1}-${EMACS_SUFFIX}.1" || die "mv man failed"
364 done
365
366 # avoid collision between slots, see bug #169033 e.g.
367 rm "${D}"/usr/share/emacs/site-lisp/subdirs.el
368 rm -rf "${D}"/usr/share/{applications,icons}
369 rm "${D}"/var/lib/games/emacs/{snake,tetris}-scores
370 keepdir /usr/share/emacs/site-lisp
371 keepdir /var/lib/games/emacs
372
373 local c=";;"
374 if use source; then
375 insinto /usr/share/emacs/${FULL_VERSION}/src
376 # This is not meant to install all the source -- just the
377 # C source you might find via find-function
378 doins src/*.[ch]
379 c=""
380 fi
381
382 sed 's/^X//' >"${SITEFILE}" <<-EOF
383 X
384 ;;; ${PN}-${SLOT} site-lisp configuration
385 X
386 (when (string-match "\\\\\`${FULL_VERSION//./\\\\.}\\\\>" emacs-version)
387 X ${c}(setq find-function-C-source-directory
388 X ${c} "/usr/share/emacs/${FULL_VERSION}/src")
389 X (let ((path (getenv "INFOPATH"))
390 X (dir "/usr/share/info/${EMACS_SUFFIX}"))
391 X (and path
392 X ;; move Emacs Info dir to beginning of list
393 X (setq Info-directory-list
394 X (cons dir (delete dir (split-string path ":" t)))))))
395 EOF
396 elisp-site-file-install "${SITEFILE}" || die
397
398 dodoc README BUGS || die "dodoc failed"
399 }
400
401 emacs-infodir-rebuild() {
402 # Depending on the Portage version, the Info dir file is compressed
403 # or removed. It is only rebuilt by Portage if our directory is in
404 # INFOPATH, which is not guaranteed. So we rebuild it ourselves.
405
406 local infodir=/usr/share/info/${EMACS_SUFFIX} f
407 [ -d "${ROOT}"${infodir} ] || return # may occur with FEATURES=noinfo
408 einfo "Regenerating Info directory index in ${infodir} ..."
409 rm -f "${ROOT}"${infodir}/dir{,.*}
410 for f in "${ROOT}"${infodir}/*.info*; do
411 [[ ${f##*/} != *[0-9].info* && -e ${f} ]] \
412 && install-info --info-dir="${ROOT}"${infodir} "${f}" &>/dev/null
413 done
414 rmdir "${ROOT}"${infodir} 2>/dev/null # remove dir if it is empty
415 echo
416 }
417
418 pkg_postinst() {
419 [ -f "${ROOT}"/usr/share/emacs/site-lisp/subdirs.el ] \
420 || cp "${ROOT}"/usr/share/emacs{/${FULL_VERSION},}/site-lisp/subdirs.el
421
422 local f
423 for f in "${ROOT}"/var/lib/games/emacs/{snake,tetris}-scores; do
424 [ -e "${f}" ] || touch "${f}"
425 done
426
427 elisp-site-regen
428 emacs-infodir-rebuild
429 eselect emacs update ifunset
430
431 echo
432 elog "You can set the version to be started by /usr/bin/emacs through"
433 elog "the Emacs eselect module, which also redirects man and info pages."
434 elog "You can therefore test emacs-cvs along with the stable release."
435 elog "\"man emacs.eselect\" for details."
436 }
437
438 pkg_postrm() {
439 elisp-site-regen
440 emacs-infodir-rebuild
441 eselect emacs update ifunset
442 }
443
444
445
446 1.1 app-editors/emacs-cvs/emacs-cvs-23.0.60_pre20090125.ebuild
447
448 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-editors/emacs-cvs/emacs-cvs-23.0.60_pre20090125.ebuild?rev=1.1&view=markup
449 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-editors/emacs-cvs/emacs-cvs-23.0.60_pre20090125.ebuild?rev=1.1&content-type=text/plain
450
451 Index: emacs-cvs-23.0.60_pre20090125.ebuild
452 ===================================================================
453 # Copyright 1999-2009 Gentoo Foundation
454 # Distributed under the terms of the GNU General Public License v2
455 # $Header: /var/cvsroot/gentoo-x86/app-editors/emacs-cvs/emacs-cvs-23.0.60_pre20090125.ebuild,v 1.1 2009/01/25 19:25:17 ulm Exp $
456
457 EAPI=2
458
459 WANT_AUTOCONF="latest"
460 WANT_AUTOMAKE="latest"
461
462 inherit autotools elisp-common eutils flag-o-matic
463
464 if [ "${PV##*.}" = "9999" ]; then
465 ECVS_AUTH="pserver"
466 ECVS_SERVER="cvs.savannah.gnu.org:/sources/emacs"
467 ECVS_MODULE="emacs"
468 ECVS_BRANCH="HEAD"
469 ECVS_LOCALNAME="emacs"
470 inherit cvs
471 SRC_URI=""
472 FULL_VERSION=""
473 S="${WORKDIR}/${ECVS_LOCALNAME}"
474 else
475 SRC_URI="mirror://gentoo/emacs-${PV}.tar.gz
476 ftp://alpha.gnu.org/gnu/emacs/pretest/emacs-${PV}.tar.gz"
477 # FULL_VERSION keeps the full version number, which is needed in
478 # order to determine some path information correctly for copy/move
479 # operations later on
480 FULL_VERSION="${PV%_*}"
481 S="${WORKDIR}/emacs-${FULL_VERSION}"
482 fi
483
484 DESCRIPTION="The extensible, customizable, self-documenting real-time display editor"
485 HOMEPAGE="http://www.gnu.org/software/emacs/"
486
487 LICENSE="GPL-3 FDL-1.3 BSD as-is X11 W3C"
488 SLOT="23"
489 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sparc ~sparc-fbsd ~x86 ~x86-fbsd"
490 IUSE="alsa dbus gif gpm gtk gzip-el hesiod jpeg kerberos m17n-lib motif png spell sound source svg tiff toolkit-scroll-bars X Xaw3d xft +xpm"
491 RESTRICT="strip"
492
493 RDEPEND="sys-libs/ncurses
494 >=app-admin/eselect-emacs-1.2
495 net-libs/liblockfile
496 hesiod? ( net-dns/hesiod )
497 kerberos? ( virtual/krb5 )
498 spell? ( || ( app-text/ispell app-text/aspell ) )
499 alsa? ( media-libs/alsa-lib )
500 gpm? ( sys-libs/gpm )
501 dbus? ( sys-apps/dbus )
502 X? (
503 x11-libs/libXmu
504 x11-libs/libXt
505 x11-misc/xbitmaps
506 x11-misc/emacs-desktop
507 gif? ( media-libs/giflib )
508 jpeg? ( media-libs/jpeg )
509 png? ( media-libs/libpng )
510 svg? ( >=gnome-base/librsvg-2.0 )
511 tiff? ( media-libs/tiff )
512 xpm? ( x11-libs/libXpm )
513 xft? (
514 media-libs/fontconfig
515 media-libs/freetype
516 x11-libs/libXft
517 m17n-lib? (
518 >=dev-libs/libotf-0.9.4
519 >=dev-libs/m17n-lib-1.5.1
520 )
521 )
522 gtk? ( x11-libs/gtk+:2 )
523 !gtk? (
524 Xaw3d? ( x11-libs/Xaw3d )
525 !Xaw3d? ( motif? ( x11-libs/openmotif ) )
526 )
527 )"
528
529 DEPEND="${RDEPEND}
530 dev-util/pkgconfig
531 gzip-el? ( app-arch/gzip )"
532
533 EMACS_SUFFIX="emacs-${SLOT}"
534 SITEFILE="20${PN}-${SLOT}-gentoo.el"
535
536 src_prepare() {
537 if [ -z "${FULL_VERSION}" ]; then
538 FULL_VERSION=$(grep 'defconst[ ]*emacs-version' lisp/version.el \
539 | sed -e 's/^[^"]*"\([^"]*\)".*$/\1/')
540 [ "${FULL_VERSION}" ] || die "Cannot determine current Emacs version"
541 echo
542 einfo "Emacs CVS branch: ${ECVS_BRANCH}"
543 einfo "Emacs version number: ${FULL_VERSION}"
544 [ "${FULL_VERSION%.*}" = ${PV%.*} ] \
545 || die "Upstream version number changed to ${FULL_VERSION}"
546 echo
547 fi
548
549 sed -i -e "s:/usr/lib/crtbegin.o:$(`tc-getCC` -print-file-name=crtbegin.o):g" \
550 -e "s:/usr/lib/crtend.o:$(`tc-getCC` -print-file-name=crtend.o):g" \
551 "${S}"/src/s/freebsd.h || die "unable to sed freebsd.h settings"
552
553 if ! use alsa; then
554 # ALSA is detected even if not requested by its USE flag.
555 # Suppress it by supplying pkg-config with a wrong library name.
556 sed -i -e "/ALSA_MODULES=/s/alsa/DiSaBlEaLsA/" configure.in \
557 || die "unable to sed configure.in"
558 fi
559 if ! use gzip-el; then
560 # Emacs' build system automatically detects the gzip binary and
561 # compresses el files. We don't want that so confuse it with a
562 # wrong binary name
563 sed -i -e "s/ gzip/ PrEvEnTcOmPrEsSiOn/" configure.in \
564 || die "unable to sed configure.in"
565 fi
566
567 eautoreconf
568 }
569
570 src_configure() {
571 ALLOWED_FLAGS=""
572 strip-flags
573 #unset LDFLAGS
574 replace-flags -O[3-9] -O2
575
576 local myconf
577
578 if use alsa && ! use sound; then
579 echo
580 einfo "Although sound USE flag is disabled you chose to have alsa,"
581 einfo "so sound is switched on anyway."
582 echo
583 myconf="${myconf} --with-sound"
584 else
585 myconf="${myconf} $(use_with sound)"
586 fi
587
588 if use X; then
589 myconf="${myconf} --with-x"
590 myconf="${myconf} $(use_with toolkit-scroll-bars)"
591 myconf="${myconf} $(use_with gif) $(use_with jpeg)"
592 myconf="${myconf} $(use_with png) $(use_with svg rsvg)"
593 myconf="${myconf} $(use_with tiff) $(use_with xpm)"
594 myconf="${myconf} $(use_with xft freetype) $(use_with xft)"
595
596 if use xft; then
597 myconf="${myconf} $(use_with m17n-lib libotf)"
598 myconf="${myconf} $(use_with m17n-lib m17n-flt)"
599 else
600 myconf="${myconf} --without-libotf --without-m17n-flt"
601 use m17n-lib && einfo \
602 "USE flag \"m17n-lib\" has no effect because xft is not set."
603 fi
604
605 # GTK+ is the default toolkit if USE=gtk is chosen with other
606 # possibilities. Emacs upstream thinks this should be standard
607 # policy on all distributions
608 if use gtk; then
609 einfo "Configuring to build with GIMP Toolkit (GTK+)"
610 myconf="${myconf} --with-x-toolkit=gtk"
611 elif use Xaw3d; then
612 einfo "Configuring to build with Xaw3d (Athena/Lucid) toolkit"
613 myconf="${myconf} --with-x-toolkit=athena"
614 elif use motif; then
615 einfo "Configuring to build with Motif toolkit"
616 myconf="${myconf} --with-x-toolkit=motif"
617 else
618 einfo "Configuring to build with no toolkit"
619 myconf="${myconf} --with-x-toolkit=no"
620 fi
621
622 local f tk=
623 for f in gtk Xaw3d motif; do
624 use ${f} || continue
625 [ "${tk}" ] \
626 && ewarn "USE flag \"${f}\" ignored (superseded by \"${tk}\")"
627 tk="${tk}${tk:+ }${f}"
628 done
629 else
630 myconf="${myconf} --without-x"
631 fi
632
633 myconf="${myconf} $(use_with hesiod)"
634 myconf="${myconf} $(use_with kerberos) $(use_with kerberos kerberos5)"
635 myconf="${myconf} $(use_with gpm) $(use_with dbus)"
636
637 econf \
638 --program-suffix=-${EMACS_SUFFIX} \
639 --infodir=/usr/share/info/${EMACS_SUFFIX} \
640 ${myconf} || die "econf emacs failed"
641 }
642
643 src_compile() {
644 export SANDBOX_ON=0 # for the unbelievers, see Bug #131505
645 if [ "${PV##*.}" = "9999" ]; then
646 emake CC="$(tc-getCC)" bootstrap || die "make bootstrap failed"
647 # cleanup, otherwise emacs will be dumped again in src_install
648 (cd src; emake versionclean)
649 fi
650 emake CC="$(tc-getCC)" || die "emake failed"
651 }
652
653 src_install () {
654 local i m
655
656 emake install DESTDIR="${D}" || die "make install failed"
657
658 rm "${D}"/usr/bin/emacs-${FULL_VERSION}-${EMACS_SUFFIX} \
659 || die "removing duplicate emacs executable failed"
660 mv "${D}"/usr/bin/emacs-${EMACS_SUFFIX} "${D}"/usr/bin/${EMACS_SUFFIX} \
661 || die "moving Emacs executable failed"
662
663 # move info documentation to the correct place
664 for i in "${D}"/usr/share/info/${EMACS_SUFFIX}/*; do
665 mv "${i}" "${i}.info" || die "mv info failed"
666 done
667
668 # move man pages to the correct place
669 for m in "${D}"/usr/share/man/man1/* ; do
670 mv "${m}" "${m%.1}-${EMACS_SUFFIX}.1" || die "mv man failed"
671 done
672
673 # avoid collision between slots, see bug #169033 e.g.
674 rm "${D}"/usr/share/emacs/site-lisp/subdirs.el
675 rm -rf "${D}"/usr/share/{applications,icons}
676 rm "${D}"/var/lib/games/emacs/{snake,tetris}-scores
677 keepdir /usr/share/emacs/site-lisp
678 keepdir /var/lib/games/emacs
679
680 local c=";;"
681 if use source; then
682 insinto /usr/share/emacs/${FULL_VERSION}/src
683 # This is not meant to install all the source -- just the
684 # C source you might find via find-function
685 doins src/*.[ch]
686 c=""
687 fi
688
689 sed 's/^X//' >"${SITEFILE}" <<-EOF
690 X
691 ;;; ${PN}-${SLOT} site-lisp configuration
692 X
693 (when (string-match "\\\\\`${FULL_VERSION//./\\\\.}\\\\>" emacs-version)
694 X ${c}(setq find-function-C-source-directory
695 X ${c} "/usr/share/emacs/${FULL_VERSION}/src")
696 X (let ((path (getenv "INFOPATH"))
697 X (dir "/usr/share/info/${EMACS_SUFFIX}"))
698 X (and path
699 X ;; move Emacs Info dir to beginning of list
700 X (setq Info-directory-list
701 X (cons dir (delete dir (split-string path ":" t)))))))
702 EOF
703 elisp-site-file-install "${SITEFILE}" || die
704
705 dodoc README BUGS || die "dodoc failed"
706 }
707
708 emacs-infodir-rebuild() {
709 # Depending on the Portage version, the Info dir file is compressed
710 # or removed. It is only rebuilt by Portage if our directory is in
711 # INFOPATH, which is not guaranteed. So we rebuild it ourselves.
712
713 local infodir=/usr/share/info/${EMACS_SUFFIX} f
714 [ -d "${ROOT}"${infodir} ] || return # may occur with FEATURES=noinfo
715 einfo "Regenerating Info directory index in ${infodir} ..."
716 rm -f "${ROOT}"${infodir}/dir{,.*}
717 for f in "${ROOT}"${infodir}/*.info*; do
718 [[ ${f##*/} != *[0-9].info* && -e ${f} ]] \
719 && install-info --info-dir="${ROOT}"${infodir} "${f}" &>/dev/null
720 done
721 rmdir "${ROOT}"${infodir} 2>/dev/null # remove dir if it is empty
722 echo
723 }
724
725 pkg_postinst() {
726 [ -f "${ROOT}"/usr/share/emacs/site-lisp/subdirs.el ] \
727 || cp "${ROOT}"/usr/share/emacs{/${FULL_VERSION},}/site-lisp/subdirs.el
728
729 local f
730 for f in "${ROOT}"/var/lib/games/emacs/{snake,tetris}-scores; do
731 [ -e "${f}" ] || touch "${f}"
732 done
733
734 elisp-site-regen
735 emacs-infodir-rebuild
736 eselect emacs update ifunset
737
738 echo
739 elog "You can set the version to be started by /usr/bin/emacs through"
740 elog "the Emacs eselect module, which also redirects man and info pages."
741 elog "You can therefore test emacs-cvs along with the stable release."
742 elog "\"man emacs.eselect\" for details."
743 }
744
745 pkg_postrm() {
746 elisp-site-regen
747 emacs-infodir-rebuild
748 eselect emacs update ifunset
749 }