Source: ibam
Version: 1:0.5.2-2.1
Tags: patch
User: [email protected]
Usertags: rebootstrap

ibam fails to cross build from source, because it does not pass cross
tools to make. The easiest way of fixing that - using dh_auto_build -
does not quite work here, because ibam uses CC to store the C++
compiler, but dh_auto_build passes a C compiler. The attached patch
therefore renames CC to CXX. It also has to make pkg-config
substitutable to make ibam cross buildable. Please consider applying it.
Also please consider abandoning dpatch to make contributions to the
package easier[1].

Helmut

[1] It's not that dpatch is inherently bad, but the vast majority of
    packages use quilt now. Uniformity has a value.
diff -u ibam-0.5.2/debian/changelog ibam-0.5.2/debian/changelog
--- ibam-0.5.2/debian/changelog
+++ ibam-0.5.2/debian/changelog
@@ -1,3 +1,13 @@
+ibam (1:0.5.2-2.2) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: (Closes: #-1)
+    + cross.patch: Rename C++ compiler from CC to CXX.
+    + cross.patch: Make pkg-config substitutable.
+    + Let dh_auto_build pass cross tools to make.
+
+ -- Helmut Grohne <[email protected]>  Sun, 28 Apr 2019 21:41:30 +0200
+
 ibam (1:0.5.2-2.1) unstable; urgency=low
 
   * Non maintainer upload.
diff -u ibam-0.5.2/debian/rules ibam-0.5.2/debian/rules
--- ibam-0.5.2/debian/rules
+++ ibam-0.5.2/debian/rules
@@ -28,8 +28,8 @@
        dh_testdir 
 
        # Add here commands to compile the package.
-       $(MAKE) 
-       $(MAKE) ibam-krell.so 
+       dh_auto_build
+       dh_auto_build -- ibam-krell.so
 
        touch build-stamp
 
diff -u ibam-0.5.2/debian/patches/00list ibam-0.5.2/debian/patches/00list
--- ibam-0.5.2/debian/patches/00list
+++ ibam-0.5.2/debian/patches/00list
@@ -4,0 +5 @@
+cross.dpatch
only in patch2:
unchanged:
--- ibam-0.5.2.orig/debian/patches/cross.dpatch
+++ ibam-0.5.2/debian/patches/cross.dpatch
@@ -0,0 +1,42 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+--- a/Makefile
++++ b/Makefile
+@@ -17,7 +17,8 @@
+ #
+ IBAM_VERSION=0.5.2
+ 
+-CC=g++
++CXX=g++
++PKG_CONFIG ?= pkg-config
+ CFLAGS=-O3 -DIBAM_VERSION=\"$(IBAM_VERSION)\" -Wall
+ 
+ PREFIX=/usr
+@@ -30,23 +31,23 @@
+ all:    ibam
+ 
+ ibam: ibam.cpp ibam.inl ibam.hpp
+-      $(CC) $(CFLAGS) ibam.cpp -o ibam
++      $(CXX) $(CFLAGS) ibam.cpp -o ibam
+ 
+ krell:        ibam-krell.so
+ 
+ ibam-krell.so: ibam-krell.o
+-      $(CC) $(CFLAGS) -fPIC -shared -o ibam-krell.so ibam-krell.o
++      $(CXX) $(CFLAGS) -fPIC -shared -o ibam-krell.so ibam-krell.o
+ 
+ ibam-krell.o: ibam-krell.cpp ibam.hpp ibam.inl
+-      $(CC) $(CFLAGS) -fPIC `pkg-config gtk+-2.0 --cflags` `gdk-pixbuf-config 
--cflags` -c ibam-krell.cpp
++      $(CXX) $(CFLAGS) -fPIC `$(PKG_CONFIG) gtk+-2.0 --cflags` 
`gdk-pixbuf-config --cflags` -c ibam-krell.cpp
+ 
+ krell1:       ibam-krell1.so
+ 
+ ibam-krell1.so: ibam-krell1.o
+-      $(CC) $(CFLAGS) -shared -o ibam-krell1.so ibam-krell1.o
++      $(CXX) $(CFLAGS) -shared -o ibam-krell1.so ibam-krell1.o
+ 
+ ibam-krell1.o: ibam-krell1.cpp ibam.hpp ibam.inl
+-      $(CC) $(CFLAGS) -fPIC `gtk-config --cflags` `imlib-config --cflags-gdk` 
-c ibam-krell1.cpp
++      $(CXX) $(CFLAGS) -fPIC `gtk-config --cflags` `imlib-config 
--cflags-gdk` -c ibam-krell1.cpp
+ 
+ install: ibam
+       $(INSTALL) ./ibam $(PREFIX)/local/bin/

Reply via email to