1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
5 # TODO: convert FusionSound #484250
8 inherit autotools flag-o-matic toolchain-funcs eutils multilib-minimal
11 DESCRIPTION
="Simple Direct Media Layer"
12 HOMEPAGE
="http://www.libsdl.org"
13 SRC_URI
="http://www.libsdl.org/release/${MY_P}.tar.gz"
17 KEYWORDS
="alpha amd64 arm hppa ppc64 x86"
19 IUSE
="cpu_flags_x86_3dnow alsa altivec custom-cflags dbus doc fusionsound gles haptic +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"
22 fusionsound? ( sound )
32 alsa? ( >=media-libs/alsa-lib-1.0.27.2[${MULTILIB_USEDEP}] )
33 dbus? ( >=sys-apps/dbus-1.6.18-r1[${MULTILIB_USEDEP}] )
34 fusionsound? ( || ( >=media-libs/FusionSound-1.1.1 >=dev-libs/DirectFB-1.7.1[fusionsound] ) )
35 gles? ( >=media-libs/mesa-9.1.6[${MULTILIB_USEDEP},gles2] )
36 nas? ( >=media-libs/nas-1.9.4[${MULTILIB_USEDEP}] )
38 >=virtual/opengl-7.0-r1[${MULTILIB_USEDEP}]
39 >=virtual/glu-9.0-r1[${MULTILIB_USEDEP}]
41 pulseaudio? ( >=media-sound/pulseaudio-2.1-r1[${MULTILIB_USEDEP}] )
42 tslib? ( >=x11-libs/tslib-1.0-r3[${MULTILIB_USEDEP}] )
43 udev? ( >=virtual/libudev-208:=[${MULTILIB_USEDEP}] )
45 >=dev-libs/wayland-1.0.6[${MULTILIB_USEDEP}]
46 >=media-libs/mesa-9.1.6[${MULTILIB_USEDEP},egl,gles2,wayland]
47 >=x11-libs/libxkbcommon-0.2.0[${MULTILIB_USEDEP}]
50 >=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
51 >=x11-libs/libXcursor-1.1.14[${MULTILIB_USEDEP}]
52 >=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
53 >=x11-libs/libXi-1.7.2[${MULTILIB_USEDEP}]
54 >=x11-libs/libXrandr-1.4.2[${MULTILIB_USEDEP}]
55 >=x11-libs/libXt-1.1.4[${MULTILIB_USEDEP}]
56 >=x11-libs/libXxf86vm-1.1.3[${MULTILIB_USEDEP}]
57 xinerama? ( >=x11-libs/libXinerama-1.1.3[${MULTILIB_USEDEP}] )
58 xscreensaver? ( >=x11-libs/libXScrnSaver-1.2.2-r1[${MULTILIB_USEDEP}] )
60 doc? ( !media-libs/libsdl[manpages] )
64 >=x11-proto/xextproto-7.2.1-r1[${MULTILIB_USEDEP}]
65 >=x11-proto/xproto-7.0.24[${MULTILIB_USEDEP}]
67 doc? ( app-doc/doxygen )
73 # https://bugzilla.libsdl.org/show_bug.cgi?id=1431
74 epatch
"${FILESDIR}"/${P}-static-libs.
patch
75 sed -i -e 's/configure.in/configure.ac/' Makefile.
in || die
76 mv configure.
{in,ac
} || die
77 AT_M4DIR
="/usr/share/aclocal acinclude" eautoreconf
79 # jury-rig manpage creation
80 use doc
&& cp "${FILESDIR}/doxyfile" "${S}/src/doxyfile"
83 multilib_src_configure
() {
84 use custom-cflags || strip-flags
86 # sorted by `./configure --help`
87 ECONF_SOURCE
="${S}" econf \
88 $
(use_enable static-libs static
) \
90 $
(use_enable sound audio
) \
94 $
(use_enable joystick
) \
95 $
(use_enable haptic
) \
98 $
(use_enable threads
) \
104 $
(use_enable cpu_flags_x86_sse ssemath
) \
105 $
(use_enable cpu_flags_x86_mmx mmx
) \
106 $
(use_enable cpu_flags_x86_3dnow
3dnow
) \
107 $
(use_enable cpu_flags_x86_sse sse
) \
108 $
(use_enable cpu_flags_x86_sse2 sse2
) \
109 $
(use_enable altivec
) \
112 --disable-alsa-shared \
114 $
(use_enable pulseaudio
) \
115 --disable-pulseaudio-shared \
118 --disable-nas-shared \
120 --disable-sndio-shared \
121 $
(use_enable sound diskaudio
) \
122 $
(use_enable sound dummyaudio
) \
123 $
(use_enable wayland video-wayland
) \
124 --disable-wayland-shared \
125 --disable-video-mir \
126 $
(use_enable X video-x11
) \
127 --disable-x11-shared \
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 $
(multilib_native_use_enable fusionsound
) \
139 --disable-fusionsound-shared \
140 $
(use_enable video video-dummy
) \
141 $
(use_enable opengl video-opengl
) \
142 $
(use_enable gles video-opengles
) \
143 $
(use_enable udev libudev
) \
146 $
(use_enable tslib input-tslib
) \
149 --disable-render-d3d \
153 multilib_src_compile
() {
156 if multilib_is_native_abi
&& use doc
; then
157 # They don't seem to have a documentation make target.
159 doxygen
"${S}/src/doxyfile"
163 multilib_src_install
() {
164 emake DESTDIR
="${D}" install
166 if multilib_is_native_abi
&& use doc
; then
167 doman
"${S}"/output
/man
/man
3/SDL_
*.3
168 doman
"${S}"/output
/man
/man
3/SDL.h
.3
172 multilib_src_install_all
() {
174 dodoc
{BUGS
,CREDITS
,README
,README-SDL
,TODO
,WhatsNew
}.txt docs
/README
*.md