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

Contents of /app-editors/emacs-vcs/emacs-vcs-25.0.50_pre20150523.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Sat Jul 25 06:53:45 2015 UTC (3 years, 9 months ago) by ulm
Branch: MAIN
CVS Tags: HEAD
Snapshot of last revision before merging of cairo branch to master.

(Portage version: 2.2.20/cvs/Linux x86_64, signed Manifest commit with key 9433907D693FB5B8!)

1 # Copyright 1999-2015 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-25.0.50_pre20150331.ebuild,v 1.1 2015/04/05 10:31:24 ulm Exp $
4
5 EAPI=5
6
7 inherit autotools elisp-common eutils flag-o-matic multilib readme.gentoo
8
9 if [[ ${PV##*.} = 9999 ]]; then
10 inherit git-r3
11 EGIT_REPO_URI="git://git.sv.gnu.org/emacs.git"
12 EGIT_BRANCH="master"
13 EGIT_CHECKOUT_DIR="${WORKDIR}/emacs"
14 S="${EGIT_CHECKOUT_DIR}"
15 else
16 SRC_URI="http://dev.gentoo.org/~ulm/distfiles/emacs-${PV}.tar.xz
17 mirror://gnu-alpha/emacs/pretest/emacs-${PV}.tar.xz"
18 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
19 # FULL_VERSION keeps the full version number, which is needed in
20 # order to determine some path information correctly for copy/move
21 # operations later on
22 FULL_VERSION="${PV%%_*}"
23 #S="${WORKDIR}/emacs-${FULL_VERSION}"
24 S="${WORKDIR}/emacs"
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 HPND MIT W3C unicode PSF-2"
31 SLOT="25"
32 IUSE="acl alsa aqua athena dbus games gconf gfile gif gnutls gpm gsettings gtk +gtk3 gzip-el hesiod imagemagick +inotify jpeg kerberos libxml2 livecd m17n-lib motif pax_kernel png selinux sound source svg tiff toolkit-scroll-bars wide-int X Xaw3d xft +xpm zlib"
33 REQUIRED_USE="?? ( aqua X )"
34
35 RDEPEND="sys-libs/ncurses
36 >=app-eselect/eselect-emacs-1.16
37 >=app-emacs/emacs-common-gentoo-1.5[games?,X?]
38 net-libs/liblockfile
39 acl? ( virtual/acl )
40 alsa? ( media-libs/alsa-lib )
41 dbus? ( sys-apps/dbus )
42 gfile? ( >=dev-libs/glib-2.28.6 )
43 gnutls? ( net-libs/gnutls )
44 gpm? ( sys-libs/gpm )
45 hesiod? ( net-dns/hesiod )
46 kerberos? ( virtual/krb5 )
47 libxml2? ( >=dev-libs/libxml2-2.2.0 )
48 selinux? ( sys-libs/libselinux )
49 zlib? ( sys-libs/zlib )
50 X? (
51 x11-libs/libXmu
52 x11-libs/libXt
53 x11-misc/xbitmaps
54 gconf? ( >=gnome-base/gconf-2.26.2 )
55 gsettings? ( >=dev-libs/glib-2.28.6 )
56 gif? ( media-libs/giflib )
57 jpeg? ( virtual/jpeg:0= )
58 png? ( >=media-libs/libpng-1.4:0= )
59 svg? ( >=gnome-base/librsvg-2.0 )
60 tiff? ( media-libs/tiff:0 )
61 xpm? ( x11-libs/libXpm )
62 imagemagick? ( >=media-gfx/imagemagick-6.6.2 )
63 xft? (
64 media-libs/fontconfig
65 media-libs/freetype
66 x11-libs/libXft
67 m17n-lib? (
68 >=dev-libs/libotf-0.9.4
69 >=dev-libs/m17n-lib-1.5.1
70 )
71 )
72 gtk? (
73 gtk3? ( x11-libs/gtk+:3 )
74 !gtk3? ( x11-libs/gtk+:2 )
75 )
76 !gtk? (
77 motif? ( >=x11-libs/motif-2.3:0 )
78 !motif? (
79 Xaw3d? ( x11-libs/libXaw3d )
80 !Xaw3d? ( athena? ( x11-libs/libXaw ) )
81 )
82 )
83 )"
84
85 DEPEND="${RDEPEND}
86 virtual/pkgconfig
87 gzip-el? ( app-arch/gzip )
88 pax_kernel? (
89 sys-apps/attr
90 sys-apps/paxctl
91 )"
92
93 if [[ ${PV##*.} = 9999 ]]; then
94 DEPEND="${DEPEND}
95 sys-apps/texinfo"
96 fi
97
98 EMACS_SUFFIX="${PN/emacs/emacs-${SLOT}}"
99 SITEFILE="20${PN}-${SLOT}-gentoo.el"
100
101 src_prepare() {
102 if [[ ${PV##*.} = 9999 ]]; then
103 FULL_VERSION=$(sed -n 's/^AC_INIT([^,]*,[ \t]*\([^ \t,)]*\).*/\1/p' \
104 configure.ac)
105 [[ ${FULL_VERSION} ]] || die "Cannot determine current Emacs version"
106 einfo "Emacs branch: ${EGIT_BRANCH}"
107 einfo "Commit: ${EGIT_VERSION}"
108 einfo "Emacs version number: ${FULL_VERSION}"
109 [[ ${FULL_VERSION} =~ ^${PV%.*}(\..*)?$ ]] \
110 || die "Upstream version number changed to ${FULL_VERSION}"
111 fi
112
113 epatch_user
114
115 # Fix filename reference in redirected man page
116 sed -i -e "/^\\.so/s/etags/&-${EMACS_SUFFIX}/" doc/man/ctags.1 \
117 || die "unable to sed ctags.1"
118
119 AT_M4DIR=m4 eautoreconf
120 }
121
122 src_configure() {
123 strip-flags
124 filter-flags -pie #526948
125
126 if use sh; then
127 replace-flags "-O[1-9]" -O0 #262359
128 elif use ia64; then
129 replace-flags "-O[2-9]" -O1 #325373
130 else
131 replace-flags "-O[3-9]" -O2
132 fi
133
134 local myconf
135
136 if use alsa; then
137 use sound || ewarn \
138 "USE flag \"alsa\" overrides \"-sound\"; enabling sound support."
139 myconf+=" --with-sound=alsa"
140 else
141 myconf+=" --with-sound=$(usex sound oss)"
142 fi
143
144 if use X; then
145 myconf+=" --with-x --without-ns"
146 myconf+=" $(use_with gconf)"
147 myconf+=" $(use_with gsettings)"
148 myconf+=" $(use_with toolkit-scroll-bars)"
149 myconf+=" $(use_with gif)"
150 myconf+=" $(use_with jpeg)"
151 myconf+=" $(use_with png)"
152 myconf+=" $(use_with svg rsvg)"
153 myconf+=" $(use_with tiff)"
154 myconf+=" $(use_with xpm)"
155 myconf+=" $(use_with imagemagick)"
156
157 if use xft; then
158 myconf+=" --with-xft"
159 myconf+=" $(use_with m17n-lib libotf)"
160 myconf+=" $(use_with m17n-lib m17n-flt)"
161 else
162 myconf+=" --without-xft"
163 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 local f
169 if use gtk; then
170 einfo "Configuring to build with GIMP Toolkit (GTK+)"
171 while read line; do ewarn "${line}"; done <<-EOF
172 Your version of GTK+ will have problems with closing open
173 displays. This is no problem if you just use one display, but
174 if you use more than one and close one of them Emacs may crash.
175 See <http://bugzilla.gnome.org/show_bug.cgi?id=85715>.
176 If you intend to use more than one display, then it is strongly
177 recommended that you compile Emacs with the Athena/Lucid or the
178 Motif toolkit instead.
179 EOF
180 myconf+=" --with-x-toolkit=$(usex gtk3 gtk3 gtk2)"
181 for f in motif Xaw3d athena; do
182 use ${f} && ewarn \
183 "USE flag \"${f}\" has no effect if \"gtk\" is set."
184 done
185 elif use motif; then
186 einfo "Configuring to build with Motif toolkit"
187 myconf+=" --with-x-toolkit=motif"
188 for f in Xaw3d athena; do
189 use ${f} && ewarn \
190 "USE flag \"${f}\" has no effect if \"motif\" is set."
191 done
192 elif use athena || use Xaw3d; then
193 einfo "Configuring to build with Athena/Lucid toolkit"
194 myconf+=" --with-x-toolkit=lucid $(use_with Xaw3d xaw3d)"
195 else
196 einfo "Configuring to build with no toolkit"
197 myconf+=" --with-x-toolkit=no"
198 fi
199 elif use aqua; then
200 einfo "Configuring to build with Nextstep (Cocoa) support"
201 myconf+=" --with-ns --disable-ns-self-contained"
202 myconf+=" --without-x"
203 else
204 myconf+=" --without-x --without-ns"
205 fi
206
207 # Save version information in the Emacs binary. It will be available
208 # in variable "system-configuration-options".
209 myconf+=" GENTOO_PACKAGE=${CATEGORY}/${PF}"
210 if [[ ${PV##*.} = 9999 ]]; then
211 myconf+=" EGIT_BRANCH=${EGIT_BRANCH} EGIT_VERSION=${EGIT_VERSION}"
212 fi
213
214 econf \
215 --program-suffix="-${EMACS_SUFFIX}" \
216 --infodir="${EPREFIX}"/usr/share/info/${EMACS_SUFFIX} \
217 --localstatedir="${EPREFIX}"/var \
218 --enable-locallisppath="${EPREFIX}/etc/emacs:${EPREFIX}${SITELISP}" \
219 --with-gameuser=":gamestat" \
220 --without-compress-install \
221 --with-file-notification=$(usev gfile || usev inotify || echo no) \
222 $(use_enable acl) \
223 $(use_with dbus) \
224 $(use_with gnutls) \
225 $(use_with gpm) \
226 $(use_with hesiod) \
227 $(use_with kerberos) $(use_with kerberos kerberos5) \
228 $(use_with libxml2 xml2) \
229 $(use_with selinux) \
230 $(use_with wide-int) \
231 $(use_with zlib) \
232 ${myconf}
233 }
234
235 src_compile() {
236 export SANDBOX_ON=0 # for the unbelievers, see Bug #131505
237 emake
238 }
239
240 src_install () {
241 emake DESTDIR="${D}" NO_BIN_LINK=t install
242
243 mv "${ED}"/usr/bin/{emacs-${FULL_VERSION}-,}${EMACS_SUFFIX} \
244 || die "moving emacs executable failed"
245 mv "${ED}"/usr/share/man/man1/{emacs-,}${EMACS_SUFFIX}.1 \
246 || die "moving emacs man page failed"
247
248 # move info dir to avoid collisions with the dir file generated by portage
249 mv "${ED}"/usr/share/info/${EMACS_SUFFIX}/dir{,.orig} \
250 || die "moving info dir failed"
251 touch "${ED}"/usr/share/info/${EMACS_SUFFIX}/.keepinfodir
252 docompress -x /usr/share/info/${EMACS_SUFFIX}/dir.orig
253
254 # avoid collision between slots, see bug #169033 e.g.
255 rm "${ED}"/usr/share/emacs/site-lisp/subdirs.el
256 rm -rf "${ED}"/usr/share/{appdata,applications,icons}
257 rm -rf "${ED}"/var
258
259 # remove unused <version>/site-lisp dir
260 rm -rf "${ED}"/usr/share/emacs/${FULL_VERSION}/site-lisp
261
262 # remove COPYING file (except for etc/COPYING used by describe-copying)
263 rm "${ED}"/usr/share/emacs/${FULL_VERSION}/lisp/COPYING
264
265 if use gzip-el; then
266 # compress .el files when a corresponding .elc exists
267 find "${ED}"/usr/share/emacs/${FULL_VERSION}/lisp -type f \
268 -name "*.elc" -print | sed 's/\.elc$/.el/' | xargs gzip -9n
269 assert "gzip .el failed"
270 fi
271
272 local cdir
273 if use source; then
274 cdir="/usr/share/emacs/${FULL_VERSION}/src"
275 insinto "${cdir}"
276 # This is not meant to install all the source -- just the
277 # C source you might find via find-function
278 doins src/*.{c,h,m}
279 elif has installsources ${FEATURES}; then
280 cdir="/usr/src/debug/${CATEGORY}/${PF}/${S#"${WORKDIR}/"}/src"
281 fi
282
283 sed -e "${cdir:+#}/^Y/d" -e "s/^[XY]//" >"${T}/${SITEFILE}" <<-EOF
284 X
285 ;;; ${PN}-${SLOT} site-lisp configuration
286 X
287 (when (string-match "\\\\\`${FULL_VERSION//./\\\\.}\\\\>" emacs-version)
288 Y (setq find-function-C-source-directory
289 Y "${EPREFIX}${cdir}")
290 X (let ((path (getenv "INFOPATH"))
291 X (dir "${EPREFIX}/usr/share/info/${EMACS_SUFFIX}")
292 X (re "\\\\\`${EPREFIX}/usr/share/info\\\\>"))
293 X (and path
294 X ;; move Emacs Info dir before anything else in /usr/share/info
295 X (let* ((p (cons nil (split-string path ":" t))) (q p))
296 X (while (and (cdr q) (not (string-match re (cadr q))))
297 X (setq q (cdr q)))
298 X (setcdr q (cons dir (delete dir (cdr q))))
299 X (setq Info-directory-list (prune-directory-list (cdr p)))))))
300 EOF
301 elisp-site-file-install "${T}/${SITEFILE}" || die
302
303 dodoc README BUGS CONTRIBUTE
304
305 if use aqua; then
306 dodir /Applications/Gentoo
307 rm -rf "${ED}"/Applications/Gentoo/Emacs${EMACS_SUFFIX#emacs}.app
308 mv nextstep/Emacs.app \
309 "${ED}"/Applications/Gentoo/Emacs${EMACS_SUFFIX#emacs}.app || die
310 fi
311
312 DOC_CONTENTS="You can set the version to be started by /usr/bin/emacs
313 through the Emacs eselect module, which also redirects man and info
314 pages. Therefore, several Emacs versions can be installed at the
315 same time. \"man emacs.eselect\" for details.
316 \\n\\nIf you upgrade from Emacs version 24.2 or earlier, then it is
317 strongly recommended that you use app-admin/emacs-updater to rebuild
318 all byte-compiled elisp files of the installed Emacs packages."
319 use X && DOC_CONTENTS+="\\n\\nYou need to install some fonts for Emacs.
320 Installing media-fonts/font-adobe-{75,100}dpi on the X server's
321 machine would satisfy basic Emacs requirements under X11.
322 See also https://wiki.gentoo.org/wiki/Xft_support_for_GNU_Emacs
323 for how to enable anti-aliased fonts."
324 use aqua && DOC_CONTENTS+="\\n\\nEmacs${EMACS_SUFFIX#emacs}.app is in
325 \"${EPREFIX}/Applications/Gentoo\". You may want to copy or symlink
326 it into /Applications by yourself."
327 readme.gentoo_create_doc
328 }
329
330 pkg_preinst() {
331 # move Info dir file to correct name
332 local infodir=/usr/share/info/${EMACS_SUFFIX} f
333 if [[ -f ${ED}${infodir}/dir.orig ]]; then
334 mv "${ED}"${infodir}/dir{.orig,} || die "moving info dir failed"
335 elif [[ -d "${ED}"${infodir} ]]; then
336 # this should not happen in EAPI 4
337 ewarn "Regenerating Info directory index in ${infodir} ..."
338 rm -f "${ED}"${infodir}/dir{,.*}
339 for f in "${ED}"${infodir}/*; do
340 if [[ ${f##*/} != *-[0-9]* && -e ${f} ]]; then
341 install-info --info-dir="${ED}"${infodir} "${f}" \
342 || die "install-info failed"
343 fi
344 done
345 fi
346 }
347
348 pkg_postinst() {
349 elisp-site-regen
350
351 local pvr
352 for pvr in ${REPLACING_VERSIONS}; do
353 [[ ${pvr%%[-_]*} = 24.[12] ]] && FORCE_PRINT_ELOG=1
354 done
355 readme.gentoo_print_elog
356
357 if use livecd; then
358 # force an update of the emacs symlink for the livecd/dvd,
359 # because some microemacs packages set it with USE=livecd
360 eselect emacs update
361 elif [[ $(readlink "${EROOT}"/usr/bin/emacs) = ${EMACS_SUFFIX} ]]; then
362 # refresh symlinks in case any installed files have changed
363 eselect emacs set ${EMACS_SUFFIX}
364 else
365 eselect emacs update ifunset
366 fi
367 }
368
369 pkg_postrm() {
370 elisp-site-regen
371 eselect emacs update ifunset
372 }

  ViewVC Help
Powered by ViewVC 1.1.20