mirror of
https://abf.rosa.ru/djam/SDL2.git
synced 2025-04-21 04:14:39 +00:00
Set library major version to 0 (same as when using configure instead of cmake as Fedora does)
Add some bugfix patches from Fedora
This commit is contained in:
parent
0d66135b98
commit
31f3ad4b28
4 changed files with 107 additions and 2 deletions
45
SDL2-2.0.5-null-deref.patch
Normal file
45
SDL2-2.0.5-null-deref.patch
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
|
||||||
|
# HG changeset patch
|
||||||
|
# User Sam Lantinga <slouken@libsdl.org>
|
||||||
|
# Date 1477183983 25200
|
||||||
|
# Node ID fbf9b0e3589a1f88e2eefbbeb3b632e2da795fde
|
||||||
|
# Parent 5184186d4366169617b434f5b71c618a7035cde4
|
||||||
|
Fixed NULL pointer dereference, thanks Ozkan Sezer
|
||||||
|
|
||||||
|
diff -r 5184186d4366 -r fbf9b0e3589a src/video/SDL_blit_N.c
|
||||||
|
--- a/src/video/SDL_blit_N.c Sat Oct 22 11:01:55 2016 -0700
|
||||||
|
+++ b/src/video/SDL_blit_N.c Sat Oct 22 17:53:03 2016 -0700
|
||||||
|
@@ -125,11 +125,7 @@
|
||||||
|
0x0C);
|
||||||
|
vector unsigned char vswiz;
|
||||||
|
vector unsigned int srcvec;
|
||||||
|
-#define RESHIFT(X) (3 - ((X) >> 3))
|
||||||
|
- Uint32 rmask = RESHIFT(srcfmt->Rshift) << (dstfmt->Rshift);
|
||||||
|
- Uint32 gmask = RESHIFT(srcfmt->Gshift) << (dstfmt->Gshift);
|
||||||
|
- Uint32 bmask = RESHIFT(srcfmt->Bshift) << (dstfmt->Bshift);
|
||||||
|
- Uint32 amask;
|
||||||
|
+ Uint32 rmask, gmask, bmask, amask;
|
||||||
|
|
||||||
|
if (!srcfmt) {
|
||||||
|
srcfmt = &default_pixel_format;
|
||||||
|
@@ -138,6 +134,11 @@
|
||||||
|
dstfmt = &default_pixel_format;
|
||||||
|
}
|
||||||
|
|
||||||
|
+#define RESHIFT(X) (3 - ((X) >> 3))
|
||||||
|
+ rmask = RESHIFT(srcfmt->Rshift) << (dstfmt->Rshift);
|
||||||
|
+ gmask = RESHIFT(srcfmt->Gshift) << (dstfmt->Gshift);
|
||||||
|
+ bmask = RESHIFT(srcfmt->Bshift) << (dstfmt->Bshift);
|
||||||
|
+
|
||||||
|
/* Use zero for alpha if either surface doesn't have alpha */
|
||||||
|
if (dstfmt->Amask) {
|
||||||
|
amask =
|
||||||
|
@@ -149,6 +150,7 @@
|
||||||
|
0xFFFFFFFF);
|
||||||
|
}
|
||||||
|
#undef RESHIFT
|
||||||
|
+
|
||||||
|
((unsigned int *) (char *) &srcvec)[0] = (rmask | gmask | bmask | amask);
|
||||||
|
vswiz = vec_add(plus, (vector unsigned char) vec_splat(srcvec, 0));
|
||||||
|
return (vswiz);
|
||||||
|
|
45
SDL2-2.0.5-ppc.patch
Normal file
45
SDL2-2.0.5-ppc.patch
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
|
||||||
|
# HG changeset patch
|
||||||
|
# User Sam Lantinga <slouken@libsdl.org>
|
||||||
|
# Date 1477159315 25200
|
||||||
|
# Node ID 5184186d4366169617b434f5b71c618a7035cde4
|
||||||
|
# Parent 71d4148e32de5088c4bc2f04c1e5ded647a2bf82
|
||||||
|
Fixed bug 3466 - Can't build 2.0.5 on ppc64
|
||||||
|
|
||||||
|
/home/fedora/SDL2-2.0.5/src/video/SDL_blit_N.c: In function 'calc_swizzle32':
|
||||||
|
/home/fedora/SDL2-2.0.5/src/video/SDL_blit_N.c:127:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
|
||||||
|
const vector unsigned char plus = VECUINT8_LITERAL(0x00, 0x00, 0x00, 0x00,
|
||||||
|
^
|
||||||
|
|
||||||
|
diff -r 71d4148e32de -r 5184186d4366 src/video/SDL_blit_N.c
|
||||||
|
--- a/src/video/SDL_blit_N.c Wed Oct 19 21:22:42 2016 -0700
|
||||||
|
+++ b/src/video/SDL_blit_N.c Sat Oct 22 11:01:55 2016 -0700
|
||||||
|
@@ -118,12 +118,6 @@
|
||||||
|
16, 8, 0, 24,
|
||||||
|
0, NULL
|
||||||
|
};
|
||||||
|
- if (!srcfmt) {
|
||||||
|
- srcfmt = &default_pixel_format;
|
||||||
|
- }
|
||||||
|
- if (!dstfmt) {
|
||||||
|
- dstfmt = &default_pixel_format;
|
||||||
|
- }
|
||||||
|
const vector unsigned char plus = VECUINT8_LITERAL(0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x04, 0x04, 0x04, 0x04,
|
||||||
|
0x08, 0x08, 0x08, 0x08,
|
||||||
|
@@ -136,6 +130,14 @@
|
||||||
|
Uint32 gmask = RESHIFT(srcfmt->Gshift) << (dstfmt->Gshift);
|
||||||
|
Uint32 bmask = RESHIFT(srcfmt->Bshift) << (dstfmt->Bshift);
|
||||||
|
Uint32 amask;
|
||||||
|
+
|
||||||
|
+ if (!srcfmt) {
|
||||||
|
+ srcfmt = &default_pixel_format;
|
||||||
|
+ }
|
||||||
|
+ if (!dstfmt) {
|
||||||
|
+ dstfmt = &default_pixel_format;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
/* Use zero for alpha if either surface doesn't have alpha */
|
||||||
|
if (dstfmt->Amask) {
|
||||||
|
amask =
|
||||||
|
|
12
SDL2-2.0.5-soversion.patch
Normal file
12
SDL2-2.0.5-soversion.patch
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
diff -urN SDL2-2.0.5/CMakeLists.txt SDL2-2.0.5-patched/CMakeLists.txt
|
||||||
|
--- SDL2-2.0.5/CMakeLists.txt 2016-10-20 13:56:26.000000000 +1000
|
||||||
|
+++ SDL2-2.0.5-patched/CMakeLists.txt 2017-02-27 20:03:11.662196288 +1000
|
||||||
|
@@ -1541,7 +1541,7 @@
|
||||||
|
if(UNIX)
|
||||||
|
set_target_properties(SDL2 PROPERTIES
|
||||||
|
VERSION ${LT_VERSION}
|
||||||
|
- SOVERSION ${LT_REVISION}
|
||||||
|
+ SOVERSION 0
|
||||||
|
OUTPUT_NAME "SDL2-${LT_RELEASE}")
|
||||||
|
else()
|
||||||
|
set_target_properties(SDL2 PROPERTIES
|
|
@ -1,19 +1,22 @@
|
||||||
%define oversion 0.4.1
|
%define oversion 0.4.1
|
||||||
|
|
||||||
%define api 2.0
|
%define api 2.0
|
||||||
%define major 1
|
%define major 0
|
||||||
%define libname %mklibname %{name}_ %{api} %{major}
|
%define libname %mklibname %{name}_ %{api} %{major}
|
||||||
%define devname %mklibname %{name} -d
|
%define devname %mklibname %{name} -d
|
||||||
|
|
||||||
Summary: Simple DirectMedia Layer
|
Summary: Simple DirectMedia Layer
|
||||||
Name: SDL2
|
Name: SDL2
|
||||||
Version: 2.0.5
|
Version: 2.0.5
|
||||||
Release: 2
|
Release: 3
|
||||||
License: Zlib
|
License: Zlib
|
||||||
Group: System/Libraries
|
Group: System/Libraries
|
||||||
Url: http://www.libsdl.org/
|
Url: http://www.libsdl.org/
|
||||||
Source0: http://www.libsdl.org/release/%{name}-%{version}.tar.gz
|
Source0: http://www.libsdl.org/release/%{name}-%{version}.tar.gz
|
||||||
Patch0: SDL2-2.0.3-cmake.patch
|
Patch0: SDL2-2.0.3-cmake.patch
|
||||||
|
Patch1: SDL2-2.0.5-soversion.patch
|
||||||
|
Patch2: SDL2-2.0.5-ppc.patch
|
||||||
|
Patch3: SDL2-2.0.5-null-deref.patch
|
||||||
BuildRequires: cmake
|
BuildRequires: cmake
|
||||||
BuildRequires: nas-devel
|
BuildRequires: nas-devel
|
||||||
BuildRequires: pkgconfig(alsa)
|
BuildRequires: pkgconfig(alsa)
|
||||||
|
|
Loading…
Add table
Reference in a new issue