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