Source: lua5.3
Version: 5.3.1-1.1
Tags: patch
User: helm...@debian.org
Usertags: rebootstrap

lua5.3 fails to cross build from source, because it uses libtool-bin.
The libtool-bin package is meant as a transitional measure until all
users switch over to libtoolize. It also doesn't support cross compiling
at all.

The attached patch libtoolizes a dummy projected to obtain a libtool
that works for lua5.3. Thus the dependency on libtool-bin is avoided and
lua5.3 cross builds. Please consider applying the attached patch.

Please also consider porting it back to lua5.2 and lua5.1, which suffer
from the same problem.

Helmut
diff --minimal -Nru lua5.3-5.3.1/debian/changelog lua5.3-5.3.1/debian/changelog
--- lua5.3-5.3.1/debian/changelog
+++ lua5.3-5.3.1/debian/changelog
@@ -1,3 +1,12 @@
+lua5.3 (5.3.1-1.2) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: (Closes: #-1)
+    + libtoolize during build to avoid a dependency on libtool-bin.
+    + Use triplet-prefixed tools.
+
+ -- Helmut Grohne <hel...@subdivi.de>  Sat, 29 Oct 2016 13:45:18 +0200
+
 lua5.3 (5.3.1-1.1) unstable; urgency=medium
 
   * Non-maintainer upload.
diff --minimal -Nru lua5.3-5.3.1/debian/configure.ac 
lua5.3-5.3.1/debian/configure.ac
--- lua5.3-5.3.1/debian/configure.ac
+++ lua5.3-5.3.1/debian/configure.ac
@@ -0,0 +1,4 @@
+AC_INIT([dummy],[1.0])
+LT_INIT
+AC_PROG_LIBTOOL
+AC_OUTPUT
diff --minimal -Nru lua5.3-5.3.1/debian/control lua5.3-5.3.1/debian/control
--- lua5.3-5.3.1/debian/control
+++ lua5.3-5.3.1/debian/control
@@ -3,7 +3,7 @@
 Priority: optional
 Maintainer: Enrico Tassi <gareuselesi...@debian.org>
 Uploaders: 
-Build-Depends: debhelper (>= 9), quilt (>= 0.40), libtool-bin, libreadline-dev
+Build-Depends: debhelper (>= 9), quilt (>= 0.40), libtool, libreadline-dev, 
autoconf
 Standards-Version: 3.9.6
 Vcs-Git: git://git.debian.org/git/pkg-lua/lua5.3.git
 Vcs-Browser: http://git.debian.org/?p=pkg-lua/lua5.3.git
diff --minimal -Nru lua5.3-5.3.1/debian/patches/0001-build-system.patch 
lua5.3-5.3.1/debian/patches/0001-build-system.patch
--- lua5.3-5.3.1/debian/patches/0001-build-system.patch
+++ lua5.3-5.3.1/debian/patches/0001-build-system.patch
@@ -11,15 +11,6 @@
 index 7fa91c8..e669e78 100644
 --- a/Makefile
 +++ b/Makefile
-@@ -1,6 +1,8 @@
- # Makefile for installing Lua
- # See doc/readme.html for installation and customization instructions.
- 
-+export LIBTOOL=libtool --quiet
-+
- # == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT 
=======================
- 
- # Your platform. See PLATS for possible values.
 @@ -10,19 +12,20 @@ PLAT= none
  # so take care if INSTALL_TOP is not an absolute path. See the local target.
  # You may want to make INSTALL_LMOD and INSTALL_CMOD consistent with
@@ -84,14 +75,11 @@
 index 2e7a412..993ff15 100644
 --- a/src/Makefile
 +++ b/src/Makefile
-@@ -6,8 +6,10 @@
- # Your platform. See PLATS for possible values.
+@@ -7,7 +7,8 @@
  PLAT= none
  
--CC= gcc -std=gnu99
+ CC= gcc -std=gnu99
 -CFLAGS= -O2 -Wall -Wextra -DLUA_COMPAT_5_2 $(SYSCFLAGS) $(MYCFLAGS)
-+CC= $(CCACHE)gcc -std=gnu99
-+CXX= $(CCACHE)g++
 +CFLAGS= -Wall -Wextra -DLUA_COMPAT_5_2 $(SYSCFLAGS) $(MYCFLAGS)
 +CXXFLAGS= -Wall -Wextra -DLUA_COMPAT_5_2 $(SYSCFLAGS) $(MYCXXFLAGS)
  LDFLAGS= $(SYSLDFLAGS) $(MYLDFLAGS)
diff --minimal -Nru lua5.3-5.3.1/debian/rules lua5.3-5.3.1/debian/rules
--- lua5.3-5.3.1/debian/rules
+++ lua5.3-5.3.1/debian/rules
@@ -3,7 +3,15 @@
 # Uncomment to use ccache
 #export CCACHE=/usr/lib/ccache/
 
-ifeq (hurd,$(shell dpkg-architecture -qDEB_HOST_ARCH_OS))
+include /usr/share/dpkg/architecture.mk
+ifeq ($(origin CC),default)
+CC = $(CCACHE)$(DEB_HOST_GNU_TYPE)-gcc
+endif
+ifeq ($(origin CXX),default)
+CXX = $(CCACHE)$(DEB_HOST_GNU_TYPE)-g++
+endif
+
+ifeq (hurd,$(DEB_HOST_ARCH_OS))
        MYLIBS=-lpthread
 endif
 
@@ -29,6 +37,10 @@
        dh $@
 
 override_dh_auto_configure:
+       mkdir debian/libtool
+       cp debian/configure.ac debian/libtool/
+       cd debian/libtool && LIBTOOLIZE='libtoolize -i' autoreconf -f -i
+       dh_auto_configure --sourcedirectory=debian/libtool
        echo "#ifndef _LUA_DEB_MULTIARCH_" > src/$(LUA_MULTIARCH)
        echo "#define _LUA_DEB_MULTIARCH_" >> src/$(LUA_MULTIARCH)
        echo "#define DEB_HOST_MULTIARCH \"$(DEB_HOST_MULTIARCH)\"" >> \
@@ -36,7 +48,7 @@
        echo "#endif" >> src/$(LUA_MULTIARCH)
 
 override_dh_auto_build:
-       $(MAKE) linux MYLIBS=$(MYLIBS)
+       $(MAKE) linux MYLIBS=$(MYLIBS) 
LIBTOOL='$(CURDIR)/debian/libtool/libtool' CC='$(CC) -std=gnu99' CXX='$(CXX)'
 
 override_dh_auto_install:
        # pkgconfig
@@ -63,7 +75,7 @@
        # multiarch
        mkdir -p $(LUA_MULTIARCH_INCLUDE)
        cp src/$(LUA_MULTIARCH) $(LUA_MULTIARCH_INCLUDE)
-       $(MAKE) install
+       $(MAKE) install LIBTOOL=$(CURDIR)/debian/libtool/libtool
        mkdir -p $(DEB_DESTDIR)/share/lua$(LUA_V)/
        cp debian/version-script $(DEB_DESTDIR)/share/lua$(LUA_V)/
 
@@ -71,6 +83,7 @@
        dh_auto_clean
        rm -f doc/lua5.3.1 doc/luac5.3.1
        rm -f src/$(LUA_MULTIARCH)
+       rm -Rf debian/libtool
 
 override_dh_strip:
        dh_strip --dbg-package=$(LIB_PACKAGE_NAME)-dbg

Reply via email to