Source: pekka-kana-2
Version: 1.2.2-2
Tags: patch upstream
User: [email protected]
Usertags: ftcbfs

pekka-kana-2 fails to cross build from source. The upstream Makefile
hard codes the build architecture pkg-config and it uses the
non-standard variable CPP for storing the C++ compiler while CXX would
be more common and supplied by debhelper. The attached patch makes
pkg-config substitutable and renames CPP to CXX. Please consider
applying it.

Helmut
--- pekka-kana-2-1.2.2.orig/Makefile
+++ pekka-kana-2-1.2.2/Makefile
@@ -7,9 +7,10 @@
 # "make" - Creates Pekka Kana 2 binary
 # "make clean" - Removes all objects, executables and dependencies
 
-CPP = g++
-CFLAGS += $(shell pkg-config --cflags sdl2) -g -O2 -std=gnu++17 -Wno-write-strings
-LFLAGS += $(shell pkg-config --libs sdl2) -lSDL2_mixer
+CXX = g++
+PKG_CONFIG ?= pkg-config
+CFLAGS += $(shell $(PKG_CONFIG) --cflags sdl2) -g -O2 -std=gnu++17 -Wno-write-strings
+LFLAGS += $(shell $(PKG_CONFIG) --libs sdl2) -lSDL2_mixer
 
 # Defines directories
 SRC_DIR = src/
@@ -44,15 +45,15 @@
 # Rules for generate the binaries using the object files
 $(PK2_BIN): $(PK2_OBJ) $(PK2_SPRITE_OBJ) $(PK2_MAP_OBJ) $(ENGINE_OBJ)
 	@echo -Linking Pekka Kana 2
-	@$(CPP) $^ $(LFLAGS) -o $@
+	@$(CXX) $^ $(LFLAGS) -o $@
 
 # Rules for generate any *.o file
 -include $(DEPENDENCIES)
 
 build/%.o : src/%.cpp
 	@echo -Some dependence of $@ was changed, updating
-	@$(CPP) $(CFLAGS) -I$(SRC_DIR) -o $@ -c $<
-	@$(CPP) -MM -MT $@ -I$(SRC_DIR) $< > build/$*.d
+	@$(CXX) $(CFLAGS) -I$(SRC_DIR) -o $@ -c $<
+	@$(CXX) -MM -MT $@ -I$(SRC_DIR) $< > build/$*.d
 
 makedirs:
 	@mkdir -p $(BIN_DIR) >/dev/null

Reply via email to