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