app-editos/{vim,vim-core}: Upgrade to 8.2.3741

Upgrades vim and vim-core to upstream. Modifies the python support range
to match Chrome OS constraints.

BUG=chromium:1283018, chromium:1268369, chromium:1266771, chromium:1268803
TEST=Builds.

Cq-Depend: chromium:3370731
Change-Id: I9b9057f4a2f53a0b1c50eca09b732eca9fd181df
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/overlays/portage-stable/+/3370406
Reviewed-by: Allen Webb <allenwebb@google.com>
Tested-by: Shervin Oloumi <enlightened@chromium.org>
Commit-Queue: Shervin Oloumi <enlightened@chromium.org>
diff --git a/app-editors/vim-core/Manifest b/app-editors/vim-core/Manifest
index ba93bb1..667cc80 100644
--- a/app-editors/vim-core/Manifest
+++ b/app-editors/vim-core/Manifest
@@ -1,3 +1,7 @@
 DIST vim-8.2.0360-gentoo-patches.tar.xz 2612 BLAKE2B a9273a686b31dd873b25bfc07f7bc254f11038bde275ae4e6f56513a14e0268fdc1032ae847d1d7f8539f8a657217011770ccb4685998f34722383ec7bfb1a15 SHA512 00bc8eb8b20a4a6f3bbd179bb90d42fa6727c8eaae5b625e95e52c33638d456ef36d06b51c542ecaffb237c0b4f7aa72dc3bae7fe00144d55ab0d2fa51950f3b
 DIST vim-8.2.0814.tar.gz 14953478 BLAKE2B fd4155ec749bd9a705e8114ff7f8cc321182c9286733ff2f665e265ec0af830f9e70c730b8d0215f6db1f73a8e2f878d22932a72c8dbfe921591be7adcdaab00 SHA512 4ddd9e2d30719f931cadd1a4de5700736f641f4b074378d9ea1462a90b81975ce8e8c3ca2e3a1e15ac0288824eef5b0f0a3e31482f7637c450c6d7e52c8f40d2
 DIST vim-8.2.3428.tar.gz 15715383 BLAKE2B 865842bae0de25c34f255085f6edfe35b6905e220bdcb76372d7289ef1f6c2b2dee2f88e4a5f849d43fa560db4ade1e8e498d86f5651c5218d9153cde5ecddd3 SHA512 7cb473afa0ad6a9728dfc2f7d8ca19a21de329c4790141c7cb815b71c07e92a1ce04a5fcc2a0381c4beb304670d6c08629dc2ed2cb0842998cca2fd846c8cd6b
+DIST vim-8.2.3567.tar.gz 15771981 BLAKE2B 5a10ce998769b73a9c3b30fccb84e90eef8242d04e52b1cf475af777233ac774a6e5ec8c2aa09cadfe2db747b485fcc26d1d953017df4bb459d8a427715a3048 SHA512 f1b5debc77d5392966d168974eab7faae99082509a8148ea212e8e06ae980d9a2652ac77547d77d10953119527f68c633440cf813bb6dec8e259b7628af93af6
+DIST vim-8.2.3582.tar.gz 15778667 BLAKE2B c8eaa95fa4fde6514168a9f42a712a78442a7fe504b59158e2e7717b8025a59cb4d8948451d72418b29f2b7cf3619cd765ef43e1304d73f81a6cba405f9706e7 SHA512 f476f24390807b71a0e02729f1815b3743b6b42cdd28a414e9ceaf0aa3fd4cab91e3550a669b1c64b4cd83207515cfe2b4acf2358a6def60e216e101c979037e
+DIST vim-8.2.3669.tar.gz 15810783 BLAKE2B edac6dabfbeb11057c7b15830b30ec555a10942494bc89d7d85b4c701b5ff8f7413887e4e33e7b812057177ffebd2cdc74e69e86080a86cfee529b1da45156bb SHA512 83d172f7e1a3c5a8ea6238f2766bf077463d32d429111c08e5b28b8aafb8aea584807023281abf3b1710d61820fec8d2b808b42b5c50058d5eb4eb917deb19ab
+DIST vim-8.2.3741.tar.gz 15812097 BLAKE2B 5cd90d4c86774a63a020ac8f245005e3f7df030c1334f989862b17b70d7859d751f79dcaf98eb5216c23df6ce63f3406cb5cb3c643f9e8170987f4f705a49833 SHA512 19ee7cc27642253ad989e6e32ab96faa46b5e1feebba00cadd018af2de186358d686cfa5efbc8e5da00a14ceb42c226acfc81cb11cd87f34ec7ca901c98df814
diff --git a/app-editors/vim-core/vim-core-8.2.0814.ebuild b/app-editors/vim-core/vim-core-8.2.3741.ebuild
similarity index 87%
rename from app-editors/vim-core/vim-core-8.2.0814.ebuild
rename to app-editors/vim-core/vim-core-8.2.3741.ebuild
index 56875ff..51ef701 100644
--- a/app-editors/vim-core/vim-core-8.2.0814.ebuild
+++ b/app-editors/vim-core/vim-core-8.2.3741.ebuild
@@ -2,6 +2,9 @@
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
+
+# Please bump with app-editors/vim and app-editors/gvim
+
 VIM_VERSION="8.2"
 inherit estack vim-doc flag-o-matic bash-completion-r1 prefix desktop xdg-utils
 
