SHA256
1
0
forked from jengelh/SDL2

Accepting request 911480 from games

- Update to release 2.0.16

OBS-URL: https://build.opensuse.org/request/show/911480
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/SDL2?expand=0&rev=33
This commit is contained in:
Richard Brown 2021-08-16 08:08:54 +00:00 committed by Git OBS Bridge
commit 0c1be38eeb
9 changed files with 163 additions and 80 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d8215b571a581be1332d2106f8036fcb03d12a70bae01e20f424976d275432bc
size 6089974

Binary file not shown.

3
SDL2-2.0.16.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:65be9ff6004034b5b2ce9927b5a4db1814930f169c4b2dae0a1e4697075f287b
size 7227262

BIN
SDL2-2.0.16.tar.gz.sig Normal file

Binary file not shown.

View File

@ -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 <endian.h>
-#define SDL_BYTEORDER BYTE_ORDER
-#elif defined(__FreeBSD__) || defined(__NetBSD__)
-#include <sys/endian.h>
-#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));
- 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
-

View File

@ -1,3 +1,20 @@
-------------------------------------------------------------------
Wed Aug 11 15:31:36 UTC 2021 - kh Lai <dlshcbmuipmam@hotmail.com>
- 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 <jengelh@inai.de>
- 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 <dmueller@suse.com>

View File

@ -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/

View File

@ -0,0 +1,33 @@
From ae7ee2a59c8d41d67c6bc80f25b6e52670dddbbf Mon Sep 17 00:00:00 2001
From: Ethan Lee <flibitijibibo@gmail.com>
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) {

View File

@ -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: