ports: Replace SDL2 with sdl2-compat
There is no need to keep two SDL versions around
This commit is contained in:
24
ports/sdl2-compat/build.sh
Executable file
24
ports/sdl2-compat/build.sh
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash ../install.sh
|
||||
|
||||
NAME='sdl2-compat'
|
||||
VERSION='2.32.70'
|
||||
DOWNLOAD_URL="https://github.com/libsdl-org/sdl2-compat/releases/download/release-$VERSION/sdl2-compat-$VERSION.tar.gz#998fa62557eb46ffe7e5c3e2c123bc332f7df9d9f593b3ceed88ed1158428a44"
|
||||
DEPENDENCIES=('SDL3')
|
||||
|
||||
configure() {
|
||||
cmake --fresh -S . -B build -G Ninja \
|
||||
--toolchain="$BANAN_TOOLCHAIN_DIR/Toolchain.txt" \
|
||||
-DCMAKE_INSTALL_PREFIX='/usr' \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DSDL2COMPAT_X11=OFF \
|
||||
|| exit 1
|
||||
}
|
||||
|
||||
build() {
|
||||
cmake --build build || exit 1
|
||||
}
|
||||
|
||||
install() {
|
||||
DESTDIR="$DESTDIR" cmake --install build || exit 1
|
||||
ln -s sdl2-compat.pc "$DESTDIR"/usr/lib/pkgconfig/sdl2.pc || exit 1
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
diff -ruN sdl2-compat-2.32.70/sdl2-config.in sdl2-compat-2.32.70-banan_os/sdl2-config.in
|
||||
--- sdl2-compat-2.32.70/sdl2-config.in 2023-07-26 08:40:50.000000000 +0300
|
||||
+++ sdl2-compat-2.32.70-banan_os/sdl2-config.in 2026-07-04 00:30:22.699878722 +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]"
|
||||
21
ports/sdl2-compat/patches/0002-add-OS_GetExeName.patch
Normal file
21
ports/sdl2-compat/patches/0002-add-OS_GetExeName.patch
Normal file
@@ -0,0 +1,21 @@
|
||||
diff -ruN sdl2-compat-2.32.70/src/sdl2_compat.c sdl2-compat-2.32.70-banan_os/src/sdl2_compat.c
|
||||
--- sdl2-compat-2.32.70/src/sdl2_compat.c 2026-06-08 18:01:06.000000000 +0300
|
||||
+++ sdl2-compat-2.32.70-banan_os/src/sdl2_compat.c 2026-07-04 00:34:09.939149767 +0300
|
||||
@@ -96,7 +96,7 @@
|
||||
#undef snprintf
|
||||
#undef vsnprintf
|
||||
|
||||
-#if defined(__linux__) || defined(__GNU__)
|
||||
+#if defined(__linux__) || defined(__GNU__) || defined(__banan_os__)
|
||||
#include <unistd.h> /* for readlink() */
|
||||
#endif
|
||||
|
||||
@@ -546,7 +546,7 @@
|
||||
#endif
|
||||
};
|
||||
|
||||
-#if defined(__linux__) || defined(__GNU__)
|
||||
+#if defined(__linux__) || defined(__GNU__) || defined(__banan_os__)
|
||||
static void OS_GetExeName(char *buf, const unsigned maxpath, bool *use_base_path)
|
||||
{
|
||||
int ret;
|
||||
Reference in New Issue
Block a user