Am Samstag, 7. Juli 2012, 00:32:07 schrieb Artur Rona:
> Hello Hendrik,
> 
> Could you then prepare a fix and upload it to mentors? Somebody will
> sponsor your package. Or if you don't have a time to handle with
> packaging, then just attach here a patch to fix FTBFS.

The FTBS is a combination of three problems. The following three upstream(=me) 
patches fix the FTBFS:
0001-Fix-swig-detection.patch
0002-Fix-swig-ruby-code-for-ruby-1.9.patch
0003-Add-another-ruby-fix-from-ALT-linux.patch

I am currently rather busy, so I'd prefer help by e.g. NMU. It probably needs 
another patch after running "autoreconf -f -i". This also requires the debian 
package autoconf-archive to be installed.

HS
From b6386cc5d12b88b99e90e959f45f6e00b3b4e921 Mon Sep 17 00:00:00 2001
From: Hendrik Sattler <p...@hendrik-sattler.de>
Date: Sun, 25 Mar 2012 19:31:06 +0200
Subject: [PATCH 1/3] Fix swig detection

Swig >= 2.0 needs a newer module from autotools-archive. This removes the old
macro, uses the new macro name in configure.in and requires autotools-archive
to be present on bootstrap.
---
 acinclude.m4 |   73 ----------------------------------------------------------
 configure.in |    3 ++-
 2 files changed, 2 insertions(+), 74 deletions(-)

diff --git a/acinclude.m4 b/acinclude.m4
index 9326885..c1e8d8d 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -161,76 +161,3 @@ AC_DEFUN([USB_CHECK],[
 
 	AC_MSG_RESULT($am_cv_usb_found)
 ])
