diff --git a/ports/sdl12-compat/build.sh b/ports/sdl12-compat/build.sh new file mode 100755 index 00000000..f900c407 --- /dev/null +++ b/ports/sdl12-compat/build.sh @@ -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 +} diff --git a/ports/sdl12-compat/patches/0001-rename-sdl-shared-library.patch b/ports/sdl12-compat/patches/0001-rename-sdl-shared-library.patch new file mode 100644 index 00000000..621a3746 --- /dev/null +++ b/ports/sdl12-compat/patches/0001-rename-sdl-shared-library.patch @@ -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 ++# 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)