SDL: Don't use stdenv ? cross

Simplify and finess logic a bit in a way that doesn't affect the
default native build, too.
This commit is contained in:
hsloan 2017-06-28 16:00:28 -04:00 committed by John Ericson
parent 49347667a8
commit 784ffeaabd

View File

@ -1,15 +1,15 @@
{ stdenv, fetchurl, fetchpatch, pkgconfig, audiofile, libcap { stdenv, fetchurl, fetchpatch, pkgconfig, audiofile, libcap
, openglSupport ? false, mesa_noglu, mesa_glu , openglSupport ? false, mesa_noglu, mesa_glu
, alsaSupport ? true, alsaLib , alsaSupport ? true, alsaLib
, x11Support ? true, libXext, libICE, libXrandr , x11Support ? hostPlatform == buildPlatform, libXext, libICE, libXrandr
, pulseaudioSupport ? true, libpulseaudio , pulseaudioSupport ? true, libpulseaudio
, OpenGL, CoreAudio, CoreServices, AudioUnit, Kernel, Cocoa , OpenGL, CoreAudio, CoreServices, AudioUnit, Kernel, Cocoa
, hostPlatform , hostPlatform, buildPlatform
}: }:
# OSS is no longer supported, for it's much crappier than ALSA and # OSS is no longer supported, for it's much crappier than ALSA and
# PulseAudio. # PulseAudio.
assert (stdenv.isLinux && !(stdenv ? cross)) -> alsaSupport || pulseaudioSupport; assert hostPlatform.isLinux -> alsaSupport || pulseaudioSupport;
let let
inherit (stdenv.lib) optional optionals; inherit (stdenv.lib) optional optionals;
@ -53,9 +53,8 @@ stdenv.mkDerivation rec {
"--enable-rpath" "--enable-rpath"
"--disable-pulseaudio-shared" "--disable-pulseaudio-shared"
"--disable-osmesa-shared" "--disable-osmesa-shared"
] ++ optionals (stdenv ? cross) ([ ] ++ optional (!x11Support) "--without-x"
"--without-x" ++ optional (alsaSupport && hostPlatform != buildPlatform) "--with-alsa-prefix=${alsaLib.out}/lib";
] ++ optional alsaSupport "--with-alsa-prefix=${alsaLib.out}/lib");
patches = [ patches = [
# Fix window resizing issues, e.g. for xmonad # Fix window resizing issues, e.g. for xmonad