Control: tags 951943 + patch

On Sun, 23 Feb 2020 at 08:31:49 +0100, Lucas Nussbaum wrote (in #951087):
> During a rebuild of all packages in sid, your package failed to build
> on amd64.
...
> > /<<PKGBUILDDIR>>/source/code/sago/SagoDataHolder.hpp:26:10: fatal error: 
> > SDL_mixer.h: No such file or directory
> >    26 | #include <SDL_mixer.h>      //Used for sound & music

blockattack has a FindSDL2.cmake "find-module", but not the same one
as in megaglest, openjk, rbdoom3bfg and spring. The implementation in
blockattack happens to be unaffected by <https://bugs.debian.org/951087>.

However, blockattack assumes that the CFLAGS necessary to find SDL.h
are also sufficient to find SDL_mixer.h, similar to the neverball
issue mentioned in <https://bugs.debian.org/909740> and addressed in
<https://salsa.debian.org/sdl-team/libsdl2/commit/6f58f10282cf9b9af567ec520f0d2c4dc368dbea>.
The solution from 6f58f102 doesn't work here, because blockattack's
FindSDL2.cmake doesn't make use of pkg-config.

There are two solutions:

- fix blockattack so it doesn't make that assumption
  <https://salsa.debian.org/games-team/blockattack/merge_requests/1>;
- change SDL2 so it fits that assumption again, for example
  <https://salsa.debian.org/sdl-team/libsdl2/merge_requests/3>

I've confirmed that either of these solutions is sufficient, but for
best robustness I think we should do both.

Patches from blockattack!1 attached (successfully compiled but otherwise
untested).

blockattack should ideally also drop FindSDL2.cmake and rely on the
CMake support in SDL2 >= 2.0.4 (it is now a "config-file package" in CMake
terminology), similar to <https://github.com/JACoders/OpenJK/pull/1033>,
but that is not required to resolve this bug.

    smcv
>From d3900ba42984518d25eb6c29b08448c957aa24c9 Mon Sep 17 00:00:00 2001
From: Simon McVittie <s...@debian.org>
Date: Sun, 23 Feb 2020 14:29:16 +0000
Subject: [PATCH 1/2] Fix FTBFS with recent SDL2 packages

Closes: #951943
---
 debian/changelog                              |  7 ++++
 ...directories-for-all-SDL2_foo-modules.patch | 36 +++++++++++++++++++
 debian/patches/series                         |  1 +
 3 files changed, 44 insertions(+)
 create mode 100644 debian/patches/build-Add-include-directories-for-all-SDL2_foo-modules.patch

diff --git a/debian/changelog b/debian/changelog
index 8da836b..0b4c7d4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+blockattack (2.5.0-1.1) UNRELEASED; urgency=medium
+
+  * d/p/build-Add-include-directories-for-all-SDL2_foo-modules.patch:
+    Fix FTBFS with recent SDL2 packages (Closes: #951943)
+
+ -- Simon McVittie <s...@debian.org>  Sun, 23 Feb 2020 14:28:40 +0000
+
 blockattack (2.5.0-1) unstable; urgency=medium
 
   * Team upload.
diff --git a/debian/patches/build-Add-include-directories-for-all-SDL2_foo-modules.patch b/debian/patches/build-Add-include-directories-for-all-SDL2_foo-modules.patch
new file mode 100644
index 0000000..4087d51
--- /dev/null
+++ b/debian/patches/build-Add-include-directories-for-all-SDL2_foo-modules.patch
@@ -0,0 +1,36 @@
+From: Simon McVittie <s...@debian.org>
+Date: Sun, 23 Feb 2020 14:28:29 +0000
+Subject: build: Add include directories for all SDL2_foo modules
+
+The build system assumed that SDL2 and all the SDL2_foo libraries were
+installed with the same ${includedir}, but this is not guaranteed:
+we could be using a system copy of SDL2 in conjunction with SDL2_foo
+libraries in a non-standard prefix.
+
+This also fixes a build regression with recent Debian SDL2 packages, in
+which the SDL2 headers are installed in an architecture-dependent
+directory but the SDL2_foo headers are not.
+
+Signed-off-by: Simon McVittie <s...@debian.org>
+Forwarded: no
+Bug-Debian: https://bugs.debian.org/951943
+---
+ CMakeLists.txt | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index d4d7644..91bdcbf 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -60,8 +60,11 @@ include_directories(${SDL2_INCLUDE_DIR})
+ #Setup things that use pkg-config
+ find_package(PkgConfig REQUIRED)
+ pkg_search_module(SDL2MIXER REQUIRED SDL2_mixer)
++include_directories(${SDL2MIXER_INCLUDE_DIRS})
+ pkg_search_module(SDL2IMAGE REQUIRED SDL2_image)
++include_directories(${SDL2IMAGE_INCLUDE_DIRS})
+ pkg_search_module(SDL2TTF REQUIRED SDL2_ttf)
++include_directories(${SDL2TTF_INCLUDE_DIRS})
+ 
+ find_package(Boost COMPONENTS program_options REQUIRED)
+ 
diff --git a/debian/patches/series b/debian/patches/series
index 31f7921..ce3a7ec 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 install-path.patch
+build-Add-include-directories-for-all-SDL2_foo-modules.patch
-- 
2.25.1

>From be5feafead3ec8f55ecf5605b4aed25a72e8afa2 Mon Sep 17 00:00:00 2001
From: Simon McVittie <s...@debian.org>
Date: Sun, 23 Feb 2020 14:32:26 +0000
Subject: [PATCH 2/2] d/.gitignore: Do not ignore *.patch in this directory

Override upstream's .gitignore, because we want to track quilt patches
in git.
---
 debian/.gitignore | 1 +
 debian/changelog  | 3 +++
 2 files changed, 4 insertions(+)
 create mode 100644 debian/.gitignore

diff --git a/debian/.gitignore b/debian/.gitignore
new file mode 100644
index 0000000..69f1bf4
--- /dev/null
+++ b/debian/.gitignore
@@ -0,0 +1 @@
+!*.patch
diff --git a/debian/changelog b/debian/changelog
index 0b4c7d4..8217a1e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,9 @@ blockattack (2.5.0-1.1) UNRELEASED; urgency=medium
 
   * d/p/build-Add-include-directories-for-all-SDL2_foo-modules.patch:
     Fix FTBFS with recent SDL2 packages (Closes: #951943)
+  * d/.gitignore: Do not ignore *.patch in this directory, overriding
+    upstream's .gitignore.
+    We want to track quilt patches in git.
 
  -- Simon McVittie <s...@debian.org>  Sun, 23 Feb 2020 14:28:40 +0000
 
-- 
2.25.1

Reply via email to