Bug#929005: superkb FTCBFS: upstream build system hard codes build architecture tools

2019-05-22 Thread Octavio Alvarez

On 5/22/19 7:59 AM, Helmut Grohne wrote:

On Wed, May 22, 2019 at 05:35:08AM -0500, Octavio Alvarez wrote:

First, in commit b364c89897 [1] I moved the help text outside of main.c into
a separate header file.


It seems to me that this commit misses the addition of the separate
header file.


Thank you for catching that. I added commit cf9a9bb3 [1] with the 
missing file.


Octavio.

[1] fix: added forgotten main-help-message.h
https://gitlab.com/alvarezp2000/superkb/commit/cf9a9bb303036085180181808078abe6ac652aff



Bug#929005: superkb FTCBFS: upstream build system hard codes build architecture tools

2019-05-22 Thread Helmut Grohne
On Wed, May 22, 2019 at 05:35:08AM -0500, Octavio Alvarez wrote:
> First, in commit b364c89897 [1] I moved the help text outside of main.c into
> a separate header file.

It seems to me that this commit misses the addition of the separate
header file.

> However, I clean the Bash script in a later commit (b5a418cc40 [3]) to use
> cpp -E instead of sed to parse the .h file. This is better because cpp is
> the proper parser for an .h file. Please confirm that this use of cpp does
> not break cross-compilation.

You're using the build architecture cpp. One usually expects both build
and host compilers to be available. That's fine for this use.

Helmut



Bug#929005: superkb FTCBFS: upstream build system hard codes build architecture tools

2019-05-22 Thread Octavio Alvarez

On 5/14/19 11:12 PM, Helmut Grohne wrote:

superkb fails to cross build from source, because the upstream build
system hard codes build architecture build tools (gcc and pkg-config).
The attached patch makes these tools substitutable,


Hi, Helmut,

Thank you for the patch! I applied it upstream.


but it doesn't make
superkb cross buildable due to its use of help2man. This is harder to
solve and not fixed here. Please consider applying the attached patch
anyway and close this bug when doing so even though superkb will
continue to fail cross building.


I also implemented a help2man fix upstream. It's done in two commits:

First, in commit b364c89897 [1] I moved the help text outside of main.c 
into a separate header file.


Then, in commit 6ba0933bd0 [2] I added a help stub: a Bash script that 
when takes the -h option it just processes the help message from the 
separate message file and outputs the help message. This stub is called 
from help2man instead of the application binary.


However, I clean the Bash script in a later commit (b5a418cc40 [3]) to 
use cpp -E instead of sed to parse the .h file. This is better because 
cpp is the proper parser for an .h file. Please confirm that this use of 
cpp does not break cross-compilation.


Because this technique is architecture independent it should work for
cross-compilation without having to build twice.

The three patches are upstream. Because I have not applied those to the 
Debian package I will keep the report open.


Thank you,
Octavio.

[1] Moved the help text outside of main.c
https://gitlab.com/alvarezp2000/superkb/commit/b364c8989773d68fb116fe2a8a5fd0c27b71bc18

[2] Add and use a help2man stub
https://gitlab.com/alvarezp2000/superkb/commit/6ba0933bd06d9ac5640aac42109f98ec1c2774fd

[3] help2man/superkb: way cleaner method to use main-help-message.h
https://gitlab.com/alvarezp2000/superkb/commit/b5a418cc4020b4ba276944b178235a9fb2373d8a



Bug#929005: superkb FTCBFS: upstream build system hard codes build architecture tools

2019-05-14 Thread Helmut Grohne
Source: superkb
Version: 0.23-2
Tags: patch upstream
User: helm...@debian.org
Usertags: rebootstrap

superkb fails to cross build from source, because the upstream build
system hard codes build architecture build tools (gcc and pkg-config).
The attached patch makes these tools substitutable, but it doesn't make
superkb cross buildable due to its use of help2man. This is harder to
solve and not fixed here. Please consider applying the attached patch
anyway and close this bug when doing so even though superkb will
continue to fail cross building.

Helmut
--- superkb-0.23.orig/Makefile
+++ superkb-0.23/Makefile
@@ -1,3 +1,4 @@
+PKG_CONFIG ?= pkg-config
 
 #Build configuration file.
 CONFIGURATION=configuration
@@ -7,50 +8,50 @@
 #puticon/puticon-gdkpixbuf
 obj-$(PUTICON_GDKPIXBUF) += puticon/puticon-gdkpixbuf.o
 syms-$(PUTICON_GDKPIXBUF) += -DWITH_GDKPIXBUF
-ldlibs-$(PUTICON_GDKPIXBUF) += $(shell pkg-config gdk-pixbuf-xlib-2.0 --libs)
-cflags-$(PUTICON_GDKPIXBUF) += $(shell pkg-config gdk-pixbuf-xlib-2.0 --cflags)
+ldlibs-$(PUTICON_GDKPIXBUF) += $(shell $(PKG_CONFIG) gdk-pixbuf-xlib-2.0 --libs)
+cflags-$(PUTICON_GDKPIXBUF) += $(shell $(PKG_CONFIG) gdk-pixbuf-xlib-2.0 --cflags)
 
 #puticon/puticon-imlib2 (which I prefer)
 obj-$(PUTICON_IMLIB2) += puticon/puticon-imlib2.o
 syms-$(PUTICON_IMLIB2) += -DWITH_IMLIB2
