summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Deutschmann <whissi@gentoo.org>2021-01-21 22:45:52 +0100
committerThomas Deutschmann <whissi@gentoo.org>2021-01-21 23:32:12 +0100
commit7da0ebc2efa34b11aa8c18da51db0a3a1415bd62 (patch)
treec3db87c3e6701ccf297b184fd548eefbaae97247
parentdev-db/mysql: bump to v5.7.33 (diff)
downloadgentoo-7da0ebc2efa34b11aa8c18da51db0a3a1415bd62.tar.gz
gentoo-7da0ebc2efa34b11aa8c18da51db0a3a1415bd62.tar.bz2
gentoo-7da0ebc2efa34b11aa8c18da51db0a3a1415bd62.zip
dev-db/mysql-connector-c: bump to v8.0.23
Package-Manager: Portage-3.0.14, Repoman-3.0.2 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
-rw-r--r--dev-db/mysql-connector-c/Manifest1
-rw-r--r--dev-db/mysql-connector-c/files/mysql-connector-c-8.0.23-libressl.patch356
-rw-r--r--dev-db/mysql-connector-c/mysql-connector-c-8.0.23.ebuild112
3 files changed, 469 insertions, 0 deletions
diff --git a/dev-db/mysql-connector-c/Manifest b/dev-db/mysql-connector-c/Manifest
index 02cd082be04f..36b6afb16c8d 100644
--- a/dev-db/mysql-connector-c/Manifest
+++ b/dev-db/mysql-connector-c/Manifest
@@ -1 +1,2 @@
DIST mysql-boost-8.0.22.tar.gz 285934450 BLAKE2B 1ba0c9bb9a0cb74af4842d3b746f8b690c122cfbf2c6d5201ce95e59a257427a8683dd8d5c2be31dfe9ece4761366c1287fa7b841c45db222725bf76b0639bc6 SHA512 792f2ada93ec67a4679228478c6b798e81d9e9f6d13c7f4977cb7682738a4aae3cb483294edc6b2fde16c3960e51af8786216c063ab500840afd39a609e4b612
+DIST mysql-boost-8.0.23.tar.gz 291039175 BLAKE2B 3a7d3e05c774085d6078d0d3effd58d2df47521615356a2aa5efc2ea2ef8457e19ad57a054926ccff0a4752ca71d0464daa7fe9a3ac6c1b1d3bd86a9a82dfc58 SHA512 b8c2e2ac772b7b730f8b3bac7a5afb205da173b3639500606e7d1fac74832a0134027951855a2dc81af015e6158c924927ad63b9e1f2e7c823d45d4c4961c3f8
diff --git a/dev-db/mysql-connector-c/files/mysql-connector-c-8.0.23-libressl.patch b/dev-db/mysql-connector-c/files/mysql-connector-c-8.0.23-libressl.patch
new file mode 100644
index 000000000000..06681d940dd8
--- /dev/null
+++ b/dev-db/mysql-connector-c/files/mysql-connector-c-8.0.23-libressl.patch
@@ -0,0 +1,356 @@
+From 262f0b8bdc86a755041c19c11b6067afce28dae1 Mon Sep 17 00:00:00 2001
+From: Thomas Deutschmann <whissi@gentoo.org>
+Date: Thu, 30 Apr 2020 20:01:48 +0200
+Subject: [PATCH 5/6] Add LibreSSL support
+
+Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
+---
+ cmake/ssl.cmake | 5 +++--
+ mysys/my_md5.cc | 2 ++
+ .../bindings/xcom/xcom/xcom_ssl_transport.cc | 6 +++++-
+ plugin/x/client/xconnection_impl.cc | 4 ++++
+ router/src/harness/src/tls_client_context.cc | 2 +-
+ router/src/harness/src/tls_context.cc | 9 ++++++--
+ router/src/harness/src/tls_server_context.cc | 3 ++-
+ sql-common/client.cc | 2 ++
+ sql/mysqld.cc | 4 +++-
+ sql/sys_vars.cc | 21 +++++++++++++++++--
+ vio/viossl.cc | 8 +++----
+ vio/viosslfactories.cc | 2 ++
+ 12 files changed, 54 insertions(+), 14 deletions(-)
+
+diff --git a/cmake/ssl.cmake b/cmake/ssl.cmake
+index 52feadeaa..3b8332695 100644
+--- a/cmake/ssl.cmake
++++ b/cmake/ssl.cmake
+@@ -222,13 +222,14 @@ MACRO (MYSQL_CHECK_SSL)
+ OPENSSL_FIX_VERSION "${OPENSSL_VERSION_NUMBER}"
+ )
+ ENDIF()
+- IF("${OPENSSL_MAJOR_VERSION}.${OPENSSL_MINOR_VERSION}.${OPENSSL_FIX_VERSION}" VERSION_GREATER "1.1.0")
++ CHECK_SYMBOL_EXISTS(TLS1_3_VERSION "openssl/tls1.h" HAVE_TLS1_3_VERSION)
++ IF(HAVE_TLS1_3_VERSION)
+ ADD_DEFINITIONS(-DHAVE_TLSv13)
+ ENDIF()
+ IF(OPENSSL_INCLUDE_DIR AND
+ OPENSSL_LIBRARY AND
+ CRYPTO_LIBRARY AND
+- OPENSSL_MAJOR_VERSION STREQUAL "1"
++ OPENSSL_MAJOR_VERSION VERSION_GREATER_EQUAL "1"
+ )
+ SET(OPENSSL_FOUND TRUE)
+ FIND_PROGRAM(OPENSSL_EXECUTABLE openssl
+diff --git a/mysys/my_md5.cc b/mysys/my_md5.cc
+index dea997b25..531696329 100644
+--- a/mysys/my_md5.cc
++++ b/mysys/my_md5.cc
+@@ -56,7 +56,9 @@ static void my_md5_hash(unsigned char *digest, unsigned const char *buf,
+ int compute_md5_hash(char *digest, const char *buf, int len) {
+ int retval = 0;
+ int fips_mode = 0;
++#ifndef LIBRESSL_VERSION_NUMBER
+ fips_mode = FIPS_mode();
++#endif
+ /* If fips mode is ON/STRICT restricted method calls will result into abort,
+ * skipping call. */
+ if (fips_mode == 0) {
+diff --git a/plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/xcom_ssl_transport.cc b/plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/xcom_ssl_transport.cc
+index 8bf63ce14..02f91b44e 100644
+--- a/plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/xcom_ssl_transport.cc
++++ b/plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/xcom_ssl_transport.cc
+@@ -325,6 +325,7 @@ error:
+ return 1;
+ }
+
++#ifndef LIBRESSL_VERSION_NUMBER
+ #define OPENSSL_ERROR_LENGTH 512
+ static int configure_ssl_fips_mode(const uint fips_mode) {
+ int rc = -1;
+@@ -348,6 +349,7 @@ static int configure_ssl_fips_mode(const uint fips_mode) {
+ EXIT:
+ return rc;
+ }
++#endif
+
+ static int configure_ssl_ca(SSL_CTX *ssl_ctx, const char *ca_file,
+ const char *ca_path) {
+@@ -544,10 +546,12 @@ int xcom_init_ssl(const char *server_key_file, const char *server_cert_file,
+ int verify_server = SSL_VERIFY_NONE;
+ int verify_client = SSL_VERIFY_NONE;
+
++#ifndef LIBRESSL_VERSION_NUMBER
+ if (configure_ssl_fips_mode(ssl_fips_mode) != 1) {
+ G_ERROR("Error setting the ssl fips mode");
+ goto error;
+ }
++#endif
+
+ SSL_library_init();
+ SSL_load_error_strings();
+@@ -611,7 +615,7 @@ error:
+ void xcom_cleanup_ssl() {
+ if (!xcom_use_ssl()) return;
+
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ ERR_remove_thread_state(0);
+ #endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */
+ }
+diff --git a/plugin/x/client/xconnection_impl.cc b/plugin/x/client/xconnection_impl.cc
+index a78371098..9d3a7b436 100644
+--- a/plugin/x/client/xconnection_impl.cc
++++ b/plugin/x/client/xconnection_impl.cc
+@@ -498,6 +498,7 @@ XError Connection_impl::get_ssl_error(const int error_id) {
+ return XError(CR_SSL_CONNECTION_ERROR, buffer);
+ }
+
++#ifndef LIBRESSL_VERSION_NUMBER
+ /**
+ Set fips mode in openssl library,
+ When we set fips mode ON/STRICT, it will perform following operations:
+@@ -537,6 +538,7 @@ int set_fips_mode(const uint32_t fips_mode,
+ EXIT:
+ return rc;
+ }
++#endif
+
+ XError Connection_impl::activate_tls() {
+ if (nullptr == m_vio) return get_socket_error(SOCKET_ECONNRESET);
+@@ -547,12 +549,14 @@ XError Connection_impl::activate_tls() {
+ if (!m_context->m_ssl_config.is_configured())
+ return XError{CR_SSL_CONNECTION_ERROR, ER_TEXT_TLS_NOT_CONFIGURATED, true};
+
++#ifndef LIBRESSL_VERSION_NUMBER
+ char err_string[OPENSSL_ERROR_LENGTH] = {'\0'};
+ if (set_fips_mode(
+ static_cast<uint32_t>(m_context->m_ssl_config.m_ssl_fips_mode),
+ err_string) != 1) {
+ return XError{CR_SSL_CONNECTION_ERROR, err_string, true};
+ }
++#endif
+ auto ssl_ctx_flags = process_tls_version(
+ details::null_when_empty(m_context->m_ssl_config.m_tls_version));
+
+diff --git a/router/src/harness/src/tls_client_context.cc b/router/src/harness/src/tls_client_context.cc
+index c14b1cb18..81a9425ca 100644
+--- a/router/src/harness/src/tls_client_context.cc
++++ b/router/src/harness/src/tls_client_context.cc
+@@ -61,7 +61,7 @@ stdx::expected<void, std::error_code> TlsClientContext::verify(
+ stdx::expected<void, std::error_code> TlsClientContext::cipher_suites(
+ const std::string &ciphers) {
+ // TLSv1.3 ciphers are controlled via SSL_CTX_set_ciphersuites()
+-#if OPENSSL_VERSION_NUMBER >= ROUTER_OPENSSL_VERSION(1, 1, 1)
++#ifdef TLS1_3_VERSION
+ if (1 != SSL_CTX_set_ciphersuites(ssl_ctx_.get(), ciphers.c_str())) {
+ return stdx::make_unexpected(make_tls_error());
+ }
+diff --git a/router/src/harness/src/tls_context.cc b/router/src/harness/src/tls_context.cc
+index e0b97bf2d..8b64b1d01 100644
+--- a/router/src/harness/src/tls_context.cc
++++ b/router/src/harness/src/tls_context.cc
+@@ -115,7 +115,7 @@ static int o11x_version(TlsVersion version) {
+ return TLS1_1_VERSION;
+ case TlsVersion::TLS_1_2:
+ return TLS1_2_VERSION;
+-#if OPENSSL_VERSION_NUMBER >= ROUTER_OPENSSL_VERSION(1, 1, 1)
++#ifdef TLS1_3_VERSION
+ case TlsVersion::TLS_1_3:
+ return TLS1_3_VERSION;
+ #endif
+@@ -145,9 +145,11 @@ stdx::expected<void, std::error_code> TlsContext::version_range(
+ switch (min_version) {
+ default:
+ // unknown, leave all disabled
++#ifdef TLS1_3_VERSION
+ // fallthrough
+ case TlsVersion::TLS_1_3:
+ opts |= SSL_OP_NO_TLSv1_2;
++#endif
+ // fallthrough
+ case TlsVersion::TLS_1_2:
+ opts |= SSL_OP_NO_TLSv1_1;
+@@ -197,8 +199,10 @@ TlsVersion TlsContext::min_version() const {
+ return TlsVersion::TLS_1_1;
+ case TLS1_2_VERSION:
+ return TlsVersion::TLS_1_2;
++#ifdef TLS1_3_VERSION
+ case TLS1_3_VERSION:
+ return TlsVersion::TLS_1_3;
++#endif
+ case 0:
+ return TlsVersion::AUTO;
+ default:
+@@ -257,7 +261,8 @@ TlsContext::InfoCallback TlsContext::info_callback() const {
+ }
+
+ int TlsContext::security_level() const {
+-#if OPENSSL_VERSION_NUMBER >= ROUTER_OPENSSL_VERSION(1, 1, 0)
++#if OPENSSL_VERSION_NUMBER >= ROUTER_OPENSSL_VERSION(1, 1, 0) && \
++ !defined(LIBRESSL_VERSION_NUMBER)
+ return SSL_CTX_get_security_level(ssl_ctx_.get());
+ #else
+ return 0;
+diff --git a/router/src/harness/src/tls_server_context.cc b/router/src/harness/src/tls_server_context.cc
+index c8fc2b5a0..76775e2a0 100644
+--- a/router/src/harness/src/tls_server_context.cc
++++ b/router/src/harness/src/tls_server_context.cc
+@@ -169,7 +169,8 @@ stdx::expected<void, std::error_code> TlsServerContext::init_tmp_dh(
+ }
+
+ } else {
+-#if OPENSSL_VERSION_NUMBER >= ROUTER_OPENSSL_VERSION(1, 1, 0)
++#if OPENSSL_VERSION_NUMBER >= ROUTER_OPENSSL_VERSION(1, 1, 0) && \
++ !defined(LIBRESSL_VERSION_NUMBER)
+ dh2048.reset(DH_get_2048_256());
+ #else
+ /*
+diff --git a/sql-common/client.cc b/sql-common/client.cc
+index 79f301fe6..b5e1d126c 100644
+--- a/sql-common/client.cc
++++ b/sql-common/client.cc
+@@ -7987,6 +7987,7 @@ int STDCALL mysql_options(MYSQL *mysql, enum mysql_option option,
+ return 1;
+ break;
+ case MYSQL_OPT_SSL_FIPS_MODE: {
++#if !defined(LIBRESSL_VERSION_NUMBER)
+ char ssl_err_string[OPENSSL_ERROR_LENGTH] = {'\0'};
+ ENSURE_EXTENSIONS_PRESENT(&mysql->options);
+ mysql->options.extension->ssl_fips_mode = *static_cast<const uint *>(arg);
+@@ -7998,6 +7999,7 @@ int STDCALL mysql_options(MYSQL *mysql, enum mysql_option option,
+ "Set Fips mode ON/STRICT failed, detail: '%s'.", ssl_err_string);
+ return 1;
+ }
++#endif
+ } break;
+ case MYSQL_OPT_SSL_MODE:
+ ENSURE_EXTENSIONS_PRESENT(&mysql->options);
+diff --git a/sql/mysqld.cc b/sql/mysqld.cc
+index cde636761..266a8c3bb 100644
+--- a/sql/mysqld.cc
++++ b/sql/mysqld.cc
+@@ -5035,7 +5035,7 @@ static int init_thread_environment() {
+
+ static PSI_memory_key key_memory_openssl = PSI_NOT_INSTRUMENTED;
+
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ #define FILE_LINE_ARGS
+ #else
+ #define FILE_LINE_ARGS , const char *, int
+@@ -5069,12 +5069,14 @@ static void init_ssl() {
+ }
+
+ static int init_ssl_communication() {
++#ifndef LIBRESSL_VERSION_NUMBER
+ char ssl_err_string[OPENSSL_ERROR_LENGTH] = {'\0'};
+ int ret_fips_mode = set_fips_mode(opt_ssl_fips_mode, ssl_err_string);
+ if (ret_fips_mode != 1) {
+ LogErr(ERROR_LEVEL, ER_SSL_FIPS_MODE_ERROR, ssl_err_string);
+ return 1;
+ }
++#endif
+ if (TLS_channel::singleton_init(&mysql_main, mysql_main_channel, opt_use_ssl,
+ &server_main_callback, opt_initialize))
+ return 1;
+diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
+index 2df3271ff..90942eef0 100644
+--- a/sql/sys_vars.cc
++++ b/sql/sys_vars.cc
+@@ -4614,6 +4614,7 @@ static Sys_var_ulong Sys_max_execution_time(
+ HINT_UPDATEABLE SESSION_VAR(max_execution_time), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(0, ULONG_MAX), DEFAULT(0), BLOCK_SIZE(1));
+
++#ifndef LIBRESSL_VERSION_NUMBER
+ static bool update_fips_mode(sys_var *, THD *, enum_var_type) {
+ char ssl_err_string[OPENSSL_ERROR_LENGTH] = {'\0'};
+ if (set_fips_mode(opt_ssl_fips_mode, ssl_err_string) != 1) {
+@@ -4624,15 +4625,31 @@ static bool update_fips_mode(sys_var *, THD *, enum_var_type) {
+ return false;
+ }
+ }
++#endif
++
++#if defined(LIBRESSL_VERSION_NUMBER)
++static const char *ssl_fips_mode_names[] = {"OFF", 0};
++#else
++static const char *ssl_fips_mode_names[] = {"OFF", "ON", "STRICT", 0};
++#endif
+
+-static const char *ssl_fips_mode_names[] = {"OFF", "ON", "STRICT", nullptr};
+ static Sys_var_enum Sys_ssl_fips_mode(
+ "ssl_fips_mode",
+ "SSL FIPS mode (applies only for OpenSSL); "
++#ifndef LIBRESSL_VERSION_NUMBER
+ "permitted values are: OFF, ON, STRICT",
++#else
++ "permitted values are: OFF",
++#endif
+ GLOBAL_VAR(opt_ssl_fips_mode), CMD_LINE(REQUIRED_ARG, OPT_SSL_FIPS_MODE),
+ ssl_fips_mode_names, DEFAULT(0), NO_MUTEX_GUARD, NOT_IN_BINLOG,
+- ON_CHECK(nullptr), ON_UPDATE(update_fips_mode), nullptr);
++ ON_CHECK(NULL),
++#ifndef LIBRESSL_VERSION_NUMBER
++ ON_UPDATE(update_fips_mode),
++#else
++ ON_UPDATE(NULL),
++#endif
++ NULL);
+
+ static Sys_var_bool Sys_auto_generate_certs(
+ "auto_generate_certs",
+diff --git a/vio/viossl.cc b/vio/viossl.cc
+index 0e9594741..3a589c64b 100644
+--- a/vio/viossl.cc
++++ b/vio/viossl.cc
+@@ -45,7 +45,7 @@
+ BIO_set_callback_ex was added in openSSL 1.1.1
+ For older openSSL, use the deprecated BIO_set_callback.
+ */
+-#if OPENSSL_VERSION_NUMBER >= 0x10101000L
++#if OPENSSL_VERSION_NUMBER >= 0x10101000L && !defined(LIBRESSL_VERSION_NUMBER)
+ #define HAVE_BIO_SET_CALLBACK_EX
+ #endif
+
+@@ -634,8 +634,8 @@ static int ssl_do(struct st_VioSSLFd *ptr, Vio *vio, long timeout,
+
+ #if !defined(DBUG_OFF)
+ {
+- STACK_OF(SSL_COMP) *ssl_comp_methods = nullptr;
+- ssl_comp_methods = SSL_COMP_get_compression_methods();
++ STACK_OF(SSL_COMP) *ssl_comp_methods = NULL;
++ ssl_comp_methods = (STACK_OF(SSL_COMP) *)SSL_COMP_get_compression_methods();
+ n = sk_SSL_COMP_num(ssl_comp_methods);
+ DBUG_PRINT("info", ("Available compression methods:\n"));
+ if (n == 0)
+@@ -643,7 +643,7 @@ static int ssl_do(struct st_VioSSLFd *ptr, Vio *vio, long timeout,
+ else
+ for (j = 0; j < n; j++) {
+ SSL_COMP *c = sk_SSL_COMP_value(ssl_comp_methods, j);
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ DBUG_PRINT("info", (" %d: %s\n", c->id, c->name));
+ #else /* OPENSSL_VERSION_NUMBER < 0x10100000L */
+ DBUG_PRINT("info",
+diff --git a/vio/viosslfactories.cc b/vio/viosslfactories.cc
+index 21c3510da..70e7d8f8b 100644
+--- a/vio/viosslfactories.cc
++++ b/vio/viosslfactories.cc
+@@ -472,6 +472,7 @@ void ssl_start() {
+ }
+ }
+
++#ifndef LIBRESSL_VERSION_NUMBER
+ /**
+ Set fips mode in openssl library,
+ When we set fips mode ON/STRICT, it will perform following operations:
+@@ -525,6 +526,7 @@ EXIT:
+ @returns openssl current fips mode
+ */
+ uint get_fips_mode() { return FIPS_mode(); }
++#endif
+
+ long process_tls_version(const char *tls_version) {
+ const char *separator = ",";
+--
+2.30.0
+
diff --git a/dev-db/mysql-connector-c/mysql-connector-c-8.0.23.ebuild b/dev-db/mysql-connector-c/mysql-connector-c-8.0.23.ebuild
new file mode 100644
index 000000000000..3b2fc70f9d2f
--- /dev/null
+++ b/dev-db/mysql-connector-c/mysql-connector-c-8.0.23.ebuild
@@ -0,0 +1,112 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit cmake-multilib
+
+# wrap the config script
+MULTILIB_CHOST_TOOLS=( /usr/bin/mysql_config )
+
+DESCRIPTION="C client library for MariaDB/MySQL"
+HOMEPAGE="https://dev.mysql.com/downloads/"
+LICENSE="GPL-2"
+
+SRC_URI="https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-boost-${PV}.tar.gz"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
+
+SLOT="0/21"
+IUSE="ldap libressl static-libs"
+
+RDEPEND="
+ >=app-arch/lz4-0_p131:=[${MULTILIB_USEDEP}]
+ app-arch/zstd:=[${MULTILIB_USEDEP}]
+ sys-libs/zlib:=[${MULTILIB_USEDEP}]
+ ldap? ( dev-libs/cyrus-sasl:=[${MULTILIB_USEDEP}] )
+ libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP}] )
+ !libressl? ( dev-libs/openssl:0=[${MULTILIB_USEDEP}] )
+ "
+DEPEND="${RDEPEND}"
+
+# Avoid file collisions, #692580
+RDEPEND+=" !<dev-db/mysql-5.6.45-r1"
+RDEPEND+=" !=dev-db/mysql-5.7.23*"
+RDEPEND+=" !=dev-db/mysql-5.7.24*"
+RDEPEND+=" !=dev-db/mysql-5.7.25*"
+RDEPEND+=" !=dev-db/mysql-5.7.26-r0"
+RDEPEND+=" !=dev-db/mysql-5.7.27-r0"
+RDEPEND+=" !<dev-db/percona-server-5.7.26.29-r1"
+
+DOCS=( README )
+
+S="${WORKDIR}/mysql-${PV}"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-8.0.22-always-build-decompress-utilities.patch
+ "${FILESDIR}"/${PN}-8.0.19-do-not-install-comp_err.patch
+ "${FILESDIR}"/${PN}-8.0.23-libressl.patch
+)
+
+src_prepare() {
+ sed -i -e 's/CLIENT_LIBS/CONFIG_CLIENT_LIBS/' "${S}/scripts/CMakeLists.txt" || die
+
+ # All these are for the server only.
+ # Disable rpm call which would trigger sandbox, #692368
+ sed -i \
+ -e '/MYSQL_CHECK_LIBEVENT/d' \
+ -e '/MYSQL_CHECK_RAPIDJSON/d' \
+ -e '/MYSQL_CHECK_ICU/d' \
+ -e '/MYSQL_CHECK_EDITLINE/d' \
+ -e '/MYSQL_CHECK_CURL/d' \
+ -e '/ADD_SUBDIRECTORY(man)/d' \
+ -e '/ADD_SUBDIRECTORY(share)/d' \
+ -e '/INCLUDE(cmake\/boost/d' \
+ -e 's/MY_RPM rpm/MY_RPM rpmNOTEXISTENT/' \
+ CMakeLists.txt || die
+
+ # Skip building clients
+ echo > client/CMakeLists.txt || die
+
+ # Forcefully disable auth plugin
+ if ! use ldap ; then
+ sed -i -e '/MYSQL_CHECK_SASL/d' CMakeLists.txt || die
+ echo > libmysql/authentication_ldap/CMakeLists.txt || die
+ fi
+
+ cmake-utils_src_prepare
+}
+
+multilib_src_configure() {
+ local mycmakeargs=(
+ -DINSTALL_LAYOUT=RPM
+ -DINSTALL_LIBDIR=$(get_libdir)
+ -DWITH_DEFAULT_COMPILER_OPTIONS=OFF
+ -DENABLED_LOCAL_INFILE=ON
+ -DMYSQL_UNIX_ADDR="${EPREFIX}/run/mysqld/mysqld.sock"
+ -DWITH_LZ4=system
+ -DWITH_NUMA=OFF
+ -DWITH_SSL=system
+ -DWITH_ZLIB=system
+ -DWITH_ZSTD=system
+ -DLIBMYSQL_OS_OUTPUT_NAME=mysqlclient
+ -DSHARED_LIB_PATCH_VERSION="0"
+ -DCMAKE_POSITION_INDEPENDENT_CODE=ON
+ -DWITHOUT_SERVER=ON
+ )
+ cmake-utils_src_configure
+}
+
+multilib_src_install() {
+ cmake-utils_src_install
+}
+
+multilib_src_install_all() {
+ doman \
+ man/my_print_defaults.1 \
+ man/perror.1 \
+ man/zlib_decompress.1
+
+ if ! use static-libs ; then
+ find "${ED}" -name "*.a" -delete || die
+ fi
+}