Bug#952105: planetblupi: FTBFS: blupi.h:23:10: fatal error: SDL.h: No such file or directory

2020-02-23 Thread Simon McVittie
Control: tags -1 + patch

On Sun, 23 Feb 2020 at 18:39:25 +, Simon McVittie wrote:
> - Fix planetblupi to stop making this assumption
>   (,
>   or equivalently the attached patch)

Sorry, here's the patch.
>From d00242ce65cb608190a0eb61fe83a6f8d404c21a Mon Sep 17 00:00:00 2001
From: Simon McVittie 
Date: Sun, 23 Feb 2020 18:24:14 +
Subject: [PATCH] Don't assume that SDL2 headers are in /usr/include/SDL2

Closes: #952105
---
 debian/changelog  |  8 
 ...tions-about-location-of-SDL2-headers.patch | 41 +++
 debian/patches/series |  1 +
 3 files changed, 50 insertions(+)
 create mode 100644 debian/patches/Avoid-making-assumptions-about-location-of-SDL2-headers.patch
 create mode 100644 debian/patches/series

diff --git a/debian/changelog b/debian/changelog
index 8d5b7c3..75f011d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+planetblupi (1.14.2-2) UNRELEASED; urgency=medium
+
+  * d/p/Avoid-making-assumptions-about-location-of-SDL2-headers.patch:
+Don't assume that SDL2 headers are in /usr/include/SDL2
+(Closes: #952105)
+
+ -- Simon McVittie   Sun, 23 Feb 2020 18:23:28 +
+
 planetblupi (1.14.2-1) unstable; urgency=medium
 
   * New 1.14.2 upstream release
diff --git a/debian/patches/Avoid-making-assumptions-about-location-of-SDL2-headers.patch b/debian/patches/Avoid-making-assumptions-about-location-of-SDL2-headers.patch
new file mode 100644
index 000..4737c6d
--- /dev/null
+++ b/debian/patches/Avoid-making-assumptions-about-location-of-SDL2-headers.patch
@@ -0,0 +1,41 @@
+From: Simon McVittie 
+Date: Sun, 23 Feb 2020 18:12:58 +
+Subject: Avoid making assumptions about location of SDL2 headers
+
+It is not an API guarantee that the SDL2 headers will be found in
+${prefix}/include/SDL2, or that SDL2 is installed in the same prefix
+as planetblupi itself. Ask pkg-config instead.
+
+Signed-off-by: Simon McVittie 
+Bug-Debian: https://bugs.debian.org/952105
+Forwarded: no
+---
+ CMakeLists.txt | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 5723efd..f067233 100644
+--- a/CMakeLists.txt
 b/CMakeLists.txt
+@@ -9,7 +9,6 @@ include (${CMAKE_ROOT}/Modules/ExternalProject.cmake)
+ include ("${CMAKE_SOURCE_DIR}/cmake/Ronn2Man.cmake")
+ 
+ include_directories (${CMAKE_INSTALL_PREFIX}/include)
+-include_directories (${CMAKE_INSTALL_PREFIX}/include/SDL2)
+ link_directories (${CMAKE_INSTALL_PREFIX}/lib)
+ 
+ project (planetblupi)
+@@ -153,10 +152,13 @@ include_directories (${SDLKitchensink_INCLUDE_DIRS})
+ find_package (PkgConfig REQUIRED)
+ if (NOT BUILD_JS)
+   pkg_search_module (SDL2 REQUIRED sdl2)
++  include_directories (${SDL2_INCLUDE_DIRS})
+   set (planetblupi_DEPS ${planetblupi_DEPS} ${SDL2_STATIC_LIBRARIES})
+   pkg_search_module (SDL2_IMAGE REQUIRED SDL2_image)
++  include_directories (${SDL2_IMAGE_INCLUDE_DIRS})
+   set (planetblupi_DEPS ${planetblupi_DEPS} ${SDL2_IMAGE_STATIC_LIBRARIES})
+   pkg_search_module (SDL2_MIXER REQUIRED SDL2_mixer)
++  include_directories (${SDL2_MIXER_INCLUDE_DIRS})
+   set (planetblupi_DEPS ${planetblupi_DEPS} ${SDL2_MIXER_STATIC_LIBRARIES})
+ endif ()
+ 
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 000..322e513
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+Avoid-making-assumptions-about-location-of-SDL2-headers.patch
-- 
2.25.1



Bug#951087: Bug#952105: planetblupi: FTBFS: blupi.h:23:10: fatal error: SDL.h: No such file or directory

2020-02-23 Thread Simon McVittie
On Sun, 23 Feb 2020 at 08:56:48 +0100, Lucas Nussbaum wrote:
> During a rebuild of all packages in sid, your package failed to build
> on amd64.
> > In file included from /<>/src/action.h:23,
> >  from /<>/src/action.cxx:24:
> > /<>/src/blupi.h:23:10: fatal error: SDL.h: No such file or 
> > directory
> >23 | #include 

Many games make wrong-but-usually-true assumptions about where the SDL2
headers and libraries can be found, but this one is particularly creative:
it assumes that SDL2 is installed in the same ${prefix} as planetblupi,
*and* that the SDL2 headers can be found in ${prefix}/include/SDL2.

Obviously, this is not how things are meant to work: it should be possible
to install SDL with --prefix=/opt/stuff and the games with
--prefix=$HOME/Games (or CMake equivalent) if that's what you want to do.

Despite not being considered correct, planetblupi's assumptions used to
work before we modified SDL2 to be multiarch co-installable
(). There are two ways to address this
bug:

- Fix planetblupi to stop making this assumption
  (,
  or equivalently the attached patch);
- Change SDL2 so the assumption is true again
  (for example 
  which also resolves )

I've verified that either of these is sufficient to fix the FTBFS (compiled
successfully but not otherwise tested). For best robustness, I think we
would ideally do both.

smcv



Bug#952105: planetblupi: FTBFS: blupi.h:23:10: fatal error: SDL.h: No such file or directory

2020-02-23 Thread Lucas Nussbaum
Source: planetblupi
Version: 1.14.2-1
Severity: serious
Justification: FTBFS on amd64
Tags: buster sid
Usertags: ftbfs-20200222 ftbfs-buster

Hi,

During a rebuild of all packages in sid, your package failed to build
on amd64.

Relevant part (hopefully):
> /usr/bin/c++   -I/usr/include/SDL2 
> -I/<>/obj-x86_64-linux-gnu/include  -g -O2 
> -fdebug-prefix-map=/<>=. -fstack-protector-strong -Wformat 
> -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -std=c++11 
> -L/usr/lib   -std=gnu++11 -o CMakeFiles/planetblupi.dir/src/decblupi.cxx.o -c 
> /<>/src/decblupi.cxx
> In file included from /<>/src/action.h:23,
>  from /<>/src/action.cxx:24:
> /<>/src/blupi.h:23:10: fatal error: SDL.h: No such file or 
> directory
>23 | #include 
>   |  ^~~
> compilation terminated.
> make[4]: *** [CMakeFiles/planetblupi.dir/build.make:66: 
> CMakeFiles/planetblupi.dir/src/action.cxx.o] Error 1

The full build log is available from:
   http://qa-logs.debian.net/2020/02/22/planetblupi_1.14.2-1_unstable.log

A list of current common problems and possible solutions is available at
http://wiki.debian.org/qa.debian.org/FTBFS . You're welcome to contribute!

About the archive rebuild: The rebuild was done on EC2 VM instances from
Amazon Web Services, using a clean, minimal and up-to-date chroot. Every
failed build was retried once to eliminate random failures.