tags 656789 +patch
thanks

Builds of scid in minimal environments (such as the autobuilders) are
failing:

The package already build-depends on tcl8.5-dev and it built fine when I tried it in my pbuilder just now.

Taking another look at the failed build log on i386 I saw the following.

configure: Makefile configuration program for Scid
   Tcl/Tk version: 8.5
   Your operating system is: Linux 2.6.32-5-686-bigmem
   Location of "tcl.h": /usr/include/tcl8.5
   Location of "tk.h": /usr/include/tcl8.5
   Location of Tcl 8.5 library: /usr/lib
   Location of Tk 8.5 library: /usr/lib
   Location of X11 library: not found
   Checking if your system already has zlib installed: yes.
   Using Makefile.conf.
Not all settings could be determined!
The default Makefile was written.
You will need to edit it before you can compile Scid.

While the last successful i386 build said

configure: Makefile configuration program for Scid
   Renaming "Makefile" to "Makefile.bak"
   Tcl/Tk version: 8.5
   Your operating system is: Linux 2.6.32-5-686-bigmem
   Location of "tcl.h": /usr/include/tcl8.5
   Location of "tk.h": /usr/include/tcl8.5
   Location of Tcl 8.5 library: /usr/lib
   Location of Tk 8.5 library: /usr/lib
   Location of X11 library: /usr/lib/i386-linux-gnu
   Checking if your system already has zlib installed: yes.
   Using Makefile.conf.
The Makefile configured for your system was written.
Now just type "make" to compile Scid.

So it looks like the real problem is nothing to do with the build-depends* but rather a problem in the configure script.

libx11-dev is pulled in indirectly by tk8.5-dev. Since the configure script is looking for it explicitly, there should probablly be a direct build-dependency but it IS getting installed in the autobuild environment so the main question is why isn't the configure script detecting it?

So I decided to try the build in my (dirty) i386 chroot and was able to reproduce the failure there. YAY

So I added some debug code to configure and got

x11Path=
       /usr/lib
       /usr/X11/lib
       /usr/X11R6/lib
       /usr/local/X11/lib
       /usr/local/X11R6/lib
       /usr/X/lib
       /usr/local/X/lib
       /usr/openwin/lib
       /usr/lib/x86_64-linux-gnu

Looking further reveals that list was hardcoded in configure.

Next I decided to take a look back at the version of the package in testing. It seems the version in testing had a list of all multiarch dirs debian uses in "x11path" while the version in unstable only has x86_64-linux-gnu. Looking at the current package it seems these directories got lost during patch conversions and/or the import of the new upstream version.

It would be possible to simply restore the list. However I think hardcoding a list of all multiarch dirs is a bad idea for two reasons. Firstly at some point in the future more ports will likely come along which won't be in the list. Secondly it raises the possibility of the wrong directory being selected (after all the whole point of multiarch is to allow multiple architecture versions of the same package to be installed).

So i decided to take a different approach, rather than patch the configure
script with a fixed list of paths I simply substitute the correct multiarch path into the configure script using sed in debian/rules.

Patch is attatched which adds the sed code to debian/rules and also adds
a build-dependency on libx11-dev (as mentioned above) and dpkg-dev (>= 1.16.0) (for DEB_HOST_MULTIARCH).





diff -ur scid-4.3.0.cvs20111216/debian/control scid-4.3.0.cvs20111216.new/debian/control
--- scid-4.3.0.cvs20111216/debian/control	2012-01-20 22:53:31.000000000 +0000
+++ scid-4.3.0.cvs20111216.new/debian/control	2012-01-22 01:15:26.000000000 +0000
@@ -3,7 +3,7 @@
 Priority: extra
 Maintainer: Oliver Korff <o...@xynyx.de>
 Homepage: http://scid.sf.net
-Build-Depends: debhelper (>= 7.0.50~), tcl8.5-dev, tk8.5-dev, zlib1g-dev
+Build-Depends: debhelper (>= 7.0.50~), tcl8.5-dev, tk8.5-dev, zlib1g-dev, libx11-dev, dpkg-dev (>= 1.16.0)
 Standards-Version: 3.9.2
 
 Package: scid
diff -ur scid-4.3.0.cvs20111216/debian/rules scid-4.3.0.cvs20111216.new/debian/rules
--- scid-4.3.0.cvs20111216/debian/rules	2012-01-20 22:44:56.000000000 +0000
+++ scid-4.3.0.cvs20111216.new/debian/rules	2012-01-22 01:19:25.000000000 +0000
@@ -16,8 +16,12 @@
 %:
 	dh $@ --sourcedirectory=src 
 
+DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
+
 override_dh_auto_configure:
-	./configure BINDIR="$(CURDIR)/debian/scid/usr/games" \
+	sed s/x86_64-linux-gnu/$(DEB_HOST_MULTIARCH)/ configure > configure.sed
+	chmod 755 configure.sed
+	./configure.sed BINDIR="$(CURDIR)/debian/scid/usr/games" \
                 SHAREDIR="$(CURDIR)/debian/scid/usr/share/scid" TB=""
 
 override_dh_auto_install:
@@ -32,6 +36,7 @@
 	[ ! -f Makefile ] || $(MAKE) clean
 	rm -f config.sub config.guess Makefile
 	dh_clean
+	rm -f configure.sed
 
 override_dh_auto_build:
 	$(MAKE) all_scid

Reply via email to