1 |
commit: 78c20fc6a719fdcc951c503a3b998b1e7c9c5046 |
2 |
Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Apr 30 19:48:00 2020 +0000 |
4 |
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Apr 30 20:44:56 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=78c20fc6 |
7 |
|
8 |
dev-db/mysql-connector-c: bump to v8.0.20 |
9 |
|
10 |
Package-Manager: Portage-2.3.99, Repoman-2.3.22 |
11 |
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org> |
12 |
|
13 |
dev-db/mysql-connector-c/Manifest | 1 + |
14 |
.../files/mysql-connector-c-8.0.20-libressl.patch | 332 +++++++++++++++++++++ |
15 |
.../mysql-connector-c-8.0.20.ebuild | 111 +++++++ |
16 |
3 files changed, 444 insertions(+) |
17 |
|
18 |
diff --git a/dev-db/mysql-connector-c/Manifest b/dev-db/mysql-connector-c/Manifest |
19 |
index 810277618eb..f72027980de 100644 |
20 |
--- a/dev-db/mysql-connector-c/Manifest |
21 |
+++ b/dev-db/mysql-connector-c/Manifest |
22 |
@@ -1,2 +1,3 @@ |
23 |
DIST mysql-boost-8.0.19.tar.gz 264147972 BLAKE2B 61a5ccbef1a7a675c85e4e6bda8e5285bdb931e6ee14d4710bf13dfd9157d1095200db2886dc93ea7251d3d59245f35c0bef5ba88ba6aac209b1e080f3b07dc4 SHA512 5ffc03f005ab2585694902e926b6cb2b10059b2b030549eccd3949f9c3b2f02626d02529f940dec003f2d69683856fd1c720ff12f89dfbdc48befaf24a9c4d01 |
24 |
+DIST mysql-boost-8.0.20.tar.gz 266282970 BLAKE2B 2aeb9d6c575ed9dc2d00d3e51e6391c59ffa39156491d9ed2c07e19bb2efb88a14d5a9d4b537c137d71854e39fa3a7fc2b93618118d4fd062e92ba2d83783c6f SHA512 7a962e9ddec7069008c5ab6ac2801515e2661ca2875afc6141541c03e2f941f4255b3c0d806a4df2fd2f2f1d12323aeb1e456c1d364777a18ccebefad7b22a99 |
25 |
DIST mysql-connector-c-6.1.11-src.tar.gz 3489345 BLAKE2B 813512520ef660521221565a4466e81d902629d0ee731f746b68eed2b9129ea8361fcabe184537ec8ba91aed5a4b02dfb3450b36524c2e98f81fba148eee0cf1 SHA512 271395c888a93b833e0bbe1840b9987ecdb37d0f1cf89904207cc9aa99ed32e538aee8c9529ff39b6533947159776a8f5aa079da86ed51b1d26b086f4ffdd7c6 |
26 |
|
27 |
diff --git a/dev-db/mysql-connector-c/files/mysql-connector-c-8.0.20-libressl.patch b/dev-db/mysql-connector-c/files/mysql-connector-c-8.0.20-libressl.patch |
28 |
new file mode 100644 |
29 |
index 00000000000..88f32419239 |
30 |
--- /dev/null |
31 |
+++ b/dev-db/mysql-connector-c/files/mysql-connector-c-8.0.20-libressl.patch |
32 |
@@ -0,0 +1,332 @@ |
33 |
+From 2108922a8292d74874ede834158c208d81c3cf76 Mon Sep 17 00:00:00 2001 |
34 |
+From: Thomas Deutschmann <whissi@g.o> |
35 |
+Date: Thu, 30 Apr 2020 20:01:48 +0200 |
36 |
+Subject: [PATCH 5/5] Add LibreSSL support |
37 |
+ |
38 |
+Signed-off-by: Thomas Deutschmann <whissi@g.o> |
39 |
+--- |
40 |
+ cmake/ssl.cmake | 5 +++-- |
41 |
+ mysys/my_md5.cc | 2 ++ |
42 |
+ .../bindings/xcom/xcom/xcom_ssl_transport.c | 6 +++++- |
43 |
+ plugin/x/client/xconnection_impl.cc | 4 ++++ |
44 |
+ router/src/http/src/tls_client_context.cc | 2 +- |
45 |
+ router/src/http/src/tls_context.cc | 9 ++++++-- |
46 |
+ router/src/http/src/tls_server_context.cc | 3 ++- |
47 |
+ sql-common/client.cc | 2 ++ |
48 |
+ sql/mysqld.cc | 4 +++- |
49 |
+ sql/sys_vars.cc | 21 +++++++++++++++++-- |
50 |
+ vio/viossl.cc | 8 +++---- |
51 |
+ vio/viosslfactories.cc | 2 ++ |
52 |
+ 12 files changed, 54 insertions(+), 14 deletions(-) |
53 |
+ |
54 |
+--- a/cmake/ssl.cmake |
55 |
++++ b/cmake/ssl.cmake |
56 |
+@@ -222,13 +222,14 @@ MACRO (MYSQL_CHECK_SSL) |
57 |
+ OPENSSL_FIX_VERSION "${OPENSSL_VERSION_NUMBER}" |
58 |
+ ) |
59 |
+ ENDIF() |
60 |
+- IF("${OPENSSL_MAJOR_VERSION}.${OPENSSL_MINOR_VERSION}.${OPENSSL_FIX_VERSION}" VERSION_GREATER "1.1.0") |
61 |
++ CHECK_SYMBOL_EXISTS(TLS1_3_VERSION "openssl/tls1.h" HAVE_TLS1_3_VERSION) |
62 |
++ IF(HAVE_TLS1_3_VERSION) |
63 |
+ ADD_DEFINITIONS(-DHAVE_TLSv13) |
64 |
+ ENDIF() |
65 |
+ IF(OPENSSL_INCLUDE_DIR AND |
66 |
+ OPENSSL_LIBRARY AND |
67 |
+ CRYPTO_LIBRARY AND |
68 |
+- OPENSSL_MAJOR_VERSION STREQUAL "1" |
69 |
++ OPENSSL_MAJOR_VERSION VERSION_GREATER_EQUAL "1" |
70 |
+ ) |
71 |
+ SET(OPENSSL_FOUND TRUE) |
72 |
+ FIND_PROGRAM(OPENSSL_EXECUTABLE openssl |
73 |
+--- a/mysys/my_md5.cc |
74 |
++++ b/mysys/my_md5.cc |
75 |
+@@ -56,7 +56,9 @@ static void my_md5_hash(unsigned char *digest, unsigned const char *buf, |
76 |
+ int compute_md5_hash(char *digest, const char *buf, int len) { |
77 |
+ int retval = 0; |
78 |
+ int fips_mode = 0; |
79 |
++#ifndef LIBRESSL_VERSION_NUMBER |
80 |
+ fips_mode = FIPS_mode(); |
81 |
++#endif |
82 |
+ /* If fips mode is ON/STRICT restricted method calls will result into abort, |
83 |
+ * skipping call. */ |
84 |
+ if (fips_mode == 0) { |
85 |
+--- a/plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/xcom_ssl_transport.c |
86 |
++++ b/plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/xcom_ssl_transport.c |
87 |
+@@ -329,6 +329,7 @@ error: |
88 |
+ return 1; |
89 |
+ } |
90 |
+ |
91 |
++#ifndef LIBRESSL_VERSION_NUMBER |
92 |
+ #define OPENSSL_ERROR_LENGTH 512 |
93 |
+ static int configure_ssl_fips_mode(const uint fips_mode) { |
94 |
+ int rc = -1; |
95 |
+@@ -352,6 +353,7 @@ static int configure_ssl_fips_mode(const uint fips_mode) { |
96 |
+ EXIT: |
97 |
+ return rc; |
98 |
+ } |
99 |
++#endif |
100 |
+ |
101 |
+ static int configure_ssl_ca(SSL_CTX *ssl_ctx, const char *ca_file, |
102 |
+ const char *ca_path) { |
103 |
+@@ -555,10 +557,12 @@ int xcom_init_ssl(const char *server_key_file, const char *server_cert_file, |
104 |
+ int verify_server = SSL_VERIFY_NONE; |
105 |
+ int verify_client = SSL_VERIFY_NONE; |
106 |
+ |
107 |
++#ifndef LIBRESSL_VERSION_NUMBER |
108 |
+ if (configure_ssl_fips_mode(ssl_fips_mode) != 1) { |
109 |
+ G_ERROR("Error setting the ssl fips mode"); |
110 |
+ goto error; |
111 |
+ } |
112 |
++#endif |
113 |
+ |
114 |
+ SSL_library_init(); |
115 |
+ SSL_load_error_strings(); |
116 |
+@@ -622,7 +626,7 @@ error: |
117 |
+ void xcom_cleanup_ssl() { |
118 |
+ if (!xcom_use_ssl()) return; |
119 |
+ |
120 |
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L |
121 |
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) |
122 |
+ ERR_remove_thread_state(0); |
123 |
+ #endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */ |
124 |
+ } |
125 |
+--- a/plugin/x/client/xconnection_impl.cc |
126 |
++++ b/plugin/x/client/xconnection_impl.cc |
127 |
+@@ -511,6 +511,7 @@ XError Connection_impl::get_ssl_error(const int error_id) { |
128 |
+ return XError(CR_SSL_CONNECTION_ERROR, buffer); |
129 |
+ } |
130 |
+ |
131 |
++#ifndef LIBRESSL_VERSION_NUMBER |
132 |
+ /** |
133 |
+ Set fips mode in openssl library, |
134 |
+ When we set fips mode ON/STRICT, it will perform following operations: |
135 |
+@@ -550,6 +551,7 @@ int set_fips_mode(const uint32_t fips_mode, |
136 |
+ EXIT: |
137 |
+ return rc; |
138 |
+ } |
139 |
++#endif |
140 |
+ |
141 |
+ XError Connection_impl::activate_tls() { |
142 |
+ if (nullptr == m_vio) return get_socket_error(SOCKET_ECONNRESET); |
143 |
+@@ -560,12 +562,14 @@ XError Connection_impl::activate_tls() { |
144 |
+ if (!m_context->m_ssl_config.is_configured()) |
145 |
+ return XError{CR_SSL_CONNECTION_ERROR, ER_TEXT_TLS_NOT_CONFIGURATED, true}; |
146 |
+ |
147 |
++#ifndef LIBRESSL_VERSION_NUMBER |
148 |
+ char err_string[OPENSSL_ERROR_LENGTH] = {'\0'}; |
149 |
+ if (set_fips_mode( |
150 |
+ static_cast<uint32_t>(m_context->m_ssl_config.m_ssl_fips_mode), |
151 |
+ err_string) != 1) { |
152 |
+ return XError{CR_SSL_CONNECTION_ERROR, err_string, true}; |
153 |
+ } |
154 |
++#endif |
155 |
+ auto ssl_ctx_flags = process_tls_version( |
156 |
+ details::null_when_empty(m_context->m_ssl_config.m_tls_version)); |
157 |
+ |
158 |
+--- a/router/src/http/src/tls_client_context.cc |
159 |
++++ b/router/src/http/src/tls_client_context.cc |
160 |
+@@ -54,7 +54,7 @@ void TlsClientContext::verify(TlsVerify verify) { |
161 |
+ |
162 |
+ void TlsClientContext::cipher_suites(const std::string &ciphers) { |
163 |
+ // TLSv1.3 ciphers are controlled via SSL_CTX_set_ciphersuites() |
164 |
+-#if OPENSSL_VERSION_NUMBER >= ROUTER_OPENSSL_VERSION(1, 1, 1) |
165 |
++#ifdef TLS1_3_VERSION |
166 |
+ if (1 != SSL_CTX_set_ciphersuites(ssl_ctx_.get(), ciphers.c_str())) { |
167 |
+ throw TlsError("set-cipher-suites"); |
168 |
+ } |
169 |
+--- a/router/src/http/src/tls_context.cc |
170 |
++++ b/router/src/http/src/tls_context.cc |
171 |
+@@ -91,7 +91,7 @@ static int o11x_version(TlsVersion version) { |
172 |
+ return TLS1_1_VERSION; |
173 |
+ case TlsVersion::TLS_1_2: |
174 |
+ return TLS1_2_VERSION; |
175 |
+-#if OPENSSL_VERSION_NUMBER >= ROUTER_OPENSSL_VERSION(1, 1, 1) |
176 |
++#ifdef TLS1_3_VERSION |
177 |
+ case TlsVersion::TLS_1_3: |
178 |
+ return TLS1_3_VERSION; |
179 |
+ #endif |
180 |
+@@ -120,9 +120,11 @@ void TlsContext::version_range(TlsVersion min_version, TlsVersion max_version) { |
181 |
+ switch (min_version) { |
182 |
+ default: |
183 |
+ // unknown, leave all disabled |
184 |
++#ifdef TLS1_3_VERSION |
185 |
+ // fallthrough |
186 |
+ case TlsVersion::TLS_1_3: |
187 |
+ opts |= SSL_OP_NO_TLSv1_2; |
188 |
++#endif |
189 |
+ // fallthrough |
190 |
+ case TlsVersion::TLS_1_2: |
191 |
+ opts |= SSL_OP_NO_TLSv1_1; |
192 |
+@@ -170,8 +172,10 @@ TlsVersion TlsContext::min_version() const { |
193 |
+ return TlsVersion::TLS_1_1; |
194 |
+ case TLS1_2_VERSION: |
195 |
+ return TlsVersion::TLS_1_2; |
196 |
++#ifdef TLS1_3_VERSION |
197 |
+ case TLS1_3_VERSION: |
198 |
+ return TlsVersion::TLS_1_3; |
199 |
++#endif |
200 |
+ case 0: |
201 |
+ return TlsVersion::AUTO; |
202 |
+ default: |
203 |
+@@ -230,7 +234,8 @@ TlsContext::InfoCallback TlsContext::info_callback() const { |
204 |
+ } |
205 |
+ |
206 |
+ int TlsContext::security_level() const { |
207 |
+-#if OPENSSL_VERSION_NUMBER >= ROUTER_OPENSSL_VERSION(1, 1, 0) |
208 |
++#if OPENSSL_VERSION_NUMBER >= ROUTER_OPENSSL_VERSION(1, 1, 0) && \ |
209 |
++ !defined(LIBRESSL_VERSION_NUMBER) |
210 |
+ return SSL_CTX_get_security_level(ssl_ctx_.get()); |
211 |
+ #else |
212 |
+ return 0; |
213 |
+--- a/router/src/http/src/tls_server_context.cc |
214 |
++++ b/router/src/http/src/tls_server_context.cc |
215 |
+@@ -167,7 +167,8 @@ void TlsServerContext::init_tmp_dh(const std::string &dh_params) { |
216 |
+ } |
217 |
+ |
218 |
+ } else { |
219 |
+-#if OPENSSL_VERSION_NUMBER >= ROUTER_OPENSSL_VERSION(1, 1, 0) |
220 |
++#if OPENSSL_VERSION_NUMBER >= ROUTER_OPENSSL_VERSION(1, 1, 0) && \ |
221 |
++ !defined(LIBRESSL_VERSION_NUMBER) |
222 |
+ dh2048.reset(DH_get_2048_256()); |
223 |
+ #else |
224 |
+ /* |
225 |
+--- a/sql-common/client.cc |
226 |
++++ b/sql-common/client.cc |
227 |
+@@ -7752,6 +7752,7 @@ int STDCALL mysql_options(MYSQL *mysql, enum mysql_option option, |
228 |
+ return 1; |
229 |
+ break; |
230 |
+ case MYSQL_OPT_SSL_FIPS_MODE: { |
231 |
++#if !defined(LIBRESSL_VERSION_NUMBER) |
232 |
+ char ssl_err_string[OPENSSL_ERROR_LENGTH] = {'\0'}; |
233 |
+ ENSURE_EXTENSIONS_PRESENT(&mysql->options); |
234 |
+ mysql->options.extension->ssl_fips_mode = *static_cast<const uint *>(arg); |
235 |
+@@ -7763,6 +7764,7 @@ int STDCALL mysql_options(MYSQL *mysql, enum mysql_option option, |
236 |
+ "Set Fips mode ON/STRICT failed, detail: '%s'.", ssl_err_string); |
237 |
+ return 1; |
238 |
+ } |
239 |
++#endif |
240 |
+ } break; |
241 |
+ case MYSQL_OPT_SSL_MODE: |
242 |
+ ENSURE_EXTENSIONS_PRESENT(&mysql->options); |
243 |
+--- a/sql/mysqld.cc |
244 |
++++ b/sql/mysqld.cc |
245 |
+@@ -4857,7 +4857,7 @@ static int init_thread_environment() { |
246 |
+ |
247 |
+ static PSI_memory_key key_memory_openssl = PSI_NOT_INSTRUMENTED; |
248 |
+ |
249 |
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L |
250 |
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) |
251 |
+ #define FILE_LINE_ARGS |
252 |
+ #else |
253 |
+ #define FILE_LINE_ARGS , const char *, int |
254 |
+@@ -4891,12 +4891,14 @@ static void init_ssl() { |
255 |
+ } |
256 |
+ |
257 |
+ static int init_ssl_communication() { |
258 |
++#ifndef LIBRESSL_VERSION_NUMBER |
259 |
+ char ssl_err_string[OPENSSL_ERROR_LENGTH] = {'\0'}; |
260 |
+ int ret_fips_mode = set_fips_mode(opt_ssl_fips_mode, ssl_err_string); |
261 |
+ if (ret_fips_mode != 1) { |
262 |
+ LogErr(ERROR_LEVEL, ER_SSL_FIPS_MODE_ERROR, ssl_err_string); |
263 |
+ return 1; |
264 |
+ } |
265 |
++#endif |
266 |
+ if (SslAcceptorContext::singleton_init(opt_use_ssl)) return 1; |
267 |
+ |
268 |
+ #if OPENSSL_VERSION_NUMBER < 0x10100000L |
269 |
+--- a/sql/sys_vars.cc |
270 |
++++ b/sql/sys_vars.cc |
271 |
+@@ -4459,6 +4459,7 @@ static Sys_var_ulong Sys_max_execution_time( |
272 |
+ HINT_UPDATEABLE SESSION_VAR(max_execution_time), CMD_LINE(REQUIRED_ARG), |
273 |
+ VALID_RANGE(0, ULONG_MAX), DEFAULT(0), BLOCK_SIZE(1)); |
274 |
+ |
275 |
++#ifndef LIBRESSL_VERSION_NUMBER |
276 |
+ static bool update_fips_mode(sys_var *, THD *, enum_var_type) { |
277 |
+ char ssl_err_string[OPENSSL_ERROR_LENGTH] = {'\0'}; |
278 |
+ if (set_fips_mode(opt_ssl_fips_mode, ssl_err_string) != 1) { |
279 |
+@@ -4469,15 +4470,31 @@ static bool update_fips_mode(sys_var *, THD *, enum_var_type) { |
280 |
+ return false; |
281 |
+ } |
282 |
+ } |
283 |
++#endif |
284 |
++ |
285 |
++#if defined(LIBRESSL_VERSION_NUMBER) |
286 |
++static const char *ssl_fips_mode_names[] = {"OFF", 0}; |
287 |
++#else |
288 |
++static const char *ssl_fips_mode_names[] = {"OFF", "ON", "STRICT", 0}; |
289 |
++#endif |
290 |
+ |
291 |
+-static const char *ssl_fips_mode_names[] = {"OFF", "ON", "STRICT", nullptr}; |
292 |
+ static Sys_var_enum Sys_ssl_fips_mode( |
293 |
+ "ssl_fips_mode", |
294 |
+ "SSL FIPS mode (applies only for OpenSSL); " |
295 |
++#ifndef LIBRESSL_VERSION_NUMBER |
296 |
+ "permitted values are: OFF, ON, STRICT", |
297 |
++#else |
298 |
++ "permitted values are: OFF", |
299 |
++#endif |
300 |
+ GLOBAL_VAR(opt_ssl_fips_mode), CMD_LINE(REQUIRED_ARG, OPT_SSL_FIPS_MODE), |
301 |
+ ssl_fips_mode_names, DEFAULT(0), NO_MUTEX_GUARD, NOT_IN_BINLOG, |
302 |
+- ON_CHECK(nullptr), ON_UPDATE(update_fips_mode), nullptr); |
303 |
++ ON_CHECK(NULL), |
304 |
++#ifndef LIBRESSL_VERSION_NUMBER |
305 |
++ ON_UPDATE(update_fips_mode), |
306 |
++#else |
307 |
++ ON_UPDATE(NULL), |
308 |
++#endif |
309 |
++ NULL); |
310 |
+ |
311 |
+ static Sys_var_bool Sys_auto_generate_certs( |
312 |
+ "auto_generate_certs", |
313 |
+--- a/vio/viossl.cc |
314 |
++++ b/vio/viossl.cc |
315 |
+@@ -45,7 +45,7 @@ |
316 |
+ BIO_set_callback_ex was added in openSSL 1.1.1 |
317 |
+ For older openSSL, use the deprecated BIO_set_callback. |
318 |
+ */ |
319 |
+-#if OPENSSL_VERSION_NUMBER >= 0x10101000L |
320 |
++#if OPENSSL_VERSION_NUMBER >= 0x10101000L && !defined(LIBRESSL_VERSION_NUMBER) |
321 |
+ #define HAVE_BIO_SET_CALLBACK_EX |
322 |
+ #endif |
323 |
+ |
324 |
+@@ -634,8 +634,8 @@ static int ssl_do(struct st_VioSSLFd *ptr, Vio *vio, long timeout, |
325 |
+ |
326 |
+ #if !defined(DBUG_OFF) |
327 |
+ { |
328 |
+- STACK_OF(SSL_COMP) *ssl_comp_methods = nullptr; |
329 |
+- ssl_comp_methods = SSL_COMP_get_compression_methods(); |
330 |
++ STACK_OF(SSL_COMP) *ssl_comp_methods = NULL; |
331 |
++ ssl_comp_methods = (STACK_OF(SSL_COMP) *)SSL_COMP_get_compression_methods(); |
332 |
+ n = sk_SSL_COMP_num(ssl_comp_methods); |
333 |
+ DBUG_PRINT("info", ("Available compression methods:\n")); |
334 |
+ if (n == 0) |
335 |
+@@ -643,7 +643,7 @@ static int ssl_do(struct st_VioSSLFd *ptr, Vio *vio, long timeout, |
336 |
+ else |
337 |
+ for (j = 0; j < n; j++) { |
338 |
+ SSL_COMP *c = sk_SSL_COMP_value(ssl_comp_methods, j); |
339 |
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L |
340 |
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) |
341 |
+ DBUG_PRINT("info", (" %d: %s\n", c->id, c->name)); |
342 |
+ #else /* OPENSSL_VERSION_NUMBER < 0x10100000L */ |
343 |
+ DBUG_PRINT("info", |
344 |
+--- a/vio/viosslfactories.cc |
345 |
++++ b/vio/viosslfactories.cc |
346 |
+@@ -472,6 +472,7 @@ void ssl_start() { |
347 |
+ } |
348 |
+ } |
349 |
+ |
350 |
++#ifndef LIBRESSL_VERSION_NUMBER |
351 |
+ /** |
352 |
+ Set fips mode in openssl library, |
353 |
+ When we set fips mode ON/STRICT, it will perform following operations: |
354 |
+@@ -525,6 +526,7 @@ EXIT: |
355 |
+ @returns openssl current fips mode |
356 |
+ */ |
357 |
+ uint get_fips_mode() { return FIPS_mode(); } |
358 |
++#endif |
359 |
+ |
360 |
+ long process_tls_version(const char *tls_version) { |
361 |
+ const char *separator = ","; |
362 |
+-- |
363 |
+2.26.2 |
364 |
+ |
365 |
|
366 |
diff --git a/dev-db/mysql-connector-c/mysql-connector-c-8.0.20.ebuild b/dev-db/mysql-connector-c/mysql-connector-c-8.0.20.ebuild |
367 |
new file mode 100644 |
368 |
index 00000000000..db0c6dcd3c1 |
369 |
--- /dev/null |
370 |
+++ b/dev-db/mysql-connector-c/mysql-connector-c-8.0.20.ebuild |
371 |
@@ -0,0 +1,111 @@ |
372 |
+# Copyright 1999-2020 Gentoo Authors |
373 |
+# Distributed under the terms of the GNU General Public License v2 |
374 |
+ |
375 |
+EAPI=7 |
376 |
+ |
377 |
+inherit cmake-multilib |
378 |
+ |
379 |
+# wrap the config script |
380 |
+MULTILIB_CHOST_TOOLS=( /usr/bin/mysql_config ) |
381 |
+ |
382 |
+DESCRIPTION="C client library for MariaDB/MySQL" |
383 |
+HOMEPAGE="https://dev.mysql.com/downloads/" |
384 |
+LICENSE="GPL-2" |
385 |
+ |
386 |
+SRC_URI="https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-boost-${PV}.tar.gz" |
387 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86" |
388 |
+ |
389 |
+SLOT="0/21" |
390 |
+IUSE="ldap libressl static-libs" |
391 |
+ |
392 |
+RDEPEND=" |
393 |
+ >=app-arch/lz4-0_p131:= |
394 |
+ sys-libs/zlib:=[${MULTILIB_USEDEP}] |
395 |
+ ldap? ( dev-libs/cyrus-sasl:=[${MULTILIB_USEDEP}] ) |
396 |
+ libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP}] ) |
397 |
+ !libressl? ( dev-libs/openssl:0=[${MULTILIB_USEDEP}] ) |
398 |
+ " |
399 |
+DEPEND="${RDEPEND}" |
400 |
+ |
401 |
+# Avoid file collisions, #692580 |
402 |
+RDEPEND+=" !<dev-db/mysql-5.6.45-r1" |
403 |
+RDEPEND+=" !=dev-db/mysql-5.7.23*" |
404 |
+RDEPEND+=" !=dev-db/mysql-5.7.24*" |
405 |
+RDEPEND+=" !=dev-db/mysql-5.7.25*" |
406 |
+RDEPEND+=" !=dev-db/mysql-5.7.26-r0" |
407 |
+RDEPEND+=" !=dev-db/mysql-5.7.27-r0" |
408 |
+RDEPEND+=" !<dev-db/percona-server-5.7.26.29-r1" |
409 |
+ |
410 |
+DOCS=( README ) |
411 |
+ |
412 |
+S="${WORKDIR}/mysql-${PV}" |
413 |
+ |
414 |
+PATCHES=( |
415 |
+ "${FILESDIR}"/${PN}-8.0.18-always-build-decompress-utilities.patch |
416 |
+ "${FILESDIR}"/${PN}-8.0.17-use-relative-include-path-for-udf_registration_types-h.patch |
417 |
+ "${FILESDIR}"/${PN}-8.0.19-do-not-install-comp_err.patch |
418 |
+ "${FILESDIR}"/${PN}-8.0.20-libressl.patch |
419 |
+) |
420 |
+ |
421 |
+src_prepare() { |
422 |
+ sed -i -e 's/CLIENT_LIBS/CONFIG_CLIENT_LIBS/' "${S}/scripts/CMakeLists.txt" || die |
423 |
+ |
424 |
+ # All these are for the server only. |
425 |
+ # Disable rpm call which would trigger sandbox, #692368 |
426 |
+ sed -i \ |
427 |
+ -e '/MYSQL_CHECK_LIBEVENT/d' \ |
428 |
+ -e '/MYSQL_CHECK_RAPIDJSON/d' \ |
429 |
+ -e '/MYSQL_CHECK_ICU/d' \ |
430 |
+ -e '/MYSQL_CHECK_EDITLINE/d' \ |
431 |
+ -e '/MYSQL_CHECK_CURL/d' \ |
432 |
+ -e '/ADD_SUBDIRECTORY(man)/d' \ |
433 |
+ -e '/ADD_SUBDIRECTORY(share)/d' \ |
434 |
+ -e '/INCLUDE(cmake\/boost/d' \ |
435 |
+ -e 's/MY_RPM rpm/MY_RPM rpmNOTEXISTENT/' \ |
436 |
+ CMakeLists.txt || die |
437 |
+ |
438 |
+ # Skip building clients |
439 |
+ echo > client/CMakeLists.txt || die |
440 |
+ |
441 |
+ # Forcefully disable auth plugin |
442 |
+ if ! use ldap ; then |
443 |
+ sed -i -e '/MYSQL_CHECK_SASL/d' CMakeLists.txt || die |
444 |
+ echo > libmysql/authentication_ldap/CMakeLists.txt || die |
445 |
+ fi |
446 |
+ |
447 |
+ cmake-utils_src_prepare |
448 |
+} |
449 |
+ |
450 |
+multilib_src_configure() { |
451 |
+ local mycmakeargs=( |
452 |
+ -DINSTALL_LAYOUT=RPM |
453 |
+ -DINSTALL_LIBDIR=$(get_libdir) |
454 |
+ -DWITH_DEFAULT_COMPILER_OPTIONS=OFF |
455 |
+ -DWITH_DEFAULT_FEATURE_SET=OFF |
456 |
+ -DENABLED_LOCAL_INFILE=ON |
457 |
+ -DMYSQL_UNIX_ADDR="${EPREFIX}/run/mysqld/mysqld.sock" |
458 |
+ -DWITH_ZLIB=system |
459 |
+ -DWITH_SSL=system |
460 |
+ -DWITH_NUMA=OFF |
461 |
+ -DLIBMYSQL_OS_OUTPUT_NAME=mysqlclient |
462 |
+ -DSHARED_LIB_PATCH_VERSION="0" |
463 |
+ -DCMAKE_POSITION_INDEPENDENT_CODE=ON |
464 |
+ -DWITHOUT_SERVER=ON |
465 |
+ ) |
466 |
+ cmake-utils_src_configure |
467 |
+} |
468 |
+ |
469 |
+multilib_src_install() { |
470 |
+ cmake-utils_src_install |
471 |
+} |
472 |
+ |
473 |
+multilib_src_install_all() { |
474 |
+ doman \ |
475 |
+ man/my_print_defaults.1 \ |
476 |
+ man/perror.1 \ |
477 |
+ man/zlib_decompress.1 |
478 |
+ |
479 |
+ if ! use static-libs ; then |
480 |
+ find "${ED}" -name "*.a" -delete || die |
481 |
+ fi |
482 |
+} |