snappy: upgraded package to upstream

Upgraded app-arch/snappy to version 1.1.7 on amd64, arm, x86

BUG=chromium:896357
TEST=for b in x86-generic coral arm64-generic; do
        FEATURES=test emerge-${b} -q --nodeps snappy; done
        + unit tests on coral

Change-Id: Id09e21878c9876bb85ad9c5fc8349bb6d61a7a3d
Reviewed-on: https://chromium-review.googlesource.com/1287023
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Georges Winkenbach <gwink@chromium.org>
Reviewed-by: Alec Thilenius <athilenius@google.com>
diff --git a/app-arch/snappy/Manifest b/app-arch/snappy/Manifest
index 333120c..3870b8d 100644
--- a/app-arch/snappy/Manifest
+++ b/app-arch/snappy/Manifest
@@ -1 +1 @@
-DIST snappy-1.0.4.tar.gz 1676541 RMD160 3e3c802adeba130175db3ec6af9f9f7c3efccb6f SHA1 d47edcb63bfad4446ecda5806337cb90ebc51aa1 SHA256 4ad91adb1592b6de67ecaad2ade6c34b9cf98a0bbc74ac8786b520b529b3bf61
+DIST snappy-1.1.7.tar.gz 1090550 SHA256 3dfa02e873ff51a11ee02b9ca391807f0c8ea0529a4924afa645fbf97163f9d4 SHA512 32046f532606ba545a4e4825c0c66a19be449f2ca2ff760a6fa170a3603731479a7deadb683546e5f8b5033414c50f4a9a29f6d23b7a41f047e566e69eca7caf WHIRLPOOL ed5dacdbdcbfbe88982b23d389d781548bf8780c1ecb9b99c8a09442821a97b6aca2fe5eec86b8db1c8e305e17b381391a595d5abacd24b9ace5048dc64cf232
diff --git a/app-arch/snappy/files/snappy-1.1.7-0001-cmake-Add-missing-linking-to-GTEST_LIBRARIES.patch b/app-arch/snappy/files/snappy-1.1.7-0001-cmake-Add-missing-linking-to-GTEST_LIBRARIES.patch
new file mode 100644
index 0000000..3327b8b
--- /dev/null
+++ b/app-arch/snappy/files/snappy-1.1.7-0001-cmake-Add-missing-linking-to-GTEST_LIBRARIES.patch
@@ -0,0 +1,31 @@
+From 1c9f699a6275f085ad710c9ae940e096ce552452 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Mon, 31 Jul 2017 20:49:22 +0200
+Subject: [PATCH] cmake: Add missing linking to GTEST_LIBRARIES
+
+Since the snappy_unittest target uses gtest routines (when available),
+it needs to link to gtest explicitly. Otherwise, the build fails due
+to unavailable gtest symbols.
+---
+ CMakeLists.txt | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 3f534b1..3a44aa9 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -118,7 +118,10 @@ if(SNAPPY_BUILD_TESTS)
+       "${PROJECT_SOURCE_DIR}/snappy-test.cc"
+   )
+   target_compile_definitions(snappy_unittest PRIVATE -DHAVE_CONFIG_H)
+-  target_link_libraries(snappy_unittest snappy ${GFLAGS_LIBRARIES})
++  target_link_libraries(snappy_unittest
++    snappy
++    ${GFLAGS_LIBRARIES}
++    ${GTEST_LIBRARIES})
+ 
+   if(HAVE_LIBZ)
+     target_link_libraries(snappy_unittest z)
+-- 
+2.14.1
+
diff --git a/app-arch/snappy/metadata.xml b/app-arch/snappy/metadata.xml
index 35d868e..e5215ea 100644
--- a/app-arch/snappy/metadata.xml
+++ b/app-arch/snappy/metadata.xml
@@ -1,15 +1,15 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
 <pkgmetadata>
-	<maintainer>
-		<email>nirbheek@gentoo.org</email>
-		<name>Nirbheek Chauhan</name>
+	<maintainer type='person'>
+		<email>mgorny@gentoo.org</email>
+		<name>MichaƂ Górny</name>
 	</maintainer>
 	<longdescription lang="en">Snappy is a compression/decompression library. It does not aim for
 		maximum compression, or compatibility with any other compression
 		library; instead, it aims for very high speeds and reasonable
 		compression.</longdescription>
 	<upstream>
-		<remote-id type="google-code">snappy</remote-id>
+		<remote-id type="github">google/snappy</remote-id>
 	</upstream>
 </pkgmetadata>