-
-dnl
-dnl From autoconf-archive, should be in macros dir
-dnl
-AC_DEFUN([AC_PROG_SWIG],[
-        AC_PATH_PROG([SWIG],[swig])
-        if test -z "$SWIG" ; then
-                AC_MSG_WARN([cannot find 'swig' program. You should look at http://www.swig.org])
-                SWIG='echo "Error: SWIG is not installed. You should look at http://www.swig.org"; ; false'
-        elif test -n "$1" ; then
-                AC_MSG_CHECKING([for SWIG version])
-                [swig_version=`$SWIG -version 2>&1 | grep 'SWIG Version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`]
-                AC_MSG_RESULT([$swig_version])
-                if test -n "$swig_version" ; then
-                        # Calculate the required version number components
-                        [required=$1]
-                        [required_major=`echo $required | sed 's/[^0-9].*//'`]
-                        if test -z "$required_major" ; then
-                                [required_major=0]
-                        fi
-                        [required=`echo $required | sed 's/[0-9]*[^0-9]//'`]
-                        [required_minor=`echo $required | sed 's/[^0-9].*//'`]
-                        if test -z "$required_minor" ; then
-                                [required_minor=0]
-                        fi
-                        [required=`echo $required | sed 's/[0-9]*[^0-9]//'`]
-                        [required_patch=`echo $required | sed 's/[^0-9].*//'`]
-                        if test -z "$required_patch" ; then
-                                [required_patch=0]
-                        fi
-                        # Calculate the available version number components
-                        [available=$swig_version]
-                        [available_major=`echo $available | sed 's/[^0-9].*//'`]
-                        if test -z "$available_major" ; then
-                                [available_major=0]
-                        fi
-                        [available=`echo $available | sed 's/[0-9]*[^0-9]//'`]
-                        [available_minor=`echo $available | sed 's/[^0-9].*//'`]
-                        if test -z "$available_minor" ; then
-                                [available_minor=0]
-                        fi
-                        [available=`echo $available | sed 's/[0-9]*[^0-9]//'`]
-                        [available_patch=`echo $available | sed 's/[^0-9].*//'`]
-                        if test -z "$available_patch" ; then
-                                [available_patch=0]
-                        fi
-                        if test $available_major -ne $required_major \
-                                -o $available_minor -ne $required_minor \
-                                -o $available_patch -lt $required_patch ; then
-                                AC_MSG_WARN([SWIG version >= $1 is required.  You have $swig_version.  You should look at http://www.swig.org])
-                                SWIG='echo "Error: SWIG version >= $1 is required.  You have '"$swig_version"'.  You should look at http://www.swig.org"; ; false'
-                        else
-                                AC_MSG_NOTICE([SWIG executable is '$SWIG'])
-                                SWIG_LIB=`$SWIG -swiglib`
-                                AC_MSG_NOTICE([SWIG library directory is '$SWIG_LIB'])
-                        fi
-                else
-                        AC_MSG_WARN([cannot determine SWIG version])
-                        SWIG='echo "Error: Cannot determine SWIG version.  You should look at http://www.swig.org"; ; false'
-                fi
-        fi
-        AC_SUBST([SWIG_LIB])
-])
-
-# SWIG_ENABLE_CXX()
-#
-# Enable SWIG C++ support.  This affects all invocations of $(SWIG).
-AC_DEFUN([SWIG_ENABLE_CXX],[
-        AC_REQUIRE([AC_PROG_SWIG])
-        AC_REQUIRE([AC_PROG_CXX])
-        SWIG="$SWIG -c++"
-])
-
diff --git a/configure.in b/configure.in
index 49fe53b..5985d9d 100644
--- a/configure.in
+++ b/configure.in
@@ -54,7 +54,7 @@ AC_ARG_ENABLE([swig],
 esac],[want_swig_rebuild=false])
 AM_CONDITIONAL(ENABLE_SWIG, test x$want_swig_rebuild = xtrue)
 if test x$want_swig_rebuild = xtrue; then
-	AC_PROG_SWIG(1.3.7) dnl how low can we go?
+	AX_PKG_SWIG(1.3.7) dnl how low can we go?
 fi
 
 # check for language bindings
@@ -77,6 +77,7 @@ AC_ARG_ENABLE([python],
 
 if test "$ac_python_enabled" = yes; then
 	AM_PATH_PYTHON
+	AX_SWIG_PYTHON([no])
 fi
 AM_CONDITIONAL([ENABLE_PYTHON], [test x"$PYTHON" != x""])
 
-- 
1.7.10.4

From d6d5fdea31abbadbfdd90b878770731ae08b66a0 Mon Sep 17 00:00:00 2001
From: Hendrik Sattler <p...@hendrik-sattler.de>
Date: Fri, 15 Jun 2012 06:46:16 +0200
Subject: [PATCH 2/3] Fix swig ruby code for ruby-1.9

---
 swig/charmap.i |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/swig/charmap.i b/swig/charmap.i
index e1f1fc1..878f203 100644
--- a/swig/charmap.i
+++ b/swig/charmap.i
@@ -90,7 +90,7 @@
 #elif defined SWIGRUBY
 /* VALUE str = StringValue($input); // perhaps better? */
 	$1 = STR2CSTR($input);
-	$2 = (int) RSTRING($input)->len;
+	$2 = (int) RSTRING_LEN($input);
 #elif defined SWIGTCL
 	$1 = Tcl_GetStringFromObj($input,&$2);
 #else
-- 
1.7.10.4

From 3cbe13601521a9d45faf474e192193476966470d Mon Sep 17 00:00:00 2001
From: Hendrik Sattler <p...@hendrik-sattler.de>
Date: Sat, 7 Jul 2012 23:33:15 +0200
Subject: [PATCH 3/3] Add another ruby fix (from ALT linux)

---
 swig/charmap.i |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/swig/charmap.i b/swig/charmap.i
index 878f203..24af65e 100644
--- a/swig/charmap.i
+++ b/swig/charmap.i
@@ -88,8 +88,7 @@
 	$1 = PyString_AsString($input);
 	$2 = PyString_Size($input);
 #elif defined SWIGRUBY
-/* VALUE str = StringValue($input); // perhaps better? */
-	$1 = STR2CSTR($input);
+	$1 = RSTRING_PTR($input);
 	$2 = (int) RSTRING_LEN($input);
 #elif defined SWIGTCL
 	$1 = Tcl_GetStringFromObj($input,&$2);
-- 
1.7.10.4

Reply via email to