Source: fltk1.3
Version: 1.3.4-7
Tags: patch
User: helm...@debian.org
Usertags: rebootstrap

Thank you for applying my previous FTCBFS patch. We knew it was
incomplete and now things improved a little as fltk1.3 moved away from
freetype-config. Unfortunately, things don't just work yet.

Running plain pkg-config is the build architecture pkg-config, so it
won't find any freetype2.pc. You must be using a triplet-prefixed
pkg-config. That's what the attached freetype.patch solves.

It also fails finding cairo, because configure.ac searches for cairo
with the build architecture pkg-config. I really recommend using
PKG_CHECK_MODULES here, but the attached cairo.patch goes the simplest
possible NMU-style diff. I wasn't able to test this part, because
configure is not built from source during package build. I really
recommend enabling autoreconf, because not doing so raises the bar for
contributions significantly. Thus you get an untested patch from me.

Given that I couldn't test the cairo part, I cannot tell what else is
problematic. What I can see already is that the cmake invocation is for
the build architecture again. I'm not sure whether that's a problem. I
recommend replacing it with "dh_auto_configure --buildsystem=cmake
--builddirectory=CMakeTmp" to minimize divergence from standard
debhelper.

Please close this bug when fixing the cairo and freetype2 detection such
that my tooling triggers a rebuild even if fltk1.3 does not cross build.

Helmut
--- fltk1.3-1.3.4/debian/rules
+++ fltk1.3-1.3.4/debian/rules
@@ -10,8 +10,9 @@
 
 XCFLAGS = -Wall -Wunused -Wno-format-y2k -fPIE -fno-strict-aliasing
 
-DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
-DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
+include /usr/share/dpkg/architecture.mk
+-include /usr/share/dpkg/buildtools.mk
+PKG_CONFIG ?= pkg-config
 libdir = /usr/lib/$(DEB_HOST_MULTIARCH)
 GAMES = blocks checkers sudoku
 EXTRA_MFLAGS = OPTIM="$(CFLAGS) $(XCFLAGS)" STRIP=@:
@@ -51,7 +52,7 @@
 	    CMakeTmp/CMakeFiles/Export/share/fltk/FLTK-Targets-noconfig.cmake \
 	    > CMakeTmp/etc/FLTK-Targets-noconfig.cmake
 endif
-	dh_auto_configure -- FTCONFIG="/usr/bin/pkg-config freetype2" \
+	dh_auto_configure -- FTCONFIG="`which $(PKG_CONFIG)` freetype2" \
             DSOFLAGS="$(filter-out -fPIE -pie,$(LDFLAGS))" \
 	    --enable-shared --enable-cairo --enable-cp936 --with-links \
 	    --with-optim=$(filter -O%,$(CXXFLAGS)) --libdir=$(libdir)
--- fltk1.3-1.3.4.orig/configure.ac
+++ fltk1.3-1.3.4/configure.ac
@@ -40,6 +40,7 @@ OPTIM="${OPTIM:=}"
 dnl Find compiler commands...
 AC_PROG_CC
 AC_PROG_CXX
+PKG_PROG_PKG_CONFIG
 
 dnl So --with-archflags option is used during "checking size of long"
 case $host_os in
@@ -132,7 +133,7 @@ if test x$enable_cairoext = xyes; then
 	  dnl FIXME This part should be fixed so configure do not depend on
 	  dnl we do not rely on pkg-config .
 	  CAIRODIR="cairo"
-	  CAIROFLAGS="`pkg-config --cflags cairo`"
+	  CAIROFLAGS="`$PKG_CONFIG --cflags cairo`"
 	  CAIROLIBS="-lcairo -lpixman-1"
 	  CXXFLAGS="$CAIROFLAGS $CXXFLAGS"
 	  LINKFLTKCAIRO="../lib/libfltk_cairo.a"
@@ -146,7 +147,7 @@ else
 	  dnl FIXME This part should be fixed so configure do not depend on
 	  dnl we do not rely on pkg-config .
 	  CAIRODIR="cairo"
-	  CAIROFLAGS="`pkg-config --cflags cairo`"
+	  CAIROFLAGS="`$PKG_CONFIG --cflags cairo`"
 	  CAIROLIBS="-lcairo -lpixman-1"
 	  CXXFLAGS="$CAIROFLAGS $CXXFLAGS"
 	  LINKFLTKCAIRO="../lib/libfltk_cairo.a"

Reply via email to