diff --git a/app-arch/snappy/snappy-1.0.4.ebuild b/app-arch/snappy/snappy-1.0.4.ebuild
deleted file mode 100644
index 7e2c339..0000000
--- a/app-arch/snappy/snappy-1.0.4.ebuild
+++ /dev/null
@@ -1,46 +0,0 @@
-# Copyright 1999-2011 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-arch/snappy/snappy-1.0.4.ebuild,v 1.1 2011/11/21 09:53:37 nirbheek Exp $
-
-EAPI="4"
-
-DESCRIPTION="A high-speed compression/decompression library by Google"
-HOMEPAGE="https://code.google.com/p/snappy/"
-SRC_URI="http://${PN}.googlecode.com/files/${P}.tar.gz"
-
-LICENSE="BSD"
-SLOT="0"
-KEYWORDS="*"
-IUSE="static-libs"
-
-RDEPEND=""
-DEPEND="${RDEPEND}"
-
-DOCS="AUTHORS ChangeLog README NEWS format_description.txt"
-
-src_prepare() {
-	default
-	# Avoid automagic lzop and gzip by not checking for it
-	#sed -i -e '/^CHECK_EXT_COMPRESSION_LIB/d' "${S}/configure.ac" || die
-	# Avoid eautoreconf due to the above sed by just removing the expanded lines
-	sed -i -e '15126,15385d' "${S}/configure" || die
-}
-
-src_configure() {
-	econf \
-		--without-gflags \
-		--disable-gtest \
-		$(use_enable static-libs static)
-}
-
-src_install() {
-	default
-
-	# Remove docs installed by snappy itself
-	rm -rf "${ED}/usr/share/doc/snappy" || die
-
-	# Remove la files if we're not installing static libraries
-	if ! use static-libs; then
-		find "${ED}" -iname '*.la' -exec rm -f {} + || die
-	fi
-}
diff --git a/app-arch/snappy/snappy-1.1.7.ebuild b/app-arch/snappy/snappy-1.1.7.ebuild
new file mode 100644
index 0000000..c015af9
--- /dev/null
+++ b/app-arch/snappy/snappy-1.1.7.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit cmake-multilib
+
+DESCRIPTION="A high-speed compression/decompression library by Google"
+HOMEPAGE="https://github.com/google/snappy"
+SRC_URI="https://github.com/google/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0/${PV%%.*}"
+KEYWORDS="*"
+IUSE="static-libs test"
+# upstream killed static lib support with build system update
+# (and we have packages depending on the flag)
+REQUIRED_USE="!static-libs"
+
+# all test dependencies are optional:
+# - gflags-2.2 is supposedly needed for command-line option parsing
+# but it's a huge hack and does not work,
+# - gtest probably gives nicer output,
+# - compression libraries are used for benchmarks which we do not run.
+DEPEND="test? ( dev-cpp/gtest )"
+
+# AUTHORS is useless, ChangeLog is stale
+DOCS=( format_description.txt framing_format.txt NEWS README.md )
+
+src_prepare() {
+	local PATCHES=(
+		"${FILESDIR}"/snappy-1.1.7-0001-cmake-Add-missing-linking-to-GTEST_LIBRARIES.patch
+	)
+
+	# command-line option parsing does not work at all, so just force
+	# it off
+	sed -i -e '/run_microbenchmarks/s:true:false:' snappy-test.cc || die
+
+	cmake-utils_src_prepare
+}
+
+multilib_src_configure() {
+	# TODO: would be nice to make unittest build conditional
+	# but it is not a priority right now
+	local mycmakeargs=(
+		-DBUILD_SHARED_LIBS=ON
+
+		# use gtest for tests only
+		-DCMAKE_DISABLE_FIND_PACKAGE_GTest=$(usex '!test')
+		# gflags does not work anyway
+		-DCMAKE_DISABLE_FIND_PACKAGE_Gflags=ON
+
+		# we do not want to run benchmarks, and those are only used
+		# for benchmarks
+		-DHAVE_LIBZ=NO
+		-DHAVE_LIBLZO2=NO
+	)
+	cmake-utils_src_configure
+}
+
+multilib_src_test() {
+	# run tests directly to get verbose output
+	cd "${S}" || die
+	"${BUILD_DIR}"/snappy_unittest || die
+}
diff --git a/metadata/md5-cache/app-arch/snappy-1.0.4 b/metadata/md5-cache/app-arch/snappy-1.0.4
deleted file mode 100644
index 618cf7e..0000000
--- a/metadata/md5-cache/app-arch/snappy-1.0.4
+++ /dev/null
@@ -1,10 +0,0 @@
-DEFINED_PHASES=configure install prepare
-DESCRIPTION=A high-speed compression/decompression library by Google
-EAPI=4
-HOMEPAGE=https://code.google.com/p/snappy/
-IUSE=static-libs
-KEYWORDS=*
-LICENSE=BSD
-SLOT=0
-SRC_URI=http://snappy.googlecode.com/files/snappy-1.0.4.tar.gz
-_md5_=6f9cbe57ec41eb0ebc326460583c3df6
diff --git a/metadata/md5-cache/app-arch/snappy-1.1.7 b/metadata/md5-cache/app-arch/snappy-1.1.7
new file mode 100644
index 0000000..d7734a2
--- /dev/null
+++ b/metadata/md5-cache/app-arch/snappy-1.1.7
@@ -0,0 +1,13 @@
+DEFINED_PHASES=compile configure install prepare test
+DEPEND=test? ( dev-cpp/gtest ) sys-devel/make >=dev-util/cmake-2.8.12
+DESCRIPTION=A high-speed compression/decompression library by Google
+EAPI=6
+HOMEPAGE=https://github.com/google/snappy
+IUSE=static-libs test 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
+KEYWORDS=*
+LICENSE=BSD
+REQUIRED_USE=!static-libs
+SLOT=0/1
+SRC_URI=https://github.com/google/snappy/archive/1.1.7.tar.gz -> snappy-1.1.7.tar.gz
+_eclasses_=cmake-multilib	7bc2cc09a4a5082b915541d447be8e5e	cmake-utils	625ac0250848368bad285a1d1de242cf	estack	43ddf5aaffa7a8d0482df54d25a66a1f	eutils	06133990e861be0fe60c2b428fd025d9	flag-o-matic	5d5921a298e95441da2f85be419894c0	multibuild	742139c87a9fa3766f0c2b155e5522bf	multilib	97f470f374f2e94ccab04a2fb21d811e	multilib-build	8fe2e81aeb36cdf8a6cc5f50443879cc	multilib-minimal	0224dee31c0f98405d572e14ad6dee65	toolchain-funcs	1e35303c63cd707f6c3422b4493d5607	versionator	26ca8a8bd95d6a74122c08ba98a4ee72
+_md5_=df9765652684d2806a38960375f9fafd