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

Bug#1024258: redland FTCBFS: multiple issues



Source: redland
Version: 1.0.17-3
Tags: patch
User: debian-cross@lists.debian.org
Usertags: ftcbfs
Control: block -1 by 1024241
X-Debbugs-Cc: Andrej Shadura <andrewsh@debian.org>

redland fails to cross build from source for multiple reasons. The
immediate failure is a missing dependency on pkg-config. As such, it
fails discovering rasqal and fails. Beyond that, it also uses
mysql_config, which is known to not work during cross compilation.
Instead, pkg-config should be used. Unfortunately, the .pc file shipped
by mariadb wrongly reports an ancient version (#1024241). This must be
fixed before using it. Once that has happened, the attached patch makes
redland cross buildable.

Helmut
diff --minimal -Nru redland-1.0.17/debian/changelog redland-1.0.17/debian/changelog
--- redland-1.0.17/debian/changelog	2022-11-14 06:03:12.000000000 +0100
+++ redland-1.0.17/debian/changelog	2022-11-16 09:28:10.000000000 +0100
@@ -1,3 +1,11 @@
+redland (1.0.17-4) UNRELEASED; urgency=medium
+
+  * Fix FTCBFS: (Closes: #-1)
+    + Missing Build-Depends: pkg-config.
+    + cross.patch: avoid using mysql_config
+
+ -- Helmut Grohne <helmut@subdivi.de>  Wed, 16 Nov 2022 09:28:10 +0100
+
 redland (1.0.17-3) unstable; urgency=medium
 
   * QA upload.
diff --minimal -Nru redland-1.0.17/debian/control redland-1.0.17/debian/control
--- redland-1.0.17/debian/control	2022-11-14 05:57:56.000000000 +0100
+++ redland-1.0.17/debian/control	2022-11-16 09:28:08.000000000 +0100
@@ -15,6 +15,7 @@
  libsqlite3-dev,
  libtool,
  perl:any,
+ pkg-config,
  unixodbc-dev,
 Rules-Requires-Root: no
 Standards-Version: 4.6.1
diff --minimal -Nru redland-1.0.17/debian/patches/cross.patch redland-1.0.17/debian/patches/cross.patch
--- redland-1.0.17/debian/patches/cross.patch	1970-01-01 01:00:00.000000000 +0100
+++ redland-1.0.17/debian/patches/cross.patch	2022-11-16 09:28:10.000000000 +0100
@@ -0,0 +1,81 @@
+--- redland-1.0.17.orig/configure.ac
++++ redland-1.0.17/configure.ac
+@@ -659,25 +659,34 @@
+   fi
+   mysql_config=yes
+ fi
+-if test $mysql_config = yes -a "X$MYSQL_CONFIG" = "X" ; then
+-  AC_CHECK_PROGS(MYSQL_CONFIG, mysql_config)
+-fi
+ 
+ libmysql_min_version=3.23.56
+ # Also tested on 4.0.14
+ 
+-mysql_cflags=
+-mysql_libs=
++MYSQL_CPPFLAGS=
++MYSQL_LIBS=
++
++AS_IF([test "$mysql_config" = yes],[
++  PKG_CHECK_MODULES([MYSQL],[mysqlclient >= $libmysql_min_version],[
++    mysql_config=no
++    MYSQL_CPPFLAGS=$MYSQL_CFLAGS
++    storages_available="$storages_available mysql"
++    mysql_storage_available=yes
++  ],[])
++])
++
++if test $mysql_config = yes -a "X$MYSQL_CONFIG" = "X" ; then
++  AC_CHECK_PROGS(MYSQL_CONFIG, mysql_config)
++fi
++
+ if test "X$MYSQL_CONFIG" != X; then
+   dnl need to change quotes to allow square brackets
+   changequote(<<, >>)dnl
+-  mysql_libs=`$MYSQL_CONFIG --libs | sed -e "s/'//g"`
++  MYSQL_LIBS=`$MYSQL_CONFIG --libs | sed -e "s/'//g"`
+   # Stop the MySQL config program adding -Os or -O<n> options to CFLAGS
+-  mysql_cflags=`$MYSQL_CONFIG --cflags | sed -e "s/'//g" -e "s/[ \t]-O[A-Za-z0-9]*/ /" `
++  MYSQL_CPPFLAGS=`$MYSQL_CONFIG --cflags | sed -e "s/'//g" -e "s/[ \t]-O[A-Za-z0-9]*/ /" `
+   changequote([, ])dnl
+ 
+-  LIBS="$LIBRDF_LIBS $mysql_libs"
+-  CPPFLAGS="$LIBRDF_CPPFLAGS $mysql_cflags"
+   AC_MSG_CHECKING(for mysql library)
+   LIBMYSQL_VERSION=`$MYSQL_CONFIG --version`
+   libmysql_version_dec=`echo $LIBMYSQL_VERSION | $AWK -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'`
+@@ -689,7 +698,11 @@
+     storages_available="$storages_available mysql($LIBMYSQL_VERSION)"
+     mysql_storage_available=yes
+   fi
++fi
+ 
++AS_IF([test -n "$MYSQL_LIBS"],[
++  LIBS="$LIBRDF_LIBS $MYSQL_LIBS"
++  CPPFLAGS="$LIBRDF_CPPFLAGS $MYSQL_CPPFLAGS"
+   AC_MSG_CHECKING(whether MYSQL_OPT_RECONNECT is declared)
+   AC_COMPILE_IFELSE([AC_LANG_SOURCE([#include <mysql.h>
+     int x=MYSQL_OPT_RECONNECT;])],
+@@ -699,8 +712,7 @@
+ 
+   LIBS="$LIBRDF_LIBS"
+   CPPFLAGS="$LIBRDF_CPPFLAGS"
+-fi
+-
++])
+ 
+ 
+ AC_ARG_WITH(sqlite, [  --with-sqlite(=yes|no) Enable SQLite store (default=auto)], with_sqlite="$withval", with_sqlite="auto")
+@@ -1071,9 +1083,9 @@
+ AM_CONDITIONAL(STORAGE_POSTGRESQL, test $postgresql_storage = yes)
+ AM_CONDITIONAL(STORAGE_VIRTUOSO,  test $virtuoso_storage  = yes)
+ 
+-if test $mysql_storage  = yes; then
+-  MYSQL_CPPFLAGS=`$MYSQL_CONFIG --cflags | sed -e "s/'//g" -e "s/-O[A-Za-z0-9]*//" `
+-  MYSQL_LIBS="$LIBRDF_LIBS $mysql_libs"
++if test $mysql_storage != yes; then
++  MYSQL_CPPFLAGS=
++  MYSQL_LIBS=
+ fi
+ if test $tstore_storage  = yes; then
+   TSTORE_CPPFLAGS="`$TSTORE_CONFIG --cflags` `$PKG_CONFIG glib --cflags`"
diff --minimal -Nru redland-1.0.17/debian/patches/series redland-1.0.17/debian/patches/series
--- redland-1.0.17/debian/patches/series	1970-01-01 01:00:00.000000000 +0100
+++ redland-1.0.17/debian/patches/series	2022-11-16 09:28:10.000000000 +0100
@@ -0,0 +1 @@
+cross.patch

Reply to: