SHA256
1
0
forked from pool/SDL2

Accepting request 534295 from games

- Disable SSE3 (and also SSE2 on ix86) to prevent crashes on older
  CPUs that don't support these instructions (forwarded request 534284 from wolfi323)

OBS-URL: https://build.opensuse.org/request/show/534295
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/SDL2?expand=0&rev=17
This commit is contained in:
Dominique Leuenberger 2017-10-16 23:50:32 +00:00 committed by Git OBS Bridge
commit 437a5bdc60
8 changed files with 99 additions and 256 deletions

View File

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

Binary file not shown.

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

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

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

Binary file not shown.

View File

@ -1,3 +1,53 @@
-------------------------------------------------------------------
Mon Oct 16 16:31:47 UTC 2017 - wbauer@tmo.at
- Disable SSE3 (and also SSE2 on ix86) to prevent crashes on older
CPUs that don't support these instructions
-------------------------------------------------------------------
Mon Oct 2 19:11:12 UTC 2017 - jengelh@inai.de
- Add dbus.diff
-------------------------------------------------------------------
Mon Oct 2 10:06:41 UTC 2017 - guillaume@opensuse.org
- Enable KMS/DRM video driver
-------------------------------------------------------------------
Sat Sep 30 16:54:04 UTC 2017 - spartanj@gmail.com
- Update to new upstream release 2.0.6
* Added Vulkan graphics support in SDL_vulkan.h.
* Added SDL_ComposeCustomBlendMode() to create custom blend
modes for 2D rendering.
* Added support for many game controllers, including the
Nintendo Switch Pro Controller.
* Added support for inverted axes and separate axis directions
in game controller mappings.
* Added functions to return information about joysticks and
open game controllers.
* Added SDL_GameControllerNumMappings() and
SDL_GameControllerMappingForIndex() to be able to enumerate
the built-in game controller mappings.
* Added SDL_LoadFile() and SDL_LoadFile_RW() to load a file
into memory.
* Added SDL_DuplicateSurface() to make a copy of a surface.
* Added an experimental JACK audio driver.
* Implemented non-power-of-two audio resampling.
* Added the hint SDL_HINT_AUDIO_RESAMPLING_MODE to control the
quality of resampling.
* Added the hint SDL_HINT_RENDER_LOGICAL_SIZE_MODE to control
the scaling policy for SDL_RenderSetLogicalSize().
* Added the hints SDL_HINT_MOUSE_NORMAL_SPEED_SCALE and
SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE to scale the mouse speed
when being read from raw mouse input.
* Added the hint SDL_HINT_TOUCH_MOUSE_EVENTS to control whether
SDL will synthesize mouse events from touch events.
* Added an experimental KMS/DRM video driver for embedded
development.
- Remove dbus-ime.diff (no longer needed)
-------------------------------------------------------------------
Tue Aug 1 13:14:45 UTC 2017 - fcrozat@suse.com

View File

