[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#917137: marked as done (sphinxsearch FTCBFS: mysql_config does not work)



Your message dated Fri, 03 Dec 2021 13:33:51 +0000
with message-id <E1mt8hD-0004S8-7W@fasolo.debian.org>
and subject line Bug#917137: fixed in sphinxsearch 2.2.11-6
has caused the Debian Bug report #917137,
regarding sphinxsearch FTCBFS: mysql_config does not work
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
917137: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=917137
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Source: sphinxsearch
Version: 2.2.11-2
Severity: normal
Tags: patch upstream
User: helmutg@debian.org
Usertags: rebootstrap
Control: block -1 by 917135

sphinxsearch fails to cross build from source, because it fails
detecting mysql using mysql_config. During cross compilation,
mysql_config does not work at all. For that reason, it should not be
used at all. The attached patch looks up mysql using pkg-config, which
presently is the standard tools for discovering compiler and linker
flags. It makes sphinxsearch cross buildable. Please be aware:
 * In order to use PKG_CHECK_MODULES, it must not occur in a shell
   if/else branch. Such branches must be expressed using AS_IF to make
   the use of AC_REQUIRE work.
 * mariadb presently lacks a dependency on libssl-dev, but it emits
   -lssl as linker flag, see #917135.
 * In order to use the patch, you need to add pkg-config to
   Build-Depends.
I tried writing the patch in a way that is upstreamable as it is useful
to other distributions (e.g. yocto).

Helmut
--- sphinxsearch-2.2.11.orig/acinclude.m4
+++ sphinxsearch-2.2.11/acinclude.m4
@@ -9,10 +9,10 @@
 mysqlconfig_locations="mysql_config /usr/bin/mysql_config /usr/local/bin/mysql_config /usr/local/mysql/bin/mysql_config /opt/mysql/bin/mysql_config /usr/pkg/bin/mysql_config"
 user_mysql_includes=
 user_mysql_libs=
+mysqlconfig_used=
 
 # check explicit MySQL root for mysql_config, include, lib
-if test [ x$1 != xyes -a x$1 != xno ]
-then
+AS_IF([test x$1 != xyes -a x$1 != xno],[
 	mysqlroot=`echo $1 | sed -e 's+/$++'`
 	if test [ -x "$mysqlroot/bin/mysql_config" ]
 	then
@@ -41,9 +41,19 @@
 	else 
 		AC_MSG_ERROR([invalid MySQL root directory '$mysqlroot'; neither bin/mysql_config, nor include/ and lib/ were found there])
 	fi
-fi
-
+],[
+	PKG_CHECK_MODULES([MYSQL],[mysqlclient],[
+		MYSQL_PKGLIBDIR=`echo $MYSQL_LIBS | sed -e 's/-[[^L]][[^ ]]*//g;s/\s*-L//g;'`
+		mysqlconfig_used=yes
+	],[
+		PKG_CHECK_MODULES([MYSQL],[mariadb],[
+			MYSQL_PKGLIBDIR=`echo $MYSQL_LIBS | sed -e 's/-[[^L]][[^ ]]*//g;s/\s*-L//g;'`
+			mysqlconfig_used=yes
+		],[])
+	])
+])
 
+AS_IF([test "x$mysqlconfig_used" = x],[
 # try running mysql_config
 AC_MSG_CHECKING([for mysql_config])
 for mysqlconfig in $mysqlconfig_locations
@@ -68,11 +78,11 @@
 done
 if test [ -n "$mysqlconfig" ]
 then
-	mysqlconfig_used=
 	AC_MSG_RESULT([not found])
 else
 	mysqlconfig_used=yes
 fi
+])
 
 
 # if there's nothing from mysql_config, check well-known include paths
--- sphinxsearch-2.2.11.orig/configure.ac
+++ sphinxsearch-2.2.11/configure.ac
@@ -344,31 +344,30 @@
 )
 
 AC_MSG_CHECKING([whether to compile with MySQL support])
