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 { stdenv, config, libGLSupported, fetchurl, fetchpatch, pkgconfig, audiofile, libcap, libiconv
, openglSupport ? false, libGL, libGLU , openglSupport ? libGLSupported, libGL, libGLU
, alsaSupport ? true, alsaLib , alsaSupport ? stdenv.isLinux, alsaLib
, x11Support ? stdenv.hostPlatform == stdenv.buildPlatform, libXext, libICE, libXrandr , x11Support ? !stdenv.isCygwin, libXext, libICE, libXrandr
, pulseaudioSupport ? true, libpulseaudio , pulseaudioSupport ? config.pulseaudio or stdenv.isLinux, libpulseaudio
, OpenGL, CoreAudio, CoreServices, AudioUnit, Kernel, Cocoa , OpenGL, CoreAudio, CoreServices, AudioUnit, Kernel, Cocoa
, cf-private , cf-private
}: }:
@ -10,7 +10,7 @@
# NOTE: When editing this expression see if the same change applies to # NOTE: When editing this expression see if the same change applies to
# SDL2 expression too # SDL2 expression too
with lib; with stdenv.lib;
assert !stdenv.isDarwin -> alsaSupport || pulseaudioSupport; assert !stdenv.isDarwin -> alsaSupport || pulseaudioSupport;
assert openglSupport -> (stdenv.isDarwin || x11Support && libGL != null && libGLU != null); assert openglSupport -> (stdenv.isDarwin || x11Support && libGL != null && libGLU != null);
@ -114,7 +114,7 @@ stdenv.mkDerivation rec {
postFixup = '' postFixup = ''
for lib in $out/lib/*.so* ; do for lib in $out/lib/*.so* ; do
if [[ -L "$lib" ]]; then 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 fi
done done
''; '';

View File

@ -1,12 +1,12 @@
{ stdenv, lib, fetchurl, pkgconfig, pruneLibtoolFiles { stdenv, config, libGLSupported, fetchurl, pkgconfig, pruneLibtoolFiles
, openglSupport ? false, libGL , openglSupport ? libGLSupported, libGL
, alsaSupport ? true, alsaLib , alsaSupport ? stdenv.isLinux, alsaLib
, x11Support ? true, libX11, xproto, libICE, libXi, libXScrnSaver, libXcursor, libXinerama, libXext, libXxf86vm, libXrandr , x11Support ? !stdenv.isCygwin, libX11, xproto, libICE, libXi, libXScrnSaver, libXcursor, libXinerama, libXext, libXxf86vm, libXrandr
, waylandSupport ? true, wayland, wayland-protocols, libxkbcommon , waylandSupport ? stdenv.isLinux, wayland, wayland-protocols, libxkbcommon
, dbusSupport ? false, dbus , dbusSupport ? stdenv.isLinux, dbus
, udevSupport ? false, udev , udevSupport ? false, udev
, ibusSupport ? false, ibus , ibusSupport ? false, ibus
, pulseaudioSupport ? true, libpulseaudio , pulseaudioSupport ? config.pulseaudio or stdenv.isLinux, libpulseaudio
, AudioUnit, Cocoa, CoreAudio, CoreServices, ForceFeedback, OpenGL , AudioUnit, Cocoa, CoreAudio, CoreServices, ForceFeedback, OpenGL
, audiofile, cf-private, libiconv , audiofile, cf-private, libiconv
}: }:
@ -14,7 +14,7 @@
# NOTE: When editing this expression see if the same change applies to # NOTE: When editing this expression see if the same change applies to
# SDL expression too # SDL expression too
with lib; with stdenv.lib;
assert !stdenv.isDarwin -> alsaSupport || pulseaudioSupport; assert !stdenv.isDarwin -> alsaSupport || pulseaudioSupport;
assert openglSupport -> (stdenv.isDarwin || x11Support && libGL != null); assert openglSupport -> (stdenv.isDarwin || x11Support && libGL != null);

View File

@ -12122,10 +12122,6 @@ with pkgs;
schroedinger = callPackage ../development/libraries/schroedinger { }; schroedinger = callPackage ../development/libraries/schroedinger { };
SDL = callPackage ../development/libraries/SDL { 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) cf-private;
inherit (darwin.apple_sdk.frameworks) OpenGL CoreAudio CoreServices AudioUnit Kernel Cocoa; inherit (darwin.apple_sdk.frameworks) OpenGL CoreAudio CoreServices AudioUnit Kernel Cocoa;
}; };
@ -12147,12 +12143,6 @@ with pkgs;
SDL_ttf = callPackage ../development/libraries/SDL_ttf { }; SDL_ttf = callPackage ../development/libraries/SDL_ttf { };
SDL2 = callPackage ../development/libraries/SDL2 { 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) cf-private;
inherit (darwin.apple_sdk.frameworks) AudioUnit Cocoa CoreAudio CoreServices ForceFeedback OpenGL; inherit (darwin.apple_sdk.frameworks) AudioUnit Cocoa CoreAudio CoreServices ForceFeedback OpenGL;
}; };