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

Contents of /app-editors/emacs-vcs/emacs-vcs-24.2.9999.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.10 - (show annotations) (download)
Fri Nov 2 08:10:14 2012 UTC (6 months, 2 weeks ago) by ulm
Branch: MAIN
CVS Tags: HEAD
Changes since 1.9: +1 -1 lines
FILE REMOVED
The upstream repository has been branched for the 24.3 release. 24.2.9999-r1 is the live ebuild for the emacs-24 branch, 24.3.9999 for the trunk.

(Portage version: 2.1.11.31/cvs/Linux x86_64, signed Manifest commit with key E7BE08CA7DC6EA25)

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

  ViewVC Help
Powered by ViewVC 1.1.13