Gentoo Archives: gentoo-commits

From: Patrice Clement <monsieurp@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-editors/gvim/
Date: Sat, 12 May 2018 21:10:15
Message-Id: 1526159393.b72c974e746022f83a229dc76f6e5dc719d8bfbb.monsieurp@gentoo
1 commit: b72c974e746022f83a229dc76f6e5dc719d8bfbb
2 Author: Patrice Clement <monsieurp <AT> gentoo <DOT> org>
3 AuthorDate: Sat May 12 21:07:48 2018 +0000
4 Commit: Patrice Clement <monsieurp <AT> gentoo <DOT> org>
5 CommitDate: Sat May 12 21:09:53 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b72c974e
7
8 app-editors/gvim: remove libgnomeui dependency.
9
10 Bug: https://bugs.gentoo.org/647602
11 Package-Manager: Portage-2.3.24, Repoman-2.3.6
12
13 app-editors/gvim/gvim-8.0.1699-r1.ebuild | 372 +++++++++++++++++++++++++++++++
14 1 file changed, 372 insertions(+)
15
16 diff --git a/app-editors/gvim/gvim-8.0.1699-r1.ebuild b/app-editors/gvim/gvim-8.0.1699-r1.ebuild
17 new file mode 100644
18 index 00000000000..5cc2db95231
19 --- /dev/null
20 +++ b/app-editors/gvim/gvim-8.0.1699-r1.ebuild
21 @@ -0,0 +1,372 @@
22 +# Copyright 1999-2018 Gentoo Foundation
23 +# Distributed under the terms of the GNU General Public License v2
24 +
25 +EAPI=6
26 +VIM_VERSION="8.0"
27 +PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
28 +PYTHON_REQ_USE="threads"
29 +USE_RUBY="ruby22 ruby23 ruby24 ruby25"
30 +
31 +inherit vim-doc flag-o-matic xdg-utils gnome2-utils versionator bash-completion-r1 prefix python-single-r1 ruby-single
32 +
33 +if [[ ${PV} == 9999* ]]; then
34 + inherit git-r3
35 + EGIT_REPO_URI="https://github.com/vim/vim.git"
36 + EGIT_CHECKOUT_DIR=${WORKDIR}/vim-${PV}
37 +else
38 + SRC_URI="https://github.com/vim/vim/archive/v${PV}.tar.gz -> vim-${PV}.tar.gz
39 + https://dev.gentoo.org/~radhermit/vim/vim-8.0.0938-gentoo-patches.tar.bz2"
40 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~x86-solaris"
41 +fi
42 +
43 +DESCRIPTION="GUI version of the Vim text editor"
44 +HOMEPAGE="https://vim.sourceforge.io/ https://github.com/vim/vim"
45 +
46 +SLOT="0"
47 +LICENSE="vim"
48 +IUSE="acl aqua cscope debug gnome gtk gtk3 lua luajit motif neXt netbeans nls perl python racket ruby selinux session tcl"
49 +
50 +REQUIRED_USE="
51 + luajit? ( lua )
52 + python? ( ${PYTHON_REQUIRED_USE} )"
53 +
54 +RDEPEND="
55 + ~app-editors/vim-core-${PV}
56 + >=app-eselect/eselect-vi-1.1
57 + >=sys-libs/ncurses-5.2-r2:0=
58 + x11-libs/libICE
59 + x11-libs/libSM
60 + x11-libs/libXext
61 + x11-libs/libXt
62 + acl? ( kernel_linux? ( sys-apps/acl ) )
63 + !aqua? (
64 + gtk3? (
65 + x11-libs/gtk+:3
66 + x11-libs/libXft
67 + )
68 + !gtk3? (
69 + gtk? (
70 + >=x11-libs/gtk+-2.6:2
71 + x11-libs/libXft
72 + )
73 + !gtk? (
74 + motif? ( >=x11-libs/motif-2.3:0 )
75 + !motif? (
76 + neXt? ( x11-libs/neXtaw )
77 + !neXt? ( x11-libs/libXaw )
78 + )
79 + )
80 + )
81 + )
82 + cscope? ( dev-util/cscope )
83 + lua? (
84 + luajit? ( dev-lang/luajit:2= )
85 + !luajit? ( dev-lang/lua:0[deprecated] )
86 + )
87 + nls? ( virtual/libintl )
88 + perl? ( dev-lang/perl:= )
89 + python? ( ${PYTHON_DEPS} )
90 + racket? ( dev-scheme/racket )
91 + ruby? ( ${RUBY_DEPS} )
92 + selinux? ( sys-libs/libselinux )
93 + session? ( x11-libs/libSM )
94 + tcl? ( dev-lang/tcl:0= )"
95 +
96 +DEPEND="
97 + ${RDEPEND}
98 + dev-util/ctags
99 + sys-devel/autoconf
100 + virtual/pkgconfig
101 + nls? ( sys-devel/gettext )"
102 +
103 +S=${WORKDIR}/vim-${PV}
104 +
105 +pkg_setup() {
106 + # people with broken alphabets run into trouble. bug 82186.
107 + unset LANG LC_ALL
108 + export LC_COLLATE="C"
109 +
110 + # Gnome sandbox silliness. bug #114475.
111 + mkdir -p "${T}"/home || die
112 + export HOME="${T}"/home
113 +
114 + use python && python-single-r1_pkg_setup
115 +}
116 +
117 +src_prepare() {
118 + if [[ ${PV} != 9999* ]]; then
119 + # Gentoo patches to fix runtime issues, cross-compile errors, etc
120 + eapply "${WORKDIR}"/patches/
121 + fi
122 +
123 + # Fixup a script to use awk instead of nawk
124 + sed -i -e \
125 + '1s|.*|#!'"${EPREFIX}"'/usr/bin/awk -f|' \
126 + "${S}"/runtime/tools/mve.awk || die "mve.awk sed failed"
127 +
128 + # Read vimrc and gvimrc from /etc/vim
129 + echo '#define SYS_VIMRC_FILE "'${EPREFIX}'/etc/vim/vimrc"' \
130 + >> "${S}"/src/feature.h || die "echo failed"
131 + echo '#define SYS_GVIMRC_FILE "'${EPREFIX}'/etc/vim/gvimrc"' \
132 + >> "${S}"/src/feature.h || die "echo failed"
133 +
134 + # Use exuberant ctags which installs as /usr/bin/exuberant-ctags.
135 + # Hopefully this pattern won't break for a while at least.
136 + # This fixes bug 29398 (27 Sep 2003 agriffis)
137 + sed -i -e \
138 + 's/\<ctags\("\| [-*.]\)/exuberant-&/g' \
139 + "${S}"/runtime/doc/syntax.txt \
140 + "${S}"/runtime/doc/tagsrch.txt \
141 + "${S}"/runtime/doc/usr_29.txt \
142 + "${S}"/runtime/menu.vim \
143 + "${S}"/src/configure.ac || die 'sed failed'
144 +
145 + # Don't be fooled by /usr/include/libc.h. When found, vim thinks
146 + # this is NeXT, but it's actually just a file in dev-libs/9libs
147 + # This fixes bug 43885 (20 Mar 2004 agriffis)
148 + sed -i -e \
149 + 's/ libc\.h / /' "${S}"/src/configure.ac || die 'sed failed'
150 +
151 + # gcc on sparc32 has this, uhm, interesting problem with detecting EOF
152 + # correctly. To avoid some really entertaining error messages about stuff
153 + # which isn't even in the source file being invalid, we'll do some trickery
154 + # to make the error never occur. bug 66162 (02 October 2004 ciaranm)
155 + find "${S}" -name '*.c' | while read c; do
156 + echo >> "$c" || die "echo failed"
157 + done
158 +
159 + # Try to avoid sandbox problems. Bug #114475.
160 + if [[ -d "${S}"/src/po ]]; then
161 + sed -i -e \
162 + '/-S check.vim/s,..VIM.,ln -s $(VIM) testvim \; ./testvim -X,' \
163 + "${S}"/src/po/Makefile || die
164 + fi
165 +
166 + cp -v "${S}"/src/config.mk.dist "${S}"/src/auto/config.mk || die "cp failed"
167 +
168 + # Bug #378107 - Build properly with >=perl-core/ExtUtils-ParseXS-3.20.0
169 + sed -i -e \
170 + "s:\\\$(PERLLIB)/ExtUtils/xsubpp:${EPREFIX}/usr/bin/xsubpp:" \
171 + "${S}"/src/Makefile || die 'sed for ExtUtils-ParseXS failed'
172 +
173 + eapply_user
174 +}
175 +
176 +src_configure() {
177 + local myconf=()
178 +
179 + # Fix bug 37354: Disallow -funroll-all-loops on amd64
180 + # Bug 57859 suggests that we want to do this for all archs
181 + filter-flags -funroll-all-loops
182 +
183 + # Fix bug 76331: -O3 causes problems, use -O2 instead. We'll do this for
184 + # everyone since previous flag filtering bugs have turned out to affect
185 + # multiple archs...
186 + replace-flags -O3 -O2
187 +
188 + # Fix bug 18245: Prevent "make" from the following chain:
189 + # (1) Notice configure.ac is newer than auto/configure
190 + # (2) Rebuild auto/configure
191 + # (3) Notice auto/configure is newer than auto/config.mk
192 + # (4) Run ./configure (with wrong args) to remake auto/config.mk
193 + sed -i -e \
194 + 's# auto/config\.mk:#:#' src/Makefile || die "Makefile sed failed"
195 + rm -v src/auto/configure || die "rm failed"
196 + emake -j1 -C src autoconf
197 +
198 + # This should fix a sandbox violation (see bug 24447). The hvc
199 + # things are for ppc64, see bug 86433.
200 + local file
201 + for file in /dev/pty/s* /dev/console /dev/hvc/* /dev/hvc*; do
202 + if [[ -e ${file} ]]; then
203 + addwrite $file
204 + fi
205 + done
206 +
207 + use debug && append-flags "-DDEBUG"
208 +
209 + myconf=(
210 + --with-features=huge
211 + --disable-gpm
212 + --enable-multibyte
213 + $(use_enable acl)
214 + $(use_enable cscope)
215 + $(use_enable lua luainterp)
216 + $(use_with luajit)
217 + $(use_enable netbeans)
218 + $(use_enable nls)
219 + $(use_enable perl perlinterp)
220 + $(use_enable python pythoninterp)
221 + $(use_enable python python3interp)
222 + $(use_enable racket mzschemeinterp)
223 + $(use_enable ruby rubyinterp)
224 + $(use_enable selinux)
225 + $(use_enable session xsmp)
226 + $(use_enable tcl tclinterp)
227 + )
228 +
229 + # --with-features=huge forces on cscope even if we --disable it. We need
230 + # to sed this out to avoid screwiness. (1 Sep 2004 ciaranm)
231 + if ! use cscope; then
232 + sed -i -e \
233 + '/# define FEAT_CSCOPE/d' src/feature.h || die "couldn't disable cscope"
234 + fi
235 +
236 + # gvim's GUI preference order is as follows:
237 + # aqua CARBON (not tested)
238 + # -aqua gtk3 GTK3
239 + # -aqua -gtk3 gnome GNOME2
240 + # -aqua -gtk3 -gnome gtk GTK2
241 + # -aqua -gtk -gtk3 motif MOTIF
242 + # -aqua -gtk -gtk3 -motif neXt NEXTAW
243 + # -aqua -gtk -gtk3 -motif -neXt ATHENA
244 + echo ; echo
245 + if use aqua; then
246 + einfo "Building gvim with the Carbon GUI"
247 + myconf+=(
248 + --enable-darwin
249 + --enable-gui=carbon
250 + )
251 + elif use gtk3; then
252 + myconf+=( --enable-gtk3-check )
253 + einfo "Building gvim with the gtk+-3 GUI"
254 + myconf+=( --enable-gui=gtk3 )
255 + elif use gtk; then
256 + myconf+=( --enable-gtk2-check )
257 + if use gnome; then
258 + einfo "Building gvim with the Gnome 2 GUI"
259 + myconf+=( --enable-gui=gnome2 )
260 + else
261 + einfo "Building gvim with the gtk+-2 GUI"
262 + myconf+=( --enable-gui=gtk2 )
263 + fi
264 + elif use motif; then
265 + einfo "Building gvim with the MOTIF GUI"
266 + myconf+=( --enable-gui=motif )
267 + elif use neXt; then
268 + einfo "Building gvim with the neXtaw GUI"
269 + myconf+=( --enable-gui=nextaw )
270 + else
271 + einfo "Building gvim with the Athena GUI"
272 + myconf+=( --enable-gui=athena )
273 + fi
274 + echo ; echo
275 +
276 + # let package manager strip binaries
277 + export ac_cv_prog_STRIP="$(type -P true ) faking strip"
278 +
279 + # keep prefix env contained within the EPREFIX
280 + use prefix && myconf+=( --without-local-dir )
281 +
282 + if [[ ${CHOST} == *-interix* ]]; then
283 + # avoid finding of this function, to avoid having to patch either
284 + # configure or the source, which would be much more hackish.
285 + # after all vim does it right, only interix is badly broken (again)
286 + export ac_cv_func_sigaction=no
287 + fi
288 +
289 + econf \
290 + --with-modified-by=Gentoo-${PVR} \
291 + --with-vim-name=gvim \
292 + --with-x \
293 + "${myconf[@]}"
294 +}
295 +
296 +src_compile() {
297 + # The following allows emake to be used
298 + emake -j1 -C src auto/osdef.h objects
299 +
300 + emake
301 +}
302 +
303 +src_test() {
304 + echo
305 + einfo "Starting vim tests. Several error messages will be shown"
306 + einfo "while the tests run. This is normal behaviour and does not"
307 + einfo "indicate a fault."
308 + echo
309 + ewarn "If the tests fail, your terminal may be left in a strange"
310 + ewarn "state. Usually, running 'reset' will fix this."
311 + echo
312 +
313 + # Don't let vim talk to X
314 + unset DISPLAY
315 +
316 + # Make gvim not try to connect to X. See :help gui-x11-start in vim for how
317 + # this evil trickery works.
318 + ln -s "${S}"/src/gvim "${S}"/src/testvim || die
319 +
320 + # Make sure our VIMPROG is used.
321 + sed -i -e 's:\.\./vim:../testvim:' src/testdir/test49.vim || die
322 +
323 + # Don't do additional GUI tests.
324 + emake -j1 VIMPROG=../testvim -C src/testdir nongui
325 +}
326 +
327 +# Call eselect vi update with --if-unset
328 +# to respect user's choice (bug 187449)
329 +eselect_vi_update() {
330 + einfo "Calling eselect vi update..."
331 + eselect vi update --if-unset
332 + eend $?
333 +}
334 +
335 +src_install() {
336 + local vimfiles=/usr/share/vim/vim${VIM_VERSION/.}
337 +
338 + dobin src/gvim
339 + dosym gvim /usr/bin/gvimdiff
340 + dosym gvim /usr/bin/evim
341 + dosym gvim /usr/bin/eview
342 + dosym gvim /usr/bin/gview
343 + dosym gvim /usr/bin/rgvim
344 + dosym gvim /usr/bin/rgview
345 +
346 + emake -C src DESTDIR="${D}" DATADIR="${EPREFIX}"/usr/share install-icons
347 +
348 + dodir /usr/share/man/man1
349 + echo ".so vim.1" > "${ED}"/usr/share/man/man1/gvim.1 || die "echo failed"
350 + echo ".so vim.1" > "${ED}"/usr/share/man/man1/gview.1 || die "echo failed"
351 + echo ".so vimdiff.1" > "${ED}"/usr/share/man/man1/gvimdiff.1 || \
352 + die "echo failed"
353 +
354 + insinto /etc/vim
355 + newins "${FILESDIR}"/gvimrc-r1 gvimrc
356 + eprefixify "${ED}"/etc/vim/gvimrc
357 +
358 + doicon -s scalable "${FILESDIR}"/gvim.svg
359 +
360 + # bash completion script, bug #79018.
361 + newbashcomp "${FILESDIR}"/${PN}-completion ${PN}
362 +
363 + # don't install vim desktop file
364 + rm -v "${ED}"/usr/share/applications/vim.desktop || die "failed to remove vim.desktop"
365 +}
366 +
367 +pkg_postinst() {
368 + # Update documentation tags (from vim-doc.eclass)
369 + update_vim_helptags
370 +
371 + # Update fdo mime stuff, bug #78394
372 + xdg_desktop_database_update
373 +
374 + # Update icon cache
375 + gnome2_icon_cache_update
376 +
377 + # Call eselect vi update
378 + eselect_vi_update
379 +}
380 +
381 +pkg_postrm() {
382 + # Update documentation tags (from vim-doc.eclass)
383 + update_vim_helptags
384 +
385 + # Update fdo mime stuff, bug #78394
386 + xdg_desktop_database_update
387 +
388 + # Update icon cache
389 + gnome2_icon_cache_update
390 +
391 + # Call eselect vi update
392 + eselect_vi_update
393 +}