commit:     7f08935d12c8200027654193664b91a6312d8d05
Author:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
AuthorDate: Thu Aug  6 06:18:09 2020 +0000
Commit:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
CommitDate: Thu Aug  6 06:22:58 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7f08935d

net-analyzer/net-snmp: Use pkg-config to find libmysqlclient

mysql_config --libs returns -L/.../$libdir which got half-heartedly
fixed in its pkg-config files, so use that instead to prevent the linker
from using a previously installed libnetsnmp.

$ mysql_config --libs
-L/usr/lib64 -lmysqlclient -lpthread -lz -lm -lrt -lssl -lcrypto -ldl
$ pkg-config --libs mysqlclient
-lmysqlclient

Package-Manager: Portage-3.0.1, Repoman-2.3.23
Bug: https://bugs.gentoo.org/686416
Signed-off-by: Jeroen Roovers <jer <AT> gentoo.org>

 .../net-snmp/files/net-snmp-5.8.1-mysqlclient.patch   | 19 +++++++++++++++++++
 net-analyzer/net-snmp/net-snmp-5.8.1_pre1-r1.ebuild   |  2 ++
 net-analyzer/net-snmp/net-snmp-5.8.1_pre2.ebuild      |  3 ++-
 net-analyzer/net-snmp/net-snmp-5.8.1_rc1.ebuild       |  3 ++-
 net-analyzer/net-snmp/net-snmp-99999999.ebuild        |  1 +
 5 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/net-analyzer/net-snmp/files/net-snmp-5.8.1-mysqlclient.patch 
b/net-analyzer/net-snmp/files/net-snmp-5.8.1-mysqlclient.patch
new file mode 100644
index 00000000000..08735d1be7c
--- /dev/null
+++ b/net-analyzer/net-snmp/files/net-snmp-5.8.1-mysqlclient.patch
@@ -0,0 +1,19 @@
+--- a/configure.d/config_os_libs2
++++ b/configure.d/config_os_libs2
+@@ -516,6 +516,8 @@
+ #   mysql
+ ##
+ if test "x$with_mysql" = "xyes" ; then
++  PKG_CHECK_MODULES([MYSQL],[mysqlclient],[MYSQL_INCLUDES="$MYSQL_CFLAGS"],)
++  if test -x "$MYSQL_LIBS"; then
+   AC_PATH_PROGS(MYSQLCONFIG,mysql_config)
+   test -x "$MYSQLCONFIG" \
+       || AC_MSG_ERROR([Could not find mysql_config and was specifically asked 
to use MySQL support])
+@@ -523,6 +525,7 @@
+   MYSQL_INCLUDES=`$MYSQLCONFIG --include`
+   _libs="${LIBS}"
+   _cppflags="${CPPFLAGS}"
++  fi
+   LIBS="${LIBS} ${MYSQL_LIBS}"
+   CPPFLAGS="${CPPFLAGS} ${MYSQL_INCLUDES}"
+   AC_CHECK_HEADER(mysql.h,,

diff --git a/net-analyzer/net-snmp/net-snmp-5.8.1_pre1-r1.ebuild 
b/net-analyzer/net-snmp/net-snmp-5.8.1_pre1-r1.ebuild
index 0247614b974..48c7448ff41 100644
--- a/net-analyzer/net-snmp/net-snmp-5.8.1_pre1-r1.ebuild
+++ b/net-analyzer/net-snmp/net-snmp-5.8.1_pre1-r1.ebuild
@@ -79,6 +79,8 @@ PATCHES=(
        "${FILESDIR}"/${PN}-5.8-pcap.patch
        "${FILESDIR}"/${PN}-5.8-tinfo.patch
        "${FILESDIR}"/${PN}-5.8.1-pkg-config.patch
+       "${FILESDIR}"/${PN}-5.8.1-net-snmp-config-libdir.patch
+       "${FILESDIR}"/${PN}-5.8.1-mysqlclient.patch
 )
 
 pkg_setup() {

diff --git a/net-analyzer/net-snmp/net-snmp-5.8.1_pre2.ebuild 
b/net-analyzer/net-snmp/net-snmp-5.8.1_pre2.ebuild
index 01b3f5ccf53..bff341a5bfc 100644
--- a/net-analyzer/net-snmp/net-snmp-5.8.1_pre2.ebuild
+++ b/net-analyzer/net-snmp/net-snmp-5.8.1_pre2.ebuild
@@ -80,6 +80,7 @@ PATCHES=(
        "${FILESDIR}"/${PN}-5.8-tinfo.patch
        "${FILESDIR}"/${PN}-5.8.1-pkg-config.patch
        "${FILESDIR}"/${PN}-5.8.1-net-snmp-config-libdir.patch
+       "${FILESDIR}"/${PN}-5.8.1-mysqlclient.patch
 )
 
 pkg_setup() {
@@ -146,7 +147,7 @@ src_compile() {
        use doc && emake docsdox
 }
 
-src_install () {
+src_install() {
        # bug #317965
        emake -j1 DESTDIR="${D}" install
 

diff --git a/net-analyzer/net-snmp/net-snmp-5.8.1_rc1.ebuild 
b/net-analyzer/net-snmp/net-snmp-5.8.1_rc1.ebuild
index 885006e7fa2..06778b74907 100644
--- a/net-analyzer/net-snmp/net-snmp-5.8.1_rc1.ebuild
+++ b/net-analyzer/net-snmp/net-snmp-5.8.1_rc1.ebuild
@@ -79,6 +79,7 @@ PATCHES=(
        "${FILESDIR}"/${PN}-5.8-pcap.patch
        "${FILESDIR}"/${PN}-5.8.1-pkg-config.patch
        "${FILESDIR}"/${PN}-5.8.1-net-snmp-config-libdir.patch
+       "${FILESDIR}"/${PN}-5.8.1-mysqlclient.patch
        "${FILESDIR}"/${PN}-99999999-tinfo.patch
 )
 
@@ -146,7 +147,7 @@ src_compile() {
        use doc && emake docsdox
 }
 
-src_install () {
+src_install() {
        # bug #317965
        emake -j1 DESTDIR="${D}" install
 

diff --git a/net-analyzer/net-snmp/net-snmp-99999999.ebuild 
b/net-analyzer/net-snmp/net-snmp-99999999.ebuild
index bc7fc206a2d..d75684cc5af 100644
--- a/net-analyzer/net-snmp/net-snmp-99999999.ebuild
+++ b/net-analyzer/net-snmp/net-snmp-99999999.ebuild
@@ -78,6 +78,7 @@ PATCHES=(
        "${FILESDIR}"/${PN}-5.8-pcap.patch
        "${FILESDIR}"/${PN}-5.8.1-pkg-config.patch
        "${FILESDIR}"/${PN}-5.8.1-net-snmp-config-libdir.patch
+       "${FILESDIR}"/${PN}-5.8.1-mysqlclient.patch
        "${FILESDIR}"/${PN}-99999999-tinfo.patch
 )
 

Reply via email to