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,24 +0,0 @@
#!/bin/bash ../install.sh
NAME='SDL2'
VERSION='2.32.8'
DOWNLOAD_URL="https://github.com/libsdl-org/SDL/releases/download/release-$VERSION/SDL2-$VERSION.tar.gz#0ca83e9c9b31e18288c7ec811108e58bac1f1bb5ec6577ad386830eac51c787e"
DEPENDENCIES=('mesa' 'libiconv')
configure() {
cmake --fresh -S . -B build -G Ninja \
--toolchain="$BANAN_TOOLCHAIN_DIR/Toolchain.txt" \
-DCMAKE_INSTALL_PREFIX='/usr' \
-DCMAKE_BUILD_TYPE=Release \
-DSDL_LIBSAMPLERATE=OFF \
-DSDL_STATIC=OFF \
|| exit 1
}
build() {
cmake --build build || exit 1
}
install() {
DESTDIR="$DESTDIR" cmake --install build || exit 1
}

File diff suppressed because it is too large Load Diff

View File

@@ -3,7 +3,7 @@
NAME='SDL2_image'
VERSION='2.8.8'
DOWNLOAD_URL="https://github.com/libsdl-org/SDL_image/releases/download/release-$VERSION/SDL2_image-$VERSION.tar.gz#2213b56fdaff2220d0e38c8e420cbe1a83c87374190cba8c70af2156097ce30a"
DEPENDENCIES=('SDL2' 'libpng' 'libjpeg' 'libtiff' 'libwebp')
DEPENDENCIES=('sdl2-compat' 'libpng' 'libjpeg' 'libtiff' 'libwebp')
configure() {
cmake --fresh -S . -B build -G Ninja \

View File

@@ -3,7 +3,7 @@
NAME='SDL2_mixer'
VERSION='2.8.1'
DOWNLOAD_URL="https://github.com/libsdl-org/SDL_mixer/releases/download/release-$VERSION/SDL2_mixer-$VERSION.tar.gz#cb760211b056bfe44f4a1e180cc7cb201137e4d1572f2002cc1be728efd22660"
DEPENDENCIES=('SDL2' 'timidity')
DEPENDENCIES=('sdl2-compat' 'timidity')
configure() {
cmake --fresh -S . -B build -G Ninja \

View File

@@ -4,7 +4,7 @@ NAME='SuperTux'
VERSION='0.6.3'
DOWNLOAD_URL="https://github.com/SuperTux/supertux/releases/download/v$VERSION/SuperTux-v$VERSION-Source.tar.gz#f7940e6009c40226eb34ebab8ffb0e3a894892d891a07b35d0e5762dd41c79f6"
TAR_CONTENT="SuperTux-v$VERSION-Source"
DEPENDENCIES=('boost' 'SDL2' 'SDL2_image' 'curl' 'openal-soft' 'libvorbis' 'freetype' 'physfs' 'glm')
DEPENDENCIES=('boost' 'sdl2-compat' 'SDL2_image' 'curl' 'openal-soft' 'libvorbis' 'freetype' 'physfs' 'glm')
configure() {
cmake --fresh -B build -S . -G Ninja \

View File

@@ -1,6 +1,5 @@
diff -ruN SuperTux-0.6.3/CMakeLists.txt SuperTux-0.6.3-banan_os/CMakeLists.txt
--- SuperTux-0.6.3/CMakeLists.txt 2021-12-23 01:01:57.000000000 +0200
+++ SuperTux-0.6.3-banan_os/CMakeLists.txt 2025-11-02 20:57:03.725932455 +0200
+++ SuperTux-0.6.3-x86_64/CMakeLists.txt 2026-07-04 22:00:48.125314950 +0300
@@ -171,7 +171,7 @@
else(ENABLE_BOOST_STATIC_LIBS)
set(Boost_USE_STATIC_LIBS FALSE)
@@ -18,35 +17,16 @@ diff -ruN SuperTux-0.6.3/CMakeLists.txt SuperTux-0.6.3-banan_os/CMakeLists.txt
-DINSTALL_INC_DIR=include
-DCMAKE_POSITION_INDEPENDENT_CODE=ON)
@@ -966,7 +967,7 @@
endif()
endif()
target_include_directories(supertux2_lib SYSTEM PUBLIC ${SDL_TTF_PREFIX}/include/SDL2)
-target_link_libraries(supertux2_lib PUBLIC SDL_ttf_lib)
+target_link_libraries(supertux2_lib PUBLIC libSDL2_ttf.a)
if(VCPKG_BUILD)
target_link_libraries(supertux2_lib PUBLIC freetype)
else()
@@ -977,9 +978,10 @@
target_link_libraries(supertux2_lib PUBLIC ${HARFBUZZ_LIBRARY} ${FRIBIDI_LIBRARY} ${RAQM_LIBRARY})
endif()
@@ -1022,11 +1023,7 @@
-target_link_libraries(supertux2_lib PUBLIC squirrel_lib)
-target_link_libraries(supertux2_lib PUBLIC sqstdlib_lib)
-target_link_libraries(supertux2_lib PUBLIC tinygettext_lib)
+target_link_libraries(supertux2_lib PUBLIC libsquirrel_static.a)
+target_link_libraries(supertux2_lib PUBLIC libsqstdlib_static.a)
+target_link_libraries(supertux2_lib PUBLIC libtinygettext.a)
+
target_link_libraries(supertux2_lib PUBLIC sexp)
target_link_libraries(supertux2_lib PUBLIC savepng)
target_link_libraries(supertux2_lib PUBLIC partio_zip_lib)
@@ -1025,7 +1027,7 @@
if(VCPKG_BUILD)
target_link_libraries(supertux2_lib PUBLIC ${CURL_LIBRARIES})
else()
if(NOT EMSCRIPTEN)
if(HAVE_LIBCURL)
- if(VCPKG_BUILD)
- target_link_libraries(supertux2_lib PUBLIC ${CURL_LIBRARIES})
- else()
- target_link_libraries(supertux2_lib PUBLIC ${CURL_LIBRARY})
+ target_link_libraries(supertux2_lib PUBLIC ${CURL_LIBRARY} ssl crypto zstd z)
endif()
- endif()
+ target_link_libraries(supertux2_lib PUBLIC ${CURL_LIBRARIES})
endif(HAVE_LIBCURL)
endif(NOT EMSCRIPTEN)

View File

@@ -4,7 +4,7 @@ NAME='SuperTuxKart'
VERSION='1.5'
DOWNLOAD_URL="https://github.com/supertuxkart/stk-code/releases/download/$VERSION/SuperTuxKart-$VERSION-src.tar.gz#33cf8841e4ff4082d80b9248014295bbbea61d14683e86dff100e3ab8f7b27cb"
TAR_CONTENT="SuperTuxKart-$VERSION-src"
DEPENDENCIES=('SDL2' 'curl' 'openal-soft' 'freetype' 'harfbuzz' 'libvorbis' 'libjpeg' 'libpng' 'zlib')
DEPENDENCIES=('sdl2-compat' 'curl' 'openal-soft' 'freetype' 'harfbuzz' 'libvorbis' 'libjpeg' 'libpng' 'zlib')
configure() {
cmake --fresh -B build -S . -G Ninja \

View File

@@ -3,7 +3,7 @@
NAME='bochs'
VERSION='3.0'
DOWNLOAD_URL="https://sourceforge.net/projects/bochs/files/bochs/$VERSION/bochs-$VERSION.tar.gz#cb6f542b51f35a2cc9206b2a980db5602b7cd1b7cf2e4ed4f116acd5507781aa"
DEPENDENCIES=('SDL2')
DEPENDENCIES=('sdl2-compat')
CONFIG_SUB=('config.sub')
CONFIGURE_OPTIONS=(
'--with-sdl2'

View File

@@ -3,7 +3,7 @@
NAME='doom'
VERSION='git'
DOWNLOAD_URL="https://github.com/ozkl/doomgeneric.git#5041246e859052e2e258ca6edb4e1e9bbd98fcf5"
DEPENDENCIES=('SDL2' 'SDL2_mixer' 'timidity')
DEPENDENCIES=('sdl2-compat' 'SDL2_mixer' 'timidity')
configure() {
rm -rf doomgeneric/build

View File

@@ -3,7 +3,7 @@
NAME='ffmpeg'
VERSION='8.0.1'
DOWNLOAD_URL="https://ffmpeg.org/releases/ffmpeg-$VERSION.tar.xz#05ee0b03119b45c0bdb4df654b96802e909e0a752f72e4fe3794f487229e5a41"
DEPENDENCIES=('SDL2' 'openssl')
DEPENDENCIES=('sdl2-compat' 'openssl')
CONFIGURE_OPTIONS=(
'--prefix=/usr'
'--target-os=none'

View File

@@ -3,7 +3,7 @@
NAME='qemu'
VERSION='10.0.2'
DOWNLOAD_URL="https://download.qemu.org/qemu-$VERSION.tar.xz#ef786f2398cb5184600f69aef4d5d691efd44576a3cff4126d38d4c6fec87759"
DEPENDENCIES=('glib' 'SDL2')
DEPENDENCIES=('glib' 'sdl2-compat')
MAKE_BUILD_TARGETS=('qemu-system-x86_64')
CONFIGURE_OPTIONS=(
'--cross-prefix='

View File

@@ -3,7 +3,7 @@
NAME='quake2'
VERSION='git'
DOWNLOAD_URL="https://github.com/ozkl/quake2generic.git#50190797664fd42fc1b0266150c54f76f92bfa15"
DEPENDENCIES=('SDL2' 'SDL2_mixer')
DEPENDENCIES=('sdl2-compat' 'SDL2_mixer')
configure() {
make clean
@@ -26,8 +26,8 @@ build() {
exit 1
fi
cflags='-Dstricmp=strcasecmp -Wno-incompatible-pointer-types'
make CC="$CC" BASE_CFLAGS="$cflags" SDL_PATH="$BANAN_SYSROOT/usr/bin/" -j$(nproc) || exit 1
cflags='-Dstricmp=strcasecmp -O3 -ffast-math -Wno-incompatible-pointer-types -Wno-pointer-to-int-cast'
make CC="$CC" CFLAGS="$cflags" SDL_PATH="$BANAN_SYSROOT/usr/bin/" -j$(nproc) createdirs build/quake2-soft || exit 1
}
install() {

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

24
ports/sdl2-compat/build.sh Executable file
View 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
}

View File

@@ -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]"

View 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;

View File

@@ -3,7 +3,7 @@
NAME='tinygb'
VERSION='git'
DOWNLOAD_URL="https://github.com/jewelcodes/tinygb.git#57fdaff675a6b5b963b2b6624868d9698eabe375"
DEPENDENCIES=('SDL2')
DEPENDENCIES=('sdl2-compat')
configure() {
sed -i "s|shell sdl2-config|shell $BANAN_SYSROOT/usr/bin/sdl2-config|g" Makefile

View File

@@ -3,7 +3,7 @@
NAME='xash3d-fwgs'
VERSION='git'
DOWNLOAD_URL="https://github.com/FWGS/xash3d-fwgs.git#da1b9ad80d76156a5cbd54d3ce87edb32634ea87"
DEPENDENCIES=('SDL2' 'freetype' 'bzip2' 'libvorbis')
DEPENDENCIES=('sdl2-compat' 'freetype' 'bzip2' 'libvorbis')
configure() {
git submodule update --init --recursive || exit 1
@@ -22,12 +22,12 @@ build() {
}
install() {
./waf install --destdir="$DESTDIR/usr/share/games/halflife" || exit 1
./waf install --destdir="$DESTDIR/home/user/halflife" || exit 1
cat > "$DESTDIR/home/user/halflife/start.sh" << EOF
#!/bin/Shell
export LD_LIBRARY_PATH=/home/user/halflife
./xash3d -console
exec /home/user/halflife/xash3d -console
EOF
chmod +x $DESTDIR/home/user/halflife/start.sh
chmod +x "$DESTDIR/home/user/halflife/start.sh"
}