2009-05-11 20:57:42 +01:00
|
|
|
{ stdenv, fetchurl, x11, libXrandr, pkgconfig
|
|
|
|
, openglSupport ? false, mesa ? null
|
2006-09-12 00:06:26 +01:00
|
|
|
, alsaSupport ? true, alsaLib ? null
|
2009-05-11 20:57:42 +01:00
|
|
|
, pulseaudioSupport ? true, pulseaudio ? null
|
2006-09-12 00:06:26 +01:00
|
|
|
}:
|
2006-01-26 14:01:08 +00:00
|
|
|
|
|
|
|
assert openglSupport -> mesa != null;
|
2006-09-12 00:06:26 +01:00
|
|
|
assert alsaSupport -> alsaLib != null;
|
2009-05-11 20:57:42 +01:00
|
|
|
assert pulseaudioSupport -> pulseaudio != null;
|
2004-09-26 19:12:51 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2008-06-14 21:46:34 +01:00
|
|
|
name = "SDL-1.2.13";
|
|
|
|
|
2004-09-26 19:12:51 +01:00
|
|
|
src = fetchurl {
|
2008-06-14 21:46:34 +01:00
|
|
|
url = http://www.libsdl.org/release/SDL-1.2.13.tar.gz;
|
|
|
|
sha256 = "0cp155296d6fy3w31jj481jxl9b43fkm01klyibnna8gsvqrvycl";
|
2004-09-26 19:12:51 +01:00
|
|
|
};
|
2008-06-14 21:46:34 +01:00
|
|
|
|
2009-05-11 22:11:25 +01:00
|
|
|
# Since `libpulse*.la' contain `-lgdbm', PulseAudio must be propagated.
|
|
|
|
propagatedBuildInputs = [ x11 libXrandr ] ++
|
|
|
|
stdenv.lib.optional pulseaudioSupport pulseaudio;
|
|
|
|
|
2009-05-11 20:57:42 +01:00
|
|
|
buildInputs = [ pkgconfig ] ++
|
2008-06-14 21:46:34 +01:00
|
|
|
stdenv.lib.optional openglSupport mesa ++
|
2009-05-11 22:11:25 +01:00
|
|
|
stdenv.lib.optional alsaSupport alsaLib;
|
2009-05-11 20:57:42 +01:00
|
|
|
|
|
|
|
# XXX: By default, SDL wants to dlopen() PulseAudio, in which case
|
|
|
|
# we must arrange to add it to its RPATH; however, `patchelf' seems
|
|
|
|
# to fail at doing this, hence `--disable-pulseaudio-shared'.
|
2008-06-14 21:46:34 +01:00
|
|
|
configureFlags = ''
|
2009-05-11 20:57:42 +01:00
|
|
|
--disable-x11-shared --disable-alsa-shared --enable-rpath --disable-pulseaudio-shared
|
2006-09-12 01:15:05 +01:00
|
|
|
${if alsaSupport then "--with-alsa-prefix=${alsaLib}/lib" else ""}
|
2008-06-14 21:46:34 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
passthru = {inherit openglSupport;};
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "A cross-platform multimedia library";
|
|
|
|
homepage = http://www.libsdl.org/;
|
|
|
|
};
|
2004-09-26 19:12:51 +01:00
|
|
|
}
|