1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
5 inherit autotools flag-o-matic ltprune toolchain-funcs multilib-minimal
8 DESCRIPTION="Simple Direct Media Layer"
9 HOMEPAGE="http://www.libsdl.org"
10 SRC_URI="http://www.libsdl.org/release/${MY_P}.tar.gz"
14 KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ia64 ~ppc ~ppc64 ~sparc x86"
16 IUSE="cpu_flags_x86_3dnow alsa altivec custom-cflags dbus gles haptic libsamplerate +joystick cpu_flags_x86_mmx nas opengl oss pulseaudio +sound cpu_flags_x86_sse cpu_flags_x86_sse2 static-libs +threads tslib udev +video wayland X xinerama xscreensaver"
28 alsa? ( >=media-libs/alsa-lib-1.0.27.2[${MULTILIB_USEDEP}] )
29 dbus? ( >=sys-apps/dbus-1.6.18-r1[${MULTILIB_USEDEP}] )
30 gles? ( >=media-libs/mesa-9.1.6[${MULTILIB_USEDEP},gles2] )
31 libsamplerate? ( media-libs/libsamplerate[${MULTILIB_USEDEP}] )
33 >=media-libs/nas-1.9.4[${MULTILIB_USEDEP}]
34 >=x11-libs/libXt-1.1.4[${MULTILIB_USEDEP}] )
36 >=virtual/opengl-7.0-r1[${MULTILIB_USEDEP}]
37 >=virtual/glu-9.0-r1[${MULTILIB_USEDEP}]
39 pulseaudio? ( >=media-sound/pulseaudio-2.1-r1[${MULTILIB_USEDEP}] )
40 tslib? ( >=x11-libs/tslib-1.0-r3[${MULTILIB_USEDEP}] )
41 udev? ( >=virtual/libudev-208:=[${MULTILIB_USEDEP}] )
43 >=dev-libs/wayland-1.0.6[${MULTILIB_USEDEP}]
44 >=media-libs/mesa-9.1.6[${MULTILIB_USEDEP},egl,gles2,wayland]
45 >=x11-libs/libxkbcommon-0.2.0[${MULTILIB_USEDEP}]
48 >=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
49 >=x11-libs/libXcursor-1.1.14[${MULTILIB_USEDEP}]
50 >=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
51 >=x11-libs/libXi-1.7.2[${MULTILIB_USEDEP}]
52 >=x11-libs/libXrandr-1.4.2[${MULTILIB_USEDEP}]
53 >=x11-libs/libXxf86vm-1.1.3[${MULTILIB_USEDEP}]
54 xinerama? ( >=x11-libs/libXinerama-1.1.3[${MULTILIB_USEDEP}] )
55 xscreensaver? ( >=x11-libs/libXScrnSaver-1.2.2-r1[${MULTILIB_USEDEP}] )
59 >=x11-proto/xextproto-7.2.1-r1[${MULTILIB_USEDEP}]
60 >=x11-proto/xproto-7.0.24[${MULTILIB_USEDEP}]
64 MULTILIB_WRAPPED_HEADERS=(
65 /usr/include/SDL2/SDL_config.h
69 # https://bugzilla.libsdl.org/show_bug.cgi?id=1431
70 "${FILESDIR}"/${PN}-2.0.6-static-libs.patch
73 S="${WORKDIR}/${MY_P}"
77 sed -i -e 's/configure.in/configure.ac/' Makefile.in || die
78 mv configure.{in,ac} || die
79 AT_M4DIR="/usr/share/aclocal acinclude" eautoreconf
82 multilib_src_configure() {
83 use custom-cflags || strip-flags
85 # sorted by `./configure --help`
87 $(use_enable static-libs static)
89 $(use_enable sound audio)
93 $(use_enable joystick)
100 $(use_enable kernel_Winnt loadso)
103 $(use_enable cpu_flags_x86_sse ssemath)
104 $(use_enable cpu_flags_x86_mmx mmx)
105 $(use_enable cpu_flags_x86_3dnow 3dnow)
106 $(use_enable cpu_flags_x86_sse sse)
107 $(use_enable cpu_flags_x86_sse2 sse2)
108 $(use_enable altivec)
111 --disable-alsa-shared
113 $(use_enable pulseaudio)
114 --disable-pulseaudio-shared
116 $(use_enable libsamplerate)
120 --disable-sndio-shared
121 $(use_enable sound diskaudio)
122 $(use_enable sound dummyaudio)
123 $(use_enable wayland video-wayland)
124 --disable-wayland-shared
126 $(use_enable X video-x11)
128 $(use_enable X video-x11-xcursor)
129 $(use_enable X video-x11-xdbe)
130 $(use_enable xinerama video-x11-xinerama)
131 $(use_enable X video-x11-xinput)
132 $(use_enable X video-x11-xrandr)
133 $(use_enable xscreensaver video-x11-scrnsaver)
134 $(use_enable X video-x11-xshape)
135 $(use_enable X video-x11-vm)
136 --disable-video-cocoa
137 --disable-video-directfb
138 --disable-fusionsound
139 --disable-fusionsound-shared
140 $(use_enable video video-dummy)
141 $(use_enable opengl video-opengl)
142 --disable-video-opengles1
143 $(use_enable gles video-opengles2)
144 --disable-video-vulkan
145 $(use_enable udev libudev)
148 $(use_enable tslib input-tslib)
155 ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
158 multilib_src_compile() {
162 multilib_src_install() {
163 emake DESTDIR="${D}" install
166 multilib_src_install_all() {
168 dodoc {BUGS,CREDITS,README,README-SDL,TODO,WhatsNew}.txt docs/README*.md