Source: highlight
Version: 3.38-1
Tags: patch
User: [email protected]
Usertags: rebootstrap

highlight fails to cross build from source, because it uses the build
architecture toolchain. Indirecting the make invocations through
dh_auto_build lets debhelper pass cross tools to make. Further more
pkg-config needs to be made substitutable. Both is implemented in the
attached patch that makes highlight cross build successfully. Please
consider applying it.

Helmut
diff --minimal -Nru highlight-3.38/debian/changelog 
highlight-3.38/debian/changelog
--- highlight-3.38/debian/changelog     2017-07-02 22:49:51.000000000 +0200
+++ highlight-3.38/debian/changelog     2017-09-15 17:31:51.000000000 +0200
@@ -1,3 +1,12 @@
+highlight (3.38-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: (Closes: #-1)
+    + Let dh_auto_build pass cross tools to make.
+    + Add 0006-cross.patch.
+
+ -- Helmut Grohne <[email protected]>  Fri, 15 Sep 2017 17:31:51 +0200
+
 highlight (3.38-1) unstable; urgency=medium
 
   * New upstream version
diff --minimal -Nru highlight-3.38/debian/patches/0006-cross.patch 
highlight-3.38/debian/patches/0006-cross.patch
--- highlight-3.38/debian/patches/0006-cross.patch      1970-01-01 
01:00:00.000000000 +0100
+++ highlight-3.38/debian/patches/0006-cross.patch      2017-09-15 
17:31:51.000000000 +0200
@@ -0,0 +1,54 @@
+From: Helmut Grohne <[email protected]>
+Subject: make pkg-config substitutable for cross compilation
+
+Index: highlight-3.38/examples/swig/makefile
+===================================================================
+--- highlight-3.38.orig/examples/swig/makefile
++++ highlight-3.38/examples/swig/makefile
+@@ -1,13 +1,14 @@
+ 
+ CXX=g++
++PKG_CONFIG ?= pkg-config
+ CFLAGS+= -fPIC
+ 
+ HL_INC=../../src/include/
+ HL_SRC=../../src/
+ 
+-LUA_CFLAGS=$(shell pkg-config --cflags lua5.2)
+-LUA_LIBS=$(shell pkg-config --libs lua5.2)
+-PYTHON_CFLAGS=$(shell pkg-config --cflags python-2.7)
++LUA_CFLAGS=$(shell $(PKG_CONFIG) --cflags lua5.2)
++LUA_LIBS=$(shell $(PKG_CONFIG) --libs lua5.2)
++PYTHON_CFLAGS=$(shell $(PKG_CONFIG) --cflags python-2.7)
+ PERL_INC=$(shell perl -MExtUtils::Embed -eccopts)
+ PHP_INC=$(shell php-config --includes)
+ 
+Index: highlight-3.38/src/makefile
+===================================================================
+--- highlight-3.38.orig/src/makefile
++++ highlight-3.38/src/makefile
+@@ -14,6 +14,7 @@
+ 
+ #CXX=clang++
+ CXX=g++
++PKG_CONFIG ?= pkg-config
+ 
+ # was: qmake-qt5
+ QMAKE=qmake
+@@ -39,13 +40,13 @@
+ # If Lua 5.2 is not default on your system yet you have to
+ # use lua5.1 in the pkg-config calls
+ 
+-LUA_CFLAGS=$(shell pkg-config --cflags lua5.2) -DUSE_LUA52
++LUA_CFLAGS=$(shell $(PKG_CONFIG) --cflags lua5.2) -DUSE_LUA52
+ 
+ # default lua lib
+-LUA_LIBS=$(shell pkg-config --libs lua5.2)
++LUA_LIBS=$(shell $(PKG_CONFIG) --libs lua5.2)
+ 
+ # luajit lib
+-# LUA_LIBS=$(shell pkg-config --libs luajit)
++# LUA_LIBS=$(shell $(PKG_CONFIG) --libs luajit)
+ 
+ # Third-Party software paths
+ ASTYLE_DIR=${CORE_DIR}astyle/
diff --minimal -Nru highlight-3.38/debian/patches/series 
highlight-3.38/debian/patches/series
--- highlight-3.38/debian/patches/series        2017-07-02 22:49:51.000000000 
+0200
+++ highlight-3.38/debian/patches/series        2017-09-15 17:30:35.000000000 
+0200
@@ -4,3 +4,4 @@
 0003-add-CPPFLAGS-to-C-compilation-line.patch
 0004-Add-on-to-LDFLAGS-rather-than-overwriting-them.patch
 0005-pass-LDFLAGS-when-compiling-python-and-perl-extensio.patch
+0006-cross.patch
diff --minimal -Nru highlight-3.38/debian/rules highlight-3.38/debian/rules
--- highlight-3.38/debian/rules 2017-07-02 22:49:51.000000000 +0200
+++ highlight-3.38/debian/rules 2017-09-15 17:29:47.000000000 +0200
@@ -8,9 +8,9 @@
        dh $@
 
 override_dh_auto_build:
-       $(MAKE) -C examples/swig perl
-       $(MAKE) -C src clean
-       $(MAKE) LUA_LIBS=-llua5.2
+       dh_auto_build --sourcedirectory=examples/swig -- perl
+       dh_auto_build --sourcedirectory=src -- clean
+       dh_auto_build -- LUA_LIBS=-llua5.2
 
 get-orig-source: 
        git archive --format=tar ${UPSTREAMTAG} | bzip2 -9 > ../${ORIG}

Reply via email to