zstd: upgraded package to upstream

Upgraded app-arch/zstd to version 1.5.0 on amd64
Removed workaround from Gentoo bug https://bugs.gentoo.org/713940.
This bug was fixed upstream and the fix is included, so the
workaround can be removed from this build.

BUG=None
TEST=Verified functionality on device

Change-Id: I80d6f88eda89f50ab7ab1672b476af380e48f7dd
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/overlays/portage-stable/+/3192165
Reviewed-by: Mike Wiitala <mwiitala@google.com>
Reviewed-by: Chris McDonald <cjmcdonald@chromium.org>
Tested-by: Parker Holloway <jparkerh@google.com>
Commit-Queue: Parker Holloway <jparkerh@google.com>
diff --git a/app-arch/zstd/Manifest b/app-arch/zstd/Manifest
index 0326d52..7950f8b 100644
--- a/app-arch/zstd/Manifest
+++ b/app-arch/zstd/Manifest
@@ -1 +1,2 @@
-DIST zstd-1.4.3.tar.gz 1911868 BLAKE2B da4c4b4f6afc36a23a13a9582874891ad206b01dc805f9e79879cb833b47c0bb18ec1b3bb5c0b99f4e8707d21659ca0b7446a84d15f513a3fcab206bc7f49539 SHA512 ccda90c7437635f92d0db39dfba3604e256f1f08284c35c042763a54b0ead45dca8e7fa3e5cf8032292d1dd9eefc1369e23f78a80d9335d69170563090677d5f
+DIST zstd-1.4.9.tar.gz 1834843 BLAKE2B 907f492bd023db9459bdc292a0bc4d1b6336d92dd7041eb2b36668589c20fcb98c411b85d78f92cd16d9b4a000d9c4125b5f966a5ca777034ae78210e639315b SHA512 f529db9c094f9ae26428bf1fdfcc91c6d783d400980e0f0d802d2cf13c2be2931465ef568907e03841ff76a369a1447e7371f8799d8526edb9a513ba5c6db133
+DIST zstd-1.5.0.tar.gz 1867111 BLAKE2B e503d17478b94128eb3ec578178f9d7023e941434dcc07790e12fd6c9933518f34fba5d7795ab7b145e4e499597644a6edd2830106649c5a749c962d5afe2f31 SHA512 25b657529a698eec891f92ff4a085d1fd95d2ff938ce52c8a4ff6163eb0b668ec642dd09e0db190652638cd92371006afa01d8e437437762c4097ad301675c33
diff --git a/app-arch/zstd/metadata.xml b/app-arch/zstd/metadata.xml
index b9782ee..847490d 100644
--- a/app-arch/zstd/metadata.xml
+++ b/app-arch/zstd/metadata.xml
@@ -1,11 +1,14 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
 <pkgmetadata>
-  <maintainer type="person">
-    <email>patrick@gentoo.org</email>
-    <name>Patrick Lauer</name>
-  </maintainer>
-  <upstream>
-    <remote-id type="github">facebook/zstd</remote-id>
-  </upstream>
+	<maintainer type="person">
+		<email>patrick@gentoo.org</email>
+		<name>Patrick Lauer</name>
+	</maintainer>
+	<maintainer type="project">
+		<email>base-system@gentoo.org</email>
+	</maintainer>
+	<upstream>
+		<remote-id type="github">facebook/zstd</remote-id>
+	</upstream>
 </pkgmetadata>
diff --git a/app-arch/zstd/zstd-1.4.3.ebuild b/app-arch/zstd/zstd-1.5.0.ebuild
similarity index 78%
rename from app-arch/zstd/zstd-1.4.3.ebuild
rename to app-arch/zstd/zstd-1.5.0.ebuild
index 8e8c6fd..0ee2971 100644
--- a/app-arch/zstd/zstd-1.4.3.ebuild
+++ b/app-arch/zstd/zstd-1.5.0.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
 
-inherit multilib-minimal toolchain-funcs
+inherit flag-o-matic multilib-minimal toolchain-funcs
 
 DESCRIPTION="zstd fast compression library"
 HOMEPAGE="https://facebook.github.io/zstd/"
@@ -12,7 +12,7 @@
 LICENSE="|| ( BSD GPL-2 )"
 SLOT="0/1"
 KEYWORDS="*"
