Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: profiles/base/, app-arch/snappy/files/, app-arch/snappy/
Date: Thu, 29 Jun 2017 14:52:37
Message-Id: 1498747947.0db7f46d94eed02e877a7cf644ee4541298eb852.mgorny@gentoo
1 commit: 0db7f46d94eed02e877a7cf644ee4541298eb852
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Thu Jun 29 10:02:00 2017 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Thu Jun 29 14:52:27 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0db7f46d
7
8 app-arch/snappy: Bump to 1.1.5
9
10 Bump to the new 1.1.5 version and update the ebuild to use CMake as
11 autotools are deprecated now. Include patches necessary to fix
12 the horribly broken upstream build system to at least build
13 and install reasonably correctly. Disable useless microbenchmarks in
14 unittest executable. Disable static-libs support since it is not
15 provided upstream.
16
17 app-arch/snappy/Manifest | 1 +
18 ...NUInstallDirs-to-provide-configurable-cor.patch | 90 ++++++++++++++++++++++
19 ...02-cmake-Correct-unify-CMake-install-path.patch | 37 +++++++++
20 ...ke-Add-missing-linking-to-GTEST_LIBRARIES.patch | 28 +++++++
21 app-arch/snappy/snappy-1.1.5.ebuild | 67 ++++++++++++++++
22 profiles/base/package.use.mask | 6 ++
23 6 files changed, 229 insertions(+)
24
25 diff --git a/app-arch/snappy/Manifest b/app-arch/snappy/Manifest
26 index c940200fe45..23b469f7acc 100644
27 --- a/app-arch/snappy/Manifest
28 +++ b/app-arch/snappy/Manifest
29 @@ -1,2 +1,3 @@
30 DIST snappy-1.1.2.tar.gz 1485435 SHA256 f9d8fe1c85494f62dbfa3efe8e73bc23d8dec7a254ff7fe09ec4b0ebfc586af4 SHA512 da0e80528dfc815d765347c60dc5f14bc7fb882cc6894b87d3a43dec1a127cf8bcfe46e6cb93e130790c0ebd67368a1042500d9080f844441803c1b69c3cc07e WHIRLPOOL a9cf520cc578a0a63ebb7fb127428b50d282cdf2448938ad88349f775e21b3dd27f2c6843f86dd749d66e9df5e29094bc5c67032f0219932fec69f882ec91246
31 DIST snappy-1.1.3.tar.gz 1509026 SHA256 2f1e82adf0868c9e26a5a7a3115111b6da7e432ddbac268a7ca2fae2a247eef3 SHA512 4c4f47c657a072989179be9df0e5e98d14f4a67c27ec7ae0e5a15d14289a75d4e266bc6c5c89723f3e9860408ffcc7138a815f8ad9299407c4a1946fc00ab5bf WHIRLPOOL 97f82d1439973582f0ba3fde43ba2ee2c23b2512e0ee426b9e372fbfbba87921355c1f6bf0bf80671d7c4da26a23d480508cb7a188e414b9cb5d95996bfabe39
32 +DIST snappy-1.1.5.tar.gz 1128197 SHA256 c67d8d23387b1902ceff134af26e401d5412c510adeeabe6bb6b47c106b08e45 SHA512 99f29f3b4ada0b25692f594a17c0c4b2625fb6c6ffbc875b8dd940fd8080f1e9afdb000c866380f2375246e7b3fbab8521e1bb4d226789798459c628318d571b WHIRLPOOL f0947129ab01bf9545bc5138a5382c555ff1f1b032fe9d53f045ef07ddc79ad0bc2a7fbdd6d058e126b07942c43fa155de2af5070d1df8edbaa677184d63f684
33
34 diff --git a/app-arch/snappy/files/snappy-1.1.5-0001-cmake-Use-GNUInstallDirs-to-provide-configurable-cor.patch b/app-arch/snappy/files/snappy-1.1.5-0001-cmake-Use-GNUInstallDirs-to-provide-configurable-cor.patch
35 new file mode 100644
36 index 00000000000..468a11618c3
37 --- /dev/null
38 +++ b/app-arch/snappy/files/snappy-1.1.5-0001-cmake-Use-GNUInstallDirs-to-provide-configurable-cor.patch
39 @@ -0,0 +1,90 @@
40 +From a35f15515db7cdfdee2b7fd04624d1b6c9a8a6bc Mon Sep 17 00:00:00 2001
41 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@g.o>
42 +Date: Thu, 29 Jun 2017 11:12:44 +0200
43 +Subject: [PATCH 1/3] cmake: Use GNUInstallDirs to provide configurable &
44 + correct install dirs
45 +
46 +Use the GNUInstallDirs CMake module to provide a standard set of
47 +variables to control install paths. Otherwise, the package is
48 +incorrectly installed into 'lib' (instead of 'lib64') on 64-bit systems.
49 +While this could be solved via providing custom variables for each
50 +directory, it is simpler to reuse what's already in CMake.
51 +---
52 + CMakeLists.txt | 21 +++++++++------------
53 + cmake/SnappyConfig.cmake.in | 8 ++++----
54 + 2 files changed, 13 insertions(+), 16 deletions(-)
55 +
56 +diff --git a/CMakeLists.txt b/CMakeLists.txt
57 +index 2c79e46..adda7fa 100644
58 +--- a/CMakeLists.txt
59 ++++ b/CMakeLists.txt
60 +@@ -8,6 +8,7 @@ INCLUDE(CheckLibraryExists)
61 + INCLUDE(CheckCXXSourceCompiles)
62 + INCLUDE(TestBigEndian)
63 + INCLUDE(CMakePackageConfigHelpers)
64 ++INCLUDE(GNUInstallDirs)
65 +
66 + TEST_BIG_ENDIAN(WORDS_BIG_ENDIAN)
67 + IF (WORDS_BIG_ENDIAN)
68 +@@ -98,32 +99,28 @@ INSTALL(FILES snappy.h
69 + snappy-c.h
70 + snappy-sinksource.h
71 + ${Snappy_BINARY_DIR}/snappy-stubs-public.h
72 +- DESTINATION include)
73 ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
74 +
75 + INSTALL(TARGETS snappy
76 + EXPORT SnappyTargets
77 +- RUNTIME DESTINATION bin
78 +- LIBRARY DESTINATION lib
79 +- ARCHIVE DESTINATION lib)
80 +-INSTALL(EXPORT SnappyTargets NAMESPACE Snappy:: DESTINATION lib/cmake/Snappy)
81 ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
82 ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
83 ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
84 ++INSTALL(EXPORT SnappyTargets NAMESPACE Snappy:: DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Snappy)
85 +
86 + SET_TARGET_PROPERTIES(snappy PROPERTIES SOVERSION ${PROJECT_VERSION})
87 +
88 +-SET(INCLUDE_INSTALL_DIR include)
89 +-SET(LIBRARY_INSTALL_DIR lib)
90 +-SET(BINARY_INSTALL_DIR bin)
91 +-
92 + CONFIGURE_PACKAGE_CONFIG_FILE(cmake/SnappyConfig.cmake.in
93 + ${Snappy_BINARY_DIR}/SnappyConfig.cmake
94 +- INSTALL_DESTINATION lib/Snappy/cmake
95 +- PATH_VARS INCLUDE_INSTALL_DIR LIBRARY_INSTALL_DIR BINARY_INSTALL_DIR
96 ++ INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/Snappy/cmake
97 ++ PATH_VARS CMAKE_INSTALL_INCLUDEDIR CMAKE_INSTALL_LIBDIR CMAKE_INSTALL_BINDIR
98 + )
99 +
100 + WRITE_BASIC_PACKAGE_VERSION_FILE(${Snappy_BINARY_DIR}/SnappyConfigVersion.cmake
101 + COMPATIBILITY SameMajorVersion)
102 + INSTALL(FILES ${Snappy_BINARY_DIR}/SnappyConfig.cmake
103 + ${Snappy_BINARY_DIR}/SnappyConfigVersion.cmake
104 +- DESTINATION lib/cmake)
105 ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
106 +
107 + ENABLE_TESTING()
108 +
109 +diff --git a/cmake/SnappyConfig.cmake.in b/cmake/SnappyConfig.cmake.in
110 +index 5e604fe..d47656b 100644
111 +--- a/cmake/SnappyConfig.cmake.in
112 ++++ b/cmake/SnappyConfig.cmake.in
113 +@@ -2,8 +2,8 @@ set(SNAPPY_VERSION @SNAPPY_MAJOR@.@SNAPPY_MINOR@.@SNAPPY_PATCHLEVEL@)
114 +
115 + @PACKAGE_INIT@
116 +
117 +-set_and_check(SNAPPY_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@")
118 +-set_and_check(SNAPPY_LIBRARY_DIR "@PACKAGE_LIBRARY_INSTALL_DIR@")
119 +-set_and_check(SNAPPY_BINARY_DIR "@PACKAGE_BINARY_INSTALL_DIR@")
120 ++set_and_check(SNAPPY_INCLUDE_DIR "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@")
121 ++set_and_check(SNAPPY_LIBRARY_DIR "@PACKAGE_CMAKE_INSTALL_LIBDIR@")
122 ++set_and_check(SNAPPY_BINARY_DIR "@PACKAGE_CMAKE_INSTALL_BINDIR@")
123 +
124 +-check_required_components(SNAPPY)
125 +\ No newline at end of file
126 ++check_required_components(SNAPPY)
127 +--
128 +2.13.2
129 +
130
131 diff --git a/app-arch/snappy/files/snappy-1.1.5-0002-cmake-Correct-unify-CMake-install-path.patch b/app-arch/snappy/files/snappy-1.1.5-0002-cmake-Correct-unify-CMake-install-path.patch
132 new file mode 100644
133 index 00000000000..ab241275791
134 --- /dev/null
135 +++ b/app-arch/snappy/files/snappy-1.1.5-0002-cmake-Correct-unify-CMake-install-path.patch
136 @@ -0,0 +1,37 @@
137 +From 0f0ff7be9bd4d2ad2cd7e5c6092b1d0261c09335 Mon Sep 17 00:00:00 2001
138 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@g.o>
139 +Date: Thu, 29 Jun 2017 11:14:37 +0200
140 +Subject: [PATCH 2/3] cmake: Correct & unify CMake install path
141 +
142 +The CMake file is using 'lib/cmake/Snappy', 'lib/Snappy/cmake'
143 +and 'lib/cmake' inconsistently. Replace all of them with a single
144 +'lib/cmake/Snappy' that matches most of standard CMake packages.
145 +---
146 + CMakeLists.txt | 4 ++--
147 + 1 file changed, 2 insertions(+), 2 deletions(-)
148 +
149 +diff --git a/CMakeLists.txt b/CMakeLists.txt
150 +index adda7fa..b88cb20 100644
151 +--- a/CMakeLists.txt
152 ++++ b/CMakeLists.txt
153 +@@ -112,7 +112,7 @@ SET_TARGET_PROPERTIES(snappy PROPERTIES SOVERSION ${PROJECT_VERSION})
154 +
155 + CONFIGURE_PACKAGE_CONFIG_FILE(cmake/SnappyConfig.cmake.in
156 + ${Snappy_BINARY_DIR}/SnappyConfig.cmake
157 +- INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/Snappy/cmake
158 ++ INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Snappy
159 + PATH_VARS CMAKE_INSTALL_INCLUDEDIR CMAKE_INSTALL_LIBDIR CMAKE_INSTALL_BINDIR
160 + )
161 +
162 +@@ -120,7 +120,7 @@ WRITE_BASIC_PACKAGE_VERSION_FILE(${Snappy_BINARY_DIR}/SnappyConfigVersion.cmake
163 + COMPATIBILITY SameMajorVersion)
164 + INSTALL(FILES ${Snappy_BINARY_DIR}/SnappyConfig.cmake
165 + ${Snappy_BINARY_DIR}/SnappyConfigVersion.cmake
166 +- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
167 ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Snappy)
168 +
169 + ENABLE_TESTING()
170 +
171 +--
172 +2.13.2
173 +
174
175 diff --git a/app-arch/snappy/files/snappy-1.1.5-0003-cmake-Add-missing-linking-to-GTEST_LIBRARIES.patch b/app-arch/snappy/files/snappy-1.1.5-0003-cmake-Add-missing-linking-to-GTEST_LIBRARIES.patch
176 new file mode 100644
177 index 00000000000..3d7d8fcb59d
178 --- /dev/null
179 +++ b/app-arch/snappy/files/snappy-1.1.5-0003-cmake-Add-missing-linking-to-GTEST_LIBRARIES.patch
180 @@ -0,0 +1,28 @@
181 +From 57b13b68466e2ac81d8faa2c92f55e629a3184f8 Mon Sep 17 00:00:00 2001
182 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@g.o>
183 +Date: Thu, 29 Jun 2017 10:01:37 +0200
184 +Subject: [PATCH 3/3] cmake: Add missing linking to GTEST_LIBRARIES
185 +
186 +Since the snappy_unittest target uses gtest routines (when available),
187 +it needs to link to gtest explicitly. Otherwise, the build fails due
188 +to unavailable gtest symbols.
189 +---
190 + CMakeLists.txt | 2 +-
191 + 1 file changed, 1 insertion(+), 1 deletion(-)
192 +
193 +diff --git a/CMakeLists.txt b/CMakeLists.txt
194 +index b88cb20..bbe4d38 100644
195 +--- a/CMakeLists.txt
196 ++++ b/CMakeLists.txt
197 +@@ -143,7 +143,7 @@ ENDIF (HAVE_LIBQUICKLZ)
198 + ADD_EXECUTABLE(snappy-unittest snappy_unittest.cc snappy-test.cc)
199 + TARGET_COMPILE_DEFINITIONS(snappy-unittest PRIVATE -DHAVE_CONFIG_H)
200 + TARGET_LINK_LIBRARIES(snappy-unittest snappy ${COMPRESSION_LIBS}
201 +- ${GFLAGS_LIBRARIES})
202 ++ ${GFLAGS_LIBRARIES} ${GTEST_LIBRARIES})
203 + TARGET_INCLUDE_DIRECTORIES(snappy-unittest BEFORE PRIVATE ${Snappy_SOURCE_DIR}
204 + ${GTEST_INCLUDE_DIRS} ${GFLAGS_INCLUDE_DIRS})
205 +
206 +--
207 +2.13.2
208 +
209
210 diff --git a/app-arch/snappy/snappy-1.1.5.ebuild b/app-arch/snappy/snappy-1.1.5.ebuild
211 new file mode 100644
212 index 00000000000..d1daec39ebb
213 --- /dev/null
214 +++ b/app-arch/snappy/snappy-1.1.5.ebuild
215 @@ -0,0 +1,67 @@
216 +# Copyright 1999-2017 Gentoo Foundation
217 +# Distributed under the terms of the GNU General Public License v2
218 +
219 +EAPI=6
220 +inherit cmake-multilib
221 +
222 +DESCRIPTION="A high-speed compression/decompression library by Google"
223 +HOMEPAGE="https://github.com/google/snappy"
224 +SRC_URI="https://github.com/google/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
225 +
226 +LICENSE="BSD"
227 +# matches SONAME...
228 +SLOT="0/${PV}"
229 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~x86 ~amd64-fbsd ~amd64-linux ~x86-linux"
230 +IUSE="static-libs test"
231 +# upstream killed static lib support with build system update
232 +# (and we have packages depending on the flag)
233 +REQUIRED_USE="!static-libs"
234 +
235 +# all test dependencies are optional:
236 +# - gflags-2.2 is supposedly needed for command-line option parsing
237 +# but it's a huge hack and does not work,
238 +# - gtest probably gives nicer output,
239 +# - compression libraries are used for benchmarks which we do not run.
240 +DEPEND="test? ( dev-cpp/gtest )"
241 +
242 +# AUTHORS is useless, ChangeLog is stale
243 +DOCS=( format_description.txt framing_format.txt NEWS README.md )
244 +
245 +src_prepare() {
246 + local PATCHES=(
247 + "${FILESDIR}"/snappy-1.1.5-0001-cmake-Use-GNUInstallDirs-to-provide-configurable-cor.patch
248 + "${FILESDIR}"/snappy-1.1.5-0002-cmake-Correct-unify-CMake-install-path.patch
249 + "${FILESDIR}"/snappy-1.1.5-0003-cmake-Add-missing-linking-to-GTEST_LIBRARIES.patch
250 + )
251 +
252 + # command-line option parsing does not work at all, so just force
253 + # it off
254 + sed -i -e '/run_microbenchmarks/s:true:false:' snappy-test.cc || die
255 +
256 + default
257 +}
258 +
259 +multilib_src_configure() {
260 + # TODO: would be nice to make unittest build conditional
261 + # but it is not a priority right now
262 + local mycmakeargs=(
263 + # use gtest for tests only
264 + -DCMAKE_DISABLE_FIND_PACKAGE_GTest=$(usex '!test')
265 + # gflags does not work anyway
266 + -DCMAKE_DISABLE_FIND_PACKAGE_Gflags=ON
267 +
268 + # we do not want to run benchmarks, and those are only used
269 + # for benchmarks
270 + -DHAVE_LIBZ=NO
271 + -DHAVE_LIBLZO2=NO
272 + -DHAVE_LIBLZF=NO
273 + -DHAVE_LIBQUICKLZ=NO
274 + )
275 + cmake-utils_src_configure
276 +}
277 +
278 +multilib_src_test() {
279 + # run tests directly to get verbose output
280 + cd "${S}" || die
281 + "${BUILD_DIR}"/snappy-unittest || die
282 +}
283
284 diff --git a/profiles/base/package.use.mask b/profiles/base/package.use.mask
285 index f27ae607f2f..6fc52ac8f25 100644
286 --- a/profiles/base/package.use.mask
287 +++ b/profiles/base/package.use.mask
288 @@ -7,6 +7,12 @@
289 # This file is only for generic masks. For arch-specific masks (i.e.
290 # mask everywhere, unmask on arch/*) use arch/base.
291
292 +# Michał Górny <mgorny@g.o> (29 Jun 2017)
293 +# Upstream switched to CMake and no longer provides option to build
294 +# static and shared libs. The flag is preserved not to break USE
295 +# depenencies.
296 +>=app-arch/snappy-1.1.5 static-libs
297 +
298 # Ilya Tumaykin <itumaykin+gentoo@×××××.com> (18 Jun 2017)
299 # Libav is basically unsupported by mpv, see upstream issues 3923, 3925.
300 # Needs patch to even build, subs are broken and not supported anymore.