e2fsprogs: upgraded package to upstream

Upgraded sys-fs/e2fsprogs to version 1.46.0 on amd64

BUG=b/179108837
TEST=presubmit
RELEASE_NOTE=None

Change-Id: Ifc0fd13abefbcba8934c2e0dbda2efc102de6139
Reviewed-on: https://cos-review.googlesource.com/c/third_party/overlays/portage-stable/+/11914
Tested-by: Cusky Presubmit Bot <presubmit@cos-infra-prod.iam.gserviceaccount.com>
Reviewed-by: Robert Kolchmeyer <rkolchmeyer@google.com>
diff --git a/metadata/md5-cache/sys-fs/e2fsprogs-1.45.5 b/metadata/md5-cache/sys-fs/e2fsprogs-1.46.0
similarity index 64%
rename from metadata/md5-cache/sys-fs/e2fsprogs-1.45.5
rename to metadata/md5-cache/sys-fs/e2fsprogs-1.46.0
index a8ea9cc..0a0cf63 100644
--- a/metadata/md5-cache/sys-fs/e2fsprogs-1.45.5
+++ b/metadata/md5-cache/sys-fs/e2fsprogs-1.46.0
@@ -1,14 +1,14 @@
 BDEPEND=nls? ( sys-devel/gettext ) virtual/pkgconfig sys-apps/texinfo virtual/pkgconfig virtual/pkgconfig
 DEFINED_PHASES=compile configure install prepare
-DEPEND=~sys-libs/e2fsprogs-libs-1.45.5 >=sys-apps/util-linux-2.16 cron? ( sys-fs/lvm2[-device-mapper-only(-)] ) fuse? ( sys-fs/fuse:0 ) nls? ( virtual/libintl )
+DEPEND=~sys-libs/e2fsprogs-libs-1.46.0 >=sys-apps/util-linux-2.16 cron? ( sys-fs/lvm2[-device-mapper-only(-)] ) fuse? ( sys-fs/fuse:0 ) nls? ( virtual/libintl )
 DESCRIPTION=Standard EXT2/EXT3/EXT4 filesystem utilities
 EAPI=7
 HOMEPAGE=http://e2fsprogs.sourceforge.net/
-IUSE=cron fuse nls static-libs elibc_FreeBSD split-usr
+IUSE=cron fuse lto nls static-libs +threads elibc_FreeBSD split-usr
 KEYWORDS=*
 LICENSE=GPL-2 BSD
-RDEPEND=~sys-libs/e2fsprogs-libs-1.45.5 >=sys-apps/util-linux-2.16 cron? ( sys-fs/lvm2[-device-mapper-only(-)] ) fuse? ( sys-fs/fuse:0 ) nls? ( virtual/libintl )
+RDEPEND=~sys-libs/e2fsprogs-libs-1.46.0 >=sys-apps/util-linux-2.16 cron? ( sys-fs/lvm2[-device-mapper-only(-)] ) fuse? ( sys-fs/fuse:0 ) nls? ( virtual/libintl )
 SLOT=0
-SRC_URI=mirror://sourceforge/e2fsprogs/e2fsprogs-1.45.5.tar.xz https://www.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/v1.45.5/e2fsprogs-1.45.5.tar.xz elibc_mintlib? ( mirror://gentoo/e2fsprogs-1.42.9-mint-r1.patch.xz )
+SRC_URI=https://www.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/v1.46.0/e2fsprogs-1.46.0.tar.xz elibc_mintlib? ( mirror://gentoo/e2fsprogs-1.42.9-mint-r1.patch.xz )
 _eclasses_=eutils	fcb2aa98e1948b835b5ae66ca52868c5	flag-o-matic	5d5921a298e95441da2f85be419894c0	multilib	2477ebe553d3e4d2c606191fe6c33602	systemd	71fd8d2065d102753fb9e4d20eaf3e9f	toolchain-funcs	605c126bed8d87e4378d5ff1645330cb	udev	452708c3f55cf6e918b045adb949a9e6	usr-ldscript	766f0a506b45f02361ad1b8ca205b7e1
