ports: Add sdl12-compat port

This commit is contained in:
Bananymous 2025-06-28 20:54:03 +03:00
parent 69229102c4
commit cd101b6844
2 changed files with 40 additions and 0 deletions

25
ports/sdl12-compat/build.sh Executable file
View File

@ -0,0 +1,25 @@
#!/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"
TAR_CONTENT="sdl12-compat-release-$VERSION"
DEPENDENCIES=('SDL2' 'glu')
configure() {
sed -i 's/CMAKE_INSTALL_FULL_DATAROOTDIR/CMAKE_INSTALL_FULL_DATADIR/' CMakeLists.txt
$BANAN_CMAKE \
--toolchain="$CMAKE_TOOLCHAIN_FILE" \
--fresh -GNinja -S . -B build \
-DCMAKE_INSTALL_PREFIX="$BANAN_SYSROOT/usr" \
-DSDL2_INCLUDE_DIR="$BANAN_SYSROOT/usr/include/SDL2"
}
build() {
$BANAN_CMAKE --build build || exit 1
}
install() {
$BANAN_CMAKE --install build || exit 1
}

View File

@ -0,0 +1,15 @@
diff -ruN sdl12-compat-release-1.2.68/src/SDL12_compat.c sdl12-compat-release-1.2.68-banan_os/src/SDL12_compat.c
--- sdl12-compat-release-1.2.68/src/SDL12_compat.c 2023-09-26 20:43:48.000000000 +0300
+++ sdl12-compat-release-1.2.68-banan_os/src/SDL12_compat.c 2025-06-26 03:40:42.751597384 +0300
@@ -1201,7 +1201,11 @@
}
#elif defined(__unix__)
#include <dlfcn.h>
+# if defined(__banan_os__)
+ #define SDL20_LIBNAME "libSDL2.so"
+# else
#define SDL20_LIBNAME "libSDL2-2.0.so.0"
+# endif
#define SDL20_REQUIRED_VER SDL_VERSIONNUM(2,0,7)
static void *Loaded_SDL20 = NULL;
#define LoadSDL20Library() ((Loaded_SDL20 = dlopen(SDL20_LIBNAME, RTLD_LOCAL|RTLD_NOW)) != NULL)