Source: xppaut
Version: 6.11b+1.dfsg-1.1
Tags: patch
User: debian-cr...@lists.debian.org
Usertags: ftcbfs

xppaut fails to cross build from source. The immediate failure happens
when it tries to run the build architecture strip. Beyond breaking cross
compilation, this also breaks DEB_BUILD_OPTIONS=nostrip as well as
generation of -dbgsym packages. A good solution is making strip
substitutable and substituting an noop strip as dh_strip will take care
of handling it properly. While at it, I noticed that the Makefile also
stuffs compiler flags into the CC variable, which get overridden by
dh_auto_build. So I also moved them to CFLAGS. Please consider applying
the attached patch to fix all of the mentioned issues.

Helmut
diff --minimal -Nru xppaut-6.11b+1.dfsg/debian/changelog 
xppaut-6.11b+1.dfsg/debian/changelog
--- xppaut-6.11b+1.dfsg/debian/changelog        2020-12-16 19:12:16.000000000 
+0100
+++ xppaut-6.11b+1.dfsg/debian/changelog        2020-12-19 14:24:52.000000000 
+0100
@@ -1,3 +1,12 @@
+xppaut (6.11b+1.dfsg-1.2) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: (Closes: #-1)
+    + cross.patch: Make build tools substitutable. (Closes: #-1)
+    + Pass a noop strip to defer stripping to dh_strip.
+
+ -- Helmut Grohne <hel...@subdivi.de>  Sat, 19 Dec 2020 14:24:52 +0100
+
 xppaut (6.11b+1.dfsg-1.1) unstable; urgency=medium
 
   * Non-maintainer upload.
diff --minimal -Nru xppaut-6.11b+1.dfsg/debian/patches/cross.patch 
xppaut-6.11b+1.dfsg/debian/patches/cross.patch
--- xppaut-6.11b+1.dfsg/debian/patches/cross.patch      1970-01-01 
01:00:00.000000000 +0100
+++ xppaut-6.11b+1.dfsg/debian/patches/cross.patch      2020-12-19 
14:24:47.000000000 +0100
@@ -0,0 +1,51 @@
+--- xppaut-6.11b+1.dfsg.orig/Makefile
++++ xppaut-6.11b+1.dfsg/Makefile
+@@ -18,9 +18,8 @@
+ # Standard C compiler
+ #CC= cc
+ # Use Gnu compiler
+-#CC= gcc
+-# Use c99 to compile according to newer ISO C standards (IEEE Std 1003.1-2001)
+-CC= gcc -O -std=c99 -pedantic -D_XOPEN_SOURCE=600 -Wall  
++CC= gcc
++STRIP=strip
+ #AUTLIBS=  -lsundials_cvode -lX11 -lm 
+ #These are the 32bit compat libraries.
+ AUTLIBS=  -lm 
+@@ -36,7 +35,8 @@
+ #CFLAGS=   -g -O -m32 -DNON_UNIX_STDIO -DAUTO -DCVODE_YES  -DHAVEDLL 
-DMYSTR1=$(MAJORVER) -DMYSTR2=$(MINORVER)  -I/usr/X11R6/include
+ #CFLAGS=   -g -O -m64 -DNOERRNO -DNON_UNIX_STDIO -DAUTO -DCVODE_YES  
-DHAVEDLL -DMYSTR1=$(MAJORVER) -DMYSTR2=$(MINORVER)  -I/usr/include/X11
+ 
+-CFLAGS = -g -pedantic -fcommon -O -DNOERRNO -DNON_UNIX_STDIO -DAUTO 
-DCVODE_YES  -DHAVEDLL -DMYSTR1=$(MAJORVER) -DMYSTR2=$(MINORVER)  
-I/usr/include/X11
++# Use c99 to compile according to newer ISO C standards (IEEE Std 1003.1-2001)
++CFLAGS = -O -std=c99 -pedantic -D_XOPEN_SOURCE=600 -Wall -g -fcommon 
-DNOERRNO -DNON_UNIX_STDIO -DAUTO -DCVODE_YES  -DHAVEDLL -DMYSTR1=$(MAJORVER) 
-DMYSTR2=$(MINORVER)  -I/usr/include/X11
+ #LDFLAGS=  -m64 -L/usr/lib -L/usr/lib64
+ LDFLAGS=  -L/usr/lib 
+ LIBS=  -lX11 -lm -ldl   
+@@ -237,7 +237,7 @@
+ ####  You have previously installed the sundials
+        #$(CC) -DAUTO -o xppaut $(OBJECTS) $(AUTOOBJ) $(LDFLAGS) $(LIBS) 
$(AUTLIBS) ./libf2cm.a
+        
+-       $(CC) -DAUTO -o xppaut $(OBJECTS) $(AUTOOBJ) $(LDFLAGS) $(LIBS) 
$(AUTLIBS)
++       $(CC) $(CFLAGS) -DAUTO -o xppaut $(OBJECTS) $(AUTOOBJ) $(LDFLAGS) 
$(LIBS) $(AUTLIBS)
+ 
+ #   
+ # 
+@@ -262,7 +262,7 @@
+       #mkdir -p /usr/X11R6/man/man1
+       mkdir -p $(DESTDIR)$(MANDIR)
+ # Put everything home
+-      strip xppaut
++      $(STRIP) xppaut
+       install -m 755 xppaut $(DESTDIR)$(BINDIR)
+       cp -r ode* $(DESTDIR)$(DOCDIR)/examples
+       cp -r help/* $(DESTDIR)$(DOCDIR)/html
+@@ -308,7 +308,7 @@
+ #  pack up a binary
+ ##############################################
+ binary:
+-      strip xppaut;tar zvcf binary.tgz xppaut *.pdf *.xbm xppaut.1 $(ODES) 
$(DOC) $(HELP) README HISTORY LICENSE
++      $(STRIP) xppaut;tar zvcf binary.tgz xppaut *.pdf *.xbm xppaut.1 $(ODES) 
$(DOC) $(HELP) README HISTORY LICENSE
+ ##############################################
+ #  clean
+ ##############################################
diff --minimal -Nru xppaut-6.11b+1.dfsg/debian/patches/series 
xppaut-6.11b+1.dfsg/debian/patches/series
--- xppaut-6.11b+1.dfsg/debian/patches/series   2020-12-16 19:10:37.000000000 
+0100
+++ xppaut-6.11b+1.dfsg/debian/patches/series   2020-12-19 14:23:24.000000000 
+0100
@@ -1,3 +1,4 @@
 010_makefile.diff
 040_menudrive_c.diff
 fix_gcc-10.patch
+cross.patch
diff --minimal -Nru xppaut-6.11b+1.dfsg/debian/rules 
xppaut-6.11b+1.dfsg/debian/rules
--- xppaut-6.11b+1.dfsg/debian/rules    2020-12-16 19:05:12.000000000 +0100
+++ xppaut-6.11b+1.dfsg/debian/rules    2020-12-19 14:24:52.000000000 +0100
@@ -3,3 +3,6 @@
 
 %:
        dh $@
+
+override_dh_auto_install:
+       dh_auto_install -- STRIP=true

Reply via email to