-if test  x$ac_cv_use_static_mysql != xno -o x$ac_cv_use_mysql != xno
-then
+AS_IF([test x$ac_cv_use_static_mysql != xno -o x$ac_cv_use_mysql != xno],[
 	dl_mysql=0
-	if test x$ac_cv_use_static_mysql != xno ; then
+	AS_IF([test x$ac_cv_use_static_mysql != xno],[
 		AC_MSG_RESULT([static])
     	AC_CHECK_MYSQL([$ac_cv_use_static_mysql])
 		MYSQL_LIBS=`echo $MYSQL_LIBS | sed -e "sX-lmysqlclientX\$MYSQL_PKGLIBDIR/libmysqlclient.aXg"`
-	else
-		if test x$sph_usedl == xyes ; then
+	],[
+		AS_IF([test x$sph_usedl == xyes],[
 			AC_MSG_RESULT([runtime dynamic])
 			AC_CHECK_MYSQL([$ac_cv_use_mysql])
 			MYSQL_LIBS=""
 			dl_mysql=1
-		else
+		],[
 			AC_MSG_RESULT([dynamic])
 			AC_CHECK_MYSQL([$ac_cv_use_mysql])
-		fi
-	fi
+		])
+	])
     AC_DEFINE(USE_MYSQL,1,[Define to 1 if you want to compile with MySQL support])
 	AC_DEFINE_UNQUOTED(DL_MYSQL,$dl_mysql,[Define to 1 if you want runtime load mysql using dlopen])
     AC_SUBST([MYSQL_LIBS])
     AC_SUBST([MYSQL_CFLAGS])
-else
+],[
 	AC_MSG_RESULT([no])
-fi
+])
 AM_CONDITIONAL(USE_MYSQL, test x$ac_cv_use_mysql != xno -o x$ac_cv_use_static_mysql != xno )
 
 dnl ---

--- End Message ---
--- Begin Message ---
Source: sphinxsearch
Source-Version: 2.2.11-6
Done: Andrej Shadura <andrewsh@debian.org>

We believe that the bug you reported is fixed in the latest version of
sphinxsearch, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 917137@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Andrej Shadura <andrewsh@debian.org> (supplier of updated sphinxsearch package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Fri, 03 Dec 2021 14:21:45 +0100
Source: sphinxsearch
Architecture: source
Version: 2.2.11-6
Distribution: unstable
Urgency: medium
Maintainer: Andrej Shadura <andrewsh@debian.org>
Changed-By: Andrej Shadura <andrewsh@debian.org>
Closes: 917137
Changes:
 sphinxsearch (2.2.11-6) unstable; urgency=medium
 .
   [ Helmut Grohne ]
   * Use pkg-config instead of mysql_config (Closes: #917137).
 .
   [ Andrej Shadura ]
   * Build-Depend on unixodbc-dev.
   * Use pkg-config to detect libre2 (fixes FTBFS on non-x86).
Checksums-Sha1:
 66874be80eed542284b3c93f9e631c0b21c5263d 1467 sphinxsearch_2.2.11-6.dsc
 1ced0214dc931618f0c06187144f847e7e7daa9e 18540 sphinxsearch_2.2.11-6.debian.tar.xz
Checksums-Sha256:
 95ea3ea9fc9c76c7bad5893b44bc27e53426ffa1a8043fa199df5a7d791d648a 1467 sphinxsearch_2.2.11-6.dsc
 84b1d50d22683f407f5a610911f9c1edd4f2f4c48b90dcde2e15863d9db03b07 18540 sphinxsearch_2.2.11-6.debian.tar.xz
Files:
 7c57851232b2dec4fa0cc264f0e1b7a0 1467 misc optional sphinxsearch_2.2.11-6.dsc
 b5225112b00ebea71457b7fbba07472b 18540 misc optional sphinxsearch_2.2.11-6.debian.tar.xz

-----BEGIN PGP SIGNATURE-----

iHUEARYIAB0WIQSD3NF/RLIsyDZW7aHoRGtKyMdyYQUCYaoaJwAKCRDoRGtKyMdy
YaT3AP4jPLMOuKl9U5yDFsT0pIik1QAZmg60chNzo2NQ1Z/xTQEAofaGJkE8bFAc
zXYCwEN8T1TMBJ9lm3LjW1jEpEMhpw4=
=2Shi
-----END PGP SIGNATURE-----

--- End Message ---

Reply to: