SDL: move overrides out of all-packages.nix

Using defaults makes it much easier to understand what the values are.
This commit is contained in:
Daiderd Jordan 2018-11-05 12:55:08 +01:00
parent 7edfded9c3
commit 8abc1cccfb
No known key found for this signature in database
GPG Key ID: D02435D05B810C96
3 changed files with 15 additions and 25 deletions

View File

@ -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
'';

View File

@ -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);

View File

@ -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;
};