diff --git a/SDL2-2.0.14.tar.gz b/SDL2-2.0.14.tar.gz deleted file mode 100644 index 9c1027c..0000000 --- a/SDL2-2.0.14.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d8215b571a581be1332d2106f8036fcb03d12a70bae01e20f424976d275432bc -size 6089974 diff --git a/SDL2-2.0.14.tar.gz.sig b/SDL2-2.0.14.tar.gz.sig deleted file mode 100644 index 184cd3f..0000000 Binary files a/SDL2-2.0.14.tar.gz.sig and /dev/null differ diff --git a/SDL2-2.0.16.tar.gz b/SDL2-2.0.16.tar.gz new file mode 100644 index 0000000..d9b9d5b --- /dev/null +++ b/SDL2-2.0.16.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:65be9ff6004034b5b2ce9927b5a4db1814930f169c4b2dae0a1e4697075f287b +size 7227262 diff --git a/SDL2-2.0.16.tar.gz.sig b/SDL2-2.0.16.tar.gz.sig new file mode 100644 index 0000000..dbc7e98 Binary files /dev/null and b/SDL2-2.0.16.tar.gz.sig differ diff --git a/SDL2-endian.patch b/SDL2-endian.patch index 910349b..9293871 100644 --- a/SDL2-endian.patch +++ b/SDL2-endian.patch @@ -1,12 +1,17 @@ ---- - include/SDL_endian.h | 155 ++------------------------------------------------- - 1 file changed, 7 insertions(+), 148 deletions(-) +From: crrodriguez@opensuse.org +Date: Fri May 11 11:08:39 UTC 2018 -Index: SDL2-2.0.12/include/SDL_endian.h +Bring up patch from SDL1, use optimized byteswap routines from the C library. + +--- + include/SDL_endian.h | 189 +-------------------------------------------------- + 1 file changed, 7 insertions(+), 182 deletions(-) + +Index: SDL2-2.0.16/include/SDL_endian.h =================================================================== ---- SDL2-2.0.12.orig/include/SDL_endian.h -+++ SDL2-2.0.12/include/SDL_endian.h -@@ -34,32 +34,17 @@ +--- SDL2-2.0.16.orig/include/SDL_endian.h ++++ SDL2-2.0.16/include/SDL_endian.h +@@ -54,35 +54,17 @@ _m_prefetch(void *__P) * \name The two types of endianness */ /* @{ */ @@ -23,6 +28,9 @@ Index: SDL2-2.0.12/include/SDL_endian.h -#elif defined(__OpenBSD__) -#include -#define SDL_BYTEORDER BYTE_ORDER +-#elif defined(__FreeBSD__) || defined(__NetBSD__) +-#include +-#define SDL_BYTEORDER BYTE_ORDER -#else -#if defined(__hppa__) || \ - defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \ @@ -43,19 +51,21 @@ Index: SDL2-2.0.12/include/SDL_endian.h /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus extern "C" { -@@ -68,149 +53,23 @@ extern "C" { +@@ -91,180 +73,23 @@ extern "C" { /** * \file SDL_endian.h */ --#if defined(__GNUC__) && defined(__i386__) && \ -- !(__GNUC__ == 2 && __GNUC_MINOR__ == 95 /* broken gcc version */) - SDL_FORCE_INLINE Uint16 - SDL_Swap16(Uint16 x) - { +-#if (defined(__clang__) && (__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 2))) || \ +- (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8))) +-#define SDL_Swap16(x) __builtin_bswap16(x) +-#elif defined(__GNUC__) && defined(__i386__) && \ +- !(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */) +-SDL_FORCE_INLINE Uint16 +-SDL_Swap16(Uint16 x) +-{ - __asm__("xchgb %b0,%h0": "=q"(x):"0"(x)); - return x; -+ return bswap_16(x); - } +-} -#elif defined(__GNUC__) && defined(__x86_64__) -SDL_FORCE_INLINE Uint16 -SDL_Swap16(Uint16 x) @@ -68,17 +78,27 @@ Index: SDL2-2.0.12/include/SDL_endian.h -SDL_Swap16(Uint16 x) -{ - int result; - +- - __asm__("rlwimi %0,%2,8,16,23": "=&r"(result):"0"(x >> 8), "r"(x)); - return (Uint16)result; -} --#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) && !defined(__mcoldfire__) +-#elif defined(__GNUC__) && defined(__aarch64__) + SDL_FORCE_INLINE Uint16 + SDL_Swap16(Uint16 x) + { +- __asm__("rev16 %w1, %w0" : "=r"(x) : "r"(x)); +- return x; +-} +-#elif defined(__GNUC__) && (defined(__m68k__) && !defined(__mcoldfire__)) -SDL_FORCE_INLINE Uint16 -SDL_Swap16(Uint16 x) -{ - __asm__("rorw #8,%0": "=d"(x): "0"(x):"cc"); - return x; -} +-#elif defined(_MSC_VER) +-#pragma intrinsic(_byteswap_ushort) +-#define SDL_Swap16(x) _byteswap_ushort(x) -#elif defined(__WATCOMC__) && defined(__386__) -extern _inline Uint16 SDL_Swap16(Uint16); -#pragma aux SDL_Swap16 = \ @@ -93,13 +113,17 @@ Index: SDL2-2.0.12/include/SDL_endian.h -} -#endif - --#if defined(__GNUC__) && defined(__i386__) - SDL_FORCE_INLINE Uint32 - SDL_Swap32(Uint32 x) - { +-#if (defined(__clang__) && (__clang_major__ > 2 || (__clang_major__ == 2 && __clang_minor__ >= 6))) || \ +- (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))) +-#define SDL_Swap32(x) __builtin_bswap32(x) +-#elif defined(__GNUC__) && defined(__i386__) && \ +- !(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */) +-SDL_FORCE_INLINE Uint32 +-SDL_Swap32(Uint32 x) +-{ - __asm__("bswap %0": "=r"(x):"0"(x)); - return x; -+ return bswap_32(x); ++ return bswap_16(x); } -#elif defined(__GNUC__) && defined(__x86_64__) -SDL_FORCE_INLINE Uint32 @@ -113,13 +137,20 @@ Index: SDL2-2.0.12/include/SDL_endian.h -SDL_Swap32(Uint32 x) -{ - Uint32 result; -- -- __asm__("rlwimi %0,%2,24,16,23": "=&r"(result):"0"(x >> 24), "r"(x)); -- __asm__("rlwimi %0,%2,8,8,15": "=&r"(result):"0"(result), "r"(x)); -- __asm__("rlwimi %0,%2,24,0,7": "=&r"(result):"0"(result), "r"(x)); + +- __asm__("rlwimi %0,%2,24,16,23": "=&r"(result): "0" (x>>24), "r"(x)); +- __asm__("rlwimi %0,%2,8,8,15" : "=&r"(result): "0" (result), "r"(x)); +- __asm__("rlwimi %0,%2,24,0,7" : "=&r"(result): "0" (result), "r"(x)); - return result; -} --#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) && !defined(__mcoldfire__) +-#elif defined(__GNUC__) && defined(__aarch64__) +-SDL_FORCE_INLINE Uint32 +-SDL_Swap32(Uint32 x) +-{ +- __asm__("rev %w1, %w0": "=r"(x):"r"(x)); +- return x; +-} +-#elif defined(__GNUC__) && (defined(__m68k__) && !defined(__mcoldfire__)) -SDL_FORCE_INLINE Uint32 -SDL_Swap32(Uint32 x) -{ @@ -128,57 +159,66 @@ Index: SDL2-2.0.12/include/SDL_endian.h -} -#elif defined(__WATCOMC__) && defined(__386__) -extern _inline Uint32 SDL_Swap32(Uint32); --#ifndef __SW_3 /* 486+ */ -#pragma aux SDL_Swap32 = \ - "bswap eax" \ - parm [eax] \ - modify [eax]; --#else /* 386-only */ --#pragma aux SDL_Swap32 = \ -- "xchg al, ah" \ -- "ror eax, 16" \ -- "xchg al, ah" \ -- parm [eax] \ -- modify [eax]; --#endif +-#elif defined(_MSC_VER) +-#pragma intrinsic(_byteswap_ulong) +-#define SDL_Swap32(x) _byteswap_ulong(x) -#else --SDL_FORCE_INLINE Uint32 --SDL_Swap32(Uint32 x) --{ + SDL_FORCE_INLINE Uint32 + SDL_Swap32(Uint32 x) + { - return SDL_static_cast(Uint32, ((x << 24) | ((x << 8) & 0x00FF0000) | - ((x >> 8) & 0x0000FF00) | (x >> 24))); --} ++ return bswap_32(x); + } -#endif --#if defined(__GNUC__) && defined(__i386__) +-#if (defined(__clang__) && (__clang_major__ > 2 || (__clang_major__ == 2 && __clang_minor__ >= 6))) || \ +- (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))) +-#define SDL_Swap64(x) __builtin_bswap64(x) +-#elif defined(__GNUC__) && defined(__i386__) && \ +- !(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */) -SDL_FORCE_INLINE Uint64 -SDL_Swap64(Uint64 x) -{ -- union -- { -- struct -- { +- union { +- struct { - Uint32 a, b; - } s; - Uint64 u; - } v; - v.u = x; -- __asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1": "=r"(v.s.a), "=r"(v.s.b):"0"(v.s.a), -- "1"(v.s. -- b)); +- __asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1" +- : "=r"(v.s.a), "=r"(v.s.b) +- : "0" (v.s.a), "1"(v.s.b)); - return v.u; -} -#elif defined(__GNUC__) && defined(__x86_64__) --SDL_FORCE_INLINE Uint64 --SDL_Swap64(Uint64 x) --{ -- __asm__("bswapq %0": "=r"(x):"0"(x)); -- return x; --} --#else SDL_FORCE_INLINE Uint64 SDL_Swap64(Uint64 x) { +- __asm__("bswapq %0": "=r"(x):"0"(x)); +- return x; ++ return bswap_64(x); + } +-#elif defined(__WATCOMC__) && defined(__386__) +-extern _inline Uint64 SDL_Swap64(Uint64); +-#pragma aux SDL_Swap64 = \ +- "bswap eax" \ +- "bswap edx" \ +- "xchg eax,edx" \ +- parm [eax edx] \ +- modify [eax edx]; +-#elif defined(_MSC_VER) +-#pragma intrinsic(_byteswap_uint64) +-#define SDL_Swap64(x) _byteswap_uint64(x) +-#else +-SDL_FORCE_INLINE Uint64 +-SDL_Swap64(Uint64 x) +-{ - Uint32 hi, lo; - - /* Separate into high and low 32-bit values and swap them */ @@ -189,8 +229,7 @@ Index: SDL2-2.0.12/include/SDL_endian.h - x <<= 32; - x |= SDL_Swap32(hi); - return (x); -+ return bswap_64(x); - } +-} -#endif - diff --git a/SDL2.changes b/SDL2.changes index 05c674d..ef95700 100644 --- a/SDL2.changes +++ b/SDL2.changes @@ -1,3 +1,20 @@ +------------------------------------------------------------------- +Wed Aug 11 15:31:36 UTC 2021 - kh Lai + +- sdl2-fix-wayland-fullscreen.patch + * fix wayland issue for wlroot, see https://github.com/libsdl-org/SDL/pull/4629 + +------------------------------------------------------------------- +Wed Aug 11 10:12:03 UTC 2021 - Jan Engelhardt + +- Update to release 2.0.16 + * Better native Wayland support, including handling for + client-side decorations and other functionality in place. + * Support for being able to directly interface with PipeWire for + audio input/output, a variety of new APIs, support for the + Amazon Luna game controller, rumble support for more + controllers. + ------------------------------------------------------------------- Wed Dec 23 10:47:09 UTC 2020 - Dirk Müller diff --git a/SDL2.spec b/SDL2.spec index 244bd34..15104d9 100644 --- a/SDL2.spec +++ b/SDL2.spec @@ -1,7 +1,7 @@ # # spec file for package SDL2 # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,7 +19,7 @@ %define sle_version 0 Name: SDL2 %define lname libSDL2-2_0-0 -Version: 2.0.14 +Version: 2.0.16 Release: 0 Summary: Simple DirectMedia Layer Library License: Zlib @@ -33,8 +33,8 @@ Source4: baselibs.conf Patch1: sdl2-symvers.patch Patch2: SDL2-endian.patch Patch3: sdl2-khronos.patch +Patch4: sdl2-fix-wayland-fullscreen.patch BuildRequires: cmake -BuildRequires: dos2unix BuildRequires: gcc-c++ BuildRequires: nasm BuildRequires: pkg-config @@ -110,13 +110,7 @@ library. %prep %autosetup -p1 -dos2unix WhatsNew.txt -dos2unix TODO.txt -dos2unix BUGS.txt -dos2unix README-SDL.txt -dos2unix README.txt -dos2unix CREDITS.txt -dos2unix COPYING.txt +perl -i -pe 's{\r\n}{\n}g' *.txt %build %global _lto_cflags %{_lto_cflags} -ffat-lto-objects @@ -131,7 +125,7 @@ dos2unix COPYING.txt %endif --enable-sse3=no --disable-rpath --disable-3dnow \ CFLAGS="%optflags -fcommon" -make %{?_smp_mflags} V=1 +%make_build %install %make_install @@ -146,12 +140,12 @@ rm -fv "%buildroot/%_libdir/libSDL2.a" "%buildroot/%_libdir/libSDL2_test.a" %postun -n %lname -p /sbin/ldconfig %files -n %lname -%license COPYING.txt -%doc BUGS.txt CREDITS.txt README.txt README-SDL.txt +%license LICENSE.txt +%doc README.md README-SDL.txt %_libdir/libSDL2-2*.so.* %files -n libSDL2-devel -%doc TODO.txt WhatsNew.txt +%doc WhatsNew.txt %_bindir/sdl2-config %_libdir/libSDL2.so %_includedir/SDL2/ diff --git a/sdl2-fix-wayland-fullscreen.patch b/sdl2-fix-wayland-fullscreen.patch new file mode 100644 index 0000000..cb89205 --- /dev/null +++ b/sdl2-fix-wayland-fullscreen.patch @@ -0,0 +1,33 @@ +From ae7ee2a59c8d41d67c6bc80f25b6e52670dddbbf Mon Sep 17 00:00:00 2001 +From: Ethan Lee +Date: Wed, 11 Aug 2021 09:59:43 -0400 +References: https://github.com/libsdl-org/SDL/pull/4629 +Subject: [PATCH] wayland: Ignore stateless/sizeless configs when starting in + fullscreen mode + +--- + src/video/wayland/SDL_waylandwindow.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +Index: SDL2-2.0.16/src/video/wayland/SDL_waylandwindow.c +=================================================================== +--- SDL2-2.0.16.orig/src/video/wayland/SDL_waylandwindow.c ++++ SDL2-2.0.16/src/video/wayland/SDL_waylandwindow.c +@@ -219,9 +219,15 @@ handle_configure_xdg_toplevel(void *data + + /* Foolishly do what the compositor says here. If it's wrong, don't + * blame us, we were explicitly instructed to do this. ++ * ++ * UPDATE: Nope, we can't actually do that, the compositor may give ++ * us a completely stateless, sizeless configure, with which we have ++ * to enforce our own state anyway. + */ +- window->w = width; +- window->h = height; ++ if (width != 0 && height != 0) { ++ window->w = width; ++ window->h = height; ++ } + + /* This part is good though. */ + if (window->flags & SDL_WINDOW_ALLOW_HIGHDPI) { diff --git a/sdl2-symvers.patch b/sdl2-symvers.patch index d14463f..b02cd89 100644 --- a/sdl2-symvers.patch +++ b/sdl2-symvers.patch @@ -8,11 +8,11 @@ some symvers so that zypper knows when to upgrade SDL. sdl2.sym | 124 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 125 insertions(+), 1 deletion(-) -Index: SDL2-2.0.10/Makefile.in +Index: SDL2-2.0.16/Makefile.in =================================================================== ---- SDL2-2.0.10.orig/Makefile.in -+++ SDL2-2.0.10/Makefile.in -@@ -125,7 +125,7 @@ LT_AGE = @LT_AGE@ +--- SDL2-2.0.16.orig/Makefile.in ++++ SDL2-2.0.16/Makefile.in +@@ -132,7 +132,7 @@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ @@ -21,10 +21,10 @@ Index: SDL2-2.0.10/Makefile.in all: $(srcdir)/configure Makefile $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET) $(objects)/$(SDLTEST_TARGET) -Index: SDL2-2.0.10/sdl2.sym +Index: SDL2-2.0.16/sdl2.sym =================================================================== --- /dev/null -+++ SDL2-2.0.10/sdl2.sym ++++ SDL2-2.0.16/sdl2.sym @@ -0,0 +1,124 @@ +SUSE_2.0.5 { +global: