brotli: upgraded package to upstream

Upgraded app-arch/brotli to version 1.0.9-r2 for all.

BUG=None
TEST=CQ passes

Change-Id: Ia41da1a2d886bde72ed4bdeb0c6de3cdeba02217
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/overlays/portage-stable/+/2923067
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Sergey Frolov <sfrolov@google.com>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
diff --git a/app-arch/brotli/Manifest b/app-arch/brotli/Manifest
index ea65e98..a717127 100644
--- a/app-arch/brotli/Manifest
+++ b/app-arch/brotli/Manifest
@@ -1 +1 @@
-DIST brotli-1.0.7.tar.gz 23827908 BLAKE2B b9fc554cd23c8387b648638b6f9bb2d29fa87035856d03cf284662f9281984f3bf8e40109e61155ece18673f4391bc0fff704f8ab800a2041d3ce1824478d2ae SHA512 a82362aa36d2f2094bca0b2808d9de0d57291fb3a4c29d7c0ca0a37e73087ec5ac4df299c8c363e61106fccf2fe7f58b5cf76eb97729e2696058ef43b1d3930a
+DIST brotli-1.0.9.tar.gz 486984 BLAKE2B 8b9939d5224396ef33b43e019250ba4bc8949903583615e8dc02c85340fc0a1e2d1632161e00b0ee7355d77f05529ac772f482e05d2089afd71a0bf71e803904 SHA512 b8e2df955e8796ac1f022eb4ebad29532cb7e3aa6a4b6aee91dbd2c7d637eee84d9a144d3e878895bb5e62800875c2c01c8f737a1261020c54feacf9f676b5f5
diff --git a/app-arch/brotli/brotli-1.0.7.ebuild b/app-arch/brotli/brotli-1.0.9-r2.ebuild
similarity index 81%
rename from app-arch/brotli/brotli-1.0.7.ebuild
rename to app-arch/brotli/brotli-1.0.9-r2.ebuild
index 9e560a8..55eed04 100644
--- a/app-arch/brotli/brotli-1.0.7.ebuild
+++ b/app-arch/brotli/brotli-1.0.9-r2.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
 
-PYTHON_COMPAT=( python2_7 python3_{5,6,7} pypy )
+PYTHON_COMPAT=( python3_{6,7,8,9} )
 DISTUTILS_OPTIONAL="1"
 DISTUTILS_IN_SOURCE_BUILD="1"
 
@@ -17,7 +17,7 @@
 RDEPEND="python? ( ${PYTHON_DEPS} )"
 DEPEND="${RDEPEND}"
 
-IUSE="python test"
+IUSE="python static-libs test"
 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
 
 LICENSE="MIT python? ( Apache-2.0 )"
@@ -33,6 +33,13 @@
 	SRC_URI="https://github.com/google/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
 fi
 
+# tests are currently broken, see https://github.com/google/brotli/issues/850
+RESTRICT="test"
+
+PATCHES=(
+	"${FILESDIR}/${PV}-linker.patch"
+)
+
 src_prepare() {
 	use python && distutils-r1_src_prepare
 	cmake-utils_src_prepare
@@ -57,7 +64,7 @@
 	use python && distutils-r1_src_compile
 }
 
-python_test(){
+python_test() {
 	esetup.py test || die
 }
 
@@ -71,6 +78,7 @@
 
 multilib_src_install() {
 	cmake-utils_src_install
+	use static-libs || rm "${ED}"/usr/$(get_libdir)/*.a || die
 }
 multilib_src_install_all() {
 	use python && distutils-r1_src_install
diff --git a/app-arch/brotli/files/1.0.9-linker.patch b/app-arch/brotli/files/1.0.9-linker.patch
new file mode 100644
index 0000000..8ecf2e4
--- /dev/null
+++ b/app-arch/brotli/files/1.0.9-linker.patch
@@ -0,0 +1,47 @@
+From 092446fafb4bfb81738853b7c7f76b293cd92a80 Mon Sep 17 00:00:00 2001
+From: Evgenii Kliuchnikov <eustas.ru@gmail.com>
+Date: Wed, 2 Sep 2020 10:49:49 +0200
+Subject: [PATCH] Revert "Add runtime linker path to pkg-config files (#740)"
+
+This reverts commit 31754d4ffce14153b5c2addf7a11019ec23f51c1.
+---
+ scripts/libbrotlicommon.pc.in | 2 +-
+ scripts/libbrotlidec.pc.in    | 2 +-
+ scripts/libbrotlienc.pc.in    | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/scripts/libbrotlicommon.pc.in b/scripts/libbrotlicommon.pc.in
+index 10ca969e..2a8cf7a3 100644
+--- a/scripts/libbrotlicommon.pc.in
++++ b/scripts/libbrotlicommon.pc.in
+@@ -7,5 +7,5 @@ Name: libbrotlicommon
+ URL: https://github.com/google/brotli
+ Description: Brotli common dictionary library
+ Version: @PACKAGE_VERSION@
+-Libs: -L${libdir} -R${libdir} -lbrotlicommon
++Libs: -L${libdir} -lbrotlicommon
+ Cflags: -I${includedir}
+diff --git a/scripts/libbrotlidec.pc.in b/scripts/libbrotlidec.pc.in
+index e7c3124f..6f8ef2e4 100644
+--- a/scripts/libbrotlidec.pc.in
++++ b/scripts/libbrotlidec.pc.in
+@@ -7,6 +7,6 @@ Name: libbrotlidec
+ URL: https://github.com/google/brotli
+ Description: Brotli decoder library
+ Version: @PACKAGE_VERSION@
+-Libs: -L${libdir} -R${libdir} -lbrotlidec
++Libs: -L${libdir} -lbrotlidec
+ Requires.private: libbrotlicommon >= 1.0.2
+ Cflags: -I${includedir}
+diff --git a/scripts/libbrotlienc.pc.in b/scripts/libbrotlienc.pc.in
+index 4dd0811b..2098afe2 100644
+--- a/scripts/libbrotlienc.pc.in
++++ b/scripts/libbrotlienc.pc.in
+@@ -7,6 +7,6 @@ Name: libbrotlienc
+ URL: https://github.com/google/brotli
+ Description: Brotli encoder library
+ Version: @PACKAGE_VERSION@
+-Libs: -L${libdir} -R${libdir} -lbrotlienc
++Libs: -L${libdir} -lbrotlienc
+ Requires.private: libbrotlicommon >= 1.0.2
+ Cflags: -I${includedir}
diff --git a/app-arch/brotli/files/brotli-1.0.2-no-rpath.patch b/app-arch/brotli/files/brotli-1.0.2-no-rpath.patch
deleted file mode 100644
index 779b5e6..0000000
--- a/app-arch/brotli/files/brotli-1.0.2-no-rpath.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index ac55f6b3..2dc7232c 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -24,16 +24,6 @@ mark_as_advanced(BROTLI_BUNDLED_MODE)
- 
- include(GNUInstallDirs)
- 
--# When building shared libraries it is important to set the correct rpath.
--# See https://cmake.org/Wiki/CMake_RPATH_handling#Always_full_RPATH
--set(CMAKE_SKIP_BUILD_RPATH FALSE)
--set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
--set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
--list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_LIBDIR}" isSystemDir)
--if ("${isSystemDir}" STREQUAL "-1")
--  set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_LIBDIR}")
--endif()
--
- # Parse version information from common/version.h. Normally we would
- # define these values here and write them out to configuration file(s)
- # (i.e., config.h), but in this case we parse them from