-_md5_=9822dad9c7eeee2a23be335b56fc1e3c
+_md5_=8404385c2140c936158a05c5d5598635
diff --git a/sys-fs/e2fsprogs/Manifest b/sys-fs/e2fsprogs/Manifest
index 69ea24d..4e036fc 100644
--- a/sys-fs/e2fsprogs/Manifest
+++ b/sys-fs/e2fsprogs/Manifest
@@ -1 +1,2 @@
-DIST e2fsprogs-1.45.5.tar.xz 5569796 BLAKE2B cf9633caa6c00afa51408364d0c0a1515a9989ad1582fb485a300fd71bf61ec56b57dbb26f152609eaf2d63bfb04fe1e3f271085c26aa0c832c1f467960e6480 SHA512 d1a8611b525742387061f390fb24825dfa175997cc7db05decea913fcc7b97a95a3e787091f2920d4a7d4eb1d813568af734a1610229ead09bcbf9f3e262e4ce
+DIST e2fsprogs-1.42.9-mint-r1.patch.xz 9012 BLAKE2B ae6421587c3cca2f9b26805c5f8d236d3fecde78cc7df3776ae9c23c7f254d7240e06507568fdd2154a16113c47609a8143535ab9cb2925426d3c578d077ce26 SHA512 591a7c80d65082eebcdc455028be6ade05c9aae96c94f654106be0facef330a8875dae82891e6e3ad2b48dece2b4e1c1940dbc47cd3eba3e6eea3b5ddba9a8fc
+DIST e2fsprogs-1.46.0.tar.xz 7007144 BLAKE2B d902028a0e538a62428e18e3c2a0a917a73351afc7d8eec804ddac459a1b8c2e11d104201235fb64170acc78942d2c9d5a45039f770cf5ce537cdba18cd559e6 SHA512 c865360e532da42264200934229aa9cfc88c3342fc4e206e82d1fe2a908b0fd3b58f2e9a4796f2ecdeafe1ace9f9ee444ea5b2e3efd488cb934f9a22af6a8f7e
diff --git a/sys-fs/e2fsprogs/e2fsprogs-1.46.0-r1.ebuild b/sys-fs/e2fsprogs/e2fsprogs-1.46.0-r1.ebuild
new file mode 120000
index 0000000..c49e2b6
--- /dev/null
+++ b/sys-fs/e2fsprogs/e2fsprogs-1.46.0-r1.ebuild
@@ -0,0 +1 @@
+e2fsprogs-1.46.0.ebuild
\ No newline at end of file
diff --git a/sys-fs/e2fsprogs/e2fsprogs-1.45.5.ebuild b/sys-fs/e2fsprogs/e2fsprogs-1.46.0.ebuild
similarity index 92%
rename from sys-fs/e2fsprogs/e2fsprogs-1.45.5.ebuild
rename to sys-fs/e2fsprogs/e2fsprogs-1.46.0.ebuild
index 6de8559..eae8fd2 100644
--- a/sys-fs/e2fsprogs/e2fsprogs-1.45.5.ebuild
+++ b/sys-fs/e2fsprogs/e2fsprogs-1.46.0.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -7,14 +7,13 @@
 
 DESCRIPTION="Standard EXT2/EXT3/EXT4 filesystem utilities"
 HOMEPAGE="http://e2fsprogs.sourceforge.net/"
-SRC_URI="mirror://sourceforge/e2fsprogs/${P}.tar.xz
-	https://www.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/v${PV}/${P}.tar.xz
+SRC_URI="https://www.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/v${PV}/${P}.tar.xz
 	elibc_mintlib? ( mirror://gentoo/${PN}-1.42.9-mint-r1.patch.xz )"
 
 LICENSE="GPL-2 BSD"
 SLOT="0"
 KEYWORDS="*"
-IUSE="cron fuse nls static-libs elibc_FreeBSD"
+IUSE="cron fuse lto nls static-libs +threads elibc_FreeBSD"
 
 RDEPEND="~sys-libs/${PN}-libs-${PV}
 	>=sys-apps/util-linux-2.16
@@ -33,6 +32,7 @@
 	"${FILESDIR}"/${PN}-1.42.13-fix-build-cflags.patch #516854
 
 	# Upstream patches (can usually removed with next version bump)
+	"${FILESDIR}/${P}-pthreads_build.patch"
 )
 
 src_prepare() {
@@ -78,13 +78,14 @@
 		--enable-symlink-install
 		--enable-elf-shlibs
 		$(tc-has-tls || echo --disable-tls)
-		--without-included-gettext
 		$(use_enable fuse fuse2fs)
 		$(use_enable nls)
 		--disable-libblkid
 		--disable-libuuid
 		--disable-fsck
 		--disable-uuidd
+		$(use_enable lto)
+		$(use_with threads pthread)
 	)
 	ac_cv_path_LDCONFIG=: econf "${myeconfargs[@]}"
 