@ -18,7 +18,7 @@
Name: SDL2
%define lname libSDL2-2_0-0
Version: 2.0.5
Version: 2.0.6
Release: 0
Summary: Simple DirectMedia Layer Library
License: Zlib
@ -30,8 +30,8 @@ Source: http://libsdl.org/release/%name-%version.tar.gz
Source2: http://libsdl.org/release/%name-%version.tar.gz.sig
Source3: %name.keyring
Source4: baselibs.conf
Patch1: %{name}-ppc64-declaration-after-statement.patch
Patch2: dbus-ime.diff
Patch1: dbus.diff
Patch2: %name-ppc64-declaration-after-statement.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: cmake
BuildRequires: dos2unix
@ -43,33 +43,32 @@ BuildRequires: pkgconfig(dbus-1)
%if !0%{?sle_version}
BuildRequires: pkgconfig(fcitx)
%endif
BuildRequires: pkgconfig(egl)
BuildRequires: pkgconfig(gl)
BuildRequires: pkgconfig(glesv1_cm)
BuildRequires: pkgconfig(glesv2)
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(glu)
BuildRequires: pkgconfig(ibus-1.0)
%if 0%{?suse_version} > 1120
BuildRequires: pkgconfig(egl)
BuildRequires: pkgconfig(glesv1_cm)
BuildRequires: pkgconfig(glesv2)
%endif
BuildRequires: pkgconfig(ice)
# KMS/DRM driver needs libdrm and libgbm
BuildRequires: pkgconfig(gbm) >= 9.0.0
BuildRequires: pkgconfig(libdrm) >= 2.4.46
%if 0%{?suse_version} > 1220
BuildRequires: pkgconfig(tslib)
%endif
BuildRequires: pkgconfig(x11)
%if 0%{?suse_version} > 1120
BuildRequires: pkgconfig(xcursor)
BuildRequires: pkgconfig(xinerama)
BuildRequires: pkgconfig(xrandr)
BuildRequires: pkgconfig(xscrnsaver)
BuildRequires: pkgconfig(xxf86vm)
%endif
BuildRequires: pkgconfig(libpulse-simple) >= 0.9
BuildRequires: pkgconfig(libudev)
BuildRequires: pkgconfig(udev)
BuildRequires: pkgconfig(wayland-server)
BuildRequires: pkgconfig(x11)
BuildRequires: pkgconfig(xcursor)
BuildRequires: pkgconfig(xext)
BuildRequires: pkgconfig(xi)
BuildRequires: pkgconfig(xinerama)
BuildRequires: pkgconfig(xrandr)
BuildRequires: pkgconfig(xscrnsaver)
BuildRequires: pkgconfig(xxf86vm)
%description
This is the "Simple DirectMedia Layer" library. It provides a generic
@ -106,10 +105,10 @@ library.
%prep
%setup -q
%ifarch ppc64 ppc64le
%patch -P 1 -p1
%endif
%ifarch ppc64 ppc64le
%patch -P 2 -p1
%endif
dos2unix WhatsNew.txt
dos2unix TODO.txt
dos2unix BUGS.txt
@ -120,13 +119,16 @@ dos2unix COPYING.txt
%build
# In this instance, we do want --with-pic because of libSDL2main.a.
%configure --with-pic \
%configure --with-pic --disable-alsa-shared --disable-video-directfb \
--enable-video-kmsdrm \
%if 0%{?sle_version}
--disable-fcitx \
--disable-fcitx \
%endif
--disable-rpath \
--disable-alsa-shared \
--disable-video-directfb
%ifarch ix86
--enable-sse2=no \
%endif
--enable-sse3=no \
--disable-rpath
make %{?_smp_mflags} V=1
%install

View File

