Gentoo Archives: gentoo-commits

From: Ben Kohler <bkohler@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-editors/vim/
Date: Tue, 28 Feb 2023 16:28:52
Message-Id: 1677601719.8c307cc4d3bab65ec72593fd2cab648d33e9c40e.bkohler@gentoo
1 commit: 8c307cc4d3bab65ec72593fd2cab648d33e9c40e
2 Author: Ben Kohler <bkohler <AT> gentoo <DOT> org>
3 AuthorDate: Tue Feb 28 16:25:23 2023 +0000
4 Commit: Ben Kohler <bkohler <AT> gentoo <DOT> org>
5 CommitDate: Tue Feb 28 16:28:39 2023 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8c307cc4
7
8 app-editors/vim: add 9.0.1363
9
10 Bug: https://bugs.gentoo.org/898446
11
12 Signed-off-by: Ben Kohler <bkohler <AT> gentoo.org>
13
14 app-editors/vim/Manifest | 1 +
15 app-editors/vim/vim-9.0.1363.ebuild | 374 ++++++++++++++++++++++++++++++++++++
16 2 files changed, 375 insertions(+)
17
18 diff --git a/app-editors/vim/Manifest b/app-editors/vim/Manifest
19 index 56bc4f66ba32..207e0d1e8f7d 100644
20 --- a/app-editors/vim/Manifest
21 +++ b/app-editors/vim/Manifest
22 @@ -1,4 +1,5 @@
23 DIST vim-9.0.1000.tar.gz 16842747 BLAKE2B 85edab7d13daa3e84ef0aeb50e3e9bfd31f0634d8e480c105727b0c34318e0adf7f1276dcdac53df8fc416fd8dfb70377cd74ed570752a3e77f07a083fa6c113 SHA512 9d2b914a112948d77b92c8dcafc2f711a83c3fdaf35a28f7f606e77007b9320e2260a0f6b24fc875a817c33c012f077f89730b34e9f12d6f00795c5c806704c8
24 DIST vim-9.0.1157.tar.gz 16924574 BLAKE2B 0cdc6cf61f5abdaff0762b98550bfa5bae8f0485ddd0e9947a5fe52390f9da54fc8f5fdae767fb8f5d3ac2b441253917a80ae7f6092f67b69bdc9b6a630df8e2 SHA512 19240a9bcf5900766db42e2894b1bf7b849274711f17dc267671aacd867b334c3d30f39947dde7dd0245f289e9ad801eeb272f34a2ab15d01fac40bf71a54271
25 DIST vim-9.0.1341.tar.gz 16965673 BLAKE2B 2b58e68b06a7eb7104f77459be9ea202d979e3daae02073db29f24a07e20152c1f9f7f380e7569ab56ceef174658081bdde06db253827684d0731afb2f3fbbc6 SHA512 48e5232d629ccc9ee0093061d5340181083e22ff6b4eb0ad2e979a92be9c2a47b640ca1a58812da0f79a736f4b406a2541eb8fa4accd8213cf6ee9df1cd7f4fc
26 +DIST vim-9.0.1363.tar.gz 16974190 BLAKE2B 456114cd7e74836998b51e9272e9c9a12952146f42740b3df66e36ee8e47c8c0538341d9ac9c877c93e0b356fd9ca46a2016e9386d53e3cbfd51d0e2b113bc5a SHA512 2e79e104d9816438c14f94d0e858766129eb3f706b3a89a9761331d32b46b3f83eeadb2ce0d2ec14392a69122ab8761e57218c0e5731a4453d2b91f53a70c4c8
27 DIST vim-patches-vim-9.0.1000-patches.tar.bz2 3245 BLAKE2B 3bf3d0e314cc3f96d5d9675de196a62c4c8a72645d56ef94b80768571c99cba5cc556442e3bd2dfa8818460fd851fe7bd1ae15999af7225fb271b81c43105843 SHA512 2883441a2001bf7ce89a7f0862f780b71cc0164c8fcb8dbdf7040e1bcbcf408d138d3d77f308aa54c762e9975fa5ec89cfceeabbf721344dfc938870a363667a
28
29 diff --git a/app-editors/vim/vim-9.0.1363.ebuild b/app-editors/vim/vim-9.0.1363.ebuild
30 new file mode 100644
31 index 000000000000..40a78fc412a4
32 --- /dev/null
33 +++ b/app-editors/vim/vim-9.0.1363.ebuild
34 @@ -0,0 +1,374 @@
35 +# Copyright 1999-2023 Gentoo Authors
36 +# Distributed under the terms of the GNU General Public License v2
37 +
38 +EAPI=8
39 +
40 +# Please bump with app-editors/vim-core and app-editors/gvim
41 +
42 +VIM_VERSION="9.0"
43 +VIM_PATCHES_VERSION="9.0.1000"
44 +
45 +LUA_COMPAT=( lua5-{1..4} luajit )
46 +PYTHON_COMPAT=( python3_{9..11} )
47 +PYTHON_REQ_USE="threads(+)"
48 +USE_RUBY="ruby27 ruby30 ruby31"
49 +
50 +inherit vim-doc flag-o-matic bash-completion-r1 lua-single python-single-r1 ruby-single toolchain-funcs desktop xdg-utils
51 +
52 +if [[ ${PV} == 9999* ]] ; then
53 + inherit git-r3
54 + EGIT_REPO_URI="https://github.com/vim/vim.git"
55 +else
56 + SRC_URI="https://github.com/vim/vim/archive/v${PV}.tar.gz -> ${P}.tar.gz
57 + https://gitweb.gentoo.org/proj/vim-patches.git/snapshot/vim-patches-vim-${VIM_PATCHES_VERSION}-patches.tar.bz2"
58 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
59 +fi
60 +
61 +DESCRIPTION="Vim, an improved vi-style text editor"
62 +HOMEPAGE="https://www.vim.org https://github.com/vim/vim"
63 +
64 +LICENSE="vim"
65 +SLOT="0"
66 +IUSE="X acl crypt cscope debug gpm lua minimal nls perl python racket ruby selinux sound tcl terminal vim-pager"
67 +REQUIRED_USE="
68 + lua? ( ${LUA_REQUIRED_USE} )
69 + python? ( ${PYTHON_REQUIRED_USE} )
70 + vim-pager? ( !minimal )
71 +"
72 +
73 +RDEPEND="
74 + >=app-eselect/eselect-vi-1.1
75 + >=sys-libs/ncurses-5.2-r2:0=
76 + nls? ( virtual/libintl )
77 + acl? ( kernel_linux? ( sys-apps/acl ) )
78 + crypt? ( dev-libs/libsodium:= )
79 + cscope? ( dev-util/cscope )
80 + gpm? ( >=sys-libs/gpm-1.19.3 )
81 + lua? ( ${LUA_DEPS}
82 + $(lua_gen_impl_dep 'deprecated' lua5-1)
83 + )
84 + ~app-editors/vim-core-${PV}
85 + !<app-editors/vim-core-8.2.4328-r1
86 + vim-pager? ( app-editors/vim-core[-minimal] )
87 + perl? ( dev-lang/perl:= )
88 + python? ( ${PYTHON_DEPS} )
89 + racket? ( dev-scheme/racket )
90 + ruby? ( ${RUBY_DEPS} )
91 + selinux? ( sys-libs/libselinux )
92 + sound? ( media-libs/libcanberra )
93 + tcl? ( dev-lang/tcl:0= )
94 + X? ( x11-libs/libXt )
95 +"
96 +DEPEND="${RDEPEND}"
97 +# configure runs the Lua interpreter
98 +BDEPEND="
99 + sys-devel/autoconf
100 + lua? ( ${LUA_DEPS} )
101 + nls? ( sys-devel/gettext )
102 +"
103 +PDEPEND="!minimal? ( app-vim/gentoo-syntax )"
104 +
105 +if [[ ${PV} != 9999* ]]; then
106 + # Gentoo patches to fix runtime issues, cross-compile errors, etc
107 + PATCHES=(
108 + "${WORKDIR}/vim-patches-vim-${VIM_PATCHES_VERSION}-patches"
109 + )
110 +fi
111 +
112 +pkg_setup() {
113 + # people with broken alphabets run into trouble. bug #82186.
114 + unset LANG LC_ALL
115 + export LC_COLLATE="C"
116 +
117 + use lua && lua-single_pkg_setup
118 + use python && python-single-r1_pkg_setup
119 +}
120 +
121 +src_prepare() {
122 + default
123 +
124 + # Fixup a script to use awk instead of nawk
125 + sed -i -e \
126 + '1s|.*|#!'"${EPREFIX}"'/usr/bin/awk -f|' \
127 + "${S}"/runtime/tools/mve.awk || die "mve.awk sed failed"
128 +
129 + # Read vimrc and gvimrc from /etc/vim
130 + echo '#define SYS_VIMRC_FILE "'${EPREFIX}'/etc/vim/vimrc"' \
131 + >> "${S}"/src/feature.h || die "echo failed"
132 + echo '#define SYS_GVIMRC_FILE "'${EPREFIX}'/etc/vim/gvimrc"' \
133 + >> "${S}"/src/feature.h || die "echo failed"
134 +
135 + # Use exuberant ctags which installs as /usr/bin/exuberant-ctags.
136 + # Hopefully this pattern won't break for a while at least.
137 + # This fixes bug #29398 (27 Sep 2003 agriffis)
138 + sed -i -e \
139 + 's/\<ctags\("\| [-*.]\)/exuberant-&/g' \
140 + "${S}"/runtime/doc/syntax.txt \
141 + "${S}"/runtime/doc/tagsrch.txt \
142 + "${S}"/runtime/doc/usr_29.txt \
143 + "${S}"/runtime/menu.vim \
144 + "${S}"/src/configure.ac || die 'sed failed'
145 +
146 + # Don't be fooled by /usr/include/libc.h. When found, vim thinks
147 + # this is NeXT, but it's actually just a file in dev-libs/9libs
148 + # This fixes bug #43885 (20 Mar 2004 agriffis)
149 + sed -i -e \
150 + 's/ libc\.h / /' \
151 + "${S}"/src/configure.ac || die 'sed failed'
152 +
153 + # gcc on sparc32 has this, uhm, interesting problem with detecting EOF
154 + # correctly. To avoid some really entertaining error messages about stuff
155 + # which isn't even in the source file being invalid, we'll do some trickery
156 + # to make the error never occur. bug 66162 (02 October 2004 ciaranm)
157 + find "${S}" -name '*.c' | while read c; do
158 + echo >> "$c" || die "echo failed"
159 + done
160 +
161 + # conditionally make the manpager.sh script
162 + if use vim-pager; then
163 + cat > "${S}"/runtime/macros/manpager.sh <<-_EOF_ || die "cat EOF failed"
164 + #!/bin/sh
165 + sed -e 's/\x1B\[[[:digit:]]\+m//g' | col -b | \\
166 + vim \\
167 + -c 'let no_plugin_maps = 1' \\
168 + -c 'set nolist nomod ft=man ts=8' \\
169 + -c 'let g:showmarks_enable=0' \\
170 + -c 'runtime! macros/less.vim' -
171 + _EOF_
172 + fi
173 +
174 + # Try to avoid sandbox problems. Bug #114475.
175 + if [[ -d "${S}"/src/po ]]; then
176 + sed -i -e \
177 + '/-S check.vim/s,..VIM.,ln -s $(VIM) testvim \; ./testvim -X,' \
178 + "${S}"/src/po/Makefile || die "sed failed"
179 + fi
180 +
181 + cp -v "${S}"/src/config.mk.dist "${S}"/src/auto/config.mk || die "cp failed"
182 +
183 + sed -i -e \
184 + "s:\\\$(PERLLIB)/ExtUtils/xsubpp:${EPREFIX}/usr/bin/xsubpp:" \
185 + "${S}"/src/Makefile || die 'sed for ExtUtils-ParseXS failed'
186 +
187 + # Fix bug 18245: Prevent "make" from the following chain:
188 + # (1) Notice configure.ac is newer than auto/configure
189 + # (2) Rebuild auto/configure
190 + # (3) Notice auto/configure is newer than auto/config.mk
191 + # (4) Run ./configure (with wrong args) to remake auto/config.mk
192 + sed -i 's# auto/config\.mk:#:#' src/Makefile || die "Makefile sed failed"
193 + rm src/auto/configure || die "rm failed"
194 +}
195 +
196 +src_configure() {
197 +
198 + # Fix bug #37354: Disallow -funroll-all-loops on amd64
199 + # Bug #57859 suggests that we want to do this for all archs
200 + filter-flags -funroll-all-loops
201 +
202 + # Fix bug 76331: -O3 causes problems, use -O2 instead. We'll do this for
203 + # everyone since previous flag filtering bugs have turned out to affect
204 + # multiple archs...
205 + replace-flags -O3 -O2
206 +
207 + emake -j1 -C src autoconf
208 +
209 + # This should fix a sandbox violation (see bug #24447). The hvc
210 + # things are for ppc64, see bug #86433.
211 + for file in /dev/pty/s* /dev/console /dev/hvc/* /dev/hvc*; do
212 + if [[ -e "${file}" ]]; then
213 + addwrite ${file}
214 + fi
215 + done
216 +
217 + local myconf=()
218 + if use minimal; then
219 + myconf=(
220 + --with-features=tiny
221 + --disable-nls
222 + --disable-canberra
223 + --disable-acl
224 + --enable-gui=no
225 + --without-x
226 + --disable-darwin
227 + --disable-luainterp
228 + --disable-perlinterp
229 + --disable-pythoninterp
230 + --disable-mzschemeinterp
231 + --disable-rubyinterp
232 + --disable-selinux
233 + --disable-tclinterp
234 + --disable-gpm
235 + )
236 + else
237 + use debug && append-flags "-DDEBUG"
238 +
239 + myconf=(
240 + --with-features=huge
241 + $(use_enable sound canberra)
242 + $(use_enable acl)
243 + $(use_enable crypt libsodium)
244 + $(use_enable cscope)
245 + $(use_enable gpm)
246 + $(use_enable nls)
247 + $(use_enable perl perlinterp)
248 + $(use_enable python python3interp)
249 + $(use_with python python3-command "${PYTHON}")
250 + $(use_enable racket mzschemeinterp)
251 + $(use_enable ruby rubyinterp)
252 + $(use_enable selinux)
253 + $(use_enable tcl tclinterp)
254 + $(use_enable terminal)
255 + )
256 +
257 + # --with-features=huge forces on cscope even if we --disable it. We need
258 + # to sed this out to avoid screwiness. (1 Sep 2004 ciaranm)
259 + if ! use cscope; then
260 + sed -i -e \
261 + '/# define FEAT_CSCOPE/d' src/feature.h || die "sed failed"
262 + fi
263 +
264 + if use lua; then
265 + # -DLUA_COMPAT_OPENLIB=1 is required to enable the
266 + # deprecated (in 5.1) luaL_openlib API (#874690)
267 + use lua_single_target_lua5-1 && append-cppflags -DLUA_COMPAT_OPENLIB=1
268 +
269 + myconf+=(
270 + --enable-luainterp
271 + $(use_with lua_single_target_luajit luajit)
272 + --with-lua-prefix="${EPREFIX}/usr"
273 + )
274 + fi
275 +
276 + # don't test USE=X here ... see bug #19115
277 + # but need to provide a way to link against X ... see bug #20093
278 + myconf+=(
279 + --enable-gui=no
280 + --disable-darwin
281 + $(use_with X x)
282 + )
283 + fi
284 +
285 + # let package manager strip binaries
286 + export ac_cv_prog_STRIP="$(type -P true ) faking strip"
287 +
288 + # keep prefix env contained within the EPREFIX
289 + use prefix && myconf+=( --without-local-dir )
290 +
291 + if tc-is-cross-compiler ; then
292 + export vim_cv_getcwd_broken=no \
293 + vim_cv_memmove_handles_overlap=yes \
294 + vim_cv_stat_ignores_slash=yes \
295 + vim_cv_terminfo=yes \
296 + vim_cv_toupper_broken=no
297 + fi
298 +
299 + econf \
300 + --with-modified-by=Gentoo-${PVR} \
301 + "${myconf[@]}"
302 +}
303 +
304 +src_compile() {
305 + # The following allows emake to be used
306 + emake -j1 -C src auto/osdef.h objects
307 +
308 + emake
309 +}
310 +
311 +src_test() {
312 + einfo
313 + einfo "Starting vim tests. Several error messages will be shown"
314 + einfo "while the tests run. This is normal behaviour and does not"
315 + einfo "indicate a fault."
316 + einfo
317 + ewarn "If the tests fail, your terminal may be left in a strange"
318 + ewarn "state. Usually, running 'reset' will fix this."
319 + einfo
320 +
321 + # Don't let vim talk to X
322 + unset DISPLAY
323 +
324 + # Arch and opensuse seem to do this and at this point, I'm willing
325 + # to try anything to avoid random test hangs!
326 + export TERM=xterm
327 +
328 + # See https://github.com/vim/vim/blob/f08b0eb8691ff09f98bc4beef986ece1c521655f/src/testdir/runtest.vim#L5
329 + # for more information on test variables we can use.
330 + # Note that certain variables need vim-compatible regex (not PCRE), see e.g.
331 + # http://www.softpanorama.org/Editors/Vimorama/vim_regular_expressions.shtml.
332 + #
333 + # Skipped tests:
334 + # - Test_expand_star_star
335 + # Hangs because of a recursive symlink in /usr/include/nodejs (bug #616680)
336 + # - Test_exrc
337 + # Looks in wrong location? (bug #742710)
338 + # - Test_job_tty_in_out
339 + # Fragile and depends on TERM(?)
340 + # - Test_spelldump_bang
341 + # Hangs.
342 + # - Test_fuzzy_completion_env
343 + # Too sensitive to leaked environment variables.
344 + # - Test_term_mouse_multiple_clicks_to_select_mode
345 + # Hangs.
346 + # - Test_spelldump
347 + # Hangs.
348 + export TEST_SKIP_PAT='\(Test_expand_star_star\|Test_exrc\|Test_job_tty_in_out\|Test_spelldump_bang\|Test_fuzzy_completion_env\|Test_term_mouse_multiple_clicks_to_select_mode\|Test_spelldump\)'
349 +
350 + emake -j1 -C src/testdir nongui
351 +}
352 +
353 +# Call eselect vi update with --if-unset
354 +# to respect user's choice (bug #187449)
355 +eselect_vi_update() {
356 + ebegin "Calling eselect vi update"
357 + eselect vi update --if-unset
358 + eend $?
359 +}
360 +
361 +src_install() {
362 + local vimfiles=/usr/share/vim/vim${VIM_VERSION/.}
363 +
364 + # Note: Do not install symlinks for 'vi', 'ex', or 'view', as these are
365 + # managed by eselect-vi
366 + dobin src/vim
367 + if ! use minimal ; then
368 + dosym vim /usr/bin/vimdiff
369 + fi
370 + dosym vim /usr/bin/rvim
371 + dosym vim /usr/bin/rview
372 + if use vim-pager ; then
373 + dosym ${vimfiles}/macros/less.sh /usr/bin/vimpager
374 + dosym ${vimfiles}/macros/manpager.sh /usr/bin/vimmanpager
375 + insinto ${vimfiles}/macros
376 + doins runtime/macros/manpager.sh
377 + fperms a+x ${vimfiles}/macros/manpager.sh
378 + fi
379 +
380 + domenu runtime/vim.desktop
381 +
382 + newbashcomp "${FILESDIR}"/${PN}-completion ${PN}
383 +
384 + # keep in sync with 'complete ... -F' list
385 + bashcomp_alias vim ex vi view rvim rview vimdiff
386 +}
387 +
388 +pkg_postinst() {
389 + # Update documentation tags (from vim-doc.eclass)
390 + update_vim_helptags
391 +
392 + # Call eselect vi update
393 + eselect_vi_update
394 +
395 + # update desktop file mime cache
396 + xdg_desktop_database_update
397 +}
398 +
399 +pkg_postrm() {
400 + # Update documentation tags (from vim-doc.eclass)
401 + update_vim_helptags
402 +
403 + # Call eselect vi update
404 + eselect_vi_update
405 +
406 + # update desktop file mime cache
407 + xdg_desktop_database_update
408 +}