summary refs log tree commit diff
diff options
context:
space:
mode:
authorDaiderd Jordan <daiderd@gmail.com>2018-11-05 12:55:08 +0100
committerDaiderd Jordan <daiderd@gmail.com>2018-11-05 14:10:44 +0100
commit8abc1cccfbf5b72f90f71627f8a13ddccf4c3670 (patch)
tree9204129c1ea9e3f77b88c51142c9cadea3c8123f
parent7edfded9c3936f50fb227aabc6423f2736f07eae (diff)
downloadnixlib-8abc1cccfbf5b72f90f71627f8a13ddccf4c3670.tar
nixlib-8abc1cccfbf5b72f90f71627f8a13ddccf4c3670.tar.gz
nixlib-8abc1cccfbf5b72f90f71627f8a13ddccf4c3670.tar.bz2
nixlib-8abc1cccfbf5b72f90f71627f8a13ddccf4c3670.tar.lz
nixlib-8abc1cccfbf5b72f90f71627f8a13ddccf4c3670.tar.xz
nixlib-8abc1cccfbf5b72f90f71627f8a13ddccf4c3670.tar.zst
nixlib-8abc1cccfbf5b72f90f71627f8a13ddccf4c3670.zip
SDL: move overrides out of all-packages.nix
Using defaults makes it much easier to understand what the values are.
-rw-r--r--pkgs/development/libraries/SDL/default.nix14
-rw-r--r--pkgs/development/libraries/SDL2/default.nix16
-rw-r--r--pkgs/top-level/all-packages.nix10
3 files changed, 15 insertions, 25 deletions
diff --git a/pkgs/development/libraries/SDL/default.nix b/pkgs/development/libraries/SDL/default.nix
index 08a52096d4b1..7ef3c4c89686 100644
--- a/pkgs/development/libraries/SDL/default.nix
+++ b/pkgs/development/libraries/SDL/default.nix
@@ -1,8 +1,8 @@
-{ stdenv, lib, fetchurl, fetchpatch, pkgconfig, audiofile, libcap, libiconv
-, openglSupport ? false, libGL, libGLU
-, alsaSupport ? true, alsaLib
-, x11Support ? stdenv.hostPlatform == stdenv.buildPlatform, libXext, libICE, libXrandr
-, pulseaudioSupport ? true, libpulseaudio
+{ 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
 , OpenGL, CoreAudio, CoreServices, AudioUnit, Kernel, Cocoa
 , cf-private
 }:
@@ -10,7 +10,7 @@
 # NOTE: When editing this expression see if the same change applies to
 # SDL2 expression too
 
-with lib;
+with stdenv.lib;
 
 assert !stdenv.isDarwin -> alsaSupport || pulseaudioSupport;
 assert openglSupport -> (stdenv.isDarwin || x11Support && libGL != null && libGLU != null);
@@ -114,7 +114,7 @@ stdenv.mkDerivation rec {
   postFixup = ''
     for lib in $out/lib/*.so* ; do
       if [[ -L "$lib" ]]; then
-        patchelf --set-rpath "$(patchelf --print-rpath $lib):${lib.makeLibraryPath propagatedBuildInputs}" "$lib"
+        patchelf --set-rpath "$(patchelf --print-rpath $lib):${makeLibraryPath propagatedBuildInputs}" "$lib"
       fi
     done
   '';
diff --git a/pkgs/development/libraries/SDL2/default.nix b/pkgs/development/libraries/SDL2/default.nix
index 4b358f68a117..242b1b8a3f58 100644
--- a/pkgs/development/libraries/SDL2/default.nix
+++ b/pkgs/development/libraries/SDL2/default.nix
@@ -1,12 +1,12 @@
-{ stdenv, lib, fetchurl, pkgconfig, pruneLibtoolFiles
-, openglSupport ? false, libGL
-, alsaSupport ? true, alsaLib
-, x11Support ? true, libX11, xproto, libICE, libXi, libXScrnSaver, libXcursor, libXinerama, libXext, libXxf86vm, libXrandr
-, waylandSupport ? true, wayland, wayland-protocols, libxkbcommon
-, dbusSupport ? false, dbus
+{ stdenv, config, libGLSupported, fetchurl, pkgconfig, pruneLibtoolFiles
+, openglSupport ? libGLSupported, libGL
+, alsaSupport ? stdenv.isLinux, alsaLib
+, x11Support ? !stdenv.isCygwin, libX11, xproto, libICE, libXi, libXScrnSaver, libXcursor, libXinerama, libXext, libXxf86vm, libXrandr
+, waylandSupport ? stdenv.isLinux, wayland, wayland-protocols, libxkbcommon
+, dbusSupport ? stdenv.isLinux, dbus
 , udevSupport ? false, udev
 , ibusSupport ? false, ibus
-, pulseaudioSupport ? true, libpulseaudio
+, pulseaudioSupport ? config.pulseaudio or stdenv.isLinux, libpulseaudio
 , AudioUnit, Cocoa, CoreAudio, CoreServices, ForceFeedback, OpenGL
 , audiofile, cf-private, libiconv
 }:
@@ -14,7 +14,7 @@
 # NOTE: When editing this expression see if the same change applies to
 # SDL expression too
 
-with lib;
+with stdenv.lib;
 
 assert !stdenv.isDarwin -> alsaSupport || pulseaudioSupport;
 assert openglSupport -> (stdenv.isDarwin || x11Support && libGL != null);
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 0c61e47ce575..07f0bf2bed2a 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -12122,10 +12122,6 @@ with pkgs;
   schroedinger = callPackage ../development/libraries/schroedinger { };
 
   SDL = callPackage ../development/libraries/SDL {
-    openglSupport = libGLSupported;
-    alsaSupport = stdenv.isLinux;
-    x11Support = !stdenv.isCygwin;
-    pulseaudioSupport = config.pulseaudio or stdenv.isLinux;
     inherit (darwin) cf-private;
     inherit (darwin.apple_sdk.frameworks) OpenGL CoreAudio CoreServices AudioUnit Kernel Cocoa;
   };
@@ -12147,12 +12143,6 @@ with pkgs;
   SDL_ttf = callPackage ../development/libraries/SDL_ttf { };
 
   SDL2 = callPackage ../development/libraries/SDL2 {
-    openglSupport = libGLSupported;
-    alsaSupport = stdenv.isLinux;
-    x11Support = !stdenv.isCygwin;
-    waylandSupport = stdenv.isLinux;
-    udevSupport = stdenv.isLinux;
-    pulseaudioSupport = config.pulseaudio or stdenv.isLinux;
     inherit (darwin) cf-private;
     inherit (darwin.apple_sdk.frameworks) AudioUnit Cocoa CoreAudio CoreServices ForceFeedback OpenGL;
   };