commit:     6d52d0ad4a081351b41371668330f880262ca5ac
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 25 11:50:38 2017 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Aug 25 13:01:01 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6d52d0ad

app-arch/snappy: Bump to 1.1.7

 app-arch/snappy/Manifest                           |  1 +
 ...ke-Add-missing-linking-to-GTEST_LIBRARIES.patch | 31 +++++++++++
 app-arch/snappy/snappy-1.1.7.ebuild                | 64 ++++++++++++++++++++++
 3 files changed, 96 insertions(+)

diff --git a/app-arch/snappy/Manifest b/app-arch/snappy/Manifest
index b72e53b2017..b7252570e19 100644
--- a/app-arch/snappy/Manifest
+++ b/app-arch/snappy/Manifest
@@ -1,2 +1,3 @@
 DIST snappy-1.1.3.tar.gz 1509026 SHA256 
2f1e82adf0868c9e26a5a7a3115111b6da7e432ddbac268a7ca2fae2a247eef3 SHA512 
4c4f47c657a072989179be9df0e5e98d14f4a67c27ec7ae0e5a15d14289a75d4e266bc6c5c89723f3e9860408ffcc7138a815f8ad9299407c4a1946fc00ab5bf
 WHIRLPOOL 
97f82d1439973582f0ba3fde43ba2ee2c23b2512e0ee426b9e372fbfbba87921355c1f6bf0bf80671d7c4da26a23d480508cb7a188e414b9cb5d95996bfabe39
 DIST snappy-1.1.6.tar.gz 1128388 SHA256 
6fa92cde5b2caefd0d9a60336991ba42e5a7ddc3bdc36c5610451373751d0495 SHA512 
38698b7ff03b39528de88bf62a84fcfc6f3dce2e98efa25a97ebdf396b6aba49860072ffa99830323944ab41c3721a3c53ff2636beb3422d5f812e84afe8dadf
 WHIRLPOOL 
87ee2fd77e4c68911d5bd5c5a278460b8e4200a2b4c96a454b2af0b61444588dfad68015effd22bebfb2bf8f9d3e0c6b8f8cc3e89614626f0bc1f91b18402eec
+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 00000000000..3327b8bcf0a
--- /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?= <mgo...@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/snappy-1.1.7.ebuild 
b/app-arch/snappy/snappy-1.1.7.ebuild
new file mode 100644
index 00000000000..c87bf5a2015
--- /dev/null
+++ b/app-arch/snappy/snappy-1.1.7.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2017 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="~alpha ~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~x86 ~amd64-fbsd 
~amd64-linux ~x86-linux"
+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
+
+       default
+}
+
+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
+}

Reply via email to