ports: Replace SDL2 with sdl2-compat

There is no need to keep two SDL versions around
This commit is contained in:
2026-07-05 00:05:51 +03:00
parent 380b172968
commit c7eb2dbdf3
22 changed files with 155 additions and 1759 deletions

View File

@@ -1,18 +1,17 @@
#!/bin/bash ../install.sh
NAME='sdl12-compat'
VERSION='1.2.68'
DOWNLOAD_URL="https://github.com/libsdl-org/sdl12-compat/archive/refs/tags/release-$VERSION.tar.gz#63c6e4dcc1154299e6f363c872900be7f3dcb3e42b9f8f57e05442ec3d89d02d"
VERSION='1.2.76'
DOWNLOAD_URL="https://github.com/libsdl-org/sdl12-compat/archive/refs/tags/release-$VERSION.tar.gz#e889ac9c7e8a6bdfc31972bf1f1254b84882cb52931608bada62e8febbf0270b"
TAR_CONTENT="sdl12-compat-release-$VERSION"
DEPENDENCIES=('SDL2' 'glu')
DEPENDENCIES=('sdl2-compat')
configure() {
sed -i 's/CMAKE_INSTALL_FULL_DATAROOTDIR/CMAKE_INSTALL_FULL_DATADIR/' CMakeLists.txt
cmake --fresh -B build -S . -G Ninja \
cmake --fresh -S . -B build -G Ninja \
--toolchain="$BANAN_TOOLCHAIN_DIR/Toolchain.txt" \
-DCMAKE_INSTALL_PREFIX="$BANAN_SYSROOT/usr" \
-DSDL2_INCLUDE_DIR="$BANAN_SYSROOT/usr/include/SDL2"
-DCMAKE_INSTALL_PREFIX='/usr' \
-DCMAKE_BUILD_TYPE=Release \
|| exit 1
}
build() {
@@ -21,4 +20,5 @@ build() {
install() {
DESTDIR="$DESTDIR" cmake --install build || exit 1
ln -s sdl12_compat.pc "$DESTDIR"/usr/lib/pkgconfig/sdl.pc || exit 1
}

View File

@@ -1,12 +0,0 @@
diff -ruN sdl12-compat-1.2.68/include/SDL/SDL_config.h sdl12-compat-1.2.68-banan_os/include/SDL/SDL_config.h
--- sdl12-compat-1.2.68/include/SDL/SDL_config.h 2023-09-26 20:43:48.000000000 +0300
+++ sdl12-compat-1.2.68-banan_os/include/SDL/SDL_config.h 2025-11-16 03:22:39.015867984 +0200
@@ -73,7 +73,7 @@
#define HAVE_MATH_H 1
#endif
-#if defined(__linux__) || defined(__sun)
+#if defined(__linux__) || defined(__sun) || defined(__banan_os__)
#define HAVE_ALLOCA_H 1
#endif

View File

@@ -0,0 +1,21 @@
diff -ruN sdl12-compat-1.2.76/sdl-config.in sdl12-compat-1.2.76-banan_os/sdl-config.in
--- sdl12-compat-1.2.76/sdl-config.in 2026-04-04 03:40:25.000000000 +0300
+++ sdl12-compat-1.2.76-banan_os/sdl-config.in 2026-07-04 09:10:44.224259068 +0300
@@ -7,11 +7,14 @@
# Copied and modified from SDL2's sdl2-compat.
-prefix=@CMAKE_INSTALL_PREFIX@
+# Get the canonical path of the folder containing this script
+bindir=`cd -P -- "\`dirname -- "$0"\`" && printf '%s\n' "\`pwd -P\`"`
+
+prefix=`cd -P -- "$bindir/.." && printf '%s\n' "\`pwd -P\`"`
exec_prefix=${prefix}
exec_prefix_set=no
-libdir=@CMAKE_INSTALL_FULL_LIBDIR@
-includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
+libdir=$prefix/lib
+includedir=$prefix/include
@ENABLE_STATIC_FALSE@usage="\
@ENABLE_STATIC_FALSE@Usage: $0 [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs]"

View File

@@ -0,0 +1,21 @@
diff -ruN sdl12-compat-1.2.76/src/SDL12_compat.c sdl12-compat-1.2.76-banan_os/src/SDL12_compat.c
--- sdl12-compat-1.2.76/src/SDL12_compat.c 2026-04-04 03:40:25.000000000 +0300
+++ sdl12-compat-1.2.76-banan_os/src/SDL12_compat.c 2026-07-04 09:13:14.105336073 +0300
@@ -57,7 +57,7 @@
#undef snprintf
#undef vsnprintf
-#ifdef __linux__
+#if defined(__linux__) || defined(__banan_os__)
#include <unistd.h> /* for readlink() */
#endif
@@ -1486,7 +1486,7 @@
#endif
};
-#ifdef __linux__
+#if defined(__linux__) || defined(__banan_os__)
static void OS_GetExeName(char *buf, const unsigned maxpath) {
int ret;
buf[0] = '\0';

View File

@@ -0,0 +1,12 @@
diff -ruN sdl12-compat-1.2.76/include/SDL/SDL_config.h sdl12-compat-1.2.76-banan_os/include/SDL/SDL_config.h
--- sdl12-compat-1.2.76/include/SDL/SDL_config.h 2026-04-04 03:40:25.000000000 +0300
+++ sdl12-compat-1.2.76-banan_os/include/SDL/SDL_config.h 2026-07-04 09:21:56.688337719 +0300
@@ -73,7 +73,7 @@
#define HAVE_MATH_H 1
#endif
-#if defined(__linux__) || defined(__sun)
+#if defined(__linux__) || defined(__sun) || defined(__banan_os__)
#define HAVE_ALLOCA_H 1
#endif