SHA256
1
0
forked from jengelh/SDL2

- Update to release 2.0.18

OBS-URL: https://build.opensuse.org/package/show/games/SDL2?expand=0&rev=113
This commit is contained in:
Jan Engelhardt 2021-11-30 17:49:35 +00:00 committed by Git OBS Bridge
parent d844206ec2
commit 824bbb56d3
9 changed files with 44 additions and 328 deletions

View File

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

Binary file not shown.

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

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

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

Binary file not shown.

View File

@ -1,237 +0,0 @@
From: crrodriguez@opensuse.org
Date: Fri May 11 11:08:39 UTC 2018
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.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
*/
/* @{ */
-#define SDL_LIL_ENDIAN 1234
-#define SDL_BIG_ENDIAN 4321
+#define SDL_LIL_ENDIAN __ORDER_LITTLE_ENDIAN__
+#define SDL_BIG_ENDIAN __ORDER_BIG_ENDIAN__
/* @} */
#ifndef SDL_BYTEORDER /* Not defined in SDL_config.h? */
-#ifdef __linux__
-#include <endian.h>
-#define SDL_BYTEORDER __BYTE_ORDER
-#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) || \
- (defined(__MIPS__) && defined(__MIPSEB__)) || \
- defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || \
- defined(__sparc__)
-#define SDL_BYTEORDER SDL_BIG_ENDIAN
-#else
-#define SDL_BYTEORDER SDL_LIL_ENDIAN
-#endif
-#endif /* __linux__ */
+#define SDL_BYTEORDER __BYTE_ORDER__
#endif /* !SDL_BYTEORDER */
#include "begin_code.h"
+#include <byteswap.h>
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
@@ -91,180 +73,23 @@ extern "C" {
/**
* \file SDL_endian.h
*/
-#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;
-}
-#elif defined(__GNUC__) && defined(__x86_64__)
-SDL_FORCE_INLINE Uint16
-SDL_Swap16(Uint16 x)
-{
- __asm__("xchgb %b0,%h0": "=Q"(x):"0"(x));
- return x;
-}
-#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
-SDL_FORCE_INLINE Uint16
-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(__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 = \
- "xchg al, ah" \
- parm [ax] \
- modify [ax];
-#else
-SDL_FORCE_INLINE Uint16
-SDL_Swap16(Uint16 x)
-{
- return SDL_static_cast(Uint16, ((x << 8) | (x >> 8)));
-}
-#endif
-
-#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_16(x);
}
-#elif defined(__GNUC__) && defined(__x86_64__)
-SDL_FORCE_INLINE Uint32
-SDL_Swap32(Uint32 x)
-{
- __asm__("bswapl %0": "=r"(x):"0"(x));
- return x;
-}
-#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
-SDL_FORCE_INLINE Uint32
-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(__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)
-{
- __asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0": "=d"(x): "0"(x):"cc");
- return x;
-}
-#elif defined(__WATCOMC__) && defined(__386__)
-extern _inline Uint32 SDL_Swap32(Uint32);
-#pragma aux SDL_Swap32 = \
- "bswap eax" \
- parm [eax] \
- modify [eax];
-#elif defined(_MSC_VER)
-#pragma intrinsic(_byteswap_ulong)
-#define SDL_Swap32(x) _byteswap_ulong(x)
-#else
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(__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 {
- 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));
- 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;
+ 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 */
- lo = SDL_static_cast(Uint32, x & 0xFFFFFFFF);
- x >>= 32;
- hi = SDL_static_cast(Uint32, x & 0xFFFFFFFF);
- x = SDL_Swap32(lo);
- x <<= 32;
- x |= SDL_Swap32(hi);
- return (x);
-}
-#endif
-
SDL_FORCE_INLINE float
SDL_SwapFloat(float x)

View File

@ -1,3 +1,42 @@
-------------------------------------------------------------------
Tue Nov 30 17:30:02 UTC 2021 - Jan Engelhardt <jengelh@inai.de>
- Update to release 2.0.18
* Added SDL_RenderGeometry() and SDL_RenderGeometryRaw() to
allow rendering of arbitrary shapes using the SDL 2D render
API.
* Added SDL_SetTextureUserData() and SDL_GetTextureUserData()
to associate application data with an SDL texture.
* Added SDL_RenderWindowToLogical() and
SDL_RenderLogicalToWindow() to convert between window
coordinates and logical render coordinates.
* Added SDL_RenderSetVSync() to change whether a renderer
present is synchronized with vblank at runtime.
* Added SDL_PremultiplyAlpha() to premultiply alpha on a block
of SDL_PIXELFORMAT_ARGB8888 pixels.
* Added a window event SDL_WINDOWEVENT_DISPLAY_CHANGED which is
sent when a window changes what display it is centered on.
* Added SDL_GetWindowICCProfile() to query a window's ICC
profile, and a window event SDL_WINDOWEVENT_ICCPROF_CHANGED
that is sent when it changes.
* Added the hint SDL_HINT_VIDEO_EGL_ALLOW_TRANSPARENCY to allow
EGL windows to be transparent instead of opaque.
* Added SDL_SetWindowMouseRect() and SDL_GetWindowMouseRect()
to confine the mouse cursor to an area of a window.
* You can now read precise mouse wheel motion using 'preciseX'
and 'preciseY' event fields.
* Added SDL_GameControllerHasRumble() and
SDL_GameControllerHasRumbleTriggers() to query whether a game
controller supports rumble.
* Added SDL_JoystickHasRumble() and
SDL_JoystickHasRumbleTriggers() to query whether a joystick
supports rumble.
* SDL's hidapi implementation is now available as a public API
in SDL_hidapi.h.
- Drop SDL2-endian.patch (inapplicable),
sdl2-fix-wayland-fullscreen.patch (merged),
audio-Support-pulse-as-an-alias-for-pulseaudio.patch (merged)
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Nov 8 12:52:16 CET 2021 - tiwai@suse.de Mon Nov 8 12:52:16 CET 2021 - tiwai@suse.de

