Be Multi-Arch: same via a forwarding header
-
Revert "Add the non-multiarch include dir to pkg-config cflags for compatibility."
This reverts commit 6f58f102.
-
Revert "Install all headers in an architecture-specific location"
This reverts commit d6aba8c7.
-
Make SDL_config.h redirect to an architecture-specific version
This avoids conflicts between different-architecture versions of libsdl2-dev, without requiring a patch to sdl2-config to make it use a different ${includedir} per architecture. It relies on the fact that the architecture-specific location /usr/include/${multiarch} is already on Debian compilers' default search paths, at the cost of adding a Debian-specific forwarding header.
This is similar to the technique used for multilib in Fedora.
Closes: #909740
Closes: #951087
Closes: #951943
Closes: #951959
Closes: #951974
Closes: #951976
Closes: #952049 -
d/tests: Assert that packages that embed FindSDL2.cmake can find us
Since SDL 2.0.6, the recommended way to link to a system copy of SDL2 from a CMake project is to behave like debian/tests/cmake-example - use find_package(SDL2) without a FindSDL2 macro. However, not all upstream projects that build using CMake have caught up with this yet.
This specific implementation was taken from openjk, but it's regularly copied around, and can be found in hedgewars, spring and many other packages: https://codesearch.debian.net/search?q=Other+versions+link+to+-lSDL2main&literal=1
Inclusion of a vaguely similar file in CMake was rejected in https://github.com/Kitware/CMake/pull/149.
Reproduces: #951087
-
Create a SDL_platform.h symlink in /usr/include/MULTIARCH/SDL2
If a package incorrectly includes <SDL2/SDL.h> instead of <SDL.h>, then the SDL2 directory won't necessarily be on the -I path, resulting in the #include "SDL_platform.h" in _real_SDL_config.h failing - unless there is a SDL_platform.h in the same directory as _real_SDL_config.h, in which case it works.
-
Add autopkgtests for more deprecated use patterns
Rename d/t/related-library to d/t/deprecated-use, and add the patterns seen causing FTBFS in planetblupi, jag, mrboom and trigger-rally.
This is one of several possible solutions to #909740. It includes !2 (merged).
Alternatives include !4 (closed) and !5 (merged).
-
libsdl2-dev:amd64 and libsdl2-dev:i386 are co-installable -
the debian/tests/build autopkgtest passes -
the debian/tests/cmake autopkgtest passes (even after enhancing it to reproduce #951087) -
x86_64-linux-gnu-pkg-config --cflags --libs sdl2 has reasonable results (-D_REENTRANT -I/usr/include/SDL2 -lSDL2) -
i686-linux-gnu-pkg-config --cflags --libs sdl2 has reasonable results (-D_REENTRANT -I/usr/include/SDL2 -lSDL2) -
sdl2-config --cflags --libs has reasonable results (-I/usr/include/SDL2 -D_REENTRANT -lSDL2) -
"CC=i686-linux-gnu-gcc PKG_CONFIG=i686-linux-gnu-pkg-config
sdl2-config --cflags --libs" has reasonable results (same as plain sdl2-config) -
"CC='gcc -m32' PKG_CONFIG=i686-linux-gnu-pkg-config
sdl2-config --cflags --libs" has reasonable results (same as plain sdl2-config) -
Confirm successful build of jag (avoiding #952066) -
Confirm successful build of mrboom (avoiding #952046) -
Confirm successful build of pekka-kana-2 (avoiding #952049) -
Confirm successful build of planetblupi (avoiding #952105) -
Confirm successful build of blockattack (avoiding #951943) -
Confirm successful build of megaglest (avoiding #951959) -
Confirm successful build of rbdoom3bfg from testing (avoiding #951976) -
Confirm closer-to-successful build of spring from testing (avoiding #951974) - my build VM ran out of memory, but SDL2 seemed to be found and used successfully -
Confirm successful build of trigger-rally (avoiding #952098) -
Confirm closer-to-successful build of fife (avoiding #951962) - reported an unrelated FTBFS -
Confirm successful build of corsix-th (avoiding #953002)
Advantages over !5 (merged):
- We don't have to patch sdl2-config any more than no-libdir.patch already does.
- We don't have to assume any particular environment variables are set, so it would work for build systems that are told their compiler some other way and don't normally use $CC, like "meson --native-file=...".
- Works for any compiler whose default search path works with Debian's libc6-dev.
- sdl2-config outputs the same things for all architectures.
-
FindSDL2.cmake
(both variants found in Debian) still works. - The incorrect
#include <SDL2/foo>
pattern still works.
Disadvantages compared with !5 (merged):
- The forwarding header is a bit weird.