--- Begin Message ---
- To: Debian Bug Tracking System <submit@bugs.debian.org>
- Subject: sphinxsearch FTCBFS: mysql_config does not work
- From: Helmut Grohne <helmut@subdivi.de>
- Date: Sun, 23 Dec 2018 08:02:59 +0100
- Message-id: <20181223070258.GA22679@alf.mars>
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 ---