Gentoo Archives: gentoo-commits

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