-IUSE="lz4 static-libs"
+IUSE="lz4 static-libs +threads"
 
 RDEPEND="app-arch/xz-utils
 	lz4? ( app-arch/lz4 )"
@@ -34,10 +34,12 @@
 }
 
 multilib_src_compile() {
-	mymake -C lib libzstd libzstd.a libzstd.pc
+	local libzstd_targets=( libzstd{,.a}$(usex threads '-mt' '') )
+
+	mymake -C lib ${libzstd_targets[@]} libzstd.pc
 
 	if multilib_is_native_abi ; then
-		mymake zstd
+		mymake HAVE_LZ4="$(usex lz4 1 0)" zstd
 
 		mymake -C contrib/pzstd
 	fi
diff --git a/metadata/md5-cache/app-arch/zstd-1.4.3 b/metadata/md5-cache/app-arch/zstd-1.4.3
deleted file mode 100644
index 0a34894..0000000
--- a/metadata/md5-cache/app-arch/zstd-1.4.3
+++ /dev/null
@@ -1,13 +0,0 @@
-DEFINED_PHASES=compile configure install prepare test
-DEPEND=app-arch/xz-utils lz4? ( app-arch/lz4 )
-DESCRIPTION=zstd fast compression library
-EAPI=7
-HOMEPAGE=https://facebook.github.io/zstd/
-IUSE=lz4 static-libs abi_x86_32 abi_x86_64 abi_x86_x32 abi_mips_n32 abi_mips_n64 abi_mips_o32 abi_ppc_32 abi_ppc_64 abi_s390_32 abi_s390_64 abi_arm_32 abi_arm_64
-KEYWORDS=*
-LICENSE=|| ( BSD GPL-2 )
-RDEPEND=app-arch/xz-utils lz4? ( app-arch/lz4 )
-SLOT=0/1
-SRC_URI=https://github.com/facebook/zstd/archive/v1.4.3.tar.gz -> zstd-1.4.3.tar.gz
-_eclasses_=multibuild	40fe59465edacd730c644ec2bc197809	multilib	2477ebe553d3e4d2c606191fe6c33602	multilib-build	1979aa0ff4d356d32507ca4650d9f37d	multilib-minimal	8bddda43703ba94d8341f4e247f97566	toolchain-funcs	f783d68a26b62d6b19e070e6bcada5e6
-_md5_=866a57b721a15931037c59a2454dc5a4
diff --git a/metadata/md5-cache/app-arch/zstd-1.5.0 b/metadata/md5-cache/app-arch/zstd-1.5.0
new file mode 100644
index 0000000..649ecf8
--- /dev/null
+++ b/metadata/md5-cache/app-arch/zstd-1.5.0
@@ -0,0 +1,13 @@
+DEFINED_PHASES=compile configure install prepare test
+DEPEND=app-arch/xz-utils lz4? ( app-arch/lz4 )
+DESCRIPTION=zstd fast compression library
+EAPI=7
+HOMEPAGE=https://facebook.github.io/zstd/
+IUSE=lz4 static-libs +threads abi_x86_32 abi_x86_64 abi_x86_x32 abi_mips_n32 abi_mips_n64 abi_mips_o32 abi_ppc_32 abi_ppc_64 abi_s390_32 abi_s390_64 abi_arm_32 abi_arm_64
+KEYWORDS=*
+LICENSE=|| ( BSD GPL-2 )
+RDEPEND=app-arch/xz-utils lz4? ( app-arch/lz4 )
+SLOT=0/1
+SRC_URI=https://github.com/facebook/zstd/archive/v1.5.0.tar.gz -> zstd-1.5.0.tar.gz
+_eclasses_=eutils	fcb2aa98e1948b835b5ae66ca52868c5	flag-o-matic	5d5921a298e95441da2f85be419894c0	multibuild	40fe59465edacd730c644ec2bc197809	multilib	2477ebe553d3e4d2c606191fe6c33602	multilib-build	1979aa0ff4d356d32507ca4650d9f37d	multilib-minimal	8bddda43703ba94d8341f4e247f97566	toolchain-funcs	605c126bed8d87e4378d5ff1645330cb
+_md5_=264a73c69d7348d9715b12cb621d6a15