summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Deutschmann <whissi@gentoo.org>2020-03-26 22:32:40 +0100
committerThomas Deutschmann <whissi@gentoo.org>2020-03-26 22:33:44 +0100
commit8515ca38ffc7da23296958f80ed6f0cef6ad86fb (patch)
treebd0cceb6306a588666eb89ee48e17c307f54b4d8 /sys-auth/libnss-mysql
parentpackage.mask: Mask x11-terms/aterm and x11-terms/xvt for removal (diff)
downloadgentoo-8515ca38ffc7da23296958f80ed6f0cef6ad86fb.tar.gz
gentoo-8515ca38ffc7da23296958f80ed6f0cef6ad86fb.tar.bz2
gentoo-8515ca38ffc7da23296958f80ed6f0cef6ad86fb.zip
sys-auth/libnss-mysql: fix building against MariaDB 10.2+ and MySQL 8
Closes: https://github.com/gentoo/gentoo/pull/15083 Closes: https://bugs.gentoo.org/693392 Package-Manager: Portage-2.3.96, Repoman-2.3.22 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
Diffstat (limited to 'sys-auth/libnss-mysql')
-rw-r--r--sys-auth/libnss-mysql/files/libnss-mysql-1.5_p20060915-mariadb10.2.patch35
-rw-r--r--sys-auth/libnss-mysql/files/libnss-mysql-1.5_p20060915-multiarch.patch21
-rw-r--r--sys-auth/libnss-mysql/libnss-mysql-1.5_p20060915-r5.ebuild62
3 files changed, 118 insertions, 0 deletions
diff --git a/sys-auth/libnss-mysql/files/libnss-mysql-1.5_p20060915-mariadb10.2.patch b/sys-auth/libnss-mysql/files/libnss-mysql-1.5_p20060915-mariadb10.2.patch
new file mode 100644
index 000000000000..b669d01c79f3
--- /dev/null
+++ b/sys-auth/libnss-mysql/files/libnss-mysql-1.5_p20060915-mariadb10.2.patch
@@ -0,0 +1,35 @@
+--- a/src/mysql.c
++++ b/src/mysql.c
+@@ -196,6 +196,7 @@
+ int retval;
+ sql_server_t *server = &conf.sql.server;
+ unsigned int port;
++ my_bool reconnect = 1;
+
+ DENTER
+
+@@ -238,8 +239,9 @@
+ DSRETURN (NSS_UNAVAIL)
+ }
+ ci.valid = ntrue;
+- ci.link.reconnect = 0; /* Safety: We can't let MySQL assume socket is
+- still valid; see _nss_mysql_validate_socket */
++ /* Safety: We can't let MySQL assume socket is still valid;
++ see _nss_mysql_validate_socket */
++ mysql_options(&ci.link, MYSQL_OPT_RECONNECT, &reconnect);
+ DSRETURN (NSS_SUCCESS)
+ }
+ _nss_mysql_log (LOG_ALERT, "Connection to server '%s' failed: %s",
+--- a/src/nss_mysql.h
++++ b/src/nss_mysql.h
+@@ -72,6 +72,10 @@ typedef nss_status_t NSS_STATUS;
+ /* Default initializers */
+ #define DEF_TIMEOUT 3
+
++#if !defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 80001
++#define my_bool bool
++#endif
++
+ #ifdef DEBUG
+ void _nss_mysql_debug (char *fmt, ...);
+ #define DEBUG_FILE "/tmp/libnss-mysql-debug.log"
diff --git a/sys-auth/libnss-mysql/files/libnss-mysql-1.5_p20060915-multiarch.patch b/sys-auth/libnss-mysql/files/libnss-mysql-1.5_p20060915-multiarch.patch
new file mode 100644
index 000000000000..3a85b601b7e6
--- /dev/null
+++ b/sys-auth/libnss-mysql/files/libnss-mysql-1.5_p20060915-multiarch.patch
@@ -0,0 +1,21 @@
+--- libnss-mysql-1.5/acinclude.m4
++++ libnss-mysql-1.5.sal/acinclude.m4
+@@ -80,6 +80,18 @@
+ fi
+ done
+
++dnl Test also $libdir path
++if test -f "$libdir/libmysqlclient.so"
++then
++ MYSQL_LIB_DIR="$libdir"
++ break
++fi
++if test -f "$libdir/mysql/libmysqlclient.so"
++then
++ MYSQL_LIB_DIR="$libdir/mysql"
++ break
++fi
++
+ if test -n "$MYSQL_LIB_DIR"
+ then
+ AC_MSG_RESULT([$MYSQL_LIB_DIR])
diff --git a/sys-auth/libnss-mysql/libnss-mysql-1.5_p20060915-r5.ebuild b/sys-auth/libnss-mysql/libnss-mysql-1.5_p20060915-r5.ebuild
new file mode 100644
index 000000000000..090feab7685a
--- /dev/null
+++ b/sys-auth/libnss-mysql/libnss-mysql-1.5_p20060915-r5.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools
+
+KEYWORDS="amd64 ppc ~sparc x86"
+
+DESCRIPTION="NSS MySQL Library"
+HOMEPAGE="http://libnss-mysql.sourceforge.net/"
+SRC_URI="http://libnss-mysql.sourceforge.net/snapshot/${PN}-${PV/1.5_p/}.tgz"
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="debug"
+
+DEPEND="dev-db/mysql-connector-c:="
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${PN}"
+
+DOCS=( AUTHORS DEBUGGING FAQ INSTALL NEWS README THANKS
+ TODO UPGRADING ChangeLog
+)
+
+PATCHES=(
+ "${FILESDIR}"/${P}-no-automagic-debug.diff
+ "${FILESDIR}"/${PN}-1.5_p20060915-multiarch.patch
+ "${FILESDIR}"/${PN}-1.5_p20060915-mariadb10.2.patch
+)
+
+src_prepare() {
+ default
+
+ mv configure.{in,ac} || die
+
+ eautoreconf
+}
+
+src_configure() {
+ # Usually, authentication libraries don't belong into usr.
+ # But here, it's required that the lib is in the same dir
+ # as libmysql, because else failures may occur on boot if
+ # udev tries to access a user / group that doesn't exist
+ # on the system before /usr is mounted.
+ econf --libdir="/usr/$(get_libdir)" \
+ $(use_enable debug)
+}
+
+src_install() {
+ default
+
+ find "${ED}" -name '*.la' -delete || die
+
+ newdoc sample/README README.sample
+
+ local subdir
+ for subdir in sample/{linux,freebsd,complex,minimal} ; do
+ docinto "${subdir}"
+ dodoc "${subdir}/"{*.sql,*.cfg}
+ done
+}