diff --git a/sys-fs/e2fsprogs/files/e2fsprogs-1.46.0-pthreads_build.patch b/sys-fs/e2fsprogs/files/e2fsprogs-1.46.0-pthreads_build.patch
new file mode 100644
index 0000000..9d251d2
--- /dev/null
+++ b/sys-fs/e2fsprogs/files/e2fsprogs-1.46.0-pthreads_build.patch
@@ -0,0 +1,46 @@
+From 24487a7fa64bfa92bea21be3ca8c155e5de7438f Mon Sep 17 00:00:00 2001
+From: Theodore Ts'o <tytso@mit.edu>
+Date: Fri, 29 Jan 2021 22:28:31 -0500
+Subject: configure.ac: fix build failure on systems with pthreads && !fuse
+ support
+
+The configure script checks for pthread.h as part of double-checking
+that the FUSE support works correctly, which implicitly defined
+HAVE_PHREAD_H.  If the FUSE libraries are not present (or fuse support
+is explicitly disabled), this check doesn't happen and so
+HAVE_PTHREAD_H is not defined, and this causes a build failure.
+
+Signed-off-by: Theodore Ts'o <tytso@mit.edu>
+---
+ configure    | 2 +-
+ configure.ac | 1 +
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/configure b/configure
+index 9d41d069..6b8b7f4b 100755
+--- a/configure
++++ b/configure
+@@ -10448,7 +10448,7 @@ fi
+ done
+ 
+ fi
+-for ac_header in  	dirent.h 	errno.h 	execinfo.h 	getopt.h 	malloc.h 	mntent.h 	paths.h 	semaphore.h 	setjmp.h 	signal.h 	stdarg.h 	stdint.h 	stdlib.h 	termios.h 	termio.h 	unistd.h 	utime.h 	attr/xattr.h 	linux/falloc.h 	linux/fd.h 	linux/fsmap.h 	linux/major.h 	linux/loop.h 	linux/types.h 	net/if_dl.h 	netinet/in.h 	sys/acl.h 	sys/disklabel.h 	sys/disk.h 	sys/file.h 	sys/ioctl.h 	sys/key.h 	sys/mkdev.h 	sys/mman.h 	sys/mount.h 	sys/prctl.h 	sys/resource.h 	sys/select.h 	sys/socket.h 	sys/sockio.h 	sys/stat.h 	sys/syscall.h 	sys/sysmacros.h 	sys/time.h 	sys/types.h 	sys/un.h 	sys/wait.h 	sys/xattr.h
++for ac_header in  	dirent.h 	errno.h 	execinfo.h 	getopt.h 	malloc.h 	mntent.h 	paths.h 	pthread.h 	semaphore.h 	setjmp.h 	signal.h 	stdarg.h 	stdint.h 	stdlib.h 	termios.h 	termio.h 	unistd.h 	utime.h 	attr/xattr.h 	linux/falloc.h 	linux/fd.h 	linux/fsmap.h 	linux/major.h 	linux/loop.h 	linux/types.h 	net/if_dl.h 	netinet/in.h 	sys/acl.h 	sys/disklabel.h 	sys/disk.h 	sys/file.h 	sys/ioctl.h 	sys/key.h 	sys/mkdev.h 	sys/mman.h 	sys/mount.h 	sys/prctl.h 	sys/resource.h 	sys/select.h 	sys/socket.h 	sys/sockio.h 	sys/stat.h 	sys/syscall.h 	sys/sysmacros.h 	sys/time.h 	sys/types.h 	sys/un.h 	sys/wait.h 	sys/xattr.h
+ do :
+   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+diff --git a/configure.ac b/configure.ac
+index 141c4d9c..42b6f486 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -975,6 +975,7 @@ AC_CHECK_HEADERS(m4_flatten([
+ 	malloc.h
+ 	mntent.h
+ 	paths.h
++	pthread.h
+ 	semaphore.h
+ 	setjmp.h
+ 	signal.h
+-- 
+cgit 1.2.3-1.el7
+
diff --git a/sys-fs/e2fsprogs/metadata.xml b/sys-fs/e2fsprogs/metadata.xml
index fd22991..05a9b85 100644
--- a/sys-fs/e2fsprogs/metadata.xml
+++ b/sys-fs/e2fsprogs/metadata.xml
@@ -8,6 +8,7 @@
 <use>
 	<flag name="cron">Install e2scrub_all cron script</flag>
 	<flag name='fuse'>Build fuse2fs, a FUSE file system client for ext2/ext3/ext4 file systems</flag>
+	<flag name="lto">Build with link time optimization (LTO)</flag>
 </use>
 <upstream>
 	<remote-id type="cpe">cpe:/a:e2fsprogs_project:e2fsprogs</remote-id>