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