diff --git a/SDL2-2.30.1-prefer-wayland.patch b/SDL2-2.30.1-prefer-wayland.patch deleted file mode 100644 index 6408643bb27c154dae2e45ca808159887f6834d7..0000000000000000000000000000000000000000 --- a/SDL2-2.30.1-prefer-wayland.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff -up ./src/video/SDL_video.c.prefer-wayland ./src/video/SDL_video.c ---- ./src/video/SDL_video.c.prefer-wayland 2024-03-25 11:11:50.474311044 +1000 -+++ ./src/video/SDL_video.c 2024-03-25 11:40:04.785892199 +1000 -@@ -69,12 +69,12 @@ static VideoBootStrap *bootstrap[] = { - #ifdef SDL_VIDEO_DRIVER_COCOA - &COCOA_bootstrap, - #endif --#ifdef SDL_VIDEO_DRIVER_X11 -- &X11_bootstrap, --#endif - #ifdef SDL_VIDEO_DRIVER_WAYLAND - &Wayland_bootstrap, - #endif -+#ifdef SDL_VIDEO_DRIVER_X11 -+ &X11_bootstrap, -+#endif - #ifdef SDL_VIDEO_DRIVER_VIVANTE - &VIVANTE_bootstrap, - #endif diff --git a/SDL2.spec b/SDL2.spec index 3bbc4f131ea33ab80a3cfb855dc204d07a4b2a50..911531bbe1c99e1f7549dca50447b9b1767dc568 100644 --- a/SDL2.spec +++ b/SDL2.spec @@ -1,98 +1,98 @@ Name: SDL2 -Version: 2.32.6 +Version: 2.32.56 Release: 1 -Summary: Cross-platform multimedia library -License: zlib and MIT +Summary: SDL2 compatibility layer that uses SDL3 behind the scenes +License: Zlib URL: https://www.libsdl.org/ -Source0: https://github.com/libsdl-org/SDL/releases/download/release-%{version}/%{name}-%{version}.tar.gz -Source1: SDL_config.h -Patch0000: multilib.patch -# Prefer Wayland by default -Patch0001: SDL2-2.30.1-prefer-wayland.patch - -BuildRequires: alsa-lib-devel audiofile-devel mesa-libGL-devel -BuildRequires: mesa-libGLU-devel mesa-libEGL-devel libglvnd-devel -BuildRequires: libXext-devel libX11-devel libXi-devel libXrandr-devel -BuildRequires: libXrender-devel libXScrnSaver-devel libusb-devel -BuildRequires: libXinerama-devel libXcursor-devel systemd-devel -%ifarch loongarch64 -BuildRequires: pkgconfig(libpulse-simple) -%else -BuildRequires: pkgconfig(libpulse-simple) pkgconfig(jack) -%endif -BuildRequires: pkgconfig(dbus-1) pkgconfig(ibus-1.0) -BuildRequires: pkgconfig(wayland-client) pkgconfig(wayland-egl) -BuildRequires: pkgconfig(wayland-cursor) pkgconfig(wayland-protocols) -BuildRequires: pkgconfig(wayland-scanner) pkgconfig(xkbcommon) -BuildRequires: vulkan-devel mesa-libgbm-devel libdrm-devel -BuildRequires: cmake-rpm-macros +Source0: https://github.com/libsdl-org/sdl2-compat/releases/download/release-%{version}/sdl2-compat-%{version}.tar.gz + +BuildRequires: cmake >= 3.0 +BuildRequires: SDL3-devel +BuildRequires: pkgconfig(gl) +BuildRequires: pkgconfig(glu) +Requires: SDL3%{?_isa} +Provides: sdl2-compat = %{version}-%{release} %description -Simple DirectMedia Layer (SDL) is a cross-platform multimedia library designed -to provide fast access to the graphics frame buffer and audio device. +This is the Simple DirectMedia Layer, a general API that provides low +level access to audio, keyboard, mouse, joystick, 3D hardware via +OpenGL, and 2D framebuffer across multiple platforms. + +This code is a compatibility layer; it provides a binary and source +compatible API for programs written against SDL2, but it uses SDL3 +behind the scenes. If you are writing new code, please target SDL3 +directly and do not use this layer. %package devel -Summary: Files needed to develop Simple DirectMedia Layer applications -Requires: %{name} = %{version}-%{release} -Requires: mesa-libEGL-devel mesa-libGLES-devel libX11-devel -Provides: %{name}-static = %{version}-%{release} -Obsoletes: %{name}-static < %{version}-%{release} +Summary: Files needed to develop Simple DirectMedia Layer applications +Requires: %{name} = %{version}-%{release} +Conflicts: SDL2-devel%{?_isa} < 2.32.56 +Requires: pkgconfig(gl) +Requires: pkgconfig(glu) +Requires: pkgconfig(x11) +Requires: pkgconfig(xproto) +Provides: sdl2-compat-devel = %{version}-%{release} %description devel -Simple DirectMedia Layer (SDL) is a cross-platform multimedia library designed -to provide fast access to the graphics frame buffer and audio device. This -package provides the libraries, include files, and other resources needed for -developing SDL applications. +This is the Simple DirectMedia Layer, a general API that provides low +level access to audio, keyboard, mouse, joystick, 3D hardware via +OpenGL, and 2D framebuffer across multiple platforms. + +This code is a compatibility layer; it provides a binary and source +compatible API for programs written against SDL2, but it uses SDL3 +behind the scenes. If you are writing new code, please target SDL3 +directly and do not use this layer. %package static -Summary: Static libraries for SDL2 +Summary: Static libraries for SDL2 +Provides: sdl2-compat-static = %{version}-%{release} %description static Static libraries for SDL2. %prep -%autosetup -p1 -sed -i -e 's/.*AM_PATH_ESD.*//' configure.ac +%autosetup -p1 -n sdl2-compat-%{version} %build -%configure \ - --enable-sdl-dlopen --enable-video-kmsdrm \ - --disable-arts --disable-esd --disable-nas \ - --enable-pulseaudio-shared --enable-jack-shared \ - --enable-alsa --enable-video-wayland \ - --enable-video-vulkan --enable-sse2=no \ - --enable-sse3=no --disable-rpath \ -%ifarch loongarch64 - --enable-lasx=no --enable-lsx=no -%endif - -%make_build +%cmake -DSDL2COMPAT_STATIC=ON +%cmake_build %install -%make_install -%delete_la +%cmake_install -mv %{buildroot}%{_includedir}/SDL2/SDL_config.h %{buildroot}%{_includedir}/SDL2/SDL_config-%{_arch}.h -install -pm 0644 %{SOURCE1} %{buildroot}%{_includedir}/SDL2/SDL_config.h +rm -f %{buildroot}%{_datadir}/licenses/sdl2-compat/LICENSE.txt + +%check +%ctest %files %license LICENSE.txt -%doc BUGS.txt CREDITS.txt README-SDL.txt +%doc BUGS.md COMPATIBILITY.md README.md %{_libdir}/lib*.so.* %files devel -%doc TODO.txt WhatsNew.txt -%{_bindir}/*-config -%{_libdir}/lib*.so -%{_libdir}/pkgconfig/sdl2.pc -%{_libdir}/cmake/SDL2/ -%{_includedir}/SDL2 -%{_datadir}/aclocal/* +%{_bindir}/sdl2-config +%{_datadir}/aclocal/sdl2.m4 +%{_includedir}/SDL2/ +%dir %{_libdir}/cmake/SDL2 +%{_libdir}/cmake/SDL2/sdl2-config*.cmake +%{_libdir}/cmake/SDL2/SDL2Config*.cmake +%{_libdir}/cmake/SDL2/SDL2Targets*.cmake +%{_libdir}/cmake/SDL2/SDL2mainTargets*.cmake +%{_libdir}/cmake/SDL2/SDL2_testTargets*.cmake +%{_libdir}/*.so +%{_libdir}/pkgconfig/*.pc +%{_libdir}/libSDL2main.a +%{_libdir}/libSDL2_test.a %files static -%{_libdir}/lib*.a +%{_libdir}/libSDL2.a +%{_libdir}/cmake/SDL2/SDL2-staticTargets*.cmake %changelog +* Tue Jun 17 2025 Funda Wang - 2.32.56-1 +- convert to sdl2-compat towards sdl3 + * Tue May 06 2025 Funda Wang - 2.32.6-1 - update to 2.32.6 diff --git a/SDL2.yaml b/SDL2.yaml index 71a849f47d22d38d4f3e8b95be9766d34c283ade..0fe6d7a6645bb0398c1f1a28467746cfcbc082a8 100644 --- a/SDL2.yaml +++ b/SDL2.yaml @@ -1,4 +1,4 @@ version_control: github -src_repo: libsdl-org/SDL +src_repo: libsdl-org/sdl2-compat tag_prefix: ^release- separator: . diff --git a/SDL_config.h b/SDL_config.h deleted file mode 100644 index e03ae4722aedd8ec5ea9982e9936f2639f3fbf76..0000000000000000000000000000000000000000 --- a/SDL_config.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2013 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/* - * This SDL_config.h is a wrapper include file for the original SDL_config.h, - * which has been renamed to SDL_config-.h. There are conflicts for the - * original SDL_config.h on multilib systems, which result from arch-specific - * configuration options. Please do not use the arch-specific file directly. - * - * Copyright (C) 2013 Igor Gnatenko - * Igor Gnatenko - */ - -/** - * \file SDL_config.h - */ - -#ifdef SDL_config_wrapper_h -#error "SDL_config_wrapper_h should not be defined!" -#endif -#define SDL_config_wrapper_h - -#if defined(__i386__) -#include "SDL_config-i386.h" -#elif defined(__ia64__) -#include "SDL_config-ia64.h" -#elif defined(__powerpc64__) -# if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -#include "SDL_config-ppc64.h" -# else -#include "SDL_config-ppc64le.h" -# endif -#elif defined(__powerpc__) -#include "SDL_config-ppc.h" -#elif defined(__s390x__) -#include "SDL_config-s390x.h" -#elif defined(__s390__) -#include "SDL_config-s390.h" -#elif defined(__x86_64__) -#include "SDL_config-x86_64.h" -#elif defined(__arm__) -#include "SDL_config-arm.h" -#elif defined(__alpha__) -#include "SDL_config-alpha.h" -#elif defined(__sw_64__) -#include "SDL_config-sw_64.h" -#elif defined(__sparc__) && defined (__arch64__) -#include "SDL_config-sparc64.h" -#elif defined(__sparc__) -#include "SDL_config-sparc.h" -#elif defined(__aarch64__) -#include "SDL_config-aarch64.h" -#elif defined(__mips64) && defined(__MIPSEL__) -#include "SDL_config-mips64el.h" -#elif defined(__mips64) -#include "SDL_config-mips64.h" -#elif defined(__mips) && defined(__MIPSEL__) -#include "SDL_config-mipsel.h" -#elif defined(__mips) -#include "SDL_config-mips.h" -#elif defined(__riscv) && defined(__riscv_xlen) && __riscv_xlen == 64 -#include "SDL_config-riscv64.h" -#elif defined(__loongarch64) -#include "SDL_config-loongarch64.h" -#else -#error "The SDL2-devel package is not usable with the architecture." -#endif - -#undef SDL_config_wrapper_h diff --git a/multilib.patch b/multilib.patch deleted file mode 100644 index 6faec5232a878bd0fd5987a4639d869b3121266b..0000000000000000000000000000000000000000 --- a/multilib.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff --git a/sdl2-config.in b/sdl2-config.in -index b41fc16..c16a159 100644 ---- a/sdl2-config.in -+++ b/sdl2-config.in -@@ -7,7 +7,6 @@ bindir=`cd -P -- "\`dirname -- "$0"\`" && printf '%s\n' "\`pwd -P\`"` - prefix=`cd -P -- "$bindir/@bin_prefix_relpath@" && printf '%s\n' "\`pwd -P\`"` - exec_prefix=@exec_prefix@ - exec_prefix_set=no --libdir=@libdir@ - - @ENABLE_STATIC_FALSE@usage="\ - @ENABLE_STATIC_FALSE@Usage: $0 [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs]" -@@ -49,12 +48,11 @@ while test $# -gt 0; do - echo -I@includedir@/SDL2 @SDL_CFLAGS@ - ;; - @ENABLE_SHARED_TRUE@ --libs) --@ENABLE_SHARED_TRUE@ echo -L@libdir@ @SDL_RLD_FLAGS@ @SDL_LIBS@ -+@ENABLE_SHARED_TRUE@ echo @SDL_RLD_FLAGS@ @SDL_LIBS@ - @ENABLE_SHARED_TRUE@ ;; - @ENABLE_STATIC_TRUE@@ENABLE_SHARED_TRUE@ --static-libs) - @ENABLE_STATIC_TRUE@@ENABLE_SHARED_FALSE@ --libs|--static-libs) --@ENABLE_STATIC_TRUE@ sdl_static_libs=$(echo "@SDL_LIBS@ @SDL_STATIC_LIBS@" | sed -E "s#-lSDL2[ $]#$libdir/libSDL2.a #g") --@ENABLE_STATIC_TRUE@ echo -L@libdir@ $sdl_static_libs -+@ENABLE_STATIC_TRUE@ echo @SDL_LIBS@ @SDL_STATIC_LIBS@ - @ENABLE_STATIC_TRUE@ ;; - *) - echo "${usage}" 1>&2 diff --git a/SDL2-2.32.6.tar.gz b/sdl2-compat-2.32.56.tar.gz similarity index 32% rename from SDL2-2.32.6.tar.gz rename to sdl2-compat-2.32.56.tar.gz index f5645d36034a68d9af2d9e10fd14a160f08229fb..1eba6c813de581b7dec0603fd81a865cc5556899 100644 --- a/SDL2-2.32.6.tar.gz +++ b/sdl2-compat-2.32.56.tar.gz @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6a7a40d6c2e00016791815e1a9f4042809210bdf10cc78d2c75b45c4f52f93ad -size 7627447 +oid sha256:27e845b1b7dc0a91a85f1a1f18892ed205adb38caf767741eb258008d8264de0 +size 2818364