From fbc307a18322c42db500aaebeaa21e0e93e82162 Mon Sep 17 00:00:00 2001 From: aszlig Date: Mon, 24 Feb 2014 05:55:29 +0100 Subject: [PATCH] SDL/cross: Fix building with mingw-w64. This is to make sure that we don't get Xlibs or alsa in cross builds, because those aren't available on non-Linux/Unix platforms. Also, until we don't have the DirectX SDK packaged, let's disable it during cross builds. Signed-off-by: aszlig --- pkgs/development/libraries/SDL/default.nix | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/pkgs/development/libraries/SDL/default.nix b/pkgs/development/libraries/SDL/default.nix index e58397fa9a5b..0df130b11fb1 100644 --- a/pkgs/development/libraries/SDL/default.nix +++ b/pkgs/development/libraries/SDL/default.nix @@ -19,7 +19,7 @@ let --disable-oss --disable-video-x11-xme --disable-x11-shared --disable-alsa-shared --enable-rpath --disable-pulseaudio-shared --disable-osmesa-shared - ${if alsaSupport then "--with-alsa-prefix=${attrs.alsaLib}/lib" else ""} + ${if attrs.alsaSupport then "--with-alsa-prefix=${attrs.alsaLib}/lib" else ""} ''; in stdenv.mkDerivation rec { @@ -32,20 +32,24 @@ stdenv.mkDerivation rec { }; # Since `libpulse*.la' contain `-lgdbm', PulseAudio must be propagated. - propagatedBuildInputs = stdenv.lib.optionals x11Support [ x11 libXrandr ] ++ + propagatedNativeBuildInputs = + stdenv.lib.optionals x11Support [ x11 libXrandr ] ++ stdenv.lib.optional pulseaudioSupport pulseaudio; - buildInputs = [ pkgconfig audiofile ] ++ + nativeBuildInputs = [ pkgconfig audiofile ] ++ stdenv.lib.optional openglSupport [ mesa ] ++ stdenv.lib.optional alsaSupport alsaLib; # 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'. - configureFlags = configureFlagsFun { inherit alsaLib; }; + configureFlags = configureFlagsFun { inherit alsaLib alsaSupport; }; crossAttrs = { - configureFlags = configureFlagsFun { alsaLib = alsaLib.crossDrv; }; + configureFlags = configureFlagsFun { + alsaSupport = stdenv.cross.config != "x86_64-w64-mingw32"; + alsaLib = alsaLib.crossDrv; + } + "--disable-directx"; }; passthru = {inherit openglSupport;};