Gentoo Archives: gentoo-commits

From: Lars Wendler <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/libsdl2/
Date: Wed, 05 May 2021 11:40:32
Message-Id: 1620214817.409c40a112b1df7dbe5fec8e7370247e56632b37.polynomial-c@gentoo
1 commit: 409c40a112b1df7dbe5fec8e7370247e56632b37
2 Author: Haelwenn (lanodan) Monnier <contact <AT> hacktivis <DOT> me>
3 AuthorDate: Wed May 5 07:05:21 2021 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Wed May 5 11:40:17 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=409c40a1
7
8 media-libs/libsdl2: Add support for GLES1
9
10 Related: https://github.com/adoptware/pinball/issues/28#issuecomment-831935835
11 Signed-off-by: Haelwenn (lanodan) Monnier <contact <AT> hacktivis.me>
12 Closes: https://github.com/gentoo/gentoo/pull/20690
13 Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
14
15 media-libs/libsdl2/libsdl2-2.0.14-r2.ebuild | 215 ++++++++++++++++++++++++++++
16 media-libs/libsdl2/metadata.xml | 1 +
17 2 files changed, 216 insertions(+)
18
19 diff --git a/media-libs/libsdl2/libsdl2-2.0.14-r2.ebuild b/media-libs/libsdl2/libsdl2-2.0.14-r2.ebuild
20 new file mode 100644
21 index 00000000000..ed96babe187
22 --- /dev/null
23 +++ b/media-libs/libsdl2/libsdl2-2.0.14-r2.ebuild
24 @@ -0,0 +1,215 @@
25 +# Copyright 1999-2021 Gentoo Authors
26 +# Distributed under the terms of the GNU General Public License v2
27 +
28 +EAPI=7
29 +
30 +inherit autotools flag-o-matic toolchain-funcs multilib-minimal
31 +
32 +MY_P="SDL2-${PV}"
33 +DESCRIPTION="Simple Direct Media Layer"
34 +HOMEPAGE="https://www.libsdl.org/"
35 +SRC_URI="https://www.libsdl.org/release/${MY_P}.tar.gz"
36 +
37 +LICENSE="ZLIB"
38 +SLOT="0"
39 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
40 +
41 +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 fcitx4 gles1 gles2 haptic ibus jack +joystick kms libsamplerate nas opengl oss pulseaudio +sound static-libs +threads udev +video video_cards_vc4 vulkan wayland X xinerama xscreensaver"
42 +REQUIRED_USE="
43 + alsa? ( sound )
44 + fcitx4? ( dbus )
45 + gles1? ( video )
46 + gles2? ( video )
47 + ibus? ( dbus )
48 + jack? ( sound )
49 + nas? ( sound )
50 + opengl? ( video )
51 + pulseaudio? ( sound )
52 + vulkan? ( video )
53 + wayland? ( gles2 )
54 + xinerama? ( X )
55 + xscreensaver? ( X )"
56 +
57 +CDEPEND="
58 + alsa? ( >=media-libs/alsa-lib-1.0.27.2[${MULTILIB_USEDEP}] )
59 + dbus? ( >=sys-apps/dbus-1.6.18-r1[${MULTILIB_USEDEP}] )
60 + fcitx4? ( app-i18n/fcitx:4 )
61 + gles1? ( media-libs/mesa[${MULTILIB_USEDEP},gles1] )
62 + gles2? ( >=media-libs/mesa-9.1.6[${MULTILIB_USEDEP},gles2] )
63 + ibus? ( app-i18n/ibus )
64 + jack? ( virtual/jack[${MULTILIB_USEDEP}] )
65 + kms? (
66 + >=x11-libs/libdrm-2.4.82[${MULTILIB_USEDEP}]
67 + >=media-libs/mesa-9.0.0[${MULTILIB_USEDEP},gbm]
68 + )
69 + libsamplerate? ( media-libs/libsamplerate[${MULTILIB_USEDEP}] )
70 + nas? (
71 + >=media-libs/nas-1.9.4[${MULTILIB_USEDEP}]
72 + >=x11-libs/libXt-1.1.4[${MULTILIB_USEDEP}]
73 + )
74 + opengl? (
75 + >=virtual/opengl-7.0-r1[${MULTILIB_USEDEP}]
76 + >=virtual/glu-9.0-r1[${MULTILIB_USEDEP}]
77 + )
78 + pulseaudio? ( >=media-sound/pulseaudio-2.1-r1[${MULTILIB_USEDEP}] )
79 + udev? ( >=virtual/libudev-208:=[${MULTILIB_USEDEP}] )
80 + wayland? (
81 + >=dev-libs/wayland-1.0.6[${MULTILIB_USEDEP}]
82 + >=media-libs/mesa-9.1.6[${MULTILIB_USEDEP},egl,gles2,wayland]
83 + >=x11-libs/libxkbcommon-0.2.0[${MULTILIB_USEDEP}]
84 + )
85 + X? (
86 + >=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
87 + >=x11-libs/libXcursor-1.1.14[${MULTILIB_USEDEP}]
88 + >=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
89 + >=x11-libs/libXi-1.7.2[${MULTILIB_USEDEP}]
90 + >=x11-libs/libXrandr-1.4.2[${MULTILIB_USEDEP}]
91 + >=x11-libs/libXxf86vm-1.1.3[${MULTILIB_USEDEP}]
92 + xinerama? ( >=x11-libs/libXinerama-1.1.3[${MULTILIB_USEDEP}] )
93 + xscreensaver? ( >=x11-libs/libXScrnSaver-1.2.2-r1[${MULTILIB_USEDEP}] )
94 + )"
95 +RDEPEND="${CDEPEND}
96 + vulkan? ( media-libs/vulkan-loader )"
97 +DEPEND="${CDEPEND}
98 + ibus? ( dev-libs/glib:2[${MULTILIB_USEDEP}] )
99 + vulkan? ( dev-util/vulkan-headers )
100 + X? ( x11-base/xorg-proto )
101 +"
102 +BDEPEND="
103 + virtual/pkgconfig
104 +"
105 +
106 +MULTILIB_WRAPPED_HEADERS=(
107 + /usr/include/SDL2/SDL_config.h
108 + /usr/include/SDL2/SDL_platform.h
109 + /usr/include/SDL2/begin_code.h
110 + /usr/include/SDL2/close_code.h
111 +)
112 +
113 +PATCHES=(
114 + "${FILESDIR}"/${PN}-2.0.14-static-libs.patch
115 + "${FILESDIR}"/${PN}-2.0.14-vulkan.patch
116 +)
117 +
118 +S="${WORKDIR}/${MY_P}"
119 +
120 +src_prepare() {
121 + default
122 +
123 + # Unbundle some headers.
124 + rm -r src/video/khronos || die
125 + ln -s "${ESYSROOT}/usr/include" src/video/khronos || die
126 +
127 + # SDL seems to customize SDL_config.h.in to remove macros like
128 + # PACKAGE_NAME. Add AT_NOEAUTOHEADER="yes" to prevent those macros from
129 + # being reintroduced.
130 + # https://bugs.gentoo.org/764959
131 + AT_NOEAUTOHEADER="yes" AT_M4DIR="/usr/share/aclocal acinclude" \
132 + eautoreconf
133 +
134 + # libsdl2-2.0.14 build regression. Please check if still needed
135 + multilib_copy_sources
136 +}
137 +
138 +multilib_src_configure() {
139 + use custom-cflags || strip-flags
140 +
141 + # libsdl2-2.0.14 build regression. Please check if still needed
142 + append-flags -D__LINUX__
143 +
144 + if use ibus; then
145 + 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"
146 + fi
147 +
148 + # sorted by `./configure --help`
149 + local myeconfargs=(
150 + $(use_enable static-libs static)
151 + --enable-atomic
152 + $(use_enable sound audio)
153 + $(use_enable video)
154 + --enable-render
155 + --enable-events
156 + $(use_enable joystick)
157 + $(use_enable haptic)
158 + --enable-power
159 + --enable-filesystem
160 + $(use_enable threads)
161 + --enable-timers
162 + --enable-file
163 + --enable-loadso
164 + --enable-cpuinfo
165 + --enable-assembly
166 + $(use_enable cpu_flags_ppc_altivec altivec)
167 + $(use_enable cpu_flags_x86_sse ssemath)
168 + $(use_enable cpu_flags_x86_mmx mmx)
169 + $(use_enable cpu_flags_x86_3dnow 3dnow)
170 + $(use_enable cpu_flags_x86_sse sse)
171 + $(use_enable cpu_flags_x86_sse2 sse2)
172 + $(use_enable oss)
173 + $(use_enable alsa)
174 + --disable-alsa-shared
175 + $(use_enable jack)
176 + --disable-jack-shared
177 + --disable-esd
178 + $(use_enable pulseaudio)
179 + --disable-pulseaudio-shared
180 + --disable-arts
181 + $(use_enable libsamplerate)
182 + $(use_enable nas)
183 + --disable-nas-shared
184 + --disable-sndio
185 + --disable-sndio-shared
186 + $(use_enable sound diskaudio)
187 + $(use_enable sound dummyaudio)
188 + $(use_enable wayland video-wayland)
189 + --disable-wayland-shared
190 + $(use_enable video_cards_vc4 video-rpi)
191 + $(use_enable X video-x11)
192 + --disable-x11-shared
193 + $(use_enable X video-x11-xcursor)
194 + $(use_enable X video-x11-xdbe)
195 + $(use_enable xinerama video-x11-xinerama)
196 + $(use_enable X video-x11-xinput)
197 + $(use_enable X video-x11-xrandr)
198 + $(use_enable xscreensaver video-x11-scrnsaver)
199 + $(use_enable X video-x11-xshape)
200 + $(use_enable X video-x11-vm)
201 + $(use_enable aqua video-cocoa)
202 + --disable-video-directfb
203 + --disable-fusionsound
204 + --disable-fusionsound-shared
205 + $(use_enable kms video-kmsdrm)
206 + --disable-kmsdrm-shared
207 + $(use_enable video video-dummy)
208 + $(use_enable opengl video-opengl)
209 + $(use_enable gles1 video-opengles1)
210 + $(use_enable gles2 video-opengles2)
211 + $(use_enable vulkan video-vulkan)
212 + $(use_enable udev libudev)
213 + $(use_enable dbus)
214 + $(use_enable fcitx4 fcitx)
215 + $(use_enable ibus)
216 + --disable-directx
217 + --disable-rpath
218 + --disable-render-d3d
219 + $(use_with X x)
220 + )
221 +
222 + #ECONF_SOURCE="${S}"
223 + econf "${myeconfargs[@]}"
224 +}
225 +
226 +multilib_src_compile() {
227 + emake V=1
228 +}
229 +
230 +multilib_src_install() {
231 + emake DESTDIR="${D}" install
232 +}
233 +
234 +multilib_src_install_all() {
235 + # Do not delete the static .a libraries here as some are
236 + # mandatory. They may be needed even when linking dynamically.
237 + find "${ED}" -type f -name "*.la" -delete || die
238 + dodoc {BUGS,CREDITS,README,README-SDL,TODO,WhatsNew}.txt docs/README*.md
239 +}
240
241 diff --git a/media-libs/libsdl2/metadata.xml b/media-libs/libsdl2/metadata.xml
242 index fb417beddc0..a35fb97837a 100644
243 --- a/media-libs/libsdl2/metadata.xml
244 +++ b/media-libs/libsdl2/metadata.xml
245 @@ -25,6 +25,7 @@
246 </longdescription>
247 <use>
248 <flag name="fcitx4">Enable support for <pkg>app-i18n/fcitx</pkg> 4</flag>
249 + <flag name="gles1">include OpenGL ES 1.0 support</flag>
250 <flag name="gles2">include OpenGL ES 2.0 support</flag>
251 <flag name="haptic">Enable the haptic (force feedback) subsystem</flag>
252 <flag name="ibus">Enable support for <pkg>app-i18n/ibus</pkg></flag>