-ldlibs-$(PUTICON_IMLIB2) += $(shell pkg-config imlib2 --libs)
-cflags-$(PUTICON_IMLIB2) += $(shell pkg-config imlib2 --cflags)
+ldlibs-$(PUTICON_IMLIB2) += $(shell $(PKG_CONFIG) imlib2 --libs)
+cflags-$(PUTICON_IMLIB2) += $(shell $(PKG_CONFIG) imlib2 --cflags)
 
 #drawkblibs/drawkblibs-xlib
 obj-$(DRAWKBLIBS_XLIB) += drawkblibs/drawkblibs-xlib.o
 syms-$(DRAWKBLIBS_XLIB) += -DWITH_DRAWKBLIBS_XLIB
-ldlibs-$(DRAWKBLIBS_XLIB) += $(shell pkg-config x11 --libs)
-cflags-$(DRAWKBLIBS_XLIB) += $(shell pkg-config x11 --cflags)
+ldlibs-$(DRAWKBLIBS_XLIB) += $(shell $(PKG_CONFIG) x11 --libs)
+cflags-$(DRAWKBLIBS_XLIB) += $(shell $(PKG_CONFIG) x11 --cflags)
 
 #drawkblibs/drawkblibs-cairo
 obj-$(DRAWKBLIBS_CAIRO) += drawkblibs/drawkblibs-cairo.o
 syms-$(DRAWKBLIBS_CAIRO) += -DWITH_DRAWKBLIBS_CAIRO
-ldlibs-$(DRAWKBLIBS_CAIRO) += $(shell pkg-config x11 renderproto xrender cairo cairo-xlib pangocairo --libs)
-cflags-$(DRAWKBLIBS_CAIRO) += $(shell pkg-config x11 renderproto xrender cairo cairo-xlib pangocairo --cflags) -DPANGO_ENABLE_BACKEND
+ldlibs-$(DRAWKBLIBS_CAIRO) += $(shell $(PKG_CONFIG) x11 renderproto xrender cairo cairo-xlib pangocairo --libs)
+cflags-$(DRAWKBLIBS_CAIRO) += $(shell $(PKG_CONFIG) x11 renderproto xrender cairo cairo-xlib pangocairo --cflags) -DPANGO_ENABLE_BACKEND
 
-cflags-y += $(shell pkg-config xft --cflags)
-ldlibs-y += $(shell pkg-config xft --libs)
+cflags-y += $(shell $(PKG_CONFIG) xft --cflags)
+ldlibs-y += $(shell $(PKG_CONFIG) xft --libs)
 
 #Choose whether Xinerama will be emulated or real.
 ifeq ($(XINERAMA_SUPPORT),n)
 	obj-y += screeninfo-xlib.o
 else
 	obj-y += screeninfo-xinerama.o
-	ldlibs-y += $(shell pkg-config xinerama --libs)
-	cflags-y += $(shell pkg-config xinerama --cflags)
+	ldlibs-y += $(shell $(PKG_CONFIG) xinerama --libs)
+	cflags-y += $(shell $(PKG_CONFIG) xinerama --cflags)
 endif
 
 version_extrainfo = $(shell ./extendedversioninfo.bash)
 
 #Conditional -pedantic-errors because of pango 1.32.3, 1.32.4 and 1.32.5.
 PEDANTIC_ERRORS := -pedantic-errors
-ifeq ($(shell pkg-config --modversion pango),1.32.3)
+ifeq ($(shell $(PKG_CONFIG) --modversion pango),1.32.3)
PEDANTIC_ERRORS :=
 endif
-ifeq ($(shell pkg-config --modversion pango),1.32.4)
+ifeq ($(shell $(PKG_CONFIG) --modversion pango),1.32.4)
PEDANTIC_ERRORS :=
 endif
-ifeq ($(shell pkg-config --modversion pango),1.32.5)
+ifeq ($(shell $(PKG_CONFIG) --modversion pango),1.32.5)
PEDANTIC_ERRORS :=
 endif
 
@@ -111,22 +112,22 @@
 	}
 
 configuration:
-	-pkg-config xinerama --exists > /dev/null \
+	-$(PKG_CONFIG) xinerama --exists > /dev/null \
 		&& (echo "XINERAMA_SUPPORT=y" >> configuration) \
 		|| (echo "XINERAMA_SUPPORT=n" >> configuration)
-	-pkg-config gdk-pixbuf-xlib-2.0 --exists > /dev/null \
+	-$(PKG_CONFIG) gdk-pixbuf-xlib-2.0 --exists > /dev/null \
 		&& (echo "PUTICON_GDKPIXBUF=$(MODTYPE)" >> configuration) \
 		|| (echo "PUTICON_GDKPIXBUF=n" >> configuration)
-	-pkg-config imlib2 --exists > /dev/null \
+	-$(PKG_CONFIG) imlib2 --exists > /dev/null \
 		&& (echo "PUTICON_IMLIB2=$(MODTYPE)" >> configuration) \
 		|| (echo "PUTICON_IMLIB2=n" >> configuration)
 	-echo "DRAWKBLIBS_XLIB=$(MODTYPE)" >> configuration
-	-pkg-config x11 renderproto xrender cairo cairo-xlib pangocairo --exists > /dev/null \
+	-$(PKG_CONFIG) x11 renderproto xrender cairo cairo-xlib pangocairo --exists > /dev/null \
 		&& (echo "DRAWKBLIBS_CAIRO=$(MODTYPE)" >> configuration) \
 		|| (echo "DRAWKBLIBS_CAIRO=n" >> configuration)
 
 checkdep:
-	@./approve-config
+	@PKG_CONFIG=$(PKG_CONFIG) ./approve-config
 
 superkb.o: superkb.h
 superkbrc.o: superkbrc.h globals.h
@@ -140,7 +141,7 @@
 
 
 $(SHARED): %.so: %.o
-	g