1 |
commit: 2fb0b1af8eaca82d0eef36eaa5de9145f5bc9919 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Sep 9 12:16:50 2022 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Sep 9 12:18:33 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2fb0b1af |
7 |
|
8 |
games-emulation/mupen64plus-core: Backport crash fix |
9 |
|
10 |
Closes: https://bugs.gentoo.org/869326 |
11 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
12 |
|
13 |
.../files/mupen64plus-core-2.5.9-pitch.patch | 29 +++++++++++++ |
14 |
...-r2.ebuild => mupen64plus-core-2.5.9-r3.ebuild} | 47 +++++++++++++--------- |
15 |
2 files changed, 57 insertions(+), 19 deletions(-) |
16 |
|
17 |
diff --git a/games-emulation/mupen64plus-core/files/mupen64plus-core-2.5.9-pitch.patch b/games-emulation/mupen64plus-core/files/mupen64plus-core-2.5.9-pitch.patch |
18 |
new file mode 100644 |
19 |
index 000000000000..449e4252dae2 |
20 |
--- /dev/null |
21 |
+++ b/games-emulation/mupen64plus-core/files/mupen64plus-core-2.5.9-pitch.patch |
22 |
@@ -0,0 +1,29 @@ |
23 |
+From 8fac78d8cb54da960ca85a49547dcc4fb952457d Mon Sep 17 00:00:00 2001 |
24 |
+From: VarNepvius <14352929+VarNepvius@××××××××××××××××××××.com> |
25 |
+Date: Tue, 6 Sep 2022 20:31:03 +0200 |
26 |
+Subject: [PATCH] Fix wrong pitch argument in call to SDL_CreateRGBSurfaceFrom. |
27 |
+ |
28 |
+--- |
29 |
+ src/api/vidext_sdl2_compat.h | 8 +++++++- |
30 |
+ 1 file changed, 7 insertions(+), 1 deletion(-) |
31 |
+ |
32 |
+diff --git a/src/api/vidext_sdl2_compat.h b/src/api/vidext_sdl2_compat.h |
33 |
+index 06d778dd9..071a64402 100644 |
34 |
+--- a/src/api/vidext_sdl2_compat.h |
35 |
++++ b/src/api/vidext_sdl2_compat.h |
36 |
+@@ -474,8 +474,14 @@ SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags) |
37 |
+ if (SDL_GL_MakeCurrent(SDL_VideoWindow, SDL_VideoContext) < 0) { |
38 |
+ return NULL; |
39 |
+ } |
40 |
++ |
41 |
++ /* Pitch: size of of line in bytes */ |
42 |
++ /* Add 7 to bpp before division, to ensure correct rounding towards infinity |
43 |
++ * in cases where bits per pixel do not cleanly divide by 8 (such as 15) |
44 |
++ */ |
45 |
++ int pitch = (bpp + 7) / 8 * width; |
46 |
+ SDL_VideoSurface = |
47 |
+- SDL_CreateRGBSurfaceFrom(NULL, width, height, bpp, 0, 0, 0, 0, 0); |
48 |
++ SDL_CreateRGBSurfaceFrom(NULL, width, height, bpp, pitch, 0, 0, 0, 0); |
49 |
+ if (!SDL_VideoSurface) { |
50 |
+ return NULL; |
51 |
+ } |
52 |
|
53 |
diff --git a/games-emulation/mupen64plus-core/mupen64plus-core-2.5.9-r2.ebuild b/games-emulation/mupen64plus-core/mupen64plus-core-2.5.9-r3.ebuild |
54 |
similarity index 81% |
55 |
rename from games-emulation/mupen64plus-core/mupen64plus-core-2.5.9-r2.ebuild |
56 |
rename to games-emulation/mupen64plus-core/mupen64plus-core-2.5.9-r3.ebuild |
57 |
index 459fd3cd6239..38e80fb81924 100644 |
58 |
--- a/games-emulation/mupen64plus-core/mupen64plus-core-2.5.9-r2.ebuild |
59 |
+++ b/games-emulation/mupen64plus-core/mupen64plus-core-2.5.9-r3.ebuild |
60 |
@@ -1,41 +1,50 @@ |
61 |
-# Copyright 1999-2021 Gentoo Authors |
62 |
+# Copyright 1999-2022 Gentoo Authors |
63 |
# Distributed under the terms of the GNU General Public License v2 |
64 |
|
65 |
-EAPI=7 |
66 |
+EAPI=8 |
67 |
|
68 |
-MY_P=${PN}-src-${PV} |
69 |
inherit toolchain-funcs |
70 |
|
71 |
+MY_P=${PN}-src-${PV} |
72 |
DESCRIPTION="A fork of Mupen64 Nintendo 64 emulator, core library" |
73 |
HOMEPAGE="https://www.mupen64plus.org/" |
74 |
-SRC_URI="https://github.com/mupen64plus/${PN}/releases/download/${PV}/${MY_P}.tar.gz" |
75 |
+SRC_URI=" |
76 |
+ https://github.com/mupen64plus/${PN}/releases/download/${PV}/${MY_P}.tar.gz |
77 |
+" |
78 |
+S=${WORKDIR}/${MY_P} |
79 |
|
80 |
LICENSE="GPL-2+" |
81 |
SLOT="0/2-sdl2" |
82 |
KEYWORDS="~amd64 ~x86" |
83 |
IUSE="debugger gles2-only lirc new-dynarec opencv +osd cpu_flags_x86_sse" |
84 |
+REQUIRED_USE="gles2-only? ( !osd )" |
85 |
|
86 |
-RDEPEND="media-libs/libpng:0= |
87 |
- media-libs/libsdl2:0=[joystick,opengl,video] |
88 |
- sys-libs/zlib:0=[minizip] |
89 |
- gles2-only? ( media-libs/libsdl2:0[gles2] ) |
90 |
- lirc? ( app-misc/lirc:0 ) |
91 |
+DEPEND=" |
92 |
+ media-libs/libpng:= |
93 |
+ media-libs/libsdl2[joystick,opengl,video] |
94 |
+ sys-libs/zlib[minizip] |
95 |
+ gles2-only? ( media-libs/libsdl2[gles2] ) |
96 |
+ lirc? ( app-misc/lirc ) |
97 |
opencv? ( media-libs/opencv:= ) |
98 |
osd? ( |
99 |
media-fonts/dejavu |
100 |
- media-libs/freetype:2= |
101 |
- virtual/opengl:0= |
102 |
- virtual/glu:0= |
103 |
- )" |
104 |
-DEPEND="${RDEPEND}" |
105 |
+ media-libs/freetype:2 |
106 |
+ virtual/opengl |
107 |
+ virtual/glu |
108 |
+ ) |
109 |
+" |
110 |
+RDEPEND=" |
111 |
+ ${DEPEND} |
112 |
+" |
113 |
BDEPEND=" |
114 |
cpu_flags_x86_sse? ( dev-lang/nasm ) |
115 |
- virtual/pkgconfig" |
116 |
- |
117 |
-REQUIRED_USE="gles2-only? ( !osd )" |
118 |
-S=${WORKDIR}/${MY_P} |
119 |
+ virtual/pkgconfig |
120 |
+" |
121 |
|
122 |
-PATCHES=( "${FILESDIR}"/${PN}-2.5.9-fix-gcc10-fno-common.patch ) |
123 |
+PATCHES=( |
124 |
+ "${FILESDIR}"/${P}-fix-gcc10-fno-common.patch |
125 |
+ "${FILESDIR}"/${P}-pitch.patch |
126 |
+) |
127 |
|
128 |
src_prepare() { |
129 |
default |