Source: pushover Version: 1.1-3 Tags: patch User: [email protected] Usertags: ftcbfs
pushover fails to cross build from source for multiple reasons. The immediate failure is a failure to find SDL2_image.pc using the build architecture pkg-config. What initially looks like wrongly hard coding a build architecture pkg-config turns out to be a correct use: It actually needs SDL2_image for a build-time utility and SDL2_image is not used at all for host objects. Therefore, the relevant build dependency should be annotated :native. Once this is fixed, a build architecture compiler invocation fails to understand host architecture compiler flags. Recently, Debian started employing architecture-dependent compiler flags such as -mbranch-protection=standard (arm64) and this fails all over the place. I propose extending the build system to tell "_NATIVE" flags apart like it does with compilers already. The defaults are chosen such that backwards-compatibility is retained. Once passing these from debian/rules, pushover actually cross builds. Do you mind applying this patch? Helmut
diff --minimal -Nru pushover-1.1/debian/changelog pushover-1.1/debian/changelog --- pushover-1.1/debian/changelog 2023-12-16 14:25:10.000000000 +0100 +++ pushover-1.1/debian/changelog 2024-02-08 12:40:44.000000000 +0100 @@ -1,3 +1,12 @@ +pushover (1.1-3.1) UNRELEASED; urgency=medium + + * Non-maintainer upload. + * Fix FTCBFS: (Closes: #-1) + + libsdl2-image-dev is used for the build architecture. + + cross.patch: Distinguish build and host compiler flags. + + -- Helmut Grohne <[email protected]> Thu, 08 Feb 2024 12:40:44 +0100 + pushover (1.1-3) unstable; urgency=medium * source upload to allow migration of NEW packages diff --minimal -Nru pushover-1.1/debian/control pushover-1.1/debian/control --- pushover-1.1/debian/control 2023-12-16 14:01:18.000000000 +0100 +++ pushover-1.1/debian/control 2024-02-08 12:39:59.000000000 +0100 @@ -15,7 +15,7 @@ libboost-dev, libboost-filesystem-dev, libboost-system-dev, - libsdl2-image-dev, + libsdl2-image-dev:native, libsdl2-mixer-dev, libsdl2-ttf-dev, Standards-Version: 4.6.2 diff --minimal -Nru pushover-1.1/debian/patches/cross.patch pushover-1.1/debian/patches/cross.patch --- pushover-1.1/debian/patches/cross.patch 1970-01-01 01:00:00.000000000 +0100 +++ pushover-1.1/debian/patches/cross.patch 2024-02-08 12:40:44.000000000 +0100 @@ -0,0 +1,23 @@ +--- pushover-1.1.orig/Makefile ++++ pushover-1.1/Makefile +@@ -29,9 +29,11 @@ + CXX = $(CROSS)$(CXX_NATIVE) + CXX_NATIVE = g++ + CXXFLAGS = -Wall -Wextra -g -O2 -std=c++17 ++CXXFLAGS_NATIVE ?= $(CXXFLAGS) + EXEEXT = $(if $(filter %-w64-mingw32.static-,$(CROSS)),.exe,) + INSTALL = install + LDFLAGS = ++LDFLAGS_NATIVE ?= $(LDFLAGS) + MSGFMT = msgfmt + MSGMERGE = msgmerge + PKG_CONFIG = $(CROSS)$(PKG_CONFIG_NATIVE) +@@ -84,7 +86,7 @@ + .SECONDARY: _tmp/dominoes/assembler + _tmp/dominoes/assembler: $(ASSEMBLER_SOURCES) + @mkdir -p $(dir $@) +- $(CXX_NATIVE) $(CXXFLAGS) $(LDFLAGS) $$($(PKG_CONFIG_NATIVE) --cflags $(ASSEMBLER_PKGS)) -o $@ $< $$($(PKG_CONFIG_NATIVE) --libs $(ASSEMBLER_PKGS)) ++ $(CXX_NATIVE) $(CXXFLAGS_NATIVE) $(LDFLAGS_NATIVE) $$($(PKG_CONFIG_NATIVE) --cflags $(ASSEMBLER_PKGS)) -o $@ $< $$($(PKG_CONFIG_NATIVE) --libs $(ASSEMBLER_PKGS)) + + DOMINOES_SOURCES := src/dominoes/domino.ini $(wildcard src/dominoes/*.pov) + .SECONDARY: _tmp/dominoes/povray_done diff --minimal -Nru pushover-1.1/debian/patches/series pushover-1.1/debian/patches/series --- pushover-1.1/debian/patches/series 2023-11-30 23:34:29.000000000 +0100 +++ pushover-1.1/debian/patches/series 2024-02-08 12:40:44.000000000 +0100 @@ -1 +1,2 @@ datadir.patch +cross.patch diff --minimal -Nru pushover-1.1/debian/rules pushover-1.1/debian/rules --- pushover-1.1/debian/rules 2023-12-02 02:28:55.000000000 +0100 +++ pushover-1.1/debian/rules 2024-02-08 12:40:44.000000000 +0100 @@ -9,7 +9,7 @@ dh $@ override_dh_auto_build: - $(MAKE) BINDIR=/usr/games DATADIR=/usr/share/games CXX=$(CXX) CXXFLAGS='$(CPPFLAGS) $(CXXFLAGS) -Wall -Wextra -g -O2 -std=c++17' LDFLAGS='$(LDFLAGS)' PKG_CONFIG=$(PKG_CONFIG) PKG_LUA=lua-5.4 + $(MAKE) BINDIR=/usr/games DATADIR=/usr/share/games CXX=$(CXX) CXXFLAGS='$(CPPFLAGS) $(CXXFLAGS) -Wall -Wextra -g -O2 -std=c++17' LDFLAGS='$(LDFLAGS)' PKG_CONFIG=$(PKG_CONFIG) PKG_LUA=lua-5.4 CXXFLAGS_NATIVE='$(CPPFLAGS_FOR_BUILD) $(CXXFLAGS_FOR_BUILD) -Wall -Wextra -g -O2 -std=c++17' LDFLAGS_NATIVE='$(LDFLAGS_FOR_BUILD)' override_dh_auto_test: echo "checks needs portable_datadir and are disabled"

