Gentoo Archives: gentoo-commits

From: Jason Zaman <perfinion@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-libs/google-cloud-cpp/files/, net-libs/google-cloud-cpp/
Date: Fri, 07 Sep 2018 18:03:35
Message-Id: 1536343338.7fc4eccc4345963c8e8bd5bd1e12988f31e2fc96.perfinion@gentoo
1 commit: 7fc4eccc4345963c8e8bd5bd1e12988f31e2fc96
2 Author: Jason Zaman <perfinion <AT> gentoo <DOT> org>
3 AuthorDate: Fri Sep 7 18:02:02 2018 +0000
4 Commit: Jason Zaman <perfinion <AT> gentoo <DOT> org>
5 CommitDate: Fri Sep 7 18:02:18 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7fc4eccc
7
8 net-libs/google-cloud-cpp: new package
9
10 ebuild by me
11
12 Package-Manager: Portage-2.3.40, Repoman-2.3.9
13
14 net-libs/google-cloud-cpp/Manifest | 3 +
15 ...GOOGLE_CLOUD_CPP_GRPC_PROVIDER-pkg-config.patch | 33 ++++
16 .../files/0002-cmake-fix-library-issues.patch | 180 +++++++++++++++++++++
17 .../google-cloud-cpp/google-cloud-cpp-0.2.0.ebuild | 60 +++++++
18 net-libs/google-cloud-cpp/metadata.xml | 11 ++
19 5 files changed, 287 insertions(+)
20
21 diff --git a/net-libs/google-cloud-cpp/Manifest b/net-libs/google-cloud-cpp/Manifest
22 new file mode 100644
23 index 00000000000..410732fa271
24 --- /dev/null
25 +++ b/net-libs/google-cloud-cpp/Manifest
26 @@ -0,0 +1,3 @@
27 +DIST google-cloud-cpp-0.2.0.tar.gz 687020 BLAKE2B 45c09c7cb5b9cc93c87e6d1faedf04f29ae81196dda95660abeadeaaf522376b4e50fd42489476c081e8de7336202d3883ab276c0e2334f1ad1b0e4e1f90fdb8 SHA512 ded3b564ef264a8bff4d81b08f2a97462e063127bf75a006bc7b18d18cfaee2f3cbe5957fe2c56cec06da5a7765854444fad8cd5045579c416c5f3de8462382e
28 +DIST googleapis-79ab27f3b70ebc221e265d2e8ab30a8cc2d21fa2.tar.gz 874997 BLAKE2B c837323124d26364c83dba72d4f73f3147ad117468b271e8d9502991c1f9a7b20d4f5405351147b65e99c57d207a2b8c1471228d2060ad238ade5159be1b009e SHA512 774e56fc30a4daf2e88d8d3b6747c1ac369d016e9d52527565b88d93252a22597339c17e612304f8823867da4b6df4b58a42dc9d4d480fc59962ee5314a85ab8
29 +DIST nlohmann-json-3.1.2-json.hpp 595822 BLAKE2B 510278344a510a516606f84aea53c682a64a7d1f4703e41503a1688e7c62ab1df8f197a697bd1149e958d21ab986d1b42cb78db6261b07239d9587756813acf5 SHA512 05df0ad3338f0bca885c0aa9da523922b99016986a9b01426b13888c0febd83bf1f6f063886f6c75f8a656ef79abac6292fe442dc05b1897d546ba5b70be48a5
30
31 diff --git a/net-libs/google-cloud-cpp/files/0001-cmake-Fix-GOOGLE_CLOUD_CPP_GRPC_PROVIDER-pkg-config.patch b/net-libs/google-cloud-cpp/files/0001-cmake-Fix-GOOGLE_CLOUD_CPP_GRPC_PROVIDER-pkg-config.patch
32 new file mode 100644
33 index 00000000000..d479a82b1e3
34 --- /dev/null
35 +++ b/net-libs/google-cloud-cpp/files/0001-cmake-Fix-GOOGLE_CLOUD_CPP_GRPC_PROVIDER-pkg-config.patch
36 @@ -0,0 +1,33 @@
37 +From eb0155e90498a5d7341490b9ed123f7638bffe44 Mon Sep 17 00:00:00 2001
38 +From: Jason Zaman <jason@×××××××××.com>
39 +Date: Fri, 7 Sep 2018 21:19:11 +0800
40 +Subject: [PATCH 1/2] cmake: Fix GOOGLE_CLOUD_CPP_GRPC_PROVIDER=pkg-config
41 +
42 +The grpc_cpp_plugin executable needs to be marked imported otherwise
43 +cmake will try (and fail) to build it.
44 +Also the location variable was typo'd.
45 +
46 +Signed-off-by: Jason Zaman <jason@×××××××××.com>
47 +---
48 + cmake/IncludeGrpc.cmake | 4 ++--
49 + 1 file changed, 2 insertions(+), 2 deletions(-)
50 +
51 +diff --git a/cmake/IncludeGrpc.cmake b/cmake/IncludeGrpc.cmake
52 +index 14273cbb..929f984d 100644
53 +--- a/cmake/IncludeGrpc.cmake
54 ++++ b/cmake/IncludeGrpc.cmake
55 +@@ -231,9 +231,9 @@ elseif("${GOOGLE_CLOUD_CPP_GRPC_PROVIDER}" STREQUAL "pkg-config")
56 + ${PROTOBUF_SRC_ROOT_FOLDER}/vsprojects/${_PROTOBUF_ARCH_DIR}Release
57 + ${PROTOBUF_SRC_ROOT_FOLDER}/vsprojects/${_PROTOBUF_ARCH_DIR}Debug)
58 + mark_as_advanced(PROTOC_GRPCPP_PLUGIN_EXECUTABLE)
59 +- add_executable(grpc_cpp_plugin ${PROTOC_GRPC_PLUGIN_EXECUTABLE})
60 ++ add_executable(grpc_cpp_plugin IMPORTED)
61 + set_property(TARGET grpc_cpp_plugin
62 + PROPERTY IMPORTED_LOCATION
63 +- ${PROTOC_GRPCPP_CPP_PLUGIN_EXECUTABLE})
64 ++ ${PROTOC_GRPCPP_PLUGIN_EXECUTABLE})
65 +
66 + endif ()
67 +--
68 +2.16.4
69 +
70
71 diff --git a/net-libs/google-cloud-cpp/files/0002-cmake-fix-library-issues.patch b/net-libs/google-cloud-cpp/files/0002-cmake-fix-library-issues.patch
72 new file mode 100644
73 index 00000000000..23a6d24d54d
74 --- /dev/null
75 +++ b/net-libs/google-cloud-cpp/files/0002-cmake-fix-library-issues.patch
76 @@ -0,0 +1,180 @@
77 +From 9978d05d4418bf813b8a457a2e49d0fc8fc8b26b Mon Sep 17 00:00:00 2001
78 +From: Jason Zaman <jason@×××××××××.com>
79 +Date: Fri, 7 Sep 2018 22:35:24 +0800
80 +Subject: [PATCH 2/2] cmake: fix library issues
81 +
82 +Set library soversions so CMake sets the symlinks and soversions
83 +properly.
84 +Install the cmake files in the correct dir.
85 +
86 +Signed-off-by: Jason Zaman <jason@×××××××××.com>
87 +---
88 + google/cloud/CMakeLists.txt | 14 +++++++-------
89 + google/cloud/bigtable/CMakeLists.txt | 11 ++++++++---
90 + google/cloud/firestore/CMakeLists.txt | 14 ++++++++------
91 + google/cloud/storage/CMakeLists.txt | 12 +++++++-----
92 + 4 files changed, 30 insertions(+), 21 deletions(-)
93 +
94 +diff --git a/google/cloud/CMakeLists.txt b/google/cloud/CMakeLists.txt
95 +index 4d777261..4e26290c 100644
96 +--- a/google/cloud/CMakeLists.txt
97 ++++ b/google/cloud/CMakeLists.txt
98 +@@ -99,6 +99,9 @@ target_include_directories(google_cloud_cpp_common
99 + $<INSTALL_INTERFACE:include>)
100 + target_compile_options(google_cloud_cpp_common
101 + PUBLIC ${GOOGLE_CLOUD_CPP_EXCEPTIONS_FLAG})
102 ++set_target_properties(google_cloud_cpp_common PROPERTIES
103 ++ VERSION ${GOOGLE_CLOUD_CPP_VERSION_MAJOR}.${GOOGLE_CLOUD_CPP_VERSION_MINOR}.${GOOGLE_CLOUD_CPP_VERSION_PATCH}
104 ++ SOVERSION ${GOOGLE_CLOUD_CPP_VERSION_MAJOR})
105 +
106 + include(CreateBazelConfig)
107 + create_bazel_config(google_cloud_cpp_common)
108 +@@ -150,7 +153,7 @@ endforeach ()
109 +
110 + # Export the CMake targets to make it easy to create configuration files.
111 + install(EXPORT google_cloud_cpp_common-targets
112 +- DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/google_cloud_cpp_common")
113 ++ DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/cmake/Modules")
114 +
115 + # Install the libraries and headers in the locations determined by
116 + # GNUInstallDirs
117 +@@ -186,12 +189,9 @@ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/google_cloud_cpp_common.pc"
118 + configure_file("config.cmake.in" "google_cloud_cpp_common-config.cmake" @ONLY)
119 + configure_file("${PROJECT_SOURCE_DIR}/google/cloud/config-version.cmake.in"
120 + "google_cloud_cpp_common-config-version.cmake" @ONLY)
121 +-install(
122 +- FILES
123 +- "${CMAKE_CURRENT_BINARY_DIR}/google_cloud_cpp_common-config.cmake"
124 +- "${CMAKE_CURRENT_BINARY_DIR}/google_cloud_cpp_common-config-version.cmake"
125 +- DESTINATION
126 +- "${CMAKE_INSTALL_LIBDIR}/cmake/google_cloud_cpp_common")
127 ++install(FILES "${CMAKE_CURRENT_BINARY_DIR}/google_cloud_cpp_common-config.cmake"
128 ++ "${CMAKE_CURRENT_BINARY_DIR}/google_cloud_cpp_common-config-version.cmake"
129 ++ DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/cmake/Modules")
130 +
131 + add_subdirectory(bigtable)
132 + add_subdirectory(firestore)
133 +diff --git a/google/cloud/bigtable/CMakeLists.txt b/google/cloud/bigtable/CMakeLists.txt
134 +index 8aaff05c..9bd3effd 100644
135 +--- a/google/cloud/bigtable/CMakeLists.txt
136 ++++ b/google/cloud/bigtable/CMakeLists.txt
137 +@@ -102,6 +102,9 @@ target_include_directories(bigtable_protos
138 + $<INSTALL_INTERFACE:include>)
139 + target_compile_options(bigtable_protos
140 + PUBLIC ${GOOGLE_CLOUD_CPP_EXCEPTIONS_FLAG})
141 ++set_target_properties(bigtable_protos PROPERTIES
142 ++ VERSION ${BIGTABLE_CLIENT_VERSION_MAJOR}.${BIGTABLE_CLIENT_VERSION_MINOR}.${BIGTABLE_CLIENT_VERSION_PATCH}
143 ++ SOVERSION ${BIGTABLE_CLIENT_VERSION_MAJOR})
144 + add_library(bigtable::protos ALIAS bigtable_protos)
145 +
146 + # Enable unit tests
147 +@@ -212,6 +215,9 @@ target_include_directories(bigtable_client
148 + $<INSTALL_INTERFACE:include>)
149 + target_compile_options(bigtable_client
150 + PUBLIC ${GOOGLE_CLOUD_CPP_EXCEPTIONS_FLAG})
151 ++set_target_properties(bigtable_client PROPERTIES
152 ++ VERSION ${BIGTABLE_CLIENT_VERSION_MAJOR}.${BIGTABLE_CLIENT_VERSION_MINOR}.${BIGTABLE_CLIENT_VERSION_PATCH}
153 ++ SOVERSION ${BIGTABLE_CLIENT_VERSION_MAJOR})
154 + add_library(bigtable::client ALIAS bigtable_client)
155 +
156 + include(CreateBazelConfig)
157 +@@ -369,7 +375,7 @@ if (NOT ${GOOGLE_CLOUD_CPP_GRPC_PROVIDER} STREQUAL "module")
158 +
159 + # Export the CMake targets to make it easy to create configuration files.
160 + install(EXPORT bigtable-targets
161 +- DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/bigtable_client")
162 ++ DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/cmake/Modules")
163 + endif ()
164 +
165 + install(TARGETS bigtable_client
166 +@@ -407,5 +413,4 @@ configure_file("${PROJECT_SOURCE_DIR}/google/cloud/config-version.cmake.in"
167 + "bigtable_client-config-version.cmake" @ONLY)
168 + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/bigtable_client-config.cmake"
169 + "${CMAKE_CURRENT_BINARY_DIR}/bigtable_client-config-version.cmake"
170 +- DESTINATION
171 +- "${CMAKE_INSTALL_LIBDIR}/cmake/bigtable_client")
172 ++ DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/cmake/Modules")
173 +diff --git a/google/cloud/firestore/CMakeLists.txt b/google/cloud/firestore/CMakeLists.txt
174 +index 88c5ad6d..63d8add1 100644
175 +--- a/google/cloud/firestore/CMakeLists.txt
176 ++++ b/google/cloud/firestore/CMakeLists.txt
177 +@@ -62,6 +62,9 @@ target_include_directories(firestore_client
178 + $<INSTALL_INTERFACE:include>)
179 + target_compile_options(firestore_client
180 + PUBLIC ${GOOGLE_CLOUD_CPP_EXCEPTIONS_FLAG})
181 ++set_target_properties(firestore_client PROPERTIES
182 ++ VERSION ${FIRESTORE_CLIENT_VERSION_MAJOR}.${FIRESTORE_CLIENT_VERSION_MINOR}.${FIRESTORE_CLIENT_VERSION_PATCH}
183 ++ SOVERSION ${FIRESTORE_CLIENT_VERSION_MAJOR})
184 + add_library(firestore::client ALIAS firestore_client)
185 +
186 + include(CreateBazelConfig)
187 +@@ -104,7 +107,8 @@ install(TARGETS
188 +
189 + # The exports can only be installed if all the dependencies are installed. CMake
190 + # needs to know where the submodules will be installed from,
191 +-install(EXPORT firestore-targets DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/cmake)
192 ++install(EXPORT firestore-targets
193 ++ DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/cmake/Modules")
194 +
195 + install(TARGETS firestore_client
196 + EXPORT firestore-targets
197 +@@ -138,8 +142,6 @@ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/firestore_client.pc" DESTINATION
198 + configure_file("config.cmake.in" "firestore_client-config.cmake" @ONLY)
199 + configure_file("${PROJECT_SOURCE_DIR}/google/cloud/config-version.cmake.in"
200 + "firestore_client-config-version.cmake" @ONLY)
201 +-install(
202 +- FILES "${CMAKE_CURRENT_BINARY_DIR}/firestore_client-config.cmake"
203 +- "${CMAKE_CURRENT_BINARY_DIR}/firestore_client-config-version.cmake"
204 +- DESTINATION
205 +- ${CMAKE_INSTALL_DATAROOTDIR}/cmake)
206 ++install(FILES "${CMAKE_CURRENT_BINARY_DIR}/firestore_client-config.cmake"
207 ++ "${CMAKE_CURRENT_BINARY_DIR}/firestore_client-config-version.cmake"
208 ++ DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/cmake/Modules")
209 +diff --git a/google/cloud/storage/CMakeLists.txt b/google/cloud/storage/CMakeLists.txt
210 +index c8b641a0..c91bb17c 100644
211 +--- a/google/cloud/storage/CMakeLists.txt
212 ++++ b/google/cloud/storage/CMakeLists.txt
213 +@@ -216,6 +216,9 @@ target_include_directories(storage_client
214 + $<INSTALL_INTERFACE:include>)
215 + target_compile_options(storage_client
216 + PUBLIC ${GOOGLE_CLOUD_CPP_EXCEPTIONS_FLAG})
217 ++set_target_properties(storage_client PROPERTIES
218 ++ VERSION ${STORAGE_CLIENT_VERSION_MAJOR}.${STORAGE_CLIENT_VERSION_MINOR}.${STORAGE_CLIENT_VERSION_PATCH}
219 ++ SOVERSION ${STORAGE_CLIENT_VERSION_MAJOR})
220 +
221 + add_library(storage_client_testing
222 + testing/canonical_errors.h
223 +@@ -326,20 +329,20 @@ install(TARGETS storage_common_options nlohmann_json
224 +
225 + # Export the CMake targets to make it easy to create configuration files.
226 + install(EXPORT storage-targets
227 +- DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/storage_client")
228 ++ DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/cmake/Modules")
229 +
230 + install(TARGETS storage_client
231 + EXPORT storage-targets
232 + RUNTIME DESTINATION bin
233 + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
234 + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
235 +-install(DIRECTORY . DESTINATION include/storage/client
236 ++install(DIRECTORY . DESTINATION include/google/cloud/storage/client
237 + FILES_MATCHING
238 + PATTERN "*.h"
239 + PATTERN "testing/*"
240 + EXCLUDE)
241 + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/version_info.h DESTINATION
242 +- include/storage/client)
243 ++ include/google/cloud/storage/client)
244 +
245 + # Setup global variables used in the following *.in files.
246 + set(GOOGLE_CLOUD_CPP_CONFIG_VERSION_MAJOR ${STORAGE_CLIENT_VERSION_MAJOR})
247 +@@ -362,5 +365,4 @@ configure_file("${PROJECT_SOURCE_DIR}/google/cloud/config-version.cmake.in"
248 + "storage_client-config-version.cmake" @ONLY)
249 + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/storage_client-config.cmake"
250 + "${CMAKE_CURRENT_BINARY_DIR}/storage_client-config-version.cmake"
251 +- DESTINATION
252 +- "${CMAKE_INSTALL_LIBDIR}/cmake/storage_client")
253 ++ DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/cmake/Modules")
254 +--
255 +2.16.4
256 +
257
258 diff --git a/net-libs/google-cloud-cpp/google-cloud-cpp-0.2.0.ebuild b/net-libs/google-cloud-cpp/google-cloud-cpp-0.2.0.ebuild
259 new file mode 100644
260 index 00000000000..fc309dfdbc6
261 --- /dev/null
262 +++ b/net-libs/google-cloud-cpp/google-cloud-cpp-0.2.0.ebuild
263 @@ -0,0 +1,60 @@
264 +# Copyright 1999-2018 Gentoo Foundation
265 +# Distributed under the terms of the GNU General Public License v2
266 +
267 +EAPI=6
268 +
269 +inherit cmake-utils
270 +
271 +JSON_VER="3.1.2"
272 +GOOGLEAPIS_COMMIT="79ab27f3b70ebc221e265d2e8ab30a8cc2d21fa2"
273 +
274 +DESCRIPTION="Google Cloud Client Library for C++"
275 +HOMEPAGE="https://cloud.google.com/"
276 +SRC_URI="https://github.com/GoogleCloudPlatform/google-cloud-cpp/archive/v${PV}.tar.gz -> ${P}.tar.gz
277 + https://github.com/nlohmann/json/releases/download/v${JSON_VER}/json.hpp -> nlohmann-json-${JSON_VER}-json.hpp
278 + https://github.com/googleapis/googleapis/archive/${GOOGLEAPIS_COMMIT}.tar.gz -> googleapis-${GOOGLEAPIS_COMMIT}.tar.gz"
279 +
280 +LICENSE="Apache-2.0"
281 +SLOT="0"
282 +KEYWORDS="~amd64 ~x86"
283 +IUSE="test"
284 +
285 +DEPEND="dev-libs/protobuf
286 + net-misc/curl
287 + net-libs/grpc"
288 +RDEPEND="${DEPEND}"
289 +
290 +DOCS=( README.md )
291 +PATCHES=(
292 + "${FILESDIR}/0001-cmake-Fix-GOOGLE_CLOUD_CPP_GRPC_PROVIDER-pkg-config.patch"
293 + "${FILESDIR}/0002-cmake-fix-library-issues.patch"
294 +)
295 +
296 +src_prepare() {
297 + rm -rf "${S}/third_party/googleapis/" || die
298 + mv "${WORKDIR}/googleapis-${GOOGLEAPIS_COMMIT}/" "${S}/third_party/googleapis/" || die
299 +
300 + cmake-utils_src_prepare
301 +}
302 +
303 +src_configure() {
304 + local mycmakeargs=(
305 + -DGOOGLE_CLOUD_CPP_GMOCK_PROVIDER=package
306 + -DGOOGLE_CLOUD_CPP_GRPC_PROVIDER=pkg-config
307 + -DBUILD_SHARED_LIBS=ON
308 + )
309 +
310 + cmake-utils_src_configure
311 +
312 + mkdir -p "${BUILD_DIR}/external/nlohmann_json/src/" || die
313 + cp "${DISTDIR}/nlohmann-json-${JSON_VER}-json.hpp" "${BUILD_DIR}/external/nlohmann_json/src/json.hpp" || die
314 +}
315 +
316 +src_test() {
317 + # test fails
318 + local myctestargs=(
319 + -E internal_parse_rfc3339_test
320 + )
321 +
322 + cmake-utils_src_test
323 +}
324
325 diff --git a/net-libs/google-cloud-cpp/metadata.xml b/net-libs/google-cloud-cpp/metadata.xml
326 new file mode 100644
327 index 00000000000..19a918bcc96
328 --- /dev/null
329 +++ b/net-libs/google-cloud-cpp/metadata.xml
330 @@ -0,0 +1,11 @@
331 +<?xml version="1.0" encoding="UTF-8"?>
332 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
333 +<pkgmetadata>
334 + <maintainer type="person">
335 + <email>perfinion@g.o</email>
336 + <name>Jason Zaman</name>
337 + </maintainer>
338 + <longdescription lang="en">
339 + Google Cloud Client Library for C++
340 + </longdescription>
341 +</pkgmetadata>