Source: luakit
Version: 2017.08.10-1
Tags: patch
User: [email protected]
Usertags: rebootstrap

luakit fails to cross build from source. The immediate failure is
failing make clean. The Makefile checks dependencies using (the wrong)
pkg-config during each invocation. Making pkg-config substitutable is
the first step and providing the PKG_CONFIG variable for all targets
(not just during dh_auto_build) is the second. Then, documentation
generation fails as it fails to find (a native) lua-filesystem. The
build dependency needs to be annotated with :native. The attached patch
makes luakit cross buildable. Please consider applying it.

Helmut
diff --minimal -Nru luakit-2017.08.10/debian/changelog 
luakit-2017.08.10/debian/changelog
--- luakit-2017.08.10/debian/changelog  2019-01-06 11:25:03.000000000 +0100
+++ luakit-2017.08.10/debian/changelog  2019-02-24 08:01:48.000000000 +0100
@@ -1,3 +1,13 @@
+luakit (2017.08.10-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: (Closes: #-1)
+    + cross.patch: Make pkg-config substitutable.
+    + Export PKG_CONFIG for all targets.
+    + Build-Depends: require a native lua-filesystem for docs.
+
+ -- Helmut Grohne <[email protected]>  Sun, 24 Feb 2019 08:01:48 +0100
+
 luakit (2017.08.10-1) unstable; urgency=medium
 
   * New upstream version 2017.08.10
diff --minimal -Nru luakit-2017.08.10/debian/control 
luakit-2017.08.10/debian/control
--- luakit-2017.08.10/debian/control    2019-01-06 11:25:03.000000000 +0100
+++ luakit-2017.08.10/debian/control    2019-02-24 08:01:48.000000000 +0100
@@ -3,7 +3,7 @@
 Priority: optional
 Maintainer: Markus Demleitner <[email protected]>
 Standards-Version: 4.3.0
-Build-Depends: debhelper (>=9), help2man, libluajit-5.1-dev, libsqlite3-dev, 
libunique-dev, libgtk-3-dev, libwebkit2gtk-4.0-dev, luajit, lua-filesystem
+Build-Depends: debhelper (>=9), help2man, libluajit-5.1-dev, libsqlite3-dev, 
libunique-dev, libgtk-3-dev, libwebkit2gtk-4.0-dev, luajit, 
lua-filesystem:native
 Homepage: http://luakit.org/
 Vcs-Git: https://salsa.debian.org/debian/luakit.git
 Vcs-Browser: https://salsa.debian.org/debian/luakit
diff --minimal -Nru luakit-2017.08.10/debian/patches/cross.patch 
luakit-2017.08.10/debian/patches/cross.patch
--- luakit-2017.08.10/debian/patches/cross.patch        1970-01-01 
01:00:00.000000000 +0100
+++ luakit-2017.08.10/debian/patches/cross.patch        2019-02-24 
08:01:45.000000000 +0100
@@ -0,0 +1,38 @@
+--- luakit-2017.08.10.orig/config.mk
++++ luakit-2017.08.10/config.mk
+@@ -5,6 +5,7 @@
+ CFLAGS     += -std=gnu99 -ggdb -W -Wall -Wextra -Werror=unused-result
+ LDFLAGS    +=
+ CPPFLAGS   +=
++PKG_CONFIG ?= pkg-config
+ 
+ # Get current luakit version.
+ VERSION    ?= $(shell ./build-utils/getversion.sh)
+@@ -64,7 +65,7 @@
+ # Search for Lua package name if not forced by user.
+ ifeq ($(LUA_PKG_NAME),)
+ LUA_PKG_NAME = $(shell sh -c '(for name in $(LUA_PKG_NAMES); do \
+-             pkg-config --exists $$name && echo $$name; done) | head -n 1')
++             $(PKG_CONFIG) --exists $$name && echo $$name; done) | head -n 1')
+ endif
+ 
+ # === Lua binary name detection =============================================
+@@ -102,15 +103,15 @@
+ endif
+ 
+ # Check user has correct packages installed (and found by pkg-config).
+-PKGS_OK := $(shell pkg-config --print-errors --exists $(PKGS) && echo 1)
++PKGS_OK := $(shell $(PKG_CONFIG) --print-errors --exists $(PKGS) && echo 1)
+ ifneq ($(PKGS_OK),1)
+     $(error Cannot find required package(s\) to build luakit. Please \
+     check you have the above packages installed and try again)
+ endif
+ 
+ # Add pkg-config options to compile flags.
+-CFLAGS  += $(shell pkg-config --cflags $(PKGS))
++CFLAGS  += $(shell $(PKG_CONFIG) --cflags $(PKGS))
+ CFLAGS  += -I./
+ 
+ # Add pkg-config options to linker flags.
+-LDFLAGS += $(shell pkg-config --libs $(PKGS))
++LDFLAGS += $(shell $(PKG_CONFIG) --libs $(PKGS))
diff --minimal -Nru luakit-2017.08.10/debian/patches/series 
luakit-2017.08.10/debian/patches/series
--- luakit-2017.08.10/debian/patches/series     2019-01-06 11:25:03.000000000 
+0100
+++ luakit-2017.08.10/debian/patches/series     2019-02-24 08:01:20.000000000 
+0100
@@ -1,2 +1,3 @@
 0001-lintian-placating-makefile-changes.patch
 0002-Fix-a-few-defaults.patch
+cross.patch
diff --minimal -Nru luakit-2017.08.10/debian/rules 
luakit-2017.08.10/debian/rules
--- luakit-2017.08.10/debian/rules      2019-01-06 11:25:03.000000000 +0100
+++ luakit-2017.08.10/debian/rules      2019-02-24 08:01:48.000000000 +0100
@@ -1,4 +1,6 @@
 #!/usr/bin/make -f
+include /usr/share/dpkg/buildtools.mk
+export PKG_CONFIG ?= pkg-config
 export DH_VERBOSE = 1
 export DEB_CFLAGS_MAINT_APPEND  = -Wall -pedantic -fstack-protector-strong 
-Wformat -Werror=format-security
 export DEB_CPPFLAGS_MAINT_APPEND  = -Wdate-time -D_FORTIFY_SOURCE=2

Reply via email to