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

Bug#870727: malaga FTCBFS: uses the build architecture pkg-config



Source: malaga
Version: 7.12-7
Tags: patch
User: helmutg@debian.org
Usertags: rebootstrap

malaga fails to cross build from source, because it uses the build
architecture pkg-config and thus fails finding gtk2 and glib2.0. After
switching configure.in to use PKG_CHECK_MODULES, which considers
$ac_tool_prefix, it fails building the documentation, because gtk2 and
glib2.0 are only requested for the host architecture. Since cross builds
typically skip building architecture-independent packages, moving the
documentation build to -indep overrides makes the build proceed. make
install tries to strip the resulting binaries with the build
architecture strip. This not only breaks cross building, but also
generating -dbgsym packages. It can be nullified by telling install to
strip with /bin/true. The attached patch combines all of that and makes
malaga cross build successfully. Please consider applying it.

Helmut
diff --minimal -Nru malaga-7.12/debian/changelog malaga-7.12/debian/changelog
--- malaga-7.12/debian/changelog	2016-04-07 11:51:00.000000000 +0200
+++ malaga-7.12/debian/changelog	2017-08-04 13:28:11.000000000 +0200
@@ -1,3 +1,13 @@
+malaga (7.12-7.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: Closes: #-1
+    + Add cross.patch.
+    + Do not build the documentation during arch-only.
+    + Do not strip during install.
+
+ -- Helmut Grohne <helmut@subdivi.de>  Fri, 04 Aug 2017 13:28:11 +0200
+
 malaga (7.12-7) unstable; urgency=low
 
   * QA upload.
diff --minimal -Nru malaga-7.12/debian/control malaga-7.12/debian/control
--- malaga-7.12/debian/control	2016-04-07 10:00:00.000000000 +0200
+++ malaga-7.12/debian/control	2017-08-04 13:22:23.000000000 +0200
@@ -2,7 +2,7 @@
 Maintainer: Debian QA Group <packages@qa.debian.org>
 Section: misc
 Priority: optional
-Build-Depends: libgtk2.0-dev, libglib2.0-dev, texinfo, texlive, libreadline-dev, debhelper (>= 9), autotools-dev, libcairo-dev, dpkg (>= 1.15.4) | install-info, dh-autoreconf
+Build-Depends: libgtk2.0-dev, libglib2.0-dev, texinfo, texlive, libreadline-dev, debhelper (>= 9), autotools-dev, libcairo-dev, dpkg (>= 1.15.4) | install-info, dh-autoreconf, pkg-config
 Standards-Version: 3.9.2
 
 Package: malaga-bin
diff --minimal -Nru malaga-7.12/debian/patches/cross.diff malaga-7.12/debian/patches/cross.diff
--- malaga-7.12/debian/patches/cross.diff	1970-01-01 01:00:00.000000000 +0100
+++ malaga-7.12/debian/patches/cross.diff	2017-08-04 13:28:11.000000000 +0200
@@ -0,0 +1,53 @@
+From: Helmut Grohne <helmut@subdivi.de>
+Subject: let PKG_CHECK_MODULES consider $ac_tool_prefix
+
+Index: malaga-7.12/configure.in
+===================================================================
+--- malaga-7.12.orig/configure.in
++++ malaga-7.12/configure.in
+@@ -58,12 +58,7 @@
+               use_malshow=$enableval, use_malshow=yes)
+ if test $use_malshow = yes
+ then
+-  AC_MSG_CHECKING(for GTK+ 2.8 or later)
+-  if ! $SHELL -c 'pkg-config --atleast-version=2.8 gtk+-2.0' >/dev/null 2>/dev/null
+-  then 
+-    use_malshow=no
+-  fi
+-  AC_MSG_RESULT($use_malshow)
++  PKG_CHECK_MODULES([GTK], [gtk+-2.0 >= 2.8], [use_malshow=yes], [use_malshow=no])
+   if test $use_malshow = no
+   then
+     echo 1>&2 "*** No GTK+, version 2.8 or later, found. Disabling malshow."
+@@ -72,29 +67,15 @@
+ fi
+ if test $use_malshow = yes
+ then
+-  GTK_LIBS=`pkg-config gtk+-2.0 --libs`
+-  GTK_CFLAGS=`pkg-config gtk+-2.0 --cflags`
+   MALSHOW="malshow"
+ else
+-  GTK_LIBS=""
+-  GTK_CFLAGS=""
+   MALSHOW=""
+ fi
+ 
+ dnl Check for GLib, version 2
+-AC_MSG_CHECKING(for GLib)
+-if $SHELL -c 'pkg-config glib-2.0' >/dev/null 2>/dev/null
+-then
+-  have_glib=yes
+-else
+-  have_glib=no
+-fi
+-AC_MSG_RESULT($have_glib)
+-if test $have_glib = yes
++PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])
++if test $have_glib != yes
+ then 
+-  GLIB_LIBS=`pkg-config glib-2.0 --libs`
+-  GLIB_CFLAGS=`pkg-config glib-2.0 --cflags`
+-else
+   echo 1>&2 "*** No GLib, version 2.0 or later, found. Please install it."
+   echo 1>&2 "*** You may get GLib from <http://www.gtk.org>."
+   exit 1
diff --minimal -Nru malaga-7.12/debian/patches/series malaga-7.12/debian/patches/series
--- malaga-7.12/debian/patches/series	2016-04-07 10:00:00.000000000 +0200
+++ malaga-7.12/debian/patches/series	2017-08-04 13:27:29.000000000 +0200
@@ -4,3 +4,4 @@
 no-ncurses.diff
 link-libm.diff
 texinfo.diff
+cross.diff
diff --minimal -Nru malaga-7.12/debian/rules malaga-7.12/debian/rules
--- malaga-7.12/debian/rules	2016-04-07 10:00:00.000000000 +0200
+++ malaga-7.12/debian/rules	2017-08-04 13:28:11.000000000 +0200
@@ -1,5 +1,7 @@
 #!/usr/bin/make -f
 
+export INSTALL=install --strip-program=true
+
 %:
 	dh $@ --with autoreconf
 
@@ -7,13 +9,11 @@
 	rm -rf build-doc
 	dh_auto_clean
 
-override_dh_auto_configure:
-	dh_auto_configure
+override_dh_auto_configure-indep:
 	mkdir -p build-doc
 	cd build-doc && ../configure --prefix=/usr
 
-override_dh_auto_build:
-	dh_auto_build
+override_dh_auto_build-indep:
 	$(MAKE) -C build-doc dvi html ps pdf
 
 override_dh_auto_install:

Reply to: