1 |
commit: 23a22803043bc6b7c9e5d2fffbfcf9aeb676c725 |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Sep 12 17:08:09 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Sep 12 17:08:09 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=23a22803 |
7 |
|
8 |
media-libs/libsdl2: fix configure tests with Clang 15 |
9 |
|
10 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
11 |
|
12 |
.../files/libsdl2-2.24.0-clang-15-configure.patch | 24 +++ |
13 |
media-libs/libsdl2/libsdl2-2.24.0-r2.ebuild | 229 +++++++++++++++++++++ |
14 |
2 files changed, 253 insertions(+) |
15 |
|
16 |
diff --git a/media-libs/libsdl2/files/libsdl2-2.24.0-clang-15-configure.patch b/media-libs/libsdl2/files/libsdl2-2.24.0-clang-15-configure.patch |
17 |
new file mode 100644 |
18 |
index 000000000000..f5dc8ea6b50b |
19 |
--- /dev/null |
20 |
+++ b/media-libs/libsdl2/files/libsdl2-2.24.0-clang-15-configure.patch |
21 |
@@ -0,0 +1,24 @@ |
22 |
+https://github.com/libsdl-org/SDL/pull/6217 |
23 |
+ |
24 |
+From 04b9178a6746cfe9e4f8708befd3e00f95912a18 Mon Sep 17 00:00:00 2001 |
25 |
+From: Sam James <sam@g.o> |
26 |
+Date: Mon, 12 Sep 2022 18:02:21 +0100 |
27 |
+Subject: [PATCH] configure.ac: fix configure tests broken with Clang 15 |
28 |
+ (implicit function declarations) |
29 |
+ |
30 |
+Clang 15 makes implicit function declarations fatal by default which |
31 |
+leads to some configure tests silently failing/returning |
32 |
+the wrong result. |
33 |
+ |
34 |
+Signed-off-by: Sam James <sam@g.o> |
35 |
+--- a/configure.ac |
36 |
++++ b/configure.ac |
37 |
+@@ -2728,6 +2728,7 @@ CheckInputKD() |
38 |
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
39 |
+ #include <linux/kd.h> |
40 |
+ #include <linux/keyboard.h> |
41 |
++ #include <sys/ioctl.h> |
42 |
+ ]], [[ |
43 |
+ struct kbentry kbe; |
44 |
+ kbe.kb_table = KG_CTRL; |
45 |
+ |
46 |
|
47 |
diff --git a/media-libs/libsdl2/libsdl2-2.24.0-r2.ebuild b/media-libs/libsdl2/libsdl2-2.24.0-r2.ebuild |
48 |
new file mode 100644 |
49 |
index 000000000000..78a8adc8cfe1 |
50 |
--- /dev/null |
51 |
+++ b/media-libs/libsdl2/libsdl2-2.24.0-r2.ebuild |
52 |
@@ -0,0 +1,229 @@ |
53 |
+# Copyright 1999-2022 Gentoo Authors |
54 |
+# Distributed under the terms of the GNU General Public License v2 |
55 |
+ |
56 |
+EAPI=8 |
57 |
+ |
58 |
+inherit autotools flag-o-matic multilib-minimal |
59 |
+ |
60 |
+MY_P="SDL2-${PV}" |
61 |
+DESCRIPTION="Simple Direct Media Layer" |
62 |
+HOMEPAGE="https://www.libsdl.org/" |
63 |
+SRC_URI="https://www.libsdl.org/release/${MY_P}.tar.gz" |
64 |
+ |
65 |
+LICENSE="ZLIB" |
66 |
+SLOT="0" |
67 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86" |
68 |
+ |
69 |
+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 doc fcitx4 gles1 gles2 haptic ibus jack +joystick kms libsamplerate nas opengl oss pipewire pulseaudio sndio +sound static-libs +threads udev +video video_cards_vc4 vulkan wayland X xscreensaver" |
70 |
+REQUIRED_USE=" |
71 |
+ alsa? ( sound ) |
72 |
+ fcitx4? ( dbus ) |
73 |
+ gles1? ( video ) |
74 |
+ gles2? ( video ) |
75 |
+ haptic? ( joystick ) |
76 |
+ ibus? ( dbus ) |
77 |
+ jack? ( sound ) |
78 |
+ nas? ( sound ) |
79 |
+ opengl? ( video ) |
80 |
+ pulseaudio? ( sound ) |
81 |
+ sndio? ( sound ) |
82 |
+ vulkan? ( video ) |
83 |
+ wayland? ( gles2 ) |
84 |
+ xscreensaver? ( X )" |
85 |
+ |
86 |
+CDEPEND=" |
87 |
+ alsa? ( >=media-libs/alsa-lib-1.0.27.2[${MULTILIB_USEDEP}] ) |
88 |
+ dbus? ( >=sys-apps/dbus-1.6.18-r1[${MULTILIB_USEDEP}] ) |
89 |
+ fcitx4? ( app-i18n/fcitx:4 ) |
90 |
+ gles1? ( media-libs/mesa[${MULTILIB_USEDEP},gles1] ) |
91 |
+ gles2? ( >=media-libs/mesa-9.1.6[${MULTILIB_USEDEP},gles2] ) |
92 |
+ ibus? ( app-i18n/ibus ) |
93 |
+ jack? ( virtual/jack[${MULTILIB_USEDEP}] ) |
94 |
+ kms? ( |
95 |
+ >=x11-libs/libdrm-2.4.82[${MULTILIB_USEDEP}] |
96 |
+ >=media-libs/mesa-9.0.0[${MULTILIB_USEDEP},gbm(+)] |
97 |
+ ) |
98 |
+ libsamplerate? ( media-libs/libsamplerate[${MULTILIB_USEDEP}] ) |
99 |
+ nas? ( |
100 |
+ >=media-libs/nas-1.9.4[${MULTILIB_USEDEP}] |
101 |
+ >=x11-libs/libXt-1.1.4[${MULTILIB_USEDEP}] |
102 |
+ ) |
103 |
+ opengl? ( |
104 |
+ >=virtual/opengl-7.0-r1[${MULTILIB_USEDEP}] |
105 |
+ >=virtual/glu-9.0-r1[${MULTILIB_USEDEP}] |
106 |
+ ) |
107 |
+ pipewire? ( media-video/pipewire:=[${MULTILIB_USEDEP}] ) |
108 |
+ pulseaudio? ( >=media-sound/pulseaudio-2.1-r1[${MULTILIB_USEDEP}] ) |
109 |
+ sndio? ( media-sound/sndio:=[${MULTILIB_USEDEP}] ) |
110 |
+ udev? ( >=virtual/libudev-208:=[${MULTILIB_USEDEP}] ) |
111 |
+ wayland? ( |
112 |
+ >=dev-libs/wayland-1.20[${MULTILIB_USEDEP}] |
113 |
+ >=media-libs/mesa-9.1.6[${MULTILIB_USEDEP},egl(+),gles2,wayland] |
114 |
+ >=x11-libs/libxkbcommon-0.2.0[${MULTILIB_USEDEP}] |
115 |
+ ) |
116 |
+ X? ( |
117 |
+ >=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}] |
118 |
+ >=x11-libs/libXcursor-1.1.14[${MULTILIB_USEDEP}] |
119 |
+ >=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}] |
120 |
+ >=x11-libs/libXfixes-6.0.0[${MULTILIB_USEDEP}] |
121 |
+ >=x11-libs/libXi-1.7.2[${MULTILIB_USEDEP}] |
122 |
+ >=x11-libs/libXrandr-1.4.2[${MULTILIB_USEDEP}] |
123 |
+ xscreensaver? ( >=x11-libs/libXScrnSaver-1.2.2-r1[${MULTILIB_USEDEP}] ) |
124 |
+ )" |
125 |
+RDEPEND="${CDEPEND} |
126 |
+ vulkan? ( media-libs/vulkan-loader )" |
127 |
+DEPEND="${CDEPEND} |
128 |
+ ibus? ( dev-libs/glib:2[${MULTILIB_USEDEP}] ) |
129 |
+ vulkan? ( dev-util/vulkan-headers ) |
130 |
+ X? ( x11-base/xorg-proto ) |
131 |
+" |
132 |
+BDEPEND=" |
133 |
+ virtual/pkgconfig |
134 |
+ doc? ( |
135 |
+ app-doc/doxygen |
136 |
+ media-gfx/graphviz |
137 |
+ ) |
138 |
+ wayland? ( >=dev-util/wayland-scanner-1.20 ) |
139 |
+" |
140 |
+ |
141 |
+MULTILIB_WRAPPED_HEADERS=( |
142 |
+ /usr/include/SDL2/SDL_config.h |
143 |
+ /usr/include/SDL2/SDL_platform.h |
144 |
+ /usr/include/SDL2/begin_code.h |
145 |
+ /usr/include/SDL2/close_code.h |
146 |
+) |
147 |
+ |
148 |
+PATCHES=( |
149 |
+ "${FILESDIR}"/${PN}-2.0.16-static-libs.patch |
150 |
+ "${FILESDIR}"/${PN}-2.24.0-clang-15-configure.patch |
151 |
+ "${FILESDIR}"/${P}-cmake-target-fixes.patch |
152 |
+) |
153 |
+ |
154 |
+S="${WORKDIR}/${MY_P}" |
155 |
+ |
156 |
+src_prepare() { |
157 |
+ default |
158 |
+ |
159 |
+ # Unbundle some headers. |
160 |
+ rm -r src/video/khronos || die |
161 |
+ ln -s "${ESYSROOT}/usr/include" src/video/khronos || die |
162 |
+ |
163 |
+ # SDL seems to customize SDL_config.h.in to remove macros like |
164 |
+ # PACKAGE_NAME. Add AT_NOEAUTOHEADER="yes" to prevent those macros from |
165 |
+ # being reintroduced. |
166 |
+ # https://bugs.gentoo.org/764959 |
167 |
+ AT_NOEAUTOHEADER="yes" AT_M4DIR="/usr/share/aclocal acinclude" \ |
168 |
+ eautoreconf |
169 |
+} |
170 |
+ |
171 |
+multilib_src_configure() { |
172 |
+ use custom-cflags || strip-flags |
173 |
+ |
174 |
+ if use ibus; then |
175 |
+ local -x IBUS_CFLAGS="-I${ESYSROOT}/usr/include/ibus-1.0 -I${ESYSROOT}/usr/include/glib-2.0 -I${ESYSROOT}/usr/$(get_libdir)/glib-2.0/include" |
176 |
+ fi |
177 |
+ |
178 |
+ # sorted by `./configure --help` |
179 |
+ local myeconfargs=( |
180 |
+ $(use_enable static-libs static) |
181 |
+ --enable-atomic |
182 |
+ $(use_enable sound audio) |
183 |
+ $(use_enable video) |
184 |
+ --enable-render |
185 |
+ --enable-events |
186 |
+ $(use_enable joystick) |
187 |
+ $(use_enable haptic) |
188 |
+ --enable-power |
189 |
+ --enable-filesystem |
190 |
+ $(use_enable threads pthreads) |
191 |
+ --enable-timers |
192 |
+ --enable-file |
193 |
+ --enable-loadso |
194 |
+ --enable-cpuinfo |
195 |
+ --enable-assembly |
196 |
+ $(use_enable cpu_flags_ppc_altivec altivec) |
197 |
+ $(use_enable cpu_flags_x86_sse ssemath) |
198 |
+ $(use_enable cpu_flags_x86_mmx mmx) |
199 |
+ $(use_enable cpu_flags_x86_3dnow 3dnow) |
200 |
+ $(use_enable cpu_flags_x86_sse sse) |
201 |
+ $(use_enable cpu_flags_x86_sse2 sse2) |
202 |
+ $(use_enable oss) |
203 |
+ $(use_enable alsa) |
204 |
+ --disable-alsa-shared |
205 |
+ $(use_enable jack) |
206 |
+ --disable-jack-shared |
207 |
+ --disable-esd |
208 |
+ $(use_enable pipewire) |
209 |
+ --disable-pipewire-shared |
210 |
+ $(use_enable pulseaudio) |
211 |
+ --disable-pulseaudio-shared |
212 |
+ --disable-arts |
213 |
+ $(use_enable libsamplerate) |
214 |
+ $(use_enable nas) |
215 |
+ --disable-nas-shared |
216 |
+ $(use_enable sndio) |
217 |
+ --disable-sndio-shared |
218 |
+ $(use_enable sound diskaudio) |
219 |
+ $(use_enable sound dummyaudio) |
220 |
+ $(use_enable wayland video-wayland) |
221 |
+ --disable-wayland-shared |
222 |
+ $(use_enable video_cards_vc4 video-rpi) |
223 |
+ $(use_enable X video-x11) |
224 |
+ --disable-x11-shared |
225 |
+ $(use_enable X video-x11-xcursor) |
226 |
+ $(use_enable X video-x11-xdbe) |
227 |
+ $(use_enable X video-x11-xfixes) |
228 |
+ $(use_enable X video-x11-xinput) |
229 |
+ $(use_enable X video-x11-xrandr) |
230 |
+ $(use_enable xscreensaver video-x11-scrnsaver) |
231 |
+ $(use_enable X video-x11-xshape) |
232 |
+ $(use_enable aqua video-cocoa) |
233 |
+ --disable-video-directfb |
234 |
+ --disable-fusionsound |
235 |
+ --disable-fusionsound-shared |
236 |
+ $(use_enable kms video-kmsdrm) |
237 |
+ --disable-kmsdrm-shared |
238 |
+ $(use_enable video video-dummy) |
239 |
+ $(use_enable opengl video-opengl) |
240 |
+ $(use_enable gles1 video-opengles1) |
241 |
+ $(use_enable gles2 video-opengles2) |
242 |
+ $(use_enable vulkan video-vulkan) |
243 |
+ $(use_enable udev libudev) |
244 |
+ $(use_enable dbus) |
245 |
+ $(use_enable fcitx4 fcitx) |
246 |
+ $(use_enable ibus) |
247 |
+ --disable-directx |
248 |
+ --disable-rpath |
249 |
+ --disable-render-d3d |
250 |
+ $(use_with X x) |
251 |
+ ) |
252 |
+ |
253 |
+ ECONF_SOURCE="${S}" \ |
254 |
+ econf "${myeconfargs[@]}" |
255 |
+} |
256 |
+ |
257 |
+multilib_src_compile() { |
258 |
+ emake V=1 |
259 |
+} |
260 |
+ |
261 |
+src_compile() { |
262 |
+ multilib-minimal_src_compile |
263 |
+ |
264 |
+ if use doc; then |
265 |
+ cd docs || die |
266 |
+ doxygen || die |
267 |
+ fi |
268 |
+} |
269 |
+ |
270 |
+multilib_src_install() { |
271 |
+ emake DESTDIR="${D}" install |
272 |
+} |
273 |
+ |
274 |
+multilib_src_install_all() { |
275 |
+ # Do not delete the static .a libraries here as some are |
276 |
+ # mandatory. They may be needed even when linking dynamically. |
277 |
+ find "${ED}" -type f -name "*.la" -delete || die |
278 |
+ |
279 |
+ dodoc {BUGS,CREDITS,README-SDL,TODO,WhatsNew}.txt README.md docs/README*.md |
280 |
+ use doc && dodoc -r docs/output/html/ |
281 |
+} |