summaryrefslogtreecommitdiff
path: root/dev-db/mysql-connector-c
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
commit8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch)
tree7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /dev-db/mysql-connector-c
parent30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff)
gentoo resync : 14.07.2018
Diffstat (limited to 'dev-db/mysql-connector-c')
-rw-r--r--dev-db/mysql-connector-c/Manifest7
-rw-r--r--dev-db/mysql-connector-c/files/20028_all_mysql-5.6-gcc7.patch13
-rw-r--r--dev-db/mysql-connector-c/files/6.1.11-openssl-1.1.patch287
-rw-r--r--dev-db/mysql-connector-c/files/mysql_com.patch31
-rw-r--r--dev-db/mysql-connector-c/metadata.xml8
-rw-r--r--dev-db/mysql-connector-c/mysql-connector-c-6.1.11-r1.ebuild90
-rw-r--r--dev-db/mysql-connector-c/mysql-connector-c-6.1.11.ebuild82
7 files changed, 518 insertions, 0 deletions
diff --git a/dev-db/mysql-connector-c/Manifest b/dev-db/mysql-connector-c/Manifest
new file mode 100644
index 000000000000..6f7189fb0b1b
--- /dev/null
+++ b/dev-db/mysql-connector-c/Manifest
@@ -0,0 +1,7 @@
+AUX 20028_all_mysql-5.6-gcc7.patch 603 BLAKE2B f03dc2e39dca4496cc084b427daa60014464876df456bf290a5de3431b481691a35ac9ac00d71cc86931efe3bca70dae012bedefc6d29ad7fec2feeb07cce014 SHA512 f9dab813418f38f3a877b8672cdec153d6f0f289144c35277e8275cc7a58195f974b7bf76b74f8dd2403643b1199f5e6d6bcde661ce5f79f614ff10347b52278
+AUX 6.1.11-openssl-1.1.patch 8528 BLAKE2B ed5c1d7455cbf5deeaa6a5badb1df665244c93222dccdf66f1121fb454fb13e2237b508f418ded84bf2dc99bce90281c95f351444f2f1593966a87aad154cfa9 SHA512 db9d1134ab2181bb78a00c0a3d22753d6bffe1b41e6b794d60af768021921573fc5061774d4ad654471f647e055e27ff36b40b4a5cc7c986d0d7837b6bd037e9
+AUX mysql_com.patch 1787 BLAKE2B 4fbd40325f400586926072927b3f07231d577f18c1e30951c34c36ded9b9e42b7c3dc47ca51df974265c28b40116e30274d8a73d6a843e5d9d0074430bc17b08 SHA512 340365b05d72045af0ef12fd5c260a796be547d9abb97a6ef3d6aaf30aecf29368c1dfa28f1284da544a81656f0436f11ada2f8c5cb481540d1f1c90dd354b49
+DIST mysql-connector-c-6.1.11-src.tar.gz 3489345 BLAKE2B 813512520ef660521221565a4466e81d902629d0ee731f746b68eed2b9129ea8361fcabe184537ec8ba91aed5a4b02dfb3450b36524c2e98f81fba148eee0cf1 SHA512 271395c888a93b833e0bbe1840b9987ecdb37d0f1cf89904207cc9aa99ed32e538aee8c9529ff39b6533947159776a8f5aa079da86ed51b1d26b086f4ffdd7c6
+EBUILD mysql-connector-c-6.1.11-r1.ebuild 2512 BLAKE2B 32d140f23e94ffbea15904aa2521e0254e51ac9f4eb0210023e343e0781282a822ab03fe923f37164bd21c94616bb7dca3725df436bd26bfc2d187ac9a680ecf SHA512 a47f7b83193220d858d0b3495233f04071c2ec62eb588c1ee2d5b884ccff217a74713f7e5fef953d472a9d8ce6f4cf9661aab092a3ecb776fcde1da46cd65f16
+EBUILD mysql-connector-c-6.1.11.ebuild 2226 BLAKE2B 67e1bf0d967f086f0946c8afc77827563ff9b2853a280af7bdaba51ffa7af803aad7241e44ba87e9aa72742e569212dc73be317660bbc11725e7fdb39609bbd0 SHA512 4967df77d63a9cc3a3628628d8ad840b6759bb6952a8cf55e6237bed1b35b7f68b10b22ab0994d28169fc433b85b99bed2e1f82b0a24420ff97f5d9e565afdd2
+MISC metadata.xml 239 BLAKE2B c4d6706d083b72927d239f41a644a4009c054c1c1a388af7733d3a2daf47d354009eb472573304a6be272601f05535297bcd9ceaea811a741cd905577ffe53d1 SHA512 e6e2fafe2f503db1d12e3d2368a99631ee8d014b7ea802d9879e7e3e2c0f9378675fffccd78ed09b914ae781ac3902567b1a53a721906e3ea63ceb51d0a1654b
diff --git a/dev-db/mysql-connector-c/files/20028_all_mysql-5.6-gcc7.patch b/dev-db/mysql-connector-c/files/20028_all_mysql-5.6-gcc7.patch
new file mode 100644
index 000000000000..cf8caedb7f1b
--- /dev/null
+++ b/dev-db/mysql-connector-c/files/20028_all_mysql-5.6-gcc7.patch
@@ -0,0 +1,13 @@
+diff --git a/sql-common/client_authentication.cc b/sql-common/client_authentication.cc
+index eaeb2d4..035ecd2 100644
+--- a/sql-common/client_authentication.cc
++++ b/sql-common/client_authentication.cc
+@@ -84,7 +84,7 @@ RSA *rsa_init(MYSQL *mysql)
+
+ if (mysql->options.extension != NULL &&
+ mysql->options.extension->server_public_key_path != NULL &&
+- mysql->options.extension->server_public_key_path != '\0')
++ mysql->options.extension->server_public_key_path[0] != '\0')
+ {
+ pub_key_file= fopen(mysql->options.extension->server_public_key_path,
+ "r");
diff --git a/dev-db/mysql-connector-c/files/6.1.11-openssl-1.1.patch b/dev-db/mysql-connector-c/files/6.1.11-openssl-1.1.patch
new file mode 100644
index 000000000000..cbca14de60b6
--- /dev/null
+++ b/dev-db/mysql-connector-c/files/6.1.11-openssl-1.1.patch
@@ -0,0 +1,287 @@
+From 7961393dd45e4ad1cdc7544b4bba2e98a5d2760c Mon Sep 17 00:00:00 2001
+From: eroen <eroen@occam.eroen.eu>
+Date: Fri, 20 Jan 2017 14:43:53 +0100
+Subject: [PATCH] Don't use deprecated API with openssl 1.1
+
+If openssl 1.1.0 is built with `--api=1.1 disable-deprecated`, using
+deprecated APIs causes build errors.
+
+X-Gentoo-Bug: 606600
+X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=606600
+---
+ mysys_ssl/my_aes_openssl.cc | 54 ++++++++++++++++++++++++++++++++-------------
+ sql-common/client.c | 16 ++++++++++++--
+ vio/viossl.c | 8 +++++++
+ vio/viosslfactories.c | 23 +++++++++++++++++++
+ 4 files changed, 84 insertions(+), 17 deletions(-)
+
+diff --git a/mysys_ssl/my_aes_openssl.cc b/mysys_ssl/my_aes_openssl.cc
+index 261ba8a..59a95e3 100644
+--- a/mysys_ssl/my_aes_openssl.cc
++++ b/mysys_ssl/my_aes_openssl.cc
+@@ -22,6 +22,12 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+ #include <openssl/evp.h>
+ #include <openssl/err.h>
+ #include <openssl/bio.h>
++#include <openssl/opensslv.h>
++
++#if (defined LIBRESSL_VERSION_NUMBER && OPENSSL_VERSION_NUMBER == 0x20000000L)
++#undef OPENSSL_VERSION_NUMBER
++#define OPENSSL_VERSION_NUMBER 0x1000107fL
++#endif
+
+ /*
+ xplugin needs BIO_new_bio_pair, but the server does not.
+@@ -122,7 +128,7 @@ int my_aes_encrypt(const unsigned char *source, uint32 source_length,
+ enum my_aes_opmode mode, const unsigned char *iv,
+ bool padding)
+ {
+- EVP_CIPHER_CTX ctx;
++ EVP_CIPHER_CTX *ctx;
+ const EVP_CIPHER *cipher= aes_evp_type(mode);
+ int u_len, f_len;
+ /* The real key to be used for encryption */
+@@ -132,23 +138,31 @@ int my_aes_encrypt(const unsigned char *source, uint32 source_length,
+ if (!cipher || (EVP_CIPHER_iv_length(cipher) > 0 && !iv))
+ return MY_AES_BAD_DATA;
+
+- if (!EVP_EncryptInit(&ctx, cipher, rkey, iv))
++ if (!EVP_EncryptInit(ctx, cipher, rkey, iv))
+ goto aes_error; /* Error */
+- if (!EVP_CIPHER_CTX_set_padding(&ctx, padding))
++ if (!EVP_CIPHER_CTX_set_padding(ctx, padding))
+ goto aes_error; /* Error */
+- if (!EVP_EncryptUpdate(&ctx, dest, &u_len, source, source_length))
++ if (!EVP_EncryptUpdate(ctx, dest, &u_len, source, source_length))
+ goto aes_error; /* Error */
+
+- if (!EVP_EncryptFinal(&ctx, dest + u_len, &f_len))
++ if (!EVP_EncryptFinal(ctx, dest + u_len, &f_len))
+ goto aes_error; /* Error */
+
+- EVP_CIPHER_CTX_cleanup(&ctx);
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
++ EVP_CIPHER_CTX_cleanup(ctx);
++#else
++ EVP_CIPHER_CTX_free(ctx);
++#endif
+ return u_len + f_len;
+
+ aes_error:
+ /* need to explicitly clean up the error if we want to ignore it */
+ ERR_clear_error();
+- EVP_CIPHER_CTX_cleanup(&ctx);
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
++ EVP_CIPHER_CTX_cleanup(ctx);
++#else
++ EVP_CIPHER_CTX_free(ctx);
++#endif
+ return MY_AES_BAD_DATA;
+ }
+
+@@ -159,7 +173,7 @@ int my_aes_decrypt(const unsigned char *source, uint32 source_length,
+ bool padding)
+ {
+
+- EVP_CIPHER_CTX ctx;
++ EVP_CIPHER_CTX *ctx;
+ const EVP_CIPHER *cipher= aes_evp_type(mode);
+ int u_len, f_len;
+
+@@ -170,24 +184,34 @@ int my_aes_decrypt(const unsigned char *source, uint32 source_length,
+ if (!cipher || (EVP_CIPHER_iv_length(cipher) > 0 && !iv))
+ return MY_AES_BAD_DATA;
+
+- EVP_CIPHER_CTX_init(&ctx);
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
++ EVP_CIPHER_CTX_init(ctx);
++#endif
+
+- if (!EVP_DecryptInit(&ctx, aes_evp_type(mode), rkey, iv))
++ if (!EVP_DecryptInit(ctx, aes_evp_type(mode), rkey, iv))
+ goto aes_error; /* Error */
+- if (!EVP_CIPHER_CTX_set_padding(&ctx, padding))
++ if (!EVP_CIPHER_CTX_set_padding(ctx, padding))
+ goto aes_error; /* Error */
+- if (!EVP_DecryptUpdate(&ctx, dest, &u_len, source, source_length))
++ if (!EVP_DecryptUpdate(ctx, dest, &u_len, source, source_length))
+ goto aes_error; /* Error */
+- if (!EVP_DecryptFinal_ex(&ctx, dest + u_len, &f_len))
++ if (!EVP_DecryptFinal_ex(ctx, dest + u_len, &f_len))
+ goto aes_error; /* Error */
+
+- EVP_CIPHER_CTX_cleanup(&ctx);
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
++ EVP_CIPHER_CTX_cleanup(ctx);
++#else
++ EVP_CIPHER_CTX_free(ctx);
++#endif
+ return u_len + f_len;
+
+ aes_error:
+ /* need to explicitly clean up the error if we want to ignore it */
+ ERR_clear_error();
+- EVP_CIPHER_CTX_cleanup(&ctx);
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
++ EVP_CIPHER_CTX_cleanup(ctx);
++#else
++ EVP_CIPHER_CTX_free(ctx);
++#endif
+ return MY_AES_BAD_DATA;
+ }
+
+diff --git a/sql-common/client.c b/sql-common/client.c
+index 9e88e9f..fe7daf7 100644
+--- a/sql-common/client.c
++++ b/sql-common/client.c
+@@ -86,6 +86,14 @@ my_bool net_flush(NET *net);
+ # include <sys/un.h>
+ #endif
+
++#ifdef HAVE_OPENSSL
++#include <openssl/opensslv.h>
++#if (defined LIBRESSL_VERSION_NUMBER && OPENSSL_VERSION_NUMBER == 0x20000000L)
++#undef OPENSSL_VERSION_NUMBER
++#define OPENSSL_VERSION_NUMBER 0x1000107fL
++#endif
++#endif
++
+ #ifndef _WIN32
+ #include <errno.h>
+ #define SOCKET_ERROR -1
+@@ -2685,7 +2693,7 @@ static int ssl_verify_server_cert(Vio *vio, const char* server_hostname, const c
+ {
+ SSL *ssl;
+ X509 *server_cert= NULL;
+- char *cn= NULL;
++ const char *cn= NULL;
+ int cn_loc= -1;
+ ASN1_STRING *cn_asn1= NULL;
+ X509_NAME_ENTRY *cn_entry= NULL;
+@@ -2757,7 +2765,11 @@ static int ssl_verify_server_cert(Vio *vio, const char* server_hostname, const c
+ goto error;
+ }
+
+- cn= (char *) ASN1_STRING_data(cn_asn1);
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
++ cn= (const char *) ASN1_STRING_data(cn_asn1);
++#else
++ cn= (const char *) ASN1_STRING_get0_data(cn_asn1);
++#endif
+
+ // There should not be any NULL embedded in the CN
+ if ((size_t)ASN1_STRING_length(cn_asn1) != strlen(cn))
+diff --git a/vio/viossl.c b/vio/viossl.c
+index 5622cb7..94b0f09 100644
+--- a/vio/viossl.c
++++ b/vio/viossl.c
+@@ -24,6 +24,12 @@
+
+ #ifdef HAVE_OPENSSL
+
++#include <openssl/opensslv.h>
++#if (defined LIBRESSL_VERSION_NUMBER && OPENSSL_VERSION_NUMBER == 0x20000000L)
++#undef OPENSSL_VERSION_NUMBER
++#define OPENSSL_VERSION_NUMBER 0x1000107fL
++#endif
++
+ #ifndef DBUG_OFF
+
+ static void
+@@ -310,8 +316,10 @@ void vio_ssl_delete(Vio *vio)
+ }
+
+ #ifndef HAVE_YASSL
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ ERR_remove_thread_state(0);
+ #endif
++#endif
+
+ vio_delete(vio);
+ }
+diff --git a/vio/viosslfactories.c b/vio/viosslfactories.c
+index da5449a..87b30c3 100644
+--- a/vio/viosslfactories.c
++++ b/vio/viosslfactories.c
+@@ -16,6 +16,14 @@
+ #include "vio_priv.h"
+
+ #ifdef HAVE_OPENSSL
++#include <openssl/bn.h>
++#include <openssl/dh.h>
++#include <openssl/opensslv.h>
++
++#if (defined LIBRESSL_VERSION_NUMBER && OPENSSL_VERSION_NUMBER == 0x20000000L)
++#undef OPENSSL_VERSION_NUMBER
++#define OPENSSL_VERSION_NUMBER 0x1000107fL
++#endif
+
+ #define TLS_VERSION_OPTION_SIZE 256
+ #define SSL_CIPHER_LIST_SIZE 4096
+@@ -121,10 +129,18 @@ static DH *get_dh2048(void)
+ DH *dh;
+ if ((dh=DH_new()))
+ {
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ dh->p=BN_bin2bn(dh2048_p,sizeof(dh2048_p),NULL);
+ dh->g=BN_bin2bn(dh2048_g,sizeof(dh2048_g),NULL);
+ if (! dh->p || ! dh->g)
+ {
++#else
++ if (! DH_set0_pqg(dh,
++ BN_bin2bn(dh2048_p,sizeof(dh2048_p),NULL),
++ BN_bin2bn(dh2048_g,sizeof(dh2048_g),NULL),
++ NULL))
++ {
++#endif
+ DH_free(dh);
+ dh=0;
+ }
+@@ -247,6 +263,8 @@ typedef struct CRYPTO_dynlock_value
+ } openssl_lock_t;
+
+
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
++
+ /* Array of locks used by openssl internally for thread synchronization.
+ The number of locks is equal to CRYPTO_num_locks.
+ */
+@@ -389,9 +407,11 @@ static void deinit_lock_callback_functions()
+ {
+ set_lock_callback_functions(FALSE);
+ }
++#endif
+
+ void vio_ssl_end()
+ {
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ int i= 0;
+
+ if (ssl_initialized) {
+@@ -409,6 +429,7 @@ void vio_ssl_end()
+
+ ssl_initialized= FALSE;
+ }
++#endif
+ }
+
+ #endif //OpenSSL specific
+@@ -419,6 +440,7 @@ void ssl_start()
+ {
+ ssl_initialized= TRUE;
+
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ SSL_library_init();
+ OpenSSL_add_all_algorithms();
+ SSL_load_error_strings();
+@@ -427,6 +449,7 @@ void ssl_start()
+ init_ssl_locks();
+ init_lock_callback_functions();
+ #endif
++#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */
+ }
+ }
+
+--
+2.11.0
+
diff --git a/dev-db/mysql-connector-c/files/mysql_com.patch b/dev-db/mysql-connector-c/files/mysql_com.patch
new file mode 100644
index 000000000000..36a7d5a23791
--- /dev/null
+++ b/dev-db/mysql-connector-c/files/mysql_com.patch
@@ -0,0 +1,31 @@
+--- a/include/mysql_com.h 2014-06-10 23:10:43.000000000 -0400
++++ b/include/mysql_com.h 2015-08-11 15:20:54.487091000 -0400
+@@ -179,7 +171,7 @@
+ #define CLIENT_IGNORE_SIGPIPE 4096 /* IGNORE sigpipes */
+ #define CLIENT_TRANSACTIONS 8192 /* Client knows about transactions */
+ #define CLIENT_RESERVED 16384 /* Old flag for 4.1 protocol */
+-#define CLIENT_RESERVED2 32768 /* Old flag for 4.1 authentication */
++#define CLIENT_SECURE_CONNECTION 32768 /* New 4.1 authentication */
+ #define CLIENT_MULTI_STATEMENTS (1UL << 16) /* Enable/disable multi-stmt support */
+ #define CLIENT_MULTI_RESULTS (1UL << 17) /* Enable/disable multi-results */
+ #define CLIENT_PS_MULTI_RESULTS (1UL << 18) /* Multi-results in PS-protocol */
+@@ -226,7 +216,7 @@
+ | CLIENT_IGNORE_SIGPIPE \
+ | CLIENT_TRANSACTIONS \
+ | CLIENT_RESERVED \
+- | CLIENT_RESERVED2 \
++ | CLIENT_SECURE_CONNECTION \
+ | CLIENT_MULTI_STATEMENTS \
+ | CLIENT_MULTI_RESULTS \
+ | CLIENT_PS_MULTI_RESULTS \
+--- a/libmysql/client_settings.h 2015-02-25 16:09:49.000000000 -0500
++++ b/libmysql/client_settings.h 2015-08-11 15:44:10.804091000 -0400
+@@ -31,7 +31,7 @@
+ CLIENT_LONG_FLAG | \
+ CLIENT_TRANSACTIONS | \
+ CLIENT_PROTOCOL_41 | \
+- CLIENT_RESERVED2 | \
++ CLIENT_SECURE_CONNECTION | \
+ CLIENT_MULTI_RESULTS | \
+ CLIENT_PS_MULTI_RESULTS | \
+ CLIENT_PLUGIN_AUTH | \
diff --git a/dev-db/mysql-connector-c/metadata.xml b/dev-db/mysql-connector-c/metadata.xml
new file mode 100644
index 000000000000..709689b06053
--- /dev/null
+++ b/dev-db/mysql-connector-c/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>mysql-bugs@gentoo.org</email>
+ <name>MySQL</name>
+</maintainer>
+</pkgmetadata>
diff --git a/dev-db/mysql-connector-c/mysql-connector-c-6.1.11-r1.ebuild b/dev-db/mysql-connector-c/mysql-connector-c-6.1.11-r1.ebuild
new file mode 100644
index 000000000000..7ec9bf8b064f
--- /dev/null
+++ b/dev-db/mysql-connector-c/mysql-connector-c-6.1.11-r1.ebuild
@@ -0,0 +1,90 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit cmake-multilib
+
+MULTILIB_WRAPPED_HEADERS+=(
+ /usr/include/mysql/my_config.h
+)
+
+# wrap the config script
+MULTILIB_CHOST_TOOLS=( /usr/bin/mysql_config )
+
+DESCRIPTION="C client library for MariaDB/MySQL"
+HOMEPAGE="https://dev.mysql.com/downloads/connector/c/"
+LICENSE="GPL-2"
+
+SRC_URI="https://dev.mysql.com/get/Downloads/Connector-C/${P}-src.tar.gz"
+S="${WORKDIR}/${P}-src"
+KEYWORDS="alpha amd64 arm ~arm64 ~hppa ia64 ~mips ppc ppc64 ~s390 ~sparc x86"
+
+SUBSLOT="18"
+SLOT="0/${SUBSLOT}"
+IUSE="libressl +ssl static-libs"
+
+CDEPEND="
+ sys-libs/zlib:=[${MULTILIB_USEDEP}]
+ ssl? (
+ libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP}] )
+ !libressl? ( dev-libs/openssl:0=[${MULTILIB_USEDEP}] )
+ )
+ "
+RDEPEND="${CDEPEND}
+ !dev-db/mysql[client-libs(+)]
+ !dev-db/mysql-cluster[client-libs(+)]
+ !dev-db/mariadb[client-libs(+)]
+ !dev-db/mariadb-connector-c[mysqlcompat]
+ !dev-db/mariadb-galera[client-libs(+)]
+ !dev-db/percona-server[client-libs(+)]
+ "
+DEPEND="${CDEPEND}"
+
+DOCS=( README )
+PATCHES=(
+ "${FILESDIR}/mysql_com.patch"
+ "${FILESDIR}/20028_all_mysql-5.6-gcc7.patch"
+ "${FILESDIR}/6.1.11-openssl-1.1.patch"
+)
+
+src_prepare() {
+ sed -i -e 's/CLIENT_LIBS/CONFIG_CLIENT_LIBS/' "${S}/scripts/CMakeLists.txt" || die
+ if use libressl ; then
+ sed -i 's/OPENSSL_MAJOR_VERSION STREQUAL "1"/OPENSSL_MAJOR_VERSION STREQUAL "2"/' \
+ "${S}/cmake/ssl.cmake" || die
+ fi
+ cmake-utils_src_prepare
+}
+
+multilib_src_configure() {
+ local mycmakeargs=(
+ -DINSTALL_LAYOUT=RPM
+ -DINSTALL_LIBDIR=$(get_libdir)
+ -DWITH_DEFAULT_COMPILER_OPTIONS=OFF
+ -DWITH_DEFAULT_FEATURE_SET=OFF
+ -DENABLED_LOCAL_INFILE=ON
+ -DMYSQL_UNIX_ADDR="${EPREFIX}/var/run/mysqld/mysqld.sock"
+ -DWITH_ZLIB=system
+ -DENABLE_DTRACE=OFF
+ -DWITH_SSL=$(usex ssl system bundled)
+ -DLIBMYSQL_OS_OUTPUT_NAME=mysqlclient
+ -DSHARED_LIB_PATCH_VERSION="0"
+ )
+ cmake-utils_src_configure
+}
+
+multilib_src_install_all() {
+ if ! use static-libs ; then
+ find "${ED}" -name "*.a" -delete || die
+ fi
+}
+
+pkg_preinst() {
+ if [[ -z ${REPLACING_VERSIONS} && -e "${EROOT}usr/$(get_libdir)/libmysqlclient.so" ]] ; then
+ elog "Due to ABI changes when switching between different client libraries,"
+ elog "revdep-rebuild must find and rebuild all packages linking to libmysqlclient."
+ elog "Please run: revdep-rebuild --library libmysqlclient.so.${SUBSLOT}"
+ ewarn "Failure to run revdep-rebuild may cause issues with other programs or libraries"
+ fi
+}
diff --git a/dev-db/mysql-connector-c/mysql-connector-c-6.1.11.ebuild b/dev-db/mysql-connector-c/mysql-connector-c-6.1.11.ebuild
new file mode 100644
index 000000000000..b0fd77fa0d6c
--- /dev/null
+++ b/dev-db/mysql-connector-c/mysql-connector-c-6.1.11.ebuild
@@ -0,0 +1,82 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit cmake-multilib
+
+MULTILIB_WRAPPED_HEADERS+=(
+ /usr/include/mysql/my_config.h
+)
+
+# wrap the config script
+MULTILIB_CHOST_TOOLS=( /usr/bin/mysql_config )
+
+DESCRIPTION="C client library for MariaDB/MySQL"
+HOMEPAGE="https://dev.mysql.com/downloads/connector/c/"
+LICENSE="GPL-2"
+
+SRC_URI="https://dev.mysql.com/get/Downloads/Connector-C/${P}-src.tar.gz"
+S="${WORKDIR}/${P}-src"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc64 ~sparc ~x86"
+
+SUBSLOT="18"
+SLOT="0/${SUBSLOT}"
+IUSE="+ssl static-libs"
+
+CDEPEND="
+ sys-libs/zlib:=[${MULTILIB_USEDEP}]
+ ssl? ( dev-libs/openssl:0=[${MULTILIB_USEDEP}] )
+ "
+RDEPEND="${CDEPEND}
+ !dev-db/mysql[client-libs(+)]
+ !dev-db/mysql-cluster[client-libs(+)]
+ !dev-db/mariadb[client-libs(+)]
+ !dev-db/mariadb-connector-c[mysqlcompat]
+ !dev-db/mariadb-galera[client-libs(+)]
+ !dev-db/percona-server[client-libs(+)]
+ "
+DEPEND="${CDEPEND}"
+
+DOCS=( README )
+PATCHES=(
+ "${FILESDIR}/mysql_com.patch"
+ "${FILESDIR}/20028_all_mysql-5.6-gcc7.patch"
+)
+
+src_prepare() {
+ sed -i -e 's/CLIENT_LIBS/CONFIG_CLIENT_LIBS/' "${S}/scripts/CMakeLists.txt" || die
+ cmake-utils_src_prepare
+}
+
+multilib_src_configure() {
+ mycmakeargs+=(
+ -DINSTALL_LAYOUT=RPM
+ -DINSTALL_LIBDIR=$(get_libdir)
+ -DWITH_DEFAULT_COMPILER_OPTIONS=OFF
+ -DWITH_DEFAULT_FEATURE_SET=OFF
+ -DENABLED_LOCAL_INFILE=ON
+ -DMYSQL_UNIX_ADDR="${EPREFIX}/var/run/mysqld/mysqld.sock"
+ -DWITH_ZLIB=system
+ -DENABLE_DTRACE=OFF
+ -DWITH_SSL=$(usex ssl system bundled)
+ -DLIBMYSQL_OS_OUTPUT_NAME=mysqlclient
+ -DSHARED_LIB_PATCH_VERSION="0"
+ )
+ cmake-utils_src_configure
+}
+
+multilib_src_install_all() {
+ if ! use static-libs ; then
+ find "${ED}" -name "*.a" -delete || die
+ fi
+}
+
+pkg_preinst() {
+ if [[ -z ${REPLACING_VERSIONS} && -e "${EROOT}usr/$(get_libdir)/libmysqlclient.so" ]] ; then
+ elog "Due to ABI changes when switching between different client libraries,"
+ elog "revdep-rebuild must find and rebuild all packages linking to libmysqlclient."
+ elog "Please run: revdep-rebuild --library libmysqlclient.so.${SUBSLOT}"
+ ewarn "Failure to run revdep-rebuild may cause issues with other programs or libraries"
+ fi
+}