/[gentoo-x86]/app-editors/emacs-vcs/emacs-vcs-24.1.9999-r1.ebuild
Gentoo

Contents of /app-editors/emacs-vcs/emacs-vcs-24.1.9999-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (hide annotations) (download)
Sun Jun 24 15:13:05 2012 UTC (2 years, 4 months ago) by ulm
Branch: MAIN
Changes since 1.5: +4 -6 lines
Store version information in system-configuration-options variable.

(Portage version: 2.1.11.1/cvs/Linux x86_64)

1 ulm 1.1 # Copyright 1999-2012 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 ulm 1.6 # $Header: /var/cvsroot/gentoo-x86/app-editors/emacs-vcs/emacs-vcs-24.1.9999-r1.ebuild,v 1.5 2012/06/10 18:34:48 ulm Exp $
4 ulm 1.1
5     EAPI=4
6    
7     inherit autotools elisp-common eutils flag-o-matic multilib
8    
9     if [[ ${PV##*.} = 9999 ]]; then
10     EBZR_PROJECT="emacs"
11     EBZR_BRANCH="trunk"
12     EBZR_REPO_URI="bzr://bzr.savannah.gnu.org/emacs/${EBZR_BRANCH}/"
13     # "Nosmart" is much faster for initial branching.
14     EBZR_INITIAL_URI="nosmart+${EBZR_REPO_URI}"
15     inherit bzr
16     SRC_URI=""
17     else
18     SRC_URI="mirror://gentoo/emacs-${PV}.tar.gz
19     mirror://gnu-alpha/emacs/pretest/emacs-${PV}.tar.gz"
20     # FULL_VERSION keeps the full version number, which is needed in
21     # order to determine some path information correctly for copy/move
22     # operations later on
23     FULL_VERSION="${PV%%_*}"
24     S="${WORKDIR}/emacs-${FULL_VERSION}"
25     fi
26    
27     DESCRIPTION="The extensible, customizable, self-documenting real-time display editor"
28     HOMEPAGE="http://www.gnu.org/software/emacs/"
29    
30     LICENSE="GPL-3 FDL-1.3 BSD as-is MIT W3C unicode PSF-2"
31     SLOT="24"
32     KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
33 ulm 1.2 IUSE="alsa athena dbus gconf gif gnutls gpm gsettings gtk gtk3 gzip-el hesiod imagemagick jpeg kerberos libxml2 m17n-lib motif pax_kernel png selinux sound source svg tiff toolkit-scroll-bars wide-int X Xaw3d xft +xpm"
34 ulm 1.1
35     RDEPEND="sys-libs/ncurses
36     >=app-admin/eselect-emacs-1.2
37 ulm 1.3 >=app-emacs/emacs-common-gentoo-1.3[X?]
38 ulm 1.1 net-libs/liblockfile
39     hesiod? ( net-dns/hesiod )
40     kerberos? ( virtual/krb5 )
41     alsa? ( media-libs/alsa-lib )
42     gpm? ( sys-libs/gpm )
43     dbus? ( sys-apps/dbus )
44     gnutls? ( net-libs/gnutls )
45     libxml2? ( >=dev-libs/libxml2-2.2.0 )
46     selinux? ( sys-libs/libselinux )
47     X? (
48     x11-libs/libXmu
49     x11-libs/libXt
50     x11-misc/xbitmaps
51     gconf? ( >=gnome-base/gconf-2.26.2 )
52     gsettings? ( >=dev-libs/glib-2.28.6 )
53     gif? ( media-libs/giflib )
54     jpeg? ( virtual/jpeg )
55     png? ( >=media-libs/libpng-1.4:0 )
56     svg? ( >=gnome-base/librsvg-2.0 )
57     tiff? ( media-libs/tiff )
58     xpm? ( x11-libs/libXpm )
59     imagemagick? ( >=media-gfx/imagemagick-6.6.2 )
60     xft? (
61     media-libs/fontconfig
62     media-libs/freetype
63     x11-libs/libXft
64     m17n-lib? (
65     >=dev-libs/libotf-0.9.4
66     >=dev-libs/m17n-lib-1.5.1
67     )
68     )
69     gtk? (
70     gtk3? ( x11-libs/gtk+:3 )
71     !gtk3? ( x11-libs/gtk+:2 )
72     )
73     !gtk? (
74     Xaw3d? ( x11-libs/libXaw3d )
75     !Xaw3d? (
76     athena? ( x11-libs/libXaw )
77     !athena? ( motif? ( >=x11-libs/openmotif-2.3:0 ) )
78     )
79     )
80     )"
81    
82     DEPEND="${RDEPEND}
83     alsa? ( virtual/pkgconfig )
84     dbus? ( virtual/pkgconfig )
85     gnutls? ( virtual/pkgconfig )
86     libxml2? ( virtual/pkgconfig )
87     X? ( virtual/pkgconfig )
88 ulm 1.2 gzip-el? ( app-arch/gzip )
89     pax_kernel? ( sys-apps/paxctl )"
90 ulm 1.1
91 ulm 1.2 EMACS_SUFFIX="${PN/emacs/emacs-${SLOT}}"
92 ulm 1.1 SITEFILE="20${PN}-${SLOT}-gentoo.el"
93    
94     src_prepare() {
95     if [[ ${PV##*.} = 9999 ]]; then
96     FULL_VERSION=$(sed -n 's/^AC_INIT(emacs,[ \t]*\([^ \t,)]*\).*/\1/p' \
97     configure.in)
98     [[ ${FULL_VERSION} ]] || die "Cannot determine current Emacs version"
99     einfo "Emacs branch: ${EBZR_BRANCH}"
100     einfo "Revision: ${EBZR_REVISION:-${EBZR_REVNO}}"
101     einfo "Emacs version number: ${FULL_VERSION}"
102     [[ ${FULL_VERSION} =~ ^${PV%.*}(\..*)?$ ]] \
103     || die "Upstream version number changed to ${FULL_VERSION}"
104     fi
105    
106     epatch_user
107    
108     if ! use alsa; then
109     # ALSA is detected even if not requested by its USE flag.
110     # Suppress it by supplying pkg-config with a wrong library name.
111     sed -i -e "/ALSA_MODULES=/s/alsa/DiSaBlEaLsA/" configure.in \
112     || die "unable to sed configure.in"
113     fi
114     if ! use gzip-el; then
115     # Emacs' build system automatically detects the gzip binary and
116     # compresses el files. We don't want that so confuse it with a
117     # wrong binary name
118     sed -i -e "s/ gzip/ PrEvEnTcOmPrEsSiOn/" configure.in \
119     || die "unable to sed configure.in"
120     fi
121    
122     AT_M4DIR=m4 eautoreconf
123     }
124    
125     src_configure() {
126     strip-flags
127    
128     if use sh; then
129     replace-flags "-O[1-9]" -O0 #262359
130     elif use ia64; then
131     replace-flags "-O[2-9]" -O1 #325373
132     else
133     replace-flags "-O[3-9]" -O2
134     fi
135    
136     local myconf
137    
138     if use alsa && ! use sound; then
139     einfo "Although sound USE flag is disabled you chose to have alsa,"
140     einfo "so sound is switched on anyway."
141     myconf="${myconf} --with-sound"
142     else
143     myconf="${myconf} $(use_with sound)"
144     fi
145    
146     if use X; then
147     myconf="${myconf} --with-x --without-ns"
148     myconf="${myconf} $(use_with gconf)"
149     myconf="${myconf} $(use_with gsettings)"
150     myconf="${myconf} $(use_with toolkit-scroll-bars)"
151     myconf="${myconf} $(use_with gif) $(use_with jpeg)"
152     myconf="${myconf} $(use_with png) $(use_with svg rsvg)"
153     myconf="${myconf} $(use_with tiff) $(use_with xpm)"
154     myconf="${myconf} $(use_with imagemagick)"
155    
156     if use xft; then
157     myconf="${myconf} --with-xft"
158     myconf="${myconf} $(use_with m17n-lib libotf)"
159     myconf="${myconf} $(use_with m17n-lib m17n-flt)"
160     else
161     myconf="${myconf} --without-xft"
162     myconf="${myconf} --without-libotf --without-m17n-flt"
163     use m17n-lib && ewarn \
164     "USE flag \"m17n-lib\" has no effect if \"xft\" is not set."
165     fi
166    
167     if use gtk; then
168     einfo "Configuring to build with GIMP Toolkit (GTK+)"
169     myconf="${myconf} --with-x-toolkit=$(usev gtk3 || echo gtk)"
170     local f
171     for f in athena Xaw3d motif; do
172     use ${f} && ewarn "USE flag \"${f}\" ignored" \
173     "(superseded by \"gtk\")"
174     done
175     elif use athena || use Xaw3d; then
176     einfo "Configuring to build with Athena/Lucid toolkit"
177     myconf="${myconf} --with-x-toolkit=lucid $(use_with Xaw3d xaw3d)"
178     use motif && ewarn "USE flag \"motif\" ignored" \
179     "(superseded by \"athena\" or \"Xaw3d\")"
180     elif use motif; then
181     einfo "Configuring to build with Motif toolkit"
182     myconf="${myconf} --with-x-toolkit=motif"
183     else
184     einfo "Configuring to build with no toolkit"
185     myconf="${myconf} --with-x-toolkit=no"
186     fi
187    
188     ! use gtk && use gtk3 \
189     && ewarn "USE flag \"gtk3\" has no effect if \"gtk\" is not set."
190     else
191     myconf="${myconf} --without-x --without-ns"
192     fi
193    
194 ulm 1.6 # Save version information in the Emacs binary. It will be available
195     # in variable "system-configuration-options".
196     myconf="${myconf} GENTOO_PACKAGE=${CATEGORY}/${PF}"
197 ulm 1.1 if [[ ${PV##*.} = 9999 ]]; then
198     myconf="${myconf} EBZR_BRANCH=${EBZR_BRANCH} EBZR_REVNO=${EBZR_REVNO}"
199     fi
200    
201     # According to configure, this option is only used for GNU/Linux
202     # (x86_64 and s390). For Gentoo Prefix we have to explicitly spell
203     # out the location because $(get_libdir) does not necessarily return
204     # something that matches the host OS's libdir naming (e.g. RHEL).
205     local crtdir=$($(tc-getCC) -print-file-name=crt1.o)
206     crtdir=${crtdir%/*}
207    
208     econf \
209     --program-suffix=-${EMACS_SUFFIX} \
210     --infodir="${EPREFIX}"/usr/share/info/${EMACS_SUFFIX} \
211     --enable-locallisppath="${EPREFIX}/etc/emacs:${EPREFIX}${SITELISP}" \
212     --with-crt-dir="${crtdir}" \
213     --with-gameuser="${GAMES_USER_DED:-games}" \
214     --without-compress-info \
215     $(use_with hesiod) \
216     $(use_with kerberos) $(use_with kerberos kerberos5) \
217     $(use_with gpm) \
218     $(use_with dbus) \
219     $(use_with gnutls) \
220     $(use_with libxml2 xml2) \
221     $(use_with selinux) \
222 ulm 1.5 $(use_with wide-int) \
223 ulm 1.1 ${myconf}
224     }
225    
226     src_compile() {
227     export SANDBOX_ON=0 # for the unbelievers, see Bug #131505
228     if [[ ${PV##*.} = 9999 ]]; then
229     emake CC="$(tc-getCC)" bootstrap
230     # cleanup, otherwise emacs will be dumped again in src_install
231     (cd src; emake versionclean)
232     fi
233     emake CC="$(tc-getCC)"
234     }
235    
236     src_install () {
237     emake install DESTDIR="${D}"
238    
239     rm "${ED}"/usr/bin/emacs-${FULL_VERSION}-${EMACS_SUFFIX} \
240     || die "removing duplicate emacs executable failed"
241     mv "${ED}"/usr/bin/emacs-${EMACS_SUFFIX} "${ED}"/usr/bin/${EMACS_SUFFIX} \
242     || die "moving Emacs executable failed"
243    
244     # move man pages to the correct place
245     local m
246     for m in "${ED}"/usr/share/man/man1/* ; do
247     mv "${m}" "${m%.1}-${EMACS_SUFFIX}.1" || die "mv man failed"
248     done
249    
250     # move info dir to avoid collisions with the dir file generated by portage
251     mv "${ED}"/usr/share/info/${EMACS_SUFFIX}/dir{,.orig} \
252     || die "moving info dir failed"
253     touch "${ED}"/usr/share/info/${EMACS_SUFFIX}/.keepinfodir
254     docompress -x /usr/share/info/${EMACS_SUFFIX}/dir.orig
255    
256     # avoid collision between slots, see bug #169033 e.g.
257     rm "${ED}"/usr/share/emacs/site-lisp/subdirs.el
258     rm -rf "${ED}"/usr/share/{applications,icons}
259 ulm 1.3 rm -rf "${ED}"/var
260 ulm 1.1
261     # remove unused <version>/site-lisp dir
262     rm -rf "${ED}"/usr/share/emacs/${FULL_VERSION}/site-lisp
263    
264     local c=";;"
265     if use source; then
266     insinto /usr/share/emacs/${FULL_VERSION}/src
267     # This is not meant to install all the source -- just the
268     # C source you might find via find-function
269     doins src/*.{c,h,m}
270     doins -r src/s
271     rm "${ED}"/usr/share/emacs/${FULL_VERSION}/src/s/README
272     c=""
273     fi
274    
275     sed 's/^X//' >"${T}/${SITEFILE}" <<-EOF
276     X
277     ;;; ${PN}-${SLOT} site-lisp configuration
278     X
279     (when (string-match "\\\\\`${FULL_VERSION//./\\\\.}\\\\>" emacs-version)
280     X ${c}(setq find-function-C-source-directory
281     X ${c} "${EPREFIX}/usr/share/emacs/${FULL_VERSION}/src")
282     X (let ((path (getenv "INFOPATH"))
283     X (dir "${EPREFIX}/usr/share/info/${EMACS_SUFFIX}")
284     X (re "\\\\\`${EPREFIX}/usr/share/info\\\\>"))
285     X (and path
286     X ;; move Emacs Info dir before anything else in /usr/share/info
287     X (let* ((p (cons nil (split-string path ":" t))) (q p))
288     X (while (and (cdr q) (not (string-match re (cadr q))))
289     X (setq q (cdr q)))
290     X (setcdr q (cons dir (delete dir (cdr q))))
291     X (setq Info-directory-list (prune-directory-list (cdr p)))))))
292     EOF
293     elisp-site-file-install "${T}/${SITEFILE}" || die
294    
295     dodoc README BUGS
296     }
297    
298     pkg_preinst() {
299     # move Info dir file to correct name
300     local infodir=/usr/share/info/${EMACS_SUFFIX} f
301     if [[ -f ${ED}${infodir}/dir.orig ]]; then
302     mv "${ED}"${infodir}/dir{.orig,} || die "moving info dir failed"
303     elif [[ -d "${ED}"${infodir} ]]; then
304     # this should not happen in EAPI 4
305     ewarn "Regenerating Info directory index in ${infodir} ..."
306     rm -f "${ED}"${infodir}/dir{,.*}
307     for f in "${ED}"${infodir}/*; do
308     if [[ ${f##*/} != *-[0-9]* && -e ${f} ]]; then
309     install-info --info-dir="${ED}"${infodir} "${f}" \
310     || die "install-info failed"
311     fi
312     done
313     fi
314     }
315    
316     pkg_postinst() {
317     elisp-site-regen
318     eselect emacs update ifunset
319    
320     if use X; then
321     elog "You need to install some fonts for Emacs."
322     elog "Installing media-fonts/font-adobe-{75,100}dpi on the X server's"
323     elog "machine would satisfy basic Emacs requirements under X11."
324     elog "See also http://www.gentoo.org/proj/en/lisp/emacs/xft.xml"
325     elog "for how to enable anti-aliased fonts."
326     elog
327     fi
328    
329     elog "You can set the version to be started by /usr/bin/emacs through"
330     elog "the Emacs eselect module, which also redirects man and info pages."
331     elog "Therefore, several Emacs versions can be installed at the same time."
332     elog "\"man emacs.eselect\" for details."
333     elog
334     elog "If you upgrade from a previous major version of Emacs, then it is"
335     elog "strongly recommended that you use app-admin/emacs-updater to rebuild"
336     elog "all byte-compiled elisp files of the installed Emacs packages."
337     }
338    
339     pkg_postrm() {
340     elisp-site-regen
341     eselect emacs update ifunset
342     }

  ViewVC Help
Powered by ViewVC 1.1.20