From c95edcb39895b26cf1282ed3cf06a6008bf4e54a Mon Sep 17 00:00:00 2001
From: Brian Evans <grknight@gentoo.org>
Date: Wed, 11 May 2016 14:48:44 -0400
Subject: mysql-multilib-r1.eclass:  Remove private header and don't install
 tests wrt bug 582738

The private include file mysql/private/config.h is not needed by anything
and should not be referenced.  It will never match in multiple ABIs so
just remove it.

When USE=-test, don't install tests which would just be removed later anyway.
---
 eclass/mysql-multilib-r1.eclass | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

(limited to 'eclass')

diff --git a/eclass/mysql-multilib-r1.eclass b/eclass/mysql-multilib-r1.eclass
index b18ebd085e4e..40ef8f544283 100644
--- a/eclass/mysql-multilib-r1.eclass
+++ b/eclass/mysql-multilib-r1.eclass
@@ -384,7 +384,6 @@ multilib_src_configure() {
 		-DINSTALL_MANDIR=share/man
 		-DINSTALL_MYSQLDATADIR=${EPREFIX}/var/lib/mysql
 		-DINSTALL_MYSQLSHAREDIR=share/mysql
-		-DINSTALL_MYSQLTESTDIR=share/mysql/mysql-test
 		-DINSTALL_PLUGINDIR=$(get_libdir)/mysql/plugin
 		-DINSTALL_SBINDIR=sbin
 		-DINSTALL_SCRIPTDIR=share/mysql/scripts
@@ -404,6 +403,12 @@ multilib_src_configure() {
 		-DENABLE_STATIC_LIBS=$(usex static-libs)
 	)
 
+	if use test ; then
+		mycmakeargs+=( -DINSTALL_MYSQLTESTDIR=share/mysql/mysql-test )
+	else
+		mycmakeargs+=( -DINSTALL_MYSQLTESTDIR='' )
+	fi
+
 	if in_iuse systemd ; then
 		mycmakeargs+=( -DWITH_SYSTEMD=$(usex systemd) )
 	fi
@@ -537,11 +542,16 @@ mysql-multilib-r1_src_install() {
 multilib_src_install() {
 	debug-print-function ${FUNCNAME} "$@"
 
-	if multilib_is_native_abi; then
-		# Make sure the vars are correctly initialized
-		mysql_init_vars
+	cmake-utils_src_install
+	# Make sure the vars are correctly initialized
+	mysql_init_vars
+
+	# Remove an unnecessary, private config header which will never match between ABIs and is not meant to be used
+	if [[ -f "${D}${MY_INCLUDEDIR}/private/config.h" ]] ; then
+		rm "${D}${MY_INCLUDEDIR}/private/config.h" || die
+	fi
 
-		cmake-utils_src_install
+	if multilib_is_native_abi; then
 
 		# Convenience links
 		einfo "Making Convenience links for mysqlcheck multi-call binary"
@@ -627,7 +637,6 @@ multilib_src_install() {
 			fi
 		done
 	else
-		cmake-utils_src_install
 		if [[ "${PN}" == "mariadb" ]] && use server ; then
 			insinto /usr/include/mysql/private
 			doins "${S}"/sql/*.h
-- 
cgit v1.2.3-65-gdbad