Source: gbase
Version: 0.5-2.2
Tags: patch
User: [email protected]
Usertags: rebootstrap
gbase fails to cross build from source for multiple reasons:
1. It does not pass cross tools to make. -> dh_auto_build
2. The Makefile uses the build architecture pkg-config. -> Make
pkg-config substitutable.
3. debian/rules uses the build architecture pkg-config. -> supply from
dpkg's buildtools.mk
4. Installs with -s. This breaks DEB_BUILD_OPTIONS=nostrip and
generation of -dbgsym packages. -> Drop -s and rely on dh_strip.
The attached patch fixes all of that. Please consider applying it.
Helmut
diff -u gbase-0.5/Makefile gbase-0.5/Makefile
--- gbase-0.5/Makefile
+++ gbase-0.5/Makefile
@@ -1,6 +1,7 @@
CC = gcc
-CCFLAGS = `pkg-config --cflags gtk+-2.0`
-LDFLAGS = `pkg-config --libs gtk+-2.0`
+PKG_CONFIG ?= pkg-config
+CCFLAGS = `$(PKG_CONFIG) --cflags gtk+-2.0`
+LDFLAGS = `$(PKG_CONFIG) --libs gtk+-2.0`
gbase: gbase.o
$(CC) gbase.o $(LDFLAGS) -o gbase
diff -u gbase-0.5/debian/control gbase-0.5/debian/control
--- gbase-0.5/debian/control
+++ gbase-0.5/debian/control
@@ -2,7 +2,7 @@
Section: math
Priority: optional
Maintainer: Josip Rodin <[email protected]>
-Build-Depends: debhelper (>= 5), libgtk2.0-dev, libglib2.0-dev
+Build-Depends: debhelper (>= 7), libgtk2.0-dev, libglib2.0-dev
Standards-Version: 3.8.0
Homepage: http://www.hibernaculum.net/gbase/index.php
diff -u gbase-0.5/debian/changelog gbase-0.5/debian/changelog
--- gbase-0.5/debian/changelog
+++ gbase-0.5/debian/changelog
@@ -1,3 +1,14 @@
+gbase (0.5-2.3) UNRELEASED; urgency=medium
+
+ * Non-maintainer upload.
+ * Fix FTCBFS: (Closes: #-1)
+ + Let dh_auto_build pass cross tools to make.
+ + Make pkg-config substitutable.
+ + Get the right pkg-config from buildtools.mk.
+ + Don't pass -s to install.
+
+ -- Helmut Grohne <[email protected]> Sun, 12 May 2019 10:04:52 +0200
+
gbase (0.5-2.2) unstable; urgency=low
* Non-maintainer upload.
diff -u gbase-0.5/debian/rules gbase-0.5/debian/rules
--- gbase-0.5/debian/rules
+++ gbase-0.5/debian/rules
@@ -1,6 +1,9 @@
#!/usr/bin/make -f
-CFLAGS := -g -Wall $(shell pkg-config --cflags gtk+-2.0)
+-include /usr/share/dpkg/buildtools.mk
+PKG_CONFIG ?= pkg-config
+
+CFLAGS := -g -Wall $(shell $(PKG_CONFIG) --cflags gtk+-2.0)
ifneq "$(findstring noopt,$(DEB_BUILD_OPTIONS))" ""
CFLAGS += -O0
else
@@ -10,7 +13,7 @@
build: build-stamp
build-stamp:
dh_testdir
- $(MAKE) CCFLAGS="$(CFLAGS)"
+ dh_auto_build -- CCFLAGS="$(CFLAGS)"
touch $@
clean:
@@ -26,7 +29,7 @@
dh_testroot
dh_clean -k
dh_installdirs usr/bin
- install -m755 -s gbase debian/gbase/usr/bin
+ install -m755 gbase debian/gbase/usr/bin
dh_installman debian/gbase.1
dh_installdocs README TODO
dh_installchangelogs