Source: lua5.2
Version: 5.2.4-3
Tags: patch
User: [email protected]
Usertags: cross-satisfiability

lua5.2 build-depends on libtool-bin. We want to remove that package from
the archive. It contains a pre-configured libtool, but that is not how
libtool is meant to be used. Instead, one is supposed to create a new
libtool during build. I'm attaching a patch to do that for lua. Very
similar patches have already made their way into lua5.3 and lua5.4.

Use of libtool-bin also breaks cross building.

Helmut
diff -Nru lua5.2-5.2.4/debian/changelog lua5.2-5.2.4/debian/changelog
--- lua5.2-5.2.4/debian/changelog       2022-12-10 12:47:03.000000000 +0100
+++ lua5.2-5.2.4/debian/changelog       2026-01-02 12:21:04.000000000 +0100
@@ -1,3 +1,10 @@
+lua5.2 (5.2.4-3.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Stop using libtool-bin. (Closes: #-1)
+
+ -- Helmut Grohne <[email protected]>  Fri, 02 Jan 2026 12:21:04 +0100
+
 lua5.2 (5.2.4-3) unstable; urgency=medium
 
   [ Debian Janitor ]
diff -Nru lua5.2-5.2.4/debian/configure.ac lua5.2-5.2.4/debian/configure.ac
--- lua5.2-5.2.4/debian/configure.ac    1970-01-01 01:00:00.000000000 +0100
+++ lua5.2-5.2.4/debian/configure.ac    2026-01-02 11:55:33.000000000 +0100
@@ -0,0 +1,4 @@
+AC_INIT([dummy],[1.0])
+LT_INIT
+AC_PROG_LIBTOOL
+AC_OUTPUT
diff -Nru lua5.2-5.2.4/debian/control lua5.2-5.2.4/debian/control
--- lua5.2-5.2.4/debian/control 2022-12-10 12:47:03.000000000 +0100
+++ lua5.2-5.2.4/debian/control 2026-01-02 12:21:04.000000000 +0100
@@ -8,7 +8,7 @@
 Build-Depends:
  debhelper-compat (= 12),
  libreadline-dev,
- libtool-bin,
+ libtool,
  quilt (>= 0.40),
 Standards-Version: 3.9.3
 Vcs-Git: https://salsa.debian.org/lua-team/lua5.2.git
@@ -58,7 +58,6 @@
  libreadline-dev,
  ${misc:Depends},
 Recommends:
- libtool-bin,
  pkg-config,
 Section: libdevel
 Description: Development files for the Lua language version 5.2
diff -Nru lua5.2-5.2.4/debian/patches/0001-debian-make.patch 
lua5.2-5.2.4/debian/patches/0001-debian-make.patch
--- lua5.2-5.2.4/debian/patches/0001-debian-make.patch  2022-12-10 
12:47:03.000000000 +0100
+++ lua5.2-5.2.4/debian/patches/0001-debian-make.patch  2026-01-02 
12:21:04.000000000 +0100
@@ -42,7 +42,7 @@
  # How to install. If your install program does not support "-p", then
  # you may have to run ranlib on the installed liblua.a.
 -INSTALL= install -p
-+INSTALL= libtool --quiet --mode=install install -p
++INSTALL= $(LIBTOOL) --quiet --mode=install install -p
  INSTALL_EXEC= $(INSTALL) -m 0755
  INSTALL_DATA= $(INSTALL) -m 0644
 +INSTALL_LIBTOOL= $(LIBTOOL) --mode=install install -m 0644
diff -Nru lua5.2-5.2.4/debian/rules lua5.2-5.2.4/debian/rules
--- lua5.2-5.2.4/debian/rules   2022-12-10 12:47:03.000000000 +0100
+++ lua5.2-5.2.4/debian/rules   2026-01-02 12:21:04.000000000 +0100
@@ -1,6 +1,9 @@
 #!/usr/bin/make -f
 
-ifeq (hurd,$(shell dpkg-architecture -qDEB_HOST_ARCH_OS))
+include /usr/share/dpkg/architecture.mk
+include /usr/share/dpkg/buildtools.mk
+
+ifeq (hurd,$(DEB_HOST_ARCH_OS))
        MYLIBS=-lpthread
 endif
 
@@ -9,6 +12,9 @@
 
 override_dh_auto_build:
        $(MAKE) linux \
+       CC='$(CC) -std=gnu99' \
+       CXX='$(CXX)' \
+       LIBTOOL='$(CURDIR)/debian/libtool/libtool' \
        MYCFLAGS="$(CFLAGS)" \
        MYLDFLAGS="$(LDFLAGS)" \
        MYLIBS=$(MYLIBS)
@@ -24,14 +30,21 @@
 LUA_MULTIARCH = lua5.2-deb-multiarch.h
 
 override_dh_auto_configure:
+       mkdir debian/libtool
+       cp debian/configure.ac debian/libtool/
+       LIBTOOLIZE='libtoolize -i' env -C debian/libtool 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)\"" >> \
                src/$(LUA_MULTIARCH)
        echo "#endif" >> src/$(LUA_MULTIARCH)
 
+override_dh_auto_test:
+       dh_auto_test -- LIBTOOL='$(CURDIR)/debian/libtool/libtool'
+
 override_dh_auto_install:
-       dh_auto_install
+       dh_auto_install -- LIBTOOL='$(CURDIR)/debian/libtool/libtool'
        mkdir -p `dirname $(PKG_CONFIG_FILE)`
        echo "prefix=/usr" > $(PKG_CONFIG_FILE)
        echo "major_version=5.2" >> $(PKG_CONFIG_FILE)
@@ -60,6 +73,7 @@
        dh_auto_clean
        rm -f lua5.2.1 luac5.2.1
        rm -f src/$(LUA_MULTIARCH)
+       rm -Rf debian/libtool
 
 override_dh_strip:
        dh_strip --dbgsym-migration='liblua5.2-0-dbg (<< 5.2.4-2~)'

Reply via email to