Bug#988226: sdlbasic FTCBFS: builds for the build architecture

Helmut Grohne helmut at subdivi.de
Sat May 8 08:22:30 BST 2021


Source: sdlbasic
Version: 0.0.20070714-7
Tags: patch
User: debian-cross at lists.debian.org
Usertags: ftcbfs

sdlbasic fails to cross build from source, because it builds for the
build architecture. It does not pass any cross tools to make. An easy
way to fix that is using dh_auto_build. Unfortunately, sdlbasic does not
use standard variable names. It does not substitute pkg-config nor strip
and calls the C++ compiler CPP or CC and the C compiler CCOMP. The
attached patch changes it to use standard substitution variables and
makes it use dh_auto_build. In effect, sdlbasic becomes cross buildable.
Please consider applying the patch.

Helmut
-------------- next part --------------
diff --minimal -Nru sdlbasic-0.0.20070714/debian/changelog sdlbasic-0.0.20070714/debian/changelog
--- sdlbasic-0.0.20070714/debian/changelog	2021-01-10 15:21:02.000000000 +0100
+++ sdlbasic-0.0.20070714/debian/changelog	2021-05-08 07:20:33.000000000 +0200
@@ -1,3 +1,13 @@
+sdlbasic (0.0.20070714-7.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: (Closes: #-1)
+    + Let dh_auto_build pass cross tools to make.
+    + Also pass a non-stripping strip to defer stripping to dh_strip.
+    + cross.patch: Make buildtools substitutable via standard names.
+
+ -- Helmut Grohne <helmut at subdivi.de>  Sat, 08 May 2021 07:20:33 +0200
+
 sdlbasic (0.0.20070714-7) unstable; urgency=medium
 
   * Team upload.
diff --minimal -Nru sdlbasic-0.0.20070714/debian/patches/cross.patch sdlbasic-0.0.20070714/debian/patches/cross.patch
--- sdlbasic-0.0.20070714/debian/patches/cross.patch	1970-01-01 01:00:00.000000000 +0100
+++ sdlbasic-0.0.20070714/debian/patches/cross.patch	2021-05-08 07:20:33.000000000 +0200
@@ -0,0 +1,280 @@
+--- sdlbasic-0.0.20070714.orig/src/sdlBasic/src/sdlBasic/gtk/makefile
++++ sdlbasic-0.0.20070714/src/sdlBasic/src/sdlBasic/gtk/makefile
+@@ -5,15 +5,17 @@
+ # GNU make does not like \r\n line endings so should be saved to CVS in binary form.
+ 
+ .SUFFIXES: .cxx .o .h .a .c
+-CC = g++
++CXX = g++
+ AR = ar
++PKG_CONFIG ?= pkg-config
++STRIP ?= strip
+ 
+ 
+ # If explicit setting of GTK1 or GTK2 then use that else look for
+ # pkg-config which is an OK indication that GTK2 is available
+ ifndef GTK1
+ ifndef GTK2
+-ifneq (,$(findstring /,$(shell whereis pkg-config)))
++ifneq (,$(findstring /,$(shell whereis $(PKG_CONFIG))))
+ GTK2=1
+ else
+ GTK1=1
+@@ -24,10 +26,10 @@
+ # For the Gnome desktop stuff to work, prefix must point to where Gnome thinks it is.
+ # "h at h@" is printed here when gnome-config unavailable. Seems harmless.
+ ifdef GTK2
+-CONFIGFLAGS=pkg-config --cflags gtk+-2.0
+-CONFIGLIB=pkg-config --libs gtk+-2.0 gthread-2.0 gmodule-2.0
++CONFIGFLAGS=$(PKG_CONFIG) --cflags gtk+-2.0
++CONFIGLIB=$(PKG_CONFIG) --libs gtk+-2.0 gthread-2.0 gmodule-2.0
+ CONFIGTHREADS=
+-gnomeprefix:=$(shell pkg-config --variable=prefix gtk+-2.0 2>/dev/null)
++gnomeprefix:=$(shell $(PKG_CONFIG) --variable=prefix gtk+-2.0 2>/dev/null)
+ else
+ CONFIGFLAGS=gtk-config --cflags
+ CONFIGLIB=gtk-config --libs
+@@ -49,7 +51,7 @@
+ PROG	= ../../../bin/sdlBasic
+ 
+ all: $(PROG)
+-	strip $(PROG)
++	$(STRIP) $(PROG)
+ 
+ vpath %.h ../src ../scintilla/include
+ vpath %.cxx ../src
+@@ -73,13 +75,13 @@
+ endif
+ 
+ .cxx.o:
+-	$(CC) `$(CONFIGFLAGS)` $(CXXFLAGS) -c $< -o $@
++	$(CXX) `$(CONFIGFLAGS)` $(CXXFLAGS) -c $< -o $@
+ 
+ clean:
+ 	rm -f *.o $(PROG)
+ 
+ deps:
+-	$(CC) -MM `$(CONFIGFLAGS)` $(CXXFLAGS) *.cxx ../src/*.cxx >deps.mak
++	$(CXX) -MM `$(CONFIGFLAGS)` $(CXXFLAGS) *.cxx ../src/*.cxx >deps.mak
+ 
+ # make should be run in ../../scintilla/gtk to compile all the lexers.
+ COMPLIB=../scintilla/gtk/scintilla.a
+@@ -87,7 +89,7 @@
+ $(PROG): SciTEGTK.o SciTEBase.o SciTEBuffers.o SciTEIO.o Exporters.o \
+ MultiplexExtension.o SciTEProps.o Utf8_16.o \
+ 	$(COMPLIB) $(LUA_OBJS)
+-	$(CC) `$(CONFIGTHREADS)` -DGTK $^ -o $@ `$(CONFIGLIB)`
++	$(CXX) `$(CONFIGTHREADS)` -DGTK $^ -o $@ `$(CONFIGLIB)`
+ 
+ # Automatically generate header dependencies with "make deps"
+ include deps.mak
+--- sdlbasic-0.0.20070714.orig/src/sdlBasic/src/sdlBasic/scintilla/gtk/makefile
++++ sdlbasic-0.0.20070714/src/sdlBasic/src/sdlBasic/scintilla/gtk/makefile
+@@ -8,10 +8,11 @@
+ # To force GTK+ 1 build, define GTK1 on the make command line.
+ 
+ .SUFFIXES: .cxx .c .o .h .a
+-CC = g++
+-CCOMP = gcc
++CXX = g++
++CC = gcc
+ AR = ar
+ RANLIB = touch
++PKG_CONFIG ?= pkg-config
+ 
+ ifeq ($(shell uname),Darwin)
+ RANLIB = ranlib
+@@ -40,14 +41,14 @@
+ # If explicit setting of GTK1 or GTK2 then use that else look for
+ # pkg-config which is an OK indication that GTK2 is available
+ ifdef GTK2
+-CONFIGFLAGS=pkg-config --cflags gtk+-2.0
++CONFIGFLAGS=$(PKG_CONFIG) --cflags gtk+-2.0
+ MARSHALLER=scintilla-marshal.o
+ else
+ ifdef GTK1
+ CONFIGFLAGS=gtk-config --cflags
+ else
+-ifneq (,$(findstring /,$(shell whereis pkg-config)))
+-CONFIGFLAGS=pkg-config --cflags gtk+-2.0
++ifneq (,$(findstring /,$(shell whereis $(PKG_CONFIG))))
++CONFIGFLAGS=$(PKG_CONFIG) --cflags gtk+-2.0
+ MARSHALLER=scintilla-marshal.o
+ else
+ CONFIGFLAGS=gtk-config --cflags
+@@ -56,9 +57,9 @@
+ endif
+ 
+ .cxx.o:
+-	$(CC) `$(CONFIGFLAGS)` $(CXXFLAGS) -c $<
++	$(CXX) `$(CONFIGFLAGS)` $(CXXFLAGS) -c $<
+ .c.o:
+-	$(CCOMP) `$(CONFIGFLAGS)` $(CXXFLAGS) -w -c $<
++	$(CC) `$(CONFIGFLAGS)` $(CXXFLAGS) -w -c $<
+ 
+ #++Autogenerated -- run src/LexGen.py to regenerate
+ #**LEXOBJS=\\\n\(\*.o \)
+@@ -72,7 +73,7 @@
+ 	rm -f *.o $(COMPLIB)
+ 
+ deps:
+-	$(CC) -MM `$(CONFIGFLAGS)` $(CXXFLAGS) *.cxx ../src/*.cxx >deps.mak
++	$(CXX) -MM `$(CONFIGFLAGS)` $(CXXFLAGS) *.cxx ../src/*.cxx >deps.mak
+ 
+ $(COMPLIB): DocumentAccessor.o WindowAccessor.o KeyWords.o StyleContext.o Document.o CallTip.o \
+ 	ScintillaBase.o ContractionState.o Editor.o ExternalLexer.o PropSet.o PlatGTK.o \
+--- sdlbasic-0.0.20070714.orig/src/sdlBasic/src/sdlBrt/makefile
++++ sdlbasic-0.0.20070714/src/sdlBasic/src/sdlBrt/makefile
+@@ -64,14 +64,14 @@
+ compress=no
+ 
+ CC= gcc
+-CPP=g++
++CXX=g++
+ INSTALL=copy
+ RM=del
+ STRIP=strip
+ 
+ CFLAG= -Wall -mwindows -g -O2 -I $(mingw)/include
+ LIBS= -lmingw32 -lSDLmain -lSDL -lSDL_image  -lSDL_mixer -lSDL_ttf -lSDL_net -lsmpeg
+-COMPILE=$(CPP) $(CFLAG)
++COMPILE=$(CXX) $(CFLAG)
+ endif
+ 
+ #----------------------------------------------------------------------------------------------------------------------------------------#
+@@ -91,7 +91,7 @@
+ compress=no
+ 
+ CC= gcc
+-CPP=g++
++CXX=g++
+ INSTALL=/usr/bin/install
+ RM=rm
+ STRIP=strip
+@@ -100,12 +100,12 @@
+ CFLAG= -Wall -g -O2 -I/usr/include/SDL -D_REENTRAT -DPLAY_MOD -DUNIX -DLINUX -DDEJAVUSANS_TTF=\"$(DEJAVUSANS_TTF)\"
+ LDFLAGS=
+ 
+-COMPILE=$(CPP) $(CFLAG)
++COMPILE=$(CXX) $(CFLAG)
+ 
+ LIBS=-Wl,-rpath, -lSDL_mixer -lSDL_image -lSDL_ttf -lSDL_net -lsmpeg -lSDL -lpthread -lm
+ #LIBS=-Wl,-rpath, -lSDL -lSDL_mixer -lSDL_image -lSDL_ttf -lSDL_net  -lsmpeg -lpthread -lm -lfreetype -lSDL -lpng -ljpeg -ltiff -lz -ldirectfb -ldirect -lesd -lasound -lopenal -lartsc  -ldl
+ #LIBS= -lSDL_mixer -lSDL_image -lSDL_ttf -lSDL_net -lsmpeg
+-COMPILE=$(CPP) $(CFLAG)
++COMPILE=$(CXX) $(CFLAG)
+ endif
+ 
+ #----------------------------------------------------------------------------------------------------------------------------------------#
+@@ -125,14 +125,14 @@
+ compress=no
+ 
+ CC= /usr/local/open2x/bin/open2x-gcc
+-CPP=/usr/local/open2x/bin/open2x-g++
++CXX=/usr/local/open2x/bin/open2x-g++
+ INSTALL=/usr/bin/install
+ RM=rm
+ STRIP=/usr/local/open2x/bin/open2x-strip
+ 
+ CFLAG= -static -Wall -g -O2 -I/usr/local/open2x/open2x/include -I/usr/local/open2x/open2x/include/SDL -D_REENTRAT -DPLAY_MOD -DUNIX -DGP2X
+ LIBS=-L/usr/local/open2x/open2x/lib -Wl,-rpath, -lSDL_mixer -lSDL_image -lSDL_ttf -lSDL_net -lsmpeg -lSDL -lpng -ltiff -lz -ljpeg -lpthread -lm -lfreetype -ldl
+-COMPILE=$(CPP) $(CFLAG)
++COMPILE=$(CXX) $(CFLAG)
+ endif
+ 
+ #----------------------------------------------------------------------------------------------------------------------------------------#
+@@ -152,7 +152,7 @@
+ compress=no
+ 
+ CC= gcc
+-CPP=g++
++CXX=g++
+ INSTALL=/usr/bin/install
+ RM=rm
+ STRIP=strip
+@@ -179,7 +179,7 @@
+ compress=UPX
+ 
+ CC= gcc
+-CPP=g++
++CXX=g++
+ INSTALL=/usr/bin/install
+ RM=rm
+ STRIP=strip
+@@ -187,7 +187,7 @@
+ CFLAG= -Wall -g -O2 -I/usr/local/include/SDL11 -D_REENTRAT -DPLAY_MOD -DUNIX -DFBSD
+ LIBS=-lSDL_mixer -lSDL_image -lSDL_ttf -lSDL_net -lsmpeg -L/usr/local/lib \
+ -lpthread
+-COMPILE=$(CPP) $(CFLAG)
++COMPILE=$(CXX) $(CFLAG)
+ endif
+ 
+ #----------------------------------------------------------------------------------------------------------------------------------------#
+@@ -207,14 +207,14 @@
+ compress=no
+ 
+ CC= gcc
+-CPP=g++
++CXX=g++
+ INSTALL=/usr/bin/install
+ RM=rm
+ STRIP=strip
+ 
+ CFLAG= -Wall -g -O2 -I/usr/local/include/SDL -D_REENTRAT -DPLAY_MOD -DUNIX -DOPENBSD
+ LIBS=-L/usr/local/lib -L/usr/X11R6/lib -lX11 -lXext -lpthread -lSDL_mixer -lSDL_image -lSDL_ttf -lSDL_net -lsmpeg
+-COMPILE=$(CPP) $(CFLAG)
++COMPILE=$(CXX) $(CFLAG)
+ endif
+ 
+ #----------------------------------------------------------------------------------------------------------------------------------------#
+@@ -234,14 +234,14 @@
+ compress=no
+ 
+ CC= gcc
+-CPP=g++
++CXX=g++
+ INSTALL=/usr/bin/install
+ RM=rm
+ STRIP=strip
+ 
+ CFLAG= -Wall -g -O2 -L/usr/pkg/lib -I/usr/pkg/include/SDL -D_REENTRAT -DPLAY_MOD -DUNIX -DNETBSD
+ LIBS=-lSDL_mixer -lSDL_image -lSDL_ttf -lSDL_net -lsmpeg
+-COMPILE=$(CPP) $(CFLAG)
++COMPILE=$(CXX) $(CFLAG)
+ endif
+ 
+ #----------------------------------------------------------------------------------------------------------------------------------------#
+@@ -261,14 +261,14 @@
+ compress=no
+ 
+ CC= gcc -noixemul
+-CPP=g++
++CXX=g++
+ INSTALL=/usr/bin/install
+ RM=rm
+ STRIP=strip
+ 
+ CFLAG= -Wall -g -O3 -fomit-frame-pointer -mmultiple -mstring -I/usr/include/SDL -D_REENTRAT -DPLAY_MOD -DUNIX -D__MORPHOS__
+ LIBS= -lSDL -lSDL_mixer -lSDL_image -lSDL_ttf -lSDL_net -lsmpeg
+-COMPILE=$(CPP) $(CFLAG)
++COMPILE=$(CXX) $(CFLAG)
+ endif
+ 
+ #----------------------------------------------------------------------------------------------------------------------------------------#
+@@ -289,14 +289,14 @@
+ 
+ # on amiga can be: ppc-amigaos-strip --remove-section=.comment $(TARGET)
+ CC= ppc-amigaos-gcc
+-CPP= ppc-amigaos-g++
++CXX= ppc-amigaos-g++
+ INSTALL=/usr/bin/install
+ RM=rm
+ STRIP=strip
+ 
+ CFLAG= -Wall -ggdb -O3 -fomit-frame-pointer -mmultiple -mstring -D__USE_INLINE__ -D__USE_NETINET_IN_H -I/usr/local/amiga/ppc-amigaos/local/clib2/include/SDL/ -D_REENTRAT -DPLAY_MOD -DUNIX
+ LIBS= -lsmpeg -lSDL_mixer -lSDL_image -lSDL_ttf -lfreetype -lSDL_net -lSDL -lpng -lz -ljpeg -lvorbisfile -lvorbis -logg -lauto -lm -lnet -lunix
+-COMPILE=$(CPP) $(CFLAG) $(LIBS)
++COMPILE=$(CXX) $(CFLAG) $(LIBS)
+ endif
+ 
+ #----------------------------------------------------------------------------------------------------------------------------------------#
diff --minimal -Nru sdlbasic-0.0.20070714/debian/patches/series sdlbasic-0.0.20070714/debian/patches/series
--- sdlbasic-0.0.20070714/debian/patches/series	2021-01-10 15:21:02.000000000 +0100
+++ sdlbasic-0.0.20070714/debian/patches/series	2021-05-08 07:20:33.000000000 +0200
@@ -10,3 +10,4 @@
 link_gmodule_libs.patch
 useless_links.patch
 gcc-10.patch
+cross.patch
diff --minimal -Nru sdlbasic-0.0.20070714/debian/rules sdlbasic-0.0.20070714/debian/rules
--- sdlbasic-0.0.20070714/debian/rules	2021-01-10 15:21:02.000000000 +0100
+++ sdlbasic-0.0.20070714/debian/rules	2021-05-08 07:20:33.000000000 +0200
@@ -41,12 +41,12 @@
 
 override_dh_auto_build:
 	cd "$(ORIGSRC)/sdlBrt/" && sh bison_build.sh
-	$(MAKE) -C "$(ORIGSRC)/sdlBasic/scintilla/gtk" $(XFLAGS) LDFLAGS="$(LDFLAGS)"
-	$(MAKE) -C "$(ORIGSRC)/sdlBasic/gtk" $(XFLAGS) LDFLAGS="$(LDFLAGS)"
-	$(MAKE) -C "$(ORIGSRC)/sdlBrt/unzip" $(XFLAGS) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
-	$(MAKE) -C "$(ORIGSRC)/sdlBrt/SDLengine" $(XFLAGS) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
-	$(MAKE) -C "$(ORIGSRC)/sdlBrt/BASengine" $(XFLAGS) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
-	$(MAKE) -C "$(ORIGSRC)/sdlBrt" $(XFLAGS) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
+	dh_auto_build --sourcedirectory="$(ORIGSRC)/sdlBasic/scintilla/gtk" -- $(XFLAGS) LDFLAGS="$(LDFLAGS)"
+	dh_auto_build --sourcedirectory="$(ORIGSRC)/sdlBasic/gtk" -- $(XFLAGS) LDFLAGS="$(LDFLAGS)" STRIP=true
+	dh_auto_build --sourcedirectory="$(ORIGSRC)/sdlBrt/unzip" -- $(XFLAGS) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
+	dh_auto_build --sourcedirectory="$(ORIGSRC)/sdlBrt/SDLengine" -- $(XFLAGS) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
+	dh_auto_build --sourcedirectory="$(ORIGSRC)/sdlBrt/BASengine" -- $(XFLAGS) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
+	dh_auto_build --sourcedirectory="$(ORIGSRC)/sdlBrt" -- $(XFLAGS) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
 
 override_dh_auto_clean:
 	rm -f "$(ORIGSRC)/sdlBrt/y_tab.c"


More information about the Pkg-games-devel mailing list