diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | SDL2-2.0.22-prefer-wayland.patch | 80 | ||||
-rw-r--r-- | SDL2.spec | 139 | ||||
-rw-r--r-- | SDL_config.h | 87 | ||||
-rw-r--r-- | multilib.patch | 27 | ||||
-rw-r--r-- | sources | 1 |
6 files changed, 335 insertions, 0 deletions
@@ -0,0 +1 @@ +/SDL2-2.26.5.tar.gz diff --git a/SDL2-2.0.22-prefer-wayland.patch b/SDL2-2.0.22-prefer-wayland.patch new file mode 100644 index 0000000..f8586e0 --- /dev/null +++ b/SDL2-2.0.22-prefer-wayland.patch @@ -0,0 +1,80 @@ +From 68d8a2c6b4f732920df40bd79dc3c18b71a4a349 Mon Sep 17 00:00:00 2001 +From: Neal Gompa <ngompa@fedoraproject.org> +Date: Fri, 29 Apr 2022 23:39:39 -0400 +Subject: [PATCH] Revert "Revert "video: Prefer Wayland over X11"" + +For Fedora/RHEL, we want to continue using Wayland by default. + +The majority of issues around Wayland by default seem to center +around cases that are issues for the Steam Runtime's bundled +copy of SDL and proprietary games that depend on that runtime. + +These issues do not apply to us. + +This reverts commit 254fcc90eb22bb159ab365ad956222a9c5632841. +--- + src/video/SDL_video.c | 24 ++++++++++++------------ + 1 file changed, 12 insertions(+), 12 deletions(-) + +diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c +index 2b896c44b..6f31f4c9e 100644 +--- a/src/video/SDL_video.c ++++ b/src/video/SDL_video.c +@@ -61,12 +61,12 @@ static VideoBootStrap *bootstrap[] = { + #if SDL_VIDEO_DRIVER_COCOA + &COCOA_bootstrap, + #endif +-#if SDL_VIDEO_DRIVER_X11 +- &X11_bootstrap, +-#endif + #if SDL_VIDEO_DRIVER_WAYLAND + &Wayland_bootstrap, + #endif ++#if SDL_VIDEO_DRIVER_X11 ++ &X11_bootstrap, ++#endif + #if SDL_VIDEO_DRIVER_VIVANTE + &VIVANTE_bootstrap, + #endif +@@ -4275,12 +4275,12 @@ SDL_IsScreenKeyboardShown(SDL_Window *window) + #if SDL_VIDEO_DRIVER_UIKIT + #include "uikit/SDL_uikitmessagebox.h" + #endif +-#if SDL_VIDEO_DRIVER_X11 +-#include "x11/SDL_x11messagebox.h" +-#endif + #if SDL_VIDEO_DRIVER_WAYLAND + #include "wayland/SDL_waylandmessagebox.h" + #endif ++#if SDL_VIDEO_DRIVER_X11 ++#include "x11/SDL_x11messagebox.h" ++#endif + #if SDL_VIDEO_DRIVER_HAIKU + #include "haiku/SDL_bmessagebox.h" + #endif +@@ -4388,17 +4388,17 @@ SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) + retval = 0; + } + #endif +-#if SDL_VIDEO_DRIVER_X11 ++#if SDL_VIDEO_DRIVER_WAYLAND + if (retval == -1 && +- SDL_MessageboxValidForDriver(messageboxdata, SDL_SYSWM_X11) && +- X11_ShowMessageBox(messageboxdata, buttonid) == 0) { ++ SDL_MessageboxValidForDriver(messageboxdata, SDL_SYSWM_WAYLAND) && ++ Wayland_ShowMessageBox(messageboxdata, buttonid) == 0) { + retval = 0; + } + #endif +-#if SDL_VIDEO_DRIVER_WAYLAND ++#if SDL_VIDEO_DRIVER_X11 + if (retval == -1 && +- SDL_MessageboxValidForDriver(messageboxdata, SDL_SYSWM_WAYLAND) && +- Wayland_ShowMessageBox(messageboxdata, buttonid) == 0) { ++ SDL_MessageboxValidForDriver(messageboxdata, SDL_SYSWM_X11) && ++ X11_ShowMessageBox(messageboxdata, buttonid) == 0) { + retval = 0; + } + #endif +-- +2.35.1 diff --git a/SDL2.spec b/SDL2.spec new file mode 100644 index 0000000..620f8bb --- /dev/null +++ b/SDL2.spec @@ -0,0 +1,139 @@ +Name: SDL2 +Version: 2.26.5 +Release: 1 +Summary: Cross-platform multimedia library +License: zlib and MIT +URL: http://www.libsdl.org/ +Source0: http://www.libsdl.org/release/%{name}-%{version}.tar.gz +Source1: SDL_config.h +Patch0000: multilib.patch +Patch0001: SDL2-2.0.22-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 + +%description +Simple DirectMedia Layer (SDL) is a cross-platform multimedia library designed +to provide fast access to the graphics frame buffer and audio device. + +%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} + +%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. + +%package static +Summary: Static libraries for SDL2 + +%description static +Static libraries for SDL2. + +%prep +%autosetup -p1 +sed -i -e 's/.*AM_PATH_ESD.*//' configure.ac +sed -i -e 's/\r//g' TODO.txt README.txt WhatsNew.txt BUGS.txt COPYING.txt CREDITS.txt README-SDL.txt + +%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 \ + +make %{?_smp_mflags} + +%install +%make_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 -vf %{buildroot}%{_libdir}/*.la + +%ldconfig_scriptlets + +%files +%license COPYING.txt +%doc BUGS.txt CREDITS.txt README-SDL.txt +%{_libdir}/lib*.so.* + +%files devel +%doc README.txt TODO.txt WhatsNew.txt +%{_bindir}/*-config +%{_libdir}/lib*.so +%{_libdir}/pkgconfig/sdl2.pc +%{_libdir}/cmake/SDL2/ +%{_includedir}/SDL2 +%{_datadir}/aclocal/* + +%files static +%license COPYING.txt +%{_libdir}/lib*.a + +%changelog +* Wed Jun 07 2023 misaka00251 <liuxin@iscas.ac.cn> - 2.26.5-1 +- Update to 2.26.5 + +* Mon Apr 24 2023 panchenbo <panchenbo@kylinsec.com.cn> - 2.0.12-7 +- add sw_64 support + +* Thu Mar 02 2023 Wenlong Zhang<zhangwenlong@loongson.cn> - 2.0.12-6 +- add loongarch support + +* Tue Jan 10 2023 jiangpeng <jiangpeng01@ncti-gba.cn> - 2.0.12-5 +- fix CVE-2022-4743 + +* Mon Apr 11 2022 yaoxin <yaoxin30@h-partners.com> - 2.0.12-4 +- Fix CVE-2020-14409 CVE-2020-14410 + +* Tue Mar 15 2022 yuanxin <yuanxin24@h-partners.com> - 2.0.12-3 +- Type:CVE +- ID:NA +- SUG:NA +- DESC:Fix CVE-2021-33657 + +* Sat Jan 8 2022 zhouwenpei <zhouwenpei1@huawei.com> - 2.0.12-2 +- Fix build against wayland + +* Mon Nov 16 2020 Zhiyi Weng <zhiyi@iscas.ac.cn> - 2.0.12-1 +- Update to 2.0.12 + +* Wed Aug 6 2020 xinghe<xinghe1@huawei.com> - 2.0.8-10 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:replace mesa-libELES-devel to libglvnd-devel + +* Wed Mar 18 2020 openEuler Buildteam <buildteam@openeuler.org> - 2.0.8-9 +- Type:CVE +- ID:NA +- SUG:NA +- DESC:Fix CVE-2019-13616 + +* Mon Feb 24 2020 yuxiangyang <yuxiangyang4@huawei.com> - 2.0.8-8 +- Delete buildrequires for jack-audio-connection-kit + +* Fri Nov 29 2019 lijin Yang <yanglijin@huawei.com> - 2.0.8-7 +- Package Init diff --git a/SDL_config.h b/SDL_config.h new file mode 100644 index 0000000..e03ae47 --- /dev/null +++ b/SDL_config.h @@ -0,0 +1,87 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga <slouken@libsdl.org> + + 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-<arch>.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 <i.gnatenko.brain@gmail.com> + */ + +/** + * \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 new file mode 100644 index 0000000..db59b08 --- /dev/null +++ b/multilib.patch @@ -0,0 +1,27 @@ +diff --git a/sdl2-config.in b/sdl2-config.in +index f6eca7668..93460f7ae 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 @@ -0,0 +1 @@ +47f22c109070431ecccd90abd3c0ab6e SDL2-2.26.5.tar.gz |