summary refs log tree commit diff
path: root/pkgs/development/libraries/SDL
diff options
context:
space:
mode:
authorhsloan <ishaqsloan@gmail.com>2017-06-28 16:00:28 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2017-06-28 19:25:41 -0400
commit784ffeaabda2d1b77d5d7c4d33e4d78297c16877 (patch)
treecb5fec3e51c866de619795c5d042f4be5f09cac1 /pkgs/development/libraries/SDL
parent49347667a879991e4593c38ca18d7297f248b05c (diff)
SDL: Don't use stdenv ? cross
Simplify and finess logic a bit in a way that doesn't affect the
default native build, too.
Diffstat (limited to 'pkgs/development/libraries/SDL')
-rw-r--r--pkgs/development/libraries/SDL/default.nix11
1 files changed, 5 insertions, 6 deletions
diff --git a/pkgs/development/libraries/SDL/default.nix b/pkgs/development/libraries/SDL/default.nix
index eb470519b4ec4..e71ad14b11fd1 100644
--- a/pkgs/development/libraries/SDL/default.nix
+++ b/pkgs/development/libraries/SDL/default.nix
@@ -1,15 +1,15 @@
 { stdenv, fetchurl, fetchpatch, pkgconfig, audiofile, libcap
 , openglSupport ? false, mesa_noglu, mesa_glu
 , alsaSupport ? true, alsaLib
-, x11Support ? true, libXext, libICE, libXrandr
+, x11Support ? hostPlatform == buildPlatform, libXext, libICE, libXrandr
 , pulseaudioSupport ? true, libpulseaudio
 , OpenGL, CoreAudio, CoreServices, AudioUnit, Kernel, Cocoa
-, hostPlatform
+, hostPlatform, buildPlatform
 }:
 
 # OSS is no longer supported, for it's much crappier than ALSA and
 # PulseAudio.
-assert (stdenv.isLinux && !(stdenv ? cross)) -> alsaSupport || pulseaudioSupport;
+assert hostPlatform.isLinux -> alsaSupport || pulseaudioSupport;
 
 let
   inherit (stdenv.lib) optional optionals;
@@ -53,9 +53,8 @@ stdenv.mkDerivation rec {
     "--enable-rpath"
     "--disable-pulseaudio-shared"
     "--disable-osmesa-shared"
-  ] ++ optionals (stdenv ? cross) ([
-    "--without-x"
-  ] ++ optional alsaSupport "--with-alsa-prefix=${alsaLib.out}/lib");
+  ] ++ optional (!x11Support) "--without-x"
+    ++ optional (alsaSupport && hostPlatform != buildPlatform) "--with-alsa-prefix=${alsaLib.out}/lib";
 
   patches = [
     # Fix window resizing issues, e.g. for xmonad