Source: libgdchart-gd2
Version: 0.11.5-8
Tags: patch
User: helm...@debian.org
Usertags: rebootstrap

libgdchart-gd2 fails to cross build from source, because it uses the
build architecture compiler. Its upstream build system has a pretty
non-standard use of CC. It embeds compiler flags into CC rather than the
more common CFLAGS. Thus it is not easy to substitute CC by standard
means. After performing the correct substitution (see patch), the build
still fails due to another bug in d-shlibs. Please close this bug anyway
after fixing the compiler invocations.

Helmut
diff --minimal -Nru libgdchart-gd2-0.11.5/debian/changelog 
libgdchart-gd2-0.11.5/debian/changelog
--- libgdchart-gd2-0.11.5/debian/changelog      2015-07-16 12:03:12.000000000 
+0200
+++ libgdchart-gd2-0.11.5/debian/changelog      2017-10-30 21:59:33.000000000 
+0100
@@ -1,3 +1,10 @@
+libgdchart-gd2 (0.11.5-8.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: Use a triplet-prefixed CC. (Closes: #-1)
+
+ -- Helmut Grohne <hel...@subdivi.de>  Mon, 30 Oct 2017 21:59:33 +0100
+
 libgdchart-gd2 (0.11.5-8) unstable; urgency=medium
 
   * Team upload
diff --minimal -Nru libgdchart-gd2-0.11.5/debian/rules 
libgdchart-gd2-0.11.5/debian/rules
--- libgdchart-gd2-0.11.5/debian/rules  2015-07-16 12:03:12.000000000 +0200
+++ libgdchart-gd2-0.11.5/debian/rules  2017-10-30 21:59:31.000000000 +0100
@@ -2,6 +2,7 @@
 # -*- mode: makefile; coding: utf-8 -*-
 # Copyright © 2004-2007 Jonas Smedegaard <d...@jones.dk>
 
+include /usr/share/dpkg/architecture.mk
 include /usr/share/cdbs/1/rules/upstream-tarball.mk
 include /usr/share/cdbs/1/class/makefile-vars.mk
 include /usr/share/cdbs/1/rules/debhelper.mk
@@ -30,6 +31,10 @@
 version := $(shell expr `pwd` : '.*-\([0-9.]*\)')
 version_major := $(shell expr `pwd` : '.*-\([0-9]*\).[0-9.]*')
 
+ifeq ($(origin CC),default)
+CC = $(DEB_HOST_GNU_TYPE)-gcc
+endif
+
 INCLUDEDIRS = -I. -I.. -I/usr/include/freetype2 
-I/usr/include/freetype2/freetype
 LIBS = -lc -lm -L/usr/lib -lpng -lz -ljpeg -lfreetype -lgd
 
@@ -47,9 +52,9 @@
        cd $(package)-xpm && \
                $(DEB_MAKE_INVOKE) -f ../Makefile VPATH=".." srcdir=".." \
                INCLUDEDIRS="$(INCLUDEDIRS) -I/usr/include/X11" \
-               $(library).a
+               CC='$(CC) $$(INCLUDEDIRS)' $(library).a
        cd $(package)-xpm && \
-               gcc -shared -D_REENTRANT \
+               $(CC) -shared -D_REENTRANT \
                -Wl,-soname,$(library).so.$(version_major) \
                -o $(library).so.$(version) \
                `echo *.o` \
@@ -63,9 +68,9 @@
        cd $(package)-noxpm && \
                $(DEB_MAKE_INVOKE) -f ../Makefile VPATH=".." srcdir=".." \
                INCLUDEDIRS="$(INCLUDEDIRS)" \
-               $(library).a
+               CC='$(CC) $$(INCLUDEDIRS)' $(library).a
        cd $(package)-noxpm && \
-               gcc -shared -D_REENTRANT \
+               $(CC) -shared -D_REENTRANT \
                -Wl,-soname,$(library).so.$(version_major) \
                -o $(library).so.$(version) \
                `echo *.o` \
@@ -79,7 +84,7 @@
        cd $(package)-xpm-dev && \
                $(DEB_MAKE_INVOKE) -f ../Makefile VPATH=".." srcdir=".." \
                INCLUDEDIRS="$(INCLUDEDIRS) -I/usr/include/X11" \
-               $(library).a
+               CC='$(CC) $$(INCLUDEDIRS)' $(library).a
 
 # Build static libc6 library without XPM support.
 build/$(package)-noxpm-dev::
@@ -89,7 +94,7 @@
        cd $(package)-noxpm-dev && \
                $(DEB_MAKE_INVOKE) -f ../Makefile VPATH=".." srcdir=".." \
                INCLUDEDIRS="$(INCLUDEDIRS)" \
-               $(library).a
+               CC='$(CC) $$(INCLUDEDIRS)' $(library).a
 
 clean::
        rm -rf $(package)-xpm $(package)-noxpm $(package)-xpm-dev 
$(package)-noxpm-dev

Reply via email to