@ -1,230 +0,0 @@
# HG changeset patch
# User Alex Baines <alex@abaines.me.uk>
# Date 1477614538 -3600
# Node ID b48d8a98e2618a6b4fd45aa2aab290ba4eb113c2
# Parent 35fee69e84dfd745ef34e392e481f9088aeff70c
Fix double events / no repeat flag on key events when built withoutibus/fcitx
Uses XkbSetDetectableKeyRepeat, and falls back to forcing @im=none if it's not
supported.
diff -r 35fee69e84df -r b48d8a98e261 src/video/x11/SDL_x11events.c
--- a/src/video/x11/SDL_x11events.c Fri Oct 28 17:00:37 2016 -0700
+++ b/src/video/x11/SDL_x11events.c Fri Oct 28 01:28:58 2016 +0100
@@ -568,14 +568,18 @@
printf("Filtered event type = %d display = %d window = %d\n",
xevent.type, xevent.xany.display, xevent.xany.window);
#endif
+ /* Make sure dead key press/release events are sent */
+ /* But only if we're using one of the DBus IMEs, otherwise
+ some XIM IMEs will generate duplicate events */
if (orig_keycode) {
- /* Make sure dead key press/release events are sent */
+#if defined(HAVE_IBUS_IBUS_H) || defined(HAVE_FCITX_FRONTEND_H)
SDL_Scancode scancode = videodata->key_layout[orig_keycode];
if (orig_event_type == KeyPress) {
SDL_SendKeyboardKey(SDL_PRESSED, scancode);
} else {
SDL_SendKeyboardKey(SDL_RELEASED, scancode);
}
+#endif
}
return;
}
diff -r 35fee69e84df -r b48d8a98e261 src/video/x11/SDL_x11keyboard.c
--- a/src/video/x11/SDL_x11keyboard.c Fri Oct 28 17:00:37 2016 -0700
+++ b/src/video/x11/SDL_x11keyboard.c Fri Oct 28 01:28:58 2016 +0100
@@ -33,6 +33,10 @@
#include "imKStoUCS.h"
+#ifdef X_HAVE_UTF8_STRING
+#include <locale.h>
+#endif
+
/* *INDENT-OFF* */
static const struct {
KeySym keysym;
@@ -262,19 +266,82 @@
int best_distance;
int best_index;
int distance;
-
+ BOOL xkb_repeat = 0;
+
X11_XAutoRepeatOn(data->display);
#if SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM
{
- int xkb_major = XkbMajorVersion;
- int xkb_minor = XkbMinorVersion;
- if (X11_XkbQueryExtension(data->display, NULL, NULL, NULL, &xkb_major, &xkb_minor)) {
- data->xkb = X11_XkbGetMap(data->display, XkbAllClientInfoMask, XkbUseCoreKbd);
- }
- }
+ int xkb_major = XkbMajorVersion;
+ int xkb_minor = XkbMinorVersion;
+
+ if (X11_XkbQueryExtension(data->display, NULL, NULL, NULL, &xkb_major, &xkb_minor)) {
+ data->xkb = X11_XkbGetMap(data->display, XkbAllClientInfoMask, XkbUseCoreKbd);
+ }
+
+ /* This will remove KeyRelease events for held keys */
+ X11_XkbSetDetectableAutoRepeat(data->display, True, &xkb_repeat);
+ }
#endif
+
+ /* Open a connection to the X input manager */
+#ifdef X_HAVE_UTF8_STRING
+ if (SDL_X11_HAVE_UTF8) {
+ /* Set the locale, and call XSetLocaleModifiers before XOpenIM so that
+ Compose keys will work correctly. */
+ char *prev_locale = setlocale(LC_ALL, NULL);
+ char *prev_xmods = X11_XSetLocaleModifiers(NULL);
+ const char *new_xmods = "";
+#if defined(HAVE_IBUS_IBUS_H) || defined(HAVE_FCITX_FRONTEND_H)
+ const char *env_xmods = SDL_getenv("XMODIFIERS");
+#endif
+ SDL_bool has_dbus_ime_support = SDL_FALSE;
+ if (prev_locale) {
+ prev_locale = SDL_strdup(prev_locale);
+ }
+
+ if (prev_xmods) {
+ prev_xmods = SDL_strdup(prev_xmods);
+ }
+
+ /* IBus resends some key events that were filtered by XFilterEvents
+ when it is used via XIM which causes issues. Prevent this by forcing
+ @im=none if XMODIFIERS contains @im=ibus. IBus can still be used via
+ the DBus implementation, which also has support for pre-editing. */
+#ifdef HAVE_IBUS_IBUS_H
+ if (env_xmods && SDL_strstr(env_xmods, "@im=ibus") != NULL) {
+ has_dbus_ime_support = SDL_TRUE;
+ }
+#endif
+#ifdef HAVE_FCITX_FRONTEND_H
+ if (env_xmods && SDL_strstr(env_xmods, "@im=fcitx") != NULL) {
+ has_dbus_ime_support = SDL_TRUE;
+ }
+#endif
+ if (has_dbus_ime_support || !xkb_repeat) {
+ new_xmods = "@im=none";
+ }
+
+ setlocale(LC_ALL, "");
+ X11_XSetLocaleModifiers(new_xmods);
+
+ data->im = X11_XOpenIM(data->display, NULL, data->classname, data->classname);
+
+ /* Reset the locale + X locale modifiers back to how they were,
+ locale first because the X locale modifiers depend on it. */
+ setlocale(LC_ALL, prev_locale);
+ X11_XSetLocaleModifiers(prev_xmods);
+
+ if (prev_locale) {
+ SDL_free(prev_locale);
+ }
+
+ if (prev_xmods) {
+ SDL_free(prev_xmods);
+ }
+ }
+#endif
/* Try to determine which scancodes are being used based on fingerprint */
best_distance = SDL_arraysize(fingerprint) + 1;
best_index = -1;
diff -r 35fee69e84df -r b48d8a98e261 src/video/x11/SDL_x11sym.h
--- a/src/video/x11/SDL_x11sym.h Fri Oct 28 17:00:37 2016 -0700
+++ b/src/video/x11/SDL_x11sym.h Fri Oct 28 01:28:58 2016 +0100
@@ -179,6 +179,7 @@
SDL_X11_SYM(Status,XkbGetUpdatedMap,(Display* a,unsigned int b,XkbDescPtr c),(a,b,c),return)
SDL_X11_SYM(XkbDescPtr,XkbGetMap,(Display* a,unsigned int b,unsigned int c),(a,b,c),return)
SDL_X11_SYM(void,XkbFreeClientMap,(XkbDescPtr a,unsigned int b, Bool c),(a,b,c),)
+SDL_X11_SYM(BOOL,XkbSetDetectableAutoRepeat,(Display* a, BOOL b, BOOL* c),(a,b,c),return)
#endif
#if NeedWidePrototypes
diff -r 35fee69e84df -r b48d8a98e261 src/video/x11/SDL_x11video.c
--- a/src/video/x11/SDL_x11video.c Fri Oct 28 17:00:37 2016 -0700
+++ b/src/video/x11/SDL_x11video.c Fri Oct 28 01:28:58 2016 +0100
@@ -39,10 +39,6 @@
#include "SDL_x11opengles.h"
#endif
-#ifdef X_HAVE_UTF8_STRING
-#include <locale.h>
-#endif
-
/* Initialization/Query functions */
static int X11_VideoInit(_THIS);
static void X11_VideoQuit(_THIS);
@@ -388,65 +384,6 @@
/* I have no idea how random this actually is, or has to be. */
data->window_group = (XID) (((size_t) data->pid) ^ ((size_t) _this));
- /* Open a connection to the X input manager */
-#ifdef X_HAVE_UTF8_STRING
- if (SDL_X11_HAVE_UTF8) {
- /* Set the locale, and call XSetLocaleModifiers before XOpenIM so that
- Compose keys will work correctly. */
- char *prev_locale = setlocale(LC_ALL, NULL);
- char *prev_xmods = X11_XSetLocaleModifiers(NULL);
- const char *new_xmods = "";
-#if defined(HAVE_IBUS_IBUS_H) || defined(HAVE_FCITX_FRONTEND_H)
- const char *env_xmods = SDL_getenv("XMODIFIERS");
-#endif
- SDL_bool has_dbus_ime_support = SDL_FALSE;
-
- if (prev_locale) {
- prev_locale = SDL_strdup(prev_locale);
- }
-
- if (prev_xmods) {
- prev_xmods = SDL_strdup(prev_xmods);
- }
-
- /* IBus resends some key events that were filtered by XFilterEvents
- when it is used via XIM which causes issues. Prevent this by forcing
- @im=none if XMODIFIERS contains @im=ibus. IBus can still be used via
- the DBus implementation, which also has support for pre-editing. */
-#ifdef HAVE_IBUS_IBUS_H
- if (env_xmods && SDL_strstr(env_xmods, "@im=ibus") != NULL) {
- has_dbus_ime_support = SDL_TRUE;
- }
-#endif
-#ifdef HAVE_FCITX_FRONTEND_H
- if (env_xmods && SDL_strstr(env_xmods, "@im=fcitx") != NULL) {
- has_dbus_ime_support = SDL_TRUE;
- }
-#endif
- if (has_dbus_ime_support) {
- new_xmods = "@im=none";
- }
-
- setlocale(LC_ALL, "");
- X11_XSetLocaleModifiers(new_xmods);
-
- data->im = X11_XOpenIM(data->display, NULL, data->classname, data->classname);
-
- /* Reset the locale + X locale modifiers back to how they were,
- locale first because the X locale modifiers depend on it. */
- setlocale(LC_ALL, prev_locale);
- X11_XSetLocaleModifiers(prev_xmods);
-
- if (prev_locale) {
- SDL_free(prev_locale);
- }
-
- if (prev_xmods) {
- SDL_free(prev_xmods);
- }
- }
-#endif
-
/* Look up some useful Atoms */
#define GET_ATOM(X) data->X = X11_XInternAtom(data->display, #X, False)
GET_ATOM(WM_PROTOCOLS);

21
dbus.diff Normal file
View File

@ -0,0 +1,21 @@
References: https://bugzilla.libsdl.org/show_bug.cgi?id=3854
Fix an assertion, triggered by libdbus receiving garbage
from a varargs function in SDL.
---
src/core/linux/SDL_ibus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: SDL2-2.0.6/src/core/linux/SDL_ibus.c
===================================================================
--- SDL2-2.0.6.orig/src/core/linux/SDL_ibus.c
+++ SDL2-2.0.6/src/core/linux/SDL_ibus.c
@@ -479,7 +479,7 @@ IBus_SimpleMessage(const char *method)
SDL_DBusContext *dbus = SDL_DBus_GetContext();
if (IBus_CheckConnection(dbus)) {
- SDL_DBus_CallVoidMethodOnConnection(ibus_conn, IBUS_SERVICE, input_ctx_path, IBUS_INPUT_INTERFACE, method);
+ SDL_DBus_CallVoidMethodOnConnection(ibus_conn, IBUS_SERVICE, input_ctx_path, IBUS_INPUT_INTERFACE, method, DBUS_TYPE_INVALID);
}
}