Gentoo Archives: gentoo-commits

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