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-core/
Date: Wed, 09 Feb 2022 11:29:19
Message-Id: 1644406138.693824c270688e8970738f4530ba2e7ebcbc7049.sam@gentoo
1 commit: 693824c270688e8970738f4530ba2e7ebcbc7049
2 Author: Mathieu Tortuyaux <mtortuyaux <AT> microsoft <DOT> com>
3 AuthorDate: Wed Feb 9 11:27:51 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Wed Feb 9 11:28:58 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=693824c2
7
8 app-editors/vim-core: 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-core/Manifest | 1 +
22 app-editors/vim-core/vim-core-8.2.4285.ebuild | 233 ++++++++++++++++++++++++++
23 2 files changed, 234 insertions(+)
24
25 diff --git a/app-editors/vim-core/Manifest b/app-editors/vim-core/Manifest
26 index 67a02daea629..15c2970a6124 100644
27 --- a/app-editors/vim-core/Manifest
28 +++ b/app-editors/vim-core/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-core/vim-core-8.2.4285.ebuild b/app-editors/vim-core/vim-core-8.2.4285.ebuild
36 new file mode 100644
37 index 000000000000..bfac57e4caa8
38 --- /dev/null
39 +++ b/app-editors/vim-core/vim-core-8.2.4285.ebuild
40 @@ -0,0 +1,233 @@
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 and app-editors/gvim
47 +
48 +VIM_VERSION="8.2"
49 +inherit estack vim-doc flag-o-matic bash-completion-r1 prefix desktop xdg-utils
50 +
51 +if [[ ${PV} == 9999* ]] ; then
52 + inherit git-r3
53 + EGIT_REPO_URI="https://github.com/vim/vim.git"
54 + EGIT_CHECKOUT_DIR=${WORKDIR}/vim-${PV}
55 +else
56 + SRC_URI="https://github.com/vim/vim/archive/v${PV}.tar.gz -> vim-${PV}.tar.gz
57 + https://dev.gentoo.org/~zlogene/distfiles/app-editors/vim/vim-8.2.0360-gentoo-patches.tar.xz"
58 + 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"
59 +fi
60 +S="${WORKDIR}"/vim-${PV}
61 +
62 +DESCRIPTION="vim and gvim shared files"
63 +HOMEPAGE="https://vim.sourceforge.io/ https://github.com/vim/vim"
64 +
65 +LICENSE="vim"
66 +SLOT="0"
67 +IUSE="nls acl minimal"
68 +
69 +BDEPEND="sys-devel/autoconf"
70 +# Avoid icon file collision, bug #673880
71 +RDEPEND="!!<app-editors/gvim-8.1.0648"
72 +PDEPEND="!minimal? ( app-vim/gentoo-syntax )"
73 +
74 +pkg_setup() {
75 + # people with broken alphabets run into trouble. bug #82186.
76 + unset LANG LC_ALL
77 + export LC_COLLATE="C"
78 +
79 + # Gnome sandbox silliness. bug #114475.
80 + mkdir -p "${T}"/home || die "mkdir -p failed"
81 + export HOME="${T}"/home
82 +}
83 +
84 +src_prepare() {
85 + if [[ ${PV} != 9999* ]] ; then
86 + # Gentoo patches to fix runtime issues, cross-compile errors, etc
87 + eapply "${WORKDIR}"/patches
88 + fi
89 +
90 + # Fixup a script to use awk instead of nawk
91 + sed -i \
92 + -e '1s|.*|#!'"${EPREFIX}"'/usr/bin/awk -f|' \
93 + "${S}"/runtime/tools/mve.awk || die "sed failed"
94 +
95 + # See bug #77841. We remove this file after the tarball extraction.
96 + rm -v "${S}"/runtime/tools/vimspell.sh || die "rm failed"
97 +
98 + # Read vimrc and gvimrc from /etc/vim
99 + echo '#define SYS_VIMRC_FILE "'${EPREFIX}'/etc/vim/vimrc"' >> "${S}"/src/feature.h
100 + echo '#define SYS_GVIMRC_FILE "'${EPREFIX}'/etc/vim/gvimrc"' >> "${S}"/src/feature.h
101 +
102 + # Use exuberant ctags which installs as /usr/bin/exuberant-ctags.
103 + # Hopefully this pattern won't break for a while at least.
104 + # This fixes bug #29398 (27 Sep 2003 agriffis)
105 + sed -i 's/\<ctags\("\| [-*.]\)/exuberant-&/g' \
106 + "${S}"/runtime/doc/syntax.txt \
107 + "${S}"/runtime/doc/tagsrch.txt \
108 + "${S}"/runtime/doc/usr_29.txt \
109 + "${S}"/runtime/menu.vim \
110 + "${S}"/src/configure.ac || die 'sed failed'
111 +
112 + # Don't be fooled by /usr/include/libc.h. When found, vim thinks
113 + # this is NeXT, but it's actually just a file in dev-libs/9libs
114 + # This fixes bug #43885 (20 Mar 2004 agriffis)
115 + sed -i 's/ libc\.h / /' "${S}"/src/configure.ac || die 'sed failed'
116 +
117 + # gcc on sparc32 has this, uhm, interesting problem with detecting EOF
118 + # correctly. To avoid some really entertaining error messages about stuff
119 + # which isn't even in the source file being invalid, we'll do some trickery
120 + # to make the error never occur. bug 66162 (02 October 2004 ciaranm)
121 + find "${S}" -name '*.c' | while read c; do
122 + echo >> "$c" || die "echo failed"
123 + done
124 +
125 + # Try to avoid sandbox problems. Bug #114475.
126 + if [[ -d "${S}"/src/po ]]; then
127 + sed -i -e \
128 + '/-S check.vim/s,..VIM.,ln -s $(VIM) testvim \; ./testvim -X,' \
129 + "${S}"/src/po/Makefile || die "sed failed"
130 + fi
131 +
132 + cp -v "${S}"/src/config.mk.dist "${S}"/src/auto/config.mk || die "cp failed"
133 +
134 + # Bug #378107 - Build properly with >=perl-core/ExtUtils-ParseXS-3.20.0
135 + sed -i -e \
136 + "s:\\\$(PERLLIB)/ExtUtils/xsubpp:${EPREFIX}/usr/bin/xsubpp:" \
137 + "${S}"/src/Makefile || die 'sed for ExtUtils-ParseXS failed'
138 +
139 + eapply_user
140 +}
141 +
142 +src_configure() {
143 + local myconf
144 +
145 + # Fix bug #37354: Disallow -funroll-all-loops on amd64
146 + # Bug 57859 suggests that we want to do this for all archs
147 + filter-flags -funroll-all-loops
148 +
149 + # Fix bug #76331: -O3 causes problems, use -O2 instead. We'll do this for
150 + # everyone since previous flag filtering bugs have turned out to affect
151 + # multiple archs...
152 + replace-flags -O3 -O2
153 +
154 + # Fix bug #18245: Prevent "make" from the following chain:
155 + # (1) Notice configure.ac is newer than auto/configure
156 + # (2) Rebuild auto/configure
157 + # (3) Notice auto/configure is newer than auto/config.mk
158 + # (4) Run ./configure (with wrong args) to remake auto/config.mk
159 + sed -i 's# auto/config\.mk:#:#' src/Makefile || die "Makefile sed failed"
160 +
161 + # Remove src/auto/configure file.
162 + rm -v src/auto/configure || die "rm configure failed"
163 +
164 + emake -j1 -C src autoconf
165 +
166 + # This should fix a sandbox violation (see bug 24447). The hvc
167 + # things are for ppc64, see bug 86433.
168 + for file in /dev/pty/s* /dev/console /dev/hvc/* /dev/hvc*; do
169 + if [[ -e "${file}" ]]; then
170 + addwrite ${file}
171 + fi
172 + done
173 +
174 + # Let Portage do the stripping. Some people like that.
175 + export ac_cv_prog_STRIP="$(type -P true ) faking strip"
176 +
177 + # Keep Gentoo Prefix env contained within the EPREFIX
178 + use prefix && myconf+=" --without-local-dir"
179 +
180 + econf \
181 + --with-modified-by=Gentoo-${PVR} \
182 + --enable-gui=no \
183 + --without-x \
184 + --disable-darwin \
185 + --disable-perlinterp \
186 + --disable-pythoninterp \
187 + --disable-rubyinterp \
188 + --disable-gpm \
189 + --disable-selinux \
190 + $(use_enable nls) \
191 + $(use_enable acl) \
192 + ${myconf}
193 +}
194 +
195 +src_compile() {
196 + emake -j1 -C src auto/osdef.h objects
197 + emake tools
198 +}
199 +
200 +src_test() { :; }
201 +
202 +src_install() {
203 + local vimfiles=/usr/share/vim/vim${VIM_VERSION/.}
204 +
205 + dodir /usr/{bin,share/{man/man1,vim}}
206 + emake -C src \
207 + installruntime \
208 + installmanlinks \
209 + installmacros \
210 + installtutor \
211 + installtutorbin \
212 + installtools \
213 + install-languages \
214 + DESTDIR="${D}" \
215 + BINDIR="${EPREFIX}"/usr/bin \
216 + MANDIR="${EPREFIX}"/usr/share/man \
217 + DATADIR="${EPREFIX}"/usr/share
218 +
219 + keepdir ${vimfiles}/keymap
220 +
221 + # default vimrc is installed by vim-core since it applies to
222 + # both vim and gvim
223 + insinto /etc/vim/
224 + newins "${FILESDIR}"/vimrc-r5 vimrc
225 + eprefixify "${ED}"/etc/vim/vimrc
226 +
227 + if use minimal; then
228 + # To save space, install only a subset of the files.
229 + # Helps minimalize the livecd, bug 65144.
230 + eshopts_push -s extglob
231 +
232 + rm -rv "${ED}${vimfiles}"/{compiler,doc,ftplugin,indent} || die "rm failed"
233 + rm -rv "${ED}${vimfiles}"/{macros,print,tools,tutor} || die "rm failed"
234 + rm -v "${ED}"/usr/bin/vimtutor || die "rm failed"
235 +
236 + # Delete defaults.vim to avoid conflicts with one from vim[minimal]
237 + rm -v "${ED}${vimfiles}"/defaults.vim || die "rm failed"
238 +
239 + local keep_colors="default"
240 + ignore=$(rm -fr "${ED}${vimfiles}"/colors/!(${keep_colors}).vim )
241 +
242 + local keep_syntax="conf|crontab|fstab|inittab|resolv|sshdconfig"
243 + # tinkering with the next line might make bad things happen ...
244 + keep_syntax="${keep_syntax}|syntax|nosyntax|synload"
245 + ignore=$(rm -fr "${ED}${vimfiles}"/syntax/!(${keep_syntax}).vim )
246 +
247 + # Delete skip_defaults_vim config not supported by vim[minimal]
248 + sed -i '/skip_defaults_vim/d' "${ED}"/etc/vim/vimrc || die "sed failed"
249 +
250 + eshopts_pop
251 + fi
252 +
253 + newbashcomp "${FILESDIR}"/xxd-completion xxd
254 +
255 + # install gvim icon since both vim/gvim desktop files reference it
256 + doicon -s scalable "${FILESDIR}"/gvim.svg
257 +}
258 +
259 +pkg_postinst() {
260 + # update documentation tags (from vim-doc.eclass)
261 + update_vim_helptags
262 +
263 + # update icon cache
264 + xdg_icon_cache_update
265 +}
266 +
267 +pkg_postrm() {
268 + # Update documentation tags (from vim-doc.eclass)
269 + update_vim_helptags
270 +
271 + # update icon cache
272 + xdg_icon_cache_update
273 +}