about summary refs log tree commit diff
path: root/pkgs/development/libraries/SDL
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2019-02-22 10:36:48 -0500
committerMatthew Bauer <mjbauer95@gmail.com>2019-02-24 17:00:48 -0500
commitd665b8ccf3781d56d3cd23b767af67286e11e5db (patch)
tree298e694201a328e18d9b448058edd8ee00f2698a /pkgs/development/libraries/SDL
parent76474b2da7a4c5a3c2f28bbbb42ccea9339371de (diff)
SDL{,2}: support building for android
This should be picking up the OpenGL ES headers provided by the NDK.
More testing is needed.
Diffstat (limited to 'pkgs/development/libraries/SDL')
-rw-r--r--pkgs/development/libraries/SDL/default.nix16
1 files changed, 7 insertions, 9 deletions
diff --git a/pkgs/development/libraries/SDL/default.nix b/pkgs/development/libraries/SDL/default.nix
index e2ff66a470844..007cd02957ba8 100644
--- a/pkgs/development/libraries/SDL/default.nix
+++ b/pkgs/development/libraries/SDL/default.nix
@@ -1,8 +1,9 @@
 { stdenv, config, libGLSupported, fetchurl, fetchpatch, pkgconfig, audiofile, libcap, libiconv
 , openglSupport ? libGLSupported, libGL, libGLU
-, alsaSupport ? stdenv.isLinux, alsaLib
-, x11Support ? !stdenv.isCygwin, libXext, libICE, libXrandr
-, pulseaudioSupport ? config.pulseaudio or stdenv.isLinux, libpulseaudio
+, alsaSupport ? stdenv.isLinux && !stdenv.hostPlatform.isAndroid, alsaLib
+, x11Support ? !stdenv.isCygwin && !stdenv.hostPlatform.isAndroid
+, libXext, libICE, libXrandr
+, pulseaudioSupport ? config.pulseaudio or stdenv.isLinux && !stdenv.hostPlatform.isAndroid, libpulseaudio
 , OpenGL, CoreAudio, CoreServices, AudioUnit, Kernel, Cocoa
 , cf-private
 }:
@@ -12,9 +13,6 @@
 
 with stdenv.lib;
 
-assert !stdenv.isDarwin -> alsaSupport || pulseaudioSupport;
-assert openglSupport -> (stdenv.isDarwin || x11Support && libGL != null && libGLU != null);
-
 stdenv.mkDerivation rec {
   name    = "SDL-${version}";
   version = "1.2.15";
@@ -30,18 +28,18 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "dev" ];
   outputBin = "dev"; # sdl-config
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ]
+    ++ optional stdenv.isLinux libcap;
 
   propagatedBuildInputs = [ libiconv ]
     ++ optionals x11Support [ libXext libICE libXrandr ]
-    ++ optional stdenv.isLinux libcap
     ++ optionals openglSupport [ libGL libGLU ]
     ++ optional alsaSupport alsaLib
     ++ optional pulseaudioSupport libpulseaudio
     ++ optional stdenv.isDarwin Cocoa;
 
   buildInputs = [ ]
-    ++ optional (!stdenv.hostPlatform.isMinGW) audiofile
+    ++ optional (!stdenv.hostPlatform.isMinGW && alsaSupport) audiofile
     ++ optionals stdenv.isDarwin [
       AudioUnit CoreAudio CoreServices Kernel OpenGL
       # Needed for NSDefaultRunLoopMode symbols.