@@ -14,23 +17,22 @@
 		https://dev.gentoo.org/~zlogene/distfiles/app-editors/vim/vim-8.2.0360-gentoo-patches.tar.xz"
 	KEYWORDS="*"
 fi
+S="${WORKDIR}"/vim-${PV}
 
 DESCRIPTION="vim and gvim shared files"
 HOMEPAGE="https://vim.sourceforge.io/ https://github.com/vim/vim"
 
-SLOT="0"
 LICENSE="vim"
+SLOT="0"
 IUSE="nls acl minimal"
 
-DEPEND="sys-devel/autoconf"
-# avoid icon file collision bug #673880
+BDEPEND="sys-devel/autoconf"
+# Avoid icon file collision, bug #673880
 RDEPEND="!!<app-editors/gvim-8.1.0648"
 PDEPEND="!minimal? ( app-vim/gentoo-syntax )"
 
-S=${WORKDIR}/vim-${PV}
-
 pkg_setup() {
-	# people with broken alphabets run into trouble. bug 82186.
+	# people with broken alphabets run into trouble. bug #82186.
 	unset LANG LC_ALL
 	export LC_COLLATE="C"
 
@@ -50,7 +52,7 @@
 		-e '1s|.*|#!'"${EPREFIX}"'/usr/bin/awk -f|' \
 		"${S}"/runtime/tools/mve.awk || die "sed failed"
 
-	# See #77841. We remove this file after the tarball extraction.
+	# See bug #77841. We remove this file after the tarball extraction.
 	rm -v "${S}"/runtime/tools/vimspell.sh || die "rm failed"
 
 	# Read vimrc and gvimrc from /etc/vim
@@ -59,7 +61,7 @@
 
 	# Use exuberant ctags which installs as /usr/bin/exuberant-ctags.
 	# Hopefully this pattern won't break for a while at least.
-	# This fixes bug 29398 (27 Sep 2003 agriffis)
+	# This fixes bug #29398 (27 Sep 2003 agriffis)
 	sed -i 's/\<ctags\("\| [-*.]\)/exuberant-&/g' \
 		"${S}"/runtime/doc/syntax.txt \
 		"${S}"/runtime/doc/tagsrch.txt \
@@ -69,7 +71,7 @@
 
 	# Don't be fooled by /usr/include/libc.h.  When found, vim thinks
 	# this is NeXT, but it's actually just a file in dev-libs/9libs
-	# This fixes bug 43885 (20 Mar 2004 agriffis)
+	# This fixes bug #43885 (20 Mar 2004 agriffis)
 	sed -i 's/ libc\.h / /' "${S}"/src/configure.ac || die 'sed failed'
 
 	# gcc on sparc32 has this, uhm, interesting problem with detecting EOF
@@ -100,16 +102,16 @@
 src_configure() {
 	local myconf
 
-	# Fix bug 37354: Disallow -funroll-all-loops on amd64
+	# Fix bug #37354: Disallow -funroll-all-loops on amd64
 	# Bug 57859 suggests that we want to do this for all archs
 	filter-flags -funroll-all-loops
 
-	# Fix bug 76331: -O3 causes problems, use -O2 instead. We'll do this for
+	# Fix bug #76331: -O3 causes problems, use -O2 instead. We'll do this for
 	# everyone since previous flag filtering bugs have turned out to affect
 	# multiple archs...
 	replace-flags -O3 -O2
 
-	# Fix bug 18245: Prevent "make" from the following chain:
+	# Fix bug #18245: Prevent "make" from the following chain:
 	# (1) Notice configure.ac is newer than auto/configure
 	# (2) Rebuild auto/configure
 	# (3) Notice auto/configure is newer than auto/config.mk
@@ -125,7 +127,7 @@
 	# things are for ppc64, see bug 86433.
 	for file in /dev/pty/s* /dev/console /dev/hvc/* /dev/hvc*; do
 		if [[ -e "${file}" ]]; then
-			addwrite $file
+			addwrite ${file}
 		fi
 	done
 
@@ -191,6 +193,9 @@
 		rm -rv "${ED}${vimfiles}"/{macros,print,tools,tutor} || die "rm failed"
 		rm -v "${ED}"/usr/bin/vimtutor || die "rm failed"
 
+		# Delete defaults.vim to avoid conflicts with one from vim[minimal]
+		rm -v "${ED}${vimfiles}"/defaults.vim || die "rm failed"
+
 		local keep_colors="default"
 		ignore=$(rm -fr "${ED}${vimfiles}"/colors/!(${keep_colors}).vim )
 
@@ -199,6 +204,9 @@
 		keep_syntax="${keep_syntax}|syntax|nosyntax|synload"
 		ignore=$(rm -fr "${ED}${vimfiles}"/syntax/!(${keep_syntax}).vim )
 
+		# Delete skip_defaults_vim config not supported by vim[minimal]
+		sed -i '/skip_defaults_vim/d' "${ED}"/etc/vim/vimrc || die "sed failed"
+
 		eshopts_pop
 	fi
 
diff --git a/app-editors/vim/Manifest b/app-editors/vim/Manifest
index ba93bb1..667cc80 100644
--- a/app-editors/vim/Manifest
+++ b/app-editors/vim/Manifest
@@ -1,3 +1,7 @@
 DIST vim-8.2.0360-gentoo-patches.tar.xz 2612 BLAKE2B a9273a686b31dd873b25bfc07f7bc254f11038bde275ae4e6f56513a14e0268fdc1032ae847d1d7f8539f8a657217011770ccb4685998f34722383ec7bfb1a15 SHA512 00bc8eb8b20a4a6f3bbd179bb90d42fa6727c8eaae5b625e95e52c33638d456ef36d06b51c542ecaffb237c0b4f7aa72dc3bae7fe00144d55ab0d2fa51950f3b
 DIST vim-8.2.0814.tar.gz 14953478 BLAKE2B fd4155ec749bd9a705e8114ff7f8cc321182c9286733ff2f665e265ec0af830f9e70c730b8d0215f6db1f73a8e2f878d22932a72c8dbfe921591be7adcdaab00 SHA512 4ddd9e2d30719f931cadd1a4de5700736f641f4b074378d9ea1462a90b81975ce8e8c3ca2e3a1e15ac0288824eef5b0f0a3e31482f7637c450c6d7e52c8f40d2
 DIST vim-8.2.3428.tar.gz 15715383 BLAKE2B 865842bae0de25c34f255085f6edfe35b6905e220bdcb76372d7289ef1f6c2b2dee2f88e4a5f849d43fa560db4ade1e8e498d86f5651c5218d9153cde5ecddd3 SHA512 7cb473afa0ad6a9728dfc2f7d8ca19a21de329c4790141c7cb815b71c07e92a1ce04a5fcc2a0381c4beb304670d6c08629dc2ed2cb0842998cca2fd846c8cd6b
+DIST vim-8.2.3567.tar.gz 15771981 BLAKE2B 5a10ce998769b73a9c3b30fccb84e90eef8242d04e52b1cf475af777233ac774a6e5ec8c2aa09cadfe2db747b485fcc26d1d953017df4bb459d8a427715a3048 SHA512 f1b5debc77d5392966d168974eab7faae99082509a8148ea212e8e06ae980d9a2652ac77547d77d10953119527f68c633440cf813bb6dec8e259b7628af93af6
+DIST vim-8.2.3582.tar.gz 15778667 BLAKE2B c8eaa95fa4fde6514168a9f42a712a78442a7fe504b59158e2e7717b8025a59cb4d8948451d72418b29f2b7cf3619cd765ef43e1304d73f81a6cba405f9706e7 SHA512 f476f24390807b71a0e02729f1815b3743b6b42cdd28a414e9ceaf0aa3fd4cab91e3550a669b1c64b4cd83207515cfe2b4acf2358a6def60e216e101c979037e
+DIST vim-8.2.3669.tar.gz 15810783 BLAKE2B edac6dabfbeb11057c7b15830b30ec555a10942494bc89d7d85b4c701b5ff8f7413887e4e33e7b812057177ffebd2cdc74e69e86080a86cfee529b1da45156bb SHA512 83d172f7e1a3c5a8ea6238f2766bf077463d32d429111c08e5b28b8aafb8aea584807023281abf3b1710d61820fec8d2b808b42b5c50058d5eb4eb917deb19ab
+DIST vim-8.2.3741.tar.gz 15812097 BLAKE2B 5cd90d4c86774a63a020ac8f245005e3f7df030c1334f989862b17b70d7859d751f79dcaf98eb5216c23df6ce63f3406cb5cb3c643f9e8170987f4f705a49833 SHA512 19ee7cc27642253ad989e6e32ab96faa46b5e1feebba00cadd018af2de186358d686cfa5efbc8e5da00a14ceb42c226acfc81cb11cd87f34ec7ca901c98df814
diff --git a/app-editors/vim/vim-8.2.0814-r100.ebuild b/app-editors/vim/vim-8.2.3741.ebuild
similarity index 84%
rename from app-editors/vim/vim-8.2.0814-r100.ebuild
rename to app-editors/vim/vim-8.2.3741.ebuild
index 04a9d49..6c0b5cb 100644
--- a/app-editors/vim/vim-8.2.0814-r100.ebuild
+++ b/app-editors/vim/vim-8.2.3741.ebuild
@@ -2,6 +2,9 @@
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
+
+# Please bump with app-editors/vim-core and app-editors/gvim
+
 VIM_VERSION="8.2"
 LUA_COMPAT=( lua5-1 luajit )
 PYTHON_COMPAT=( python3_{6..9} )
@@ -22,9 +25,9 @@
 DESCRIPTION="Vim, an improved vi-style text editor"
 HOMEPAGE="https://vim.sourceforge.io/ https://github.com/vim/vim"
 
-SLOT="0"
 LICENSE="vim"
-IUSE="X acl cscope debug gpm lua ipv6 minimal nls perl python racket ruby selinux sound tcl terminal vim-pager"
+SLOT="0"
+IUSE="X acl crypt cscope debug gpm lua minimal nls perl python racket ruby selinux sound tcl terminal vim-pager"
 REQUIRED_USE="
 	lua? ( ${LUA_REQUIRED_USE} )
 	python? ( ${PYTHON_REQUIRED_USE} )
@@ -36,6 +39,7 @@
 	>=sys-libs/ncurses-5.2-r2:0=
 	nls? ( virtual/libintl )
 	acl? ( kernel_linux? ( sys-apps/acl ) )
+	crypt? ( dev-libs/libsodium:= )
 	cscope? ( dev-util/cscope )
 	gpm? ( >=sys-libs/gpm-1.19.3 )
 	lua? ( ${LUA_DEPS}
@@ -52,17 +56,16 @@
 	tcl? ( dev-lang/tcl:0= )
 	X? ( x11-libs/libXt )
 "
-
-DEPEND="
-	${RDEPEND}
+DEPEND="${RDEPEND}"
+# configure runs the Lua interpreter
+BDEPEND="
 	sys-devel/autoconf
+	lua? ( ${LUA_DEPS} )
 	nls? ( sys-devel/gettext )
 "
-# configure runs the Lua interpreter
-BDEPEND="lua? ( ${LUA_DEPS} )"
 
 pkg_setup() {
-	# people with broken alphabets run into trouble. bug 82186.
+	# people with broken alphabets run into trouble. bug #82186.
 	unset LANG LC_ALL
 	export LC_COLLATE="C"
 
@@ -93,7 +96,7 @@
 
 	# Use exuberant ctags which installs as /usr/bin/exuberant-ctags.
 	# Hopefully this pattern won't break for a while at least.
-	# This fixes bug 29398 (27 Sep 2003 agriffis)
+	# This fixes bug #29398 (27 Sep 2003 agriffis)
 	sed -i -e \
 		's/\<ctags\("\| [-*.]\)/exuberant-&/g' \
 		"${S}"/runtime/doc/syntax.txt \
@@ -104,7 +107,7 @@
 
 	# Don't be fooled by /usr/include/libc.h.  When found, vim thinks
 	# this is NeXT, but it's actually just a file in dev-libs/9libs
-	# This fixes bug 43885 (20 Mar 2004 agriffis)
+	# This fixes bug #43885 (20 Mar 2004 agriffis)
 	sed -i -e \
 		's/ libc\.h / /' \
 		"${S}"/src/configure.ac || die 'sed failed'
@@ -149,8 +152,8 @@
 src_configure() {
 	local myconf=()
 
-	# Fix bug 37354: Disallow -funroll-all-loops on amd64
-	# Bug 57859 suggests that we want to do this for all archs
+	# Fix bug #37354: Disallow -funroll-all-loops on amd64
+	# Bug #57859 suggests that we want to do this for all archs
 	filter-flags -funroll-all-loops
 
 	# Fix bug 76331: -O3 causes problems, use -O2 instead. We'll do this for
@@ -167,11 +170,11 @@
 	rm src/auto/configure || die "rm failed"
 	emake -j1 -C src autoconf
 
-	# This should fix a sandbox violation (see bug 24447). The hvc
-	# things are for ppc64, see bug 86433.
+	# This should fix a sandbox violation (see bug #24447). The hvc
+	# things are for ppc64, see bug #86433.
 	for file in /dev/pty/s* /dev/console /dev/hvc/* /dev/hvc*; do
 		if [[ -e "${file}" ]]; then
-			addwrite $file
+			addwrite ${file}
 		fi
 	done
 
@@ -200,6 +203,7 @@
 			--with-features=huge
 			$(use_enable sound canberra)
 			$(use_enable acl)
+			$(use_enable crypt libsodium)
 			$(use_enable cscope)
 			$(use_enable gpm)
 			$(use_enable nls)
@@ -228,12 +232,6 @@
 			)
 		fi
 
-		if ! use ipv6; then
-			myconf+=(
-				vim_cv_ipv6_networking=no
-			)
-		fi
-
 		# don't test USE=X here ... see bug #19115
 		# but need to provide a way to link against X ... see bug #20093
 		myconf+=(
@@ -274,11 +272,27 @@
 	# Don't let vim talk to X
 	unset DISPLAY
 
+	# See https://github.com/vim/vim/blob/f08b0eb8691ff09f98bc4beef986ece1c521655f/src/testdir/runtest.vim#L5
+	# for more information on test variables we can use.
+	# Note that certain variables need vim-compatible regex (not PCRE), see e.g.
+	# http://www.softpanorama.org/Editors/Vimorama/vim_regular_expressions.shtml.
+	#
+	# Skipped tests:
+	# - Test_expand_star_star
+	# Hangs because of a recursive symlink in /usr/include/nodejs (bug #616680)
+	# - Test_exrc
+	# Looks in wrong location? (bug #742710)
+	# - Test_job_tty_in_out
+	# Fragile and depends on TERM(?)
+	# - Test_spelldump_bang
+	# Hangs.
+	export TEST_SKIP_PAT='\(Test_expand_star_star\|Test_exrc\|Test_job_tty_in_out\|Test_spelldump_bang\)'
+
 	emake -j1 -C src/testdir nongui
 }
 
 # Call eselect vi update with --if-unset
-# to respect user's choice (bug 187449)
+# to respect user's choice (bug #187449)
 eselect_vi_update() {
 	einfo "Calling eselect vi update..."
 	eselect vi update --if-unset
@@ -304,6 +318,12 @@
 		fperms a+x ${vimfiles}/macros/manpager.sh
 	fi
 
+	# Fix an issue of missing defaults.vim when USE=minimal.
+	if use minimal ; then
+		insinto ${vimfiles}
+		doins runtime/defaults.vim
+	fi
+
 	domenu runtime/vim.desktop
 
 	newbashcomp "${FILESDIR}"/${PN}-completion ${PN}