From 784ffeaabda2d1b77d5d7c4d33e4d78297c16877 Mon Sep 17 00:00:00 2001 From: hsloan Date: Wed, 28 Jun 2017 16:00:28 -0400 Subject: [PATCH] SDL: Don't use stdenv ? cross Simplify and finess logic a bit in a way that doesn't affect the default native build, too. --- pkgs/development/libraries/SDL/default.nix | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pkgs/development/libraries/SDL/default.nix b/pkgs/development/libraries/SDL/default.nix index eb470519b4e..e71ad14b11f 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