View File

@ -19,7 +19,7 @@
%define sle_version 0 %define sle_version 0
Name: SDL2 Name: SDL2
%define lname libSDL2-2_0-0 %define lname libSDL2-2_0-0
Version: 2.0.16 Version: 2.0.18
Release: 0 Release: 0
Summary: Simple DirectMedia Layer Library Summary: Simple DirectMedia Layer Library
License: Zlib License: Zlib
@ -31,10 +31,7 @@ Source2: http://libsdl.org/release/%name-%version.tar.gz.sig
Source3: %name.keyring Source3: %name.keyring
Source4: baselibs.conf Source4: baselibs.conf
Patch1: sdl2-symvers.patch Patch1: sdl2-symvers.patch
Patch2: SDL2-endian.patch
Patch3: sdl2-khronos.patch Patch3: sdl2-khronos.patch
Patch4: sdl2-fix-wayland-fullscreen.patch
Patch5: audio-Support-pulse-as-an-alias-for-pulseaudio.patch
BuildRequires: cmake BuildRequires: cmake
BuildRequires: gcc-c++ BuildRequires: gcc-c++
BuildRequires: nasm BuildRequires: nasm
@ -55,11 +52,9 @@ BuildRequires: pkgconfig(ice)
# KMS/DRM driver needs libdrm and libgbm # KMS/DRM driver needs libdrm and libgbm
BuildRequires: pkgconfig(gbm) >= 9.0.0 BuildRequires: pkgconfig(gbm) >= 9.0.0
BuildRequires: pkgconfig(libdrm) >= 2.4.46 BuildRequires: pkgconfig(libdrm) >= 2.4.46
%if 0%{?suse_version} > 1220
BuildRequires: pkgconfig(tslib)
%endif
BuildRequires: pkgconfig(libpulse-simple) >= 0.9 BuildRequires: pkgconfig(libpulse-simple) >= 0.9
BuildRequires: pkgconfig(libudev) BuildRequires: pkgconfig(libudev)
BuildRequires: pkgconfig(tslib)
BuildRequires: pkgconfig(udev) BuildRequires: pkgconfig(udev)
BuildRequires: pkgconfig(wayland-client) BuildRequires: pkgconfig(wayland-client)
BuildRequires: pkgconfig(wayland-cursor) BuildRequires: pkgconfig(wayland-cursor)

View File

@ -1,48 +0,0 @@
From 3261f7f6ceaaa435a3aca0252b2f7126eeae1bb2 Mon Sep 17 00:00:00 2001
From: David Gow <david@ingeniumdigital.com>
Date: Thu, 26 Aug 2021 16:15:30 +0800
Subject: [PATCH] audio: Support "pulse" as an alias for "pulseaudio"
Originally, SDL 1.2 used "pulse" as the name for its PulseAudio driver.
While it now supports "pulseaudio" as well for compatibility with SDL
2.0 [1], there are still scripts and distro packages which set
SDL_AUDIODRIVER=pulse [2]. While it's possible to remove this in most
circumstances or replace it with "pulseaudio" or a comma-separated list,
this may still conflict if the environment variable is set globally and
old binary builds of SDL 1.2 (e.g. packaged with older games) are being
used.
To fix this on SDL 2.0, add a hardcoded check for "pulse" as an audio
driver name, and replace it with "pulseaudio". This mimics what SDL 1.2
does (but in reverse). Note that setting driver_attempt{,_len} is safe
here as they're reset correctly based on driver_attempt_end on the next
loop.
[1] https://github.com/libsdl-org/SDL-1.2/commit/d9514097846381cd30fe08df65dbdd48de92a058
[2] https://bugzilla.opensuse.org/show_bug.cgi?id=1189778
---
src/audio/SDL_audio.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/audio/SDL_audio.c b/src/audio/SDL_audio.c
index 69cddd535369..972207d366f4 100644
--- a/src/audio/SDL_audio.c
+++ b/src/audio/SDL_audio.c
@@ -978,6 +978,14 @@ SDL_AudioInit(const char *driver_name)
const char *driver_attempt_end = SDL_strchr(driver_attempt, ',');
size_t driver_attempt_len = (driver_attempt_end != NULL) ? (driver_attempt_end - driver_attempt)
: SDL_strlen(driver_attempt);
+#if SDL_AUDIO_DRIVER_PULSEAUDIO
+ /* SDL 1.2 uses the name "pulse", so we'll support both. */
+ if (driver_attempt_len == SDL_strlen("pulse") &&
+ (SDL_strncasecmp(driver_attempt, "pulse", driver_attempt_len) == 0)) {
+ driver_attempt = "pulseaudio";
+ driver_attempt_len = SDL_strlen("pulseaudio");
+ }
+#endif
for (i = 0; bootstrap[i]; ++i) {
if ((driver_attempt_len == SDL_strlen(bootstrap[i]->name)) &&
--
2.26.2

View File

@ -1,33 +0,0 @@
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) {