Source: fltk1.1
Version: 1.1.10-23
Tags: patch
User: helm...@debian.org
Usertags: rebootstrap
Control: affects 871470 + src:fltk1.1

fltk1.1 fails to cross build from source. There are a number of reasons
for that. Let me discuss them individually.

 * The upstream makefile includes "makeinclude" and for building
   makeinclude, it configures the package. Thus when "dh_auto_clean"
   issues make clean, the package actually configures itself. It does so
   for the build architecture and aborts, because it doesn't find some
   dependencies. Thus dh_auto_clean fails.

   The cure here is to create makeinclude prior to dh_auto_clean and
   then supply the one variable (RMDIR) it needs from that file.

 * Then the packaging supplies CC and CXX to dh_auto_configure.
   Unfortunately, those variables contain the build architecture
   compilers. Again configure aborts failing to find dependencies.
   Removing the erroneous assignments cures this.

 * Next, dh_auto_build builds the "test" directory and that fails
   during cross compilation. That subdirectory should really only be
   built by an indep build or by dh_auto_test (unless DEB_BUILD_OPTIONS
   contains nocheck). So we should remove it from DIRS in an arch-only
   build.

 * Finally, #871470 breaks the build.

The attached patch fixes all of the issues but the last one. Please
consider applying it. When doing so, please close this bug even though
fltk1.1 will still fail to cross build.

Helmut
diff --minimal -Nru fltk1.1-1.1.10/debian/changelog 
fltk1.1-1.1.10/debian/changelog
--- fltk1.1-1.1.10/debian/changelog     2017-01-25 05:25:20.000000000 +0100
+++ fltk1.1-1.1.10/debian/changelog     2017-08-29 20:57:48.000000000 +0200
@@ -1,3 +1,13 @@
+fltk1.1 (1.1.10-23.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Address FTCBFS: (Closes: #-1)
+    + Avoid configuring during clean.
+    + Do not pass build architecture compiler to configure.
+    + Do not build directory test during arch-only build.
+
+ -- Helmut Grohne <hel...@subdivi.de>  Tue, 29 Aug 2017 20:57:48 +0200
+
 fltk1.1 (1.1.10-23) unstable; urgency=medium
 
   * debian/control:
diff --minimal -Nru fltk1.1-1.1.10/debian/rules fltk1.1-1.1.10/debian/rules
--- fltk1.1-1.1.10/debian/rules 2017-01-25 05:25:20.000000000 +0100
+++ fltk1.1-1.1.10/debian/rules 2017-08-29 20:57:48.000000000 +0200
@@ -19,22 +19,23 @@
 
 override_dh_auto_configure:
        mv fltk.spec fltk.spec.saved
-       dh_auto_configure -- CC="$(CC)" CXX="$(CXX)" \
+       dh_auto_configure -- \
             DSOFLAGS="$(filter-out -fPIE -pie,$(LDFLAGS))" \
            --enable-shared --enable-threads --enable-xft \
            --enable-xinerama --without-links --libdir=$(libdir) \
            --with-optim=$(filter -O%,$(CXXFLAGS))
        mv fltk.spec.saved fltk.spec
 
-override_dh_auto_build:
-       dh_auto_build     -- OPTIM="$(CFLAGS) $(XCFLAGS)" STRIP=@:
-# documentation/Makefile ignores errors from htmldoc, so this command
-# should be safe to run unconditionally.
+override_dh_auto_build-arch:
+       dh_auto_build     -- OPTIM="$(CFLAGS) $(XCFLAGS)" STRIP=@: 
DIRS='$$(IMAGEDIRS) src fluid'
+override_dh_auto_build-indep:
+       dh_auto_build     -- OPTIM="$(CFLAGS) $(XCFLAGS)" STRIP=@: DIRS='test 
documentation'
        $(MAKE) -C documentation fltk.pdf fltk.ps
 
 override_dh_auto_clean:
        mv fltk.spec fltk.spec.saved
-       dh_auto_clean
+       touch makeinclude # avoid reconfigure. removed by distclean
+       dh_auto_clean -- RMDIR='rm -Rf'
        mv fltk.spec.saved fltk.spec
 
 override_dh_clean:

Reply via email to