1 |
commit: 9e656cb039645db3c3510a0eaf30b0004125bd13 |
2 |
Author: Brian Kubisiak <brian <AT> kubisiak <DOT> com> |
3 |
AuthorDate: Tue Sep 1 17:41:02 2020 +0000 |
4 |
Commit: James Le Cuirot <chewi <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Sep 5 21:28:14 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9e656cb0 |
7 |
|
8 |
media-libs/libsdl2: Fix EGL and wayland support on systems without X11. |
9 |
|
10 |
Package-Manager: Portage-3.0.4, Repoman-2.3.23 |
11 |
Signed-off-by: Brian Kubisiak <brian <AT> kubisiak.com> |
12 |
Closes: https://github.com/gentoo/gentoo/pull/17365 |
13 |
Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org> |
14 |
|
15 |
.../files/libsdl2-2.0.12-egl-detection.patch | 24 +++ |
16 |
media-libs/libsdl2/libsdl2-2.0.12-r2.ebuild | 193 +++++++++++++++++++++ |
17 |
2 files changed, 217 insertions(+) |
18 |
|
19 |
diff --git a/media-libs/libsdl2/files/libsdl2-2.0.12-egl-detection.patch b/media-libs/libsdl2/files/libsdl2-2.0.12-egl-detection.patch |
20 |
new file mode 100644 |
21 |
index 00000000000..7655ca67494 |
22 |
--- /dev/null |
23 |
+++ b/media-libs/libsdl2/files/libsdl2-2.0.12-egl-detection.patch |
24 |
@@ -0,0 +1,24 @@ |
25 |
+Fix wayland support on systems without X11. |
26 |
+ |
27 |
+Bug: https://bugzilla.libsdl.org/show_bug.cgi?id=5270 |
28 |
+ |
29 |
+--- a/configure Tue Aug 25 04:05:36 2020 +0200 |
30 |
++++ a/configure Tue Aug 25 06:40:03 2020 -0700 |
31 |
+@@ -22306,6 +22306,7 @@ |
32 |
+ #define LINUX |
33 |
+ #define EGL_API_FB |
34 |
+ #define MESA_EGL_NO_X11_HEADERS |
35 |
++ #define EGL_NO_X11 |
36 |
+ #include <EGL/egl.h> |
37 |
+ #include <EGL/eglext.h> |
38 |
+ |
39 |
+--- a/configure.ac Tue Aug 25 04:05:36 2020 +0200 |
40 |
++++ a/configure.ac Tue Aug 25 06:40:03 2020 -0700 |
41 |
+@@ -2373,6 +2373,7 @@ |
42 |
+ #define LINUX |
43 |
+ #define EGL_API_FB |
44 |
+ #define MESA_EGL_NO_X11_HEADERS |
45 |
++ #define EGL_NO_X11 |
46 |
+ #include <EGL/egl.h> |
47 |
+ #include <EGL/eglext.h> |
48 |
+ ],[ |
49 |
|
50 |
diff --git a/media-libs/libsdl2/libsdl2-2.0.12-r2.ebuild b/media-libs/libsdl2/libsdl2-2.0.12-r2.ebuild |
51 |
new file mode 100644 |
52 |
index 00000000000..2d3f0b84734 |
53 |
--- /dev/null |
54 |
+++ b/media-libs/libsdl2/libsdl2-2.0.12-r2.ebuild |
55 |
@@ -0,0 +1,193 @@ |
56 |
+# Copyright 1999-2020 Gentoo Authors |
57 |
+# Distributed under the terms of the GNU General Public License v2 |
58 |
+ |
59 |
+EAPI=7 |
60 |
+inherit autotools flag-o-matic toolchain-funcs multilib-minimal |
61 |
+ |
62 |
+MY_P="SDL2-${PV}" |
63 |
+DESCRIPTION="Simple Direct Media Layer" |
64 |
+HOMEPAGE="https://www.libsdl.org/" |
65 |
+SRC_URI="https://www.libsdl.org/release/${MY_P}.tar.gz" |
66 |
+ |
67 |
+LICENSE="ZLIB" |
68 |
+SLOT="0" |
69 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86" |
70 |
+ |
71 |
+IUSE="alsa aqua cpu_flags_ppc_altivec cpu_flags_x86_3dnow cpu_flags_x86_mmx cpu_flags_x86_sse cpu_flags_x86_sse2 custom-cflags dbus gles2 haptic jack +joystick kms libsamplerate nas opengl oss pulseaudio +sound static-libs +threads tslib udev +video video_cards_vc4 vulkan wayland X xinerama xscreensaver" |
72 |
+REQUIRED_USE=" |
73 |
+ alsa? ( sound ) |
74 |
+ gles2? ( video ) |
75 |
+ jack? ( sound ) |
76 |
+ nas? ( sound ) |
77 |
+ opengl? ( video ) |
78 |
+ pulseaudio? ( sound ) |
79 |
+ vulkan? ( video ) |
80 |
+ wayland? ( gles2 ) |
81 |
+ xinerama? ( X ) |
82 |
+ xscreensaver? ( X )" |
83 |
+ |
84 |
+CDEPEND=" |
85 |
+ alsa? ( >=media-libs/alsa-lib-1.0.27.2[${MULTILIB_USEDEP}] ) |
86 |
+ dbus? ( >=sys-apps/dbus-1.6.18-r1[${MULTILIB_USEDEP}] ) |
87 |
+ gles2? ( >=media-libs/mesa-9.1.6[${MULTILIB_USEDEP},gles2] ) |
88 |
+ jack? ( virtual/jack[${MULTILIB_USEDEP}] ) |
89 |
+ kms? ( |
90 |
+ >=x11-libs/libdrm-2.4.46[${MULTILIB_USEDEP}] |
91 |
+ >=media-libs/mesa-9.0.0[${MULTILIB_USEDEP},gbm] |
92 |
+ ) |
93 |
+ libsamplerate? ( media-libs/libsamplerate[${MULTILIB_USEDEP}] ) |
94 |
+ nas? ( |
95 |
+ >=media-libs/nas-1.9.4[${MULTILIB_USEDEP}] |
96 |
+ >=x11-libs/libXt-1.1.4[${MULTILIB_USEDEP}] |
97 |
+ ) |
98 |
+ opengl? ( |
99 |
+ >=virtual/opengl-7.0-r1[${MULTILIB_USEDEP}] |
100 |
+ >=virtual/glu-9.0-r1[${MULTILIB_USEDEP}] |
101 |
+ ) |
102 |
+ pulseaudio? ( >=media-sound/pulseaudio-2.1-r1[${MULTILIB_USEDEP}] ) |
103 |
+ tslib? ( >=x11-libs/tslib-1.0-r3[${MULTILIB_USEDEP}] ) |
104 |
+ udev? ( >=virtual/libudev-208:=[${MULTILIB_USEDEP}] ) |
105 |
+ wayland? ( |
106 |
+ >=dev-libs/wayland-1.0.6[${MULTILIB_USEDEP}] |
107 |
+ >=media-libs/mesa-9.1.6[${MULTILIB_USEDEP},egl,gles2,wayland] |
108 |
+ >=x11-libs/libxkbcommon-0.2.0[${MULTILIB_USEDEP}] |
109 |
+ ) |
110 |
+ X? ( |
111 |
+ >=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}] |
112 |
+ >=x11-libs/libXcursor-1.1.14[${MULTILIB_USEDEP}] |
113 |
+ >=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}] |
114 |
+ >=x11-libs/libXi-1.7.2[${MULTILIB_USEDEP}] |
115 |
+ >=x11-libs/libXrandr-1.4.2[${MULTILIB_USEDEP}] |
116 |
+ >=x11-libs/libXxf86vm-1.1.3[${MULTILIB_USEDEP}] |
117 |
+ xinerama? ( >=x11-libs/libXinerama-1.1.3[${MULTILIB_USEDEP}] ) |
118 |
+ xscreensaver? ( >=x11-libs/libXScrnSaver-1.2.2-r1[${MULTILIB_USEDEP}] ) |
119 |
+ )" |
120 |
+RDEPEND="${CDEPEND} |
121 |
+ vulkan? ( media-libs/vulkan-loader )" |
122 |
+DEPEND="${CDEPEND} |
123 |
+ vulkan? ( dev-util/vulkan-headers ) |
124 |
+ X? ( x11-base/xorg-proto ) |
125 |
+" |
126 |
+BDEPEND=" |
127 |
+ virtual/pkgconfig |
128 |
+" |
129 |
+ |
130 |
+MULTILIB_WRAPPED_HEADERS=( |
131 |
+ /usr/include/SDL2/SDL_config.h |
132 |
+ /usr/include/SDL2/SDL_platform.h |
133 |
+ /usr/include/SDL2/begin_code.h |
134 |
+ /usr/include/SDL2/close_code.h |
135 |
+) |
136 |
+ |
137 |
+PATCHES=( |
138 |
+ "${FILESDIR}"/${PN}-2.0.12-static-libs.patch |
139 |
+ "${FILESDIR}"/${PN}-2.0.12-vulkan-headers.patch |
140 |
+ "${FILESDIR}"/${PN}-2.0.12-egl-detection.patch |
141 |
+) |
142 |
+ |
143 |
+S="${WORKDIR}/${MY_P}" |
144 |
+ |
145 |
+src_prepare() { |
146 |
+ default |
147 |
+ |
148 |
+ # Unbundle some headers. |
149 |
+ rm -r src/video/khronos || die |
150 |
+ ln -s "${SYSROOT}${EPREFIX}"/usr/include src/video/khronos || die |
151 |
+ |
152 |
+ AT_M4DIR="/usr/share/aclocal acinclude" eautoreconf |
153 |
+} |
154 |
+ |
155 |
+multilib_src_configure() { |
156 |
+ use custom-cflags || strip-flags |
157 |
+ |
158 |
+ # sorted by `./configure --help` |
159 |
+ local myeconfargs=( |
160 |
+ $(use_enable static-libs static) |
161 |
+ --enable-atomic |
162 |
+ $(use_enable sound audio) |
163 |
+ $(use_enable video) |
164 |
+ --enable-render |
165 |
+ --enable-events |
166 |
+ $(use_enable joystick) |
167 |
+ $(use_enable haptic) |
168 |
+ --enable-power |
169 |
+ --enable-filesystem |
170 |
+ $(use_enable threads) |
171 |
+ --enable-timers |
172 |
+ --enable-file |
173 |
+ --enable-loadso |
174 |
+ --enable-cpuinfo |
175 |
+ --enable-assembly |
176 |
+ $(use_enable cpu_flags_ppc_altivec altivec) |
177 |
+ $(use_enable cpu_flags_x86_sse ssemath) |
178 |
+ $(use_enable cpu_flags_x86_mmx mmx) |
179 |
+ $(use_enable cpu_flags_x86_3dnow 3dnow) |
180 |
+ $(use_enable cpu_flags_x86_sse sse) |
181 |
+ $(use_enable cpu_flags_x86_sse2 sse2) |
182 |
+ $(use_enable oss) |
183 |
+ $(use_enable alsa) |
184 |
+ --disable-alsa-shared |
185 |
+ $(use_enable jack) |
186 |
+ --disable-jack-shared |
187 |
+ --disable-esd |
188 |
+ $(use_enable pulseaudio) |
189 |
+ --disable-pulseaudio-shared |
190 |
+ --disable-arts |
191 |
+ $(use_enable libsamplerate) |
192 |
+ $(use_enable nas) |
193 |
+ --disable-nas-shared |
194 |
+ --disable-sndio |
195 |
+ --disable-sndio-shared |
196 |
+ $(use_enable sound diskaudio) |
197 |
+ $(use_enable sound dummyaudio) |
198 |
+ $(use_enable wayland video-wayland) |
199 |
+ --disable-wayland-shared |
200 |
+ $(use_enable video_cards_vc4 video-rpi) |
201 |
+ $(use_enable X video-x11) |
202 |
+ --disable-x11-shared |
203 |
+ $(use_enable X video-x11-xcursor) |
204 |
+ $(use_enable X video-x11-xdbe) |
205 |
+ $(use_enable xinerama video-x11-xinerama) |
206 |
+ $(use_enable X video-x11-xinput) |
207 |
+ $(use_enable X video-x11-xrandr) |
208 |
+ $(use_enable xscreensaver video-x11-scrnsaver) |
209 |
+ $(use_enable X video-x11-xshape) |
210 |
+ $(use_enable X video-x11-vm) |
211 |
+ $(use_enable aqua video-cocoa) |
212 |
+ --disable-video-directfb |
213 |
+ --disable-fusionsound |
214 |
+ --disable-fusionsound-shared |
215 |
+ $(use_enable kms video-kmsdrm) |
216 |
+ --disable-kmsdrm-shared |
217 |
+ $(use_enable video video-dummy) |
218 |
+ $(use_enable opengl video-opengl) |
219 |
+ --disable-video-opengles1 |
220 |
+ $(use_enable gles2 video-opengles2) |
221 |
+ $(use_enable vulkan video-vulkan) |
222 |
+ $(use_enable udev libudev) |
223 |
+ $(use_enable dbus) |
224 |
+ --disable-ibus |
225 |
+ $(use_enable tslib input-tslib) |
226 |
+ --disable-directx |
227 |
+ --disable-rpath |
228 |
+ --disable-render-d3d |
229 |
+ $(use_with X x) |
230 |
+ ) |
231 |
+ |
232 |
+ ECONF_SOURCE="${S}" econf "${myeconfargs[@]}" |
233 |
+} |
234 |
+ |
235 |
+multilib_src_compile() { |
236 |
+ emake V=1 |
237 |
+} |
238 |
+ |
239 |
+multilib_src_install() { |
240 |
+ emake DESTDIR="${D}" install |
241 |
+} |
242 |
+ |
243 |
+multilib_src_install_all() { |
244 |
+ # Do not delete the static .a libraries here as some are |
245 |
+ # mandatory. They may be needed even when linking dynamically. |
246 |
+ find "${ED}" -type f -name "*.la" -delete || die |
247 |
+ dodoc {BUGS,CREDITS,README,README-SDL,TODO,WhatsNew}.txt docs/README*.md |
248 |
+} |