From 1cef6dc89acdd7e00b2281f0d81e1c3bc136e7c2 Mon Sep 17 00:00:00 2001 From: Spencer Whitt Date: Thu, 5 Mar 2015 15:55:59 -0500 Subject: [PATCH 1/2] SDL: Build on Darwin --- pkgs/development/libraries/SDL/default.nix | 11 +++++++++-- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/SDL/default.nix b/pkgs/development/libraries/SDL/default.nix index 3f1fbfcd6a9..6d6148e092a 100644 --- a/pkgs/development/libraries/SDL/default.nix +++ b/pkgs/development/libraries/SDL/default.nix @@ -7,7 +7,7 @@ # OSS is no longer supported, for it's much crappier than ALSA and # PulseAudio. -assert !(stdenv ? cross) -> alsaSupport || pulseaudioSupport; +assert (stdenv.isLinux && !(stdenv ? cross)) -> alsaSupport || pulseaudioSupport; assert openglSupport -> (mesa != null && x11Support); assert x11Support -> (x11 != null && libXrandr != null); @@ -51,6 +51,13 @@ stdenv.mkDerivation rec { "--without-x" ] ++ stdenv.lib.optional alsaSupport "--with-alsa-prefix=${alsaLib}/lib"); + # Fix a build failure on OS X Mavericks + # Ticket: https://bugzilla.libsdl.org/show_bug.cgi?id=2085 + patches = stdenv.lib.optional stdenv.isDarwin [ (fetchurl { + url = "http://bugzilla-attachments.libsdl.org/attachment.cgi?id=1320"; + sha1 = "3137feb503a89a8d606405373905b92dcf7e293b"; + }) ]; + crossAttrs =stdenv.lib.optionalAttrs (stdenv.cross.libc == "libSystem") { patches = let f = rev: sha256: fetchurl { @@ -72,6 +79,6 @@ stdenv.mkDerivation rec { description = "A cross-platform multimedia library"; homepage = http://www.libsdl.org/; maintainers = with maintainers; [ lovek323 ]; - platforms = platforms.linux; + platforms = platforms.unix; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index db1d42c1614..f66870a8102 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7357,7 +7357,7 @@ let openglSupport = mesaSupported; alsaSupport = (!stdenv.isDarwin); x11Support = true; - pulseaudioSupport = true; + pulseaudioSupport = (!stdenv.isDarwin); # resolve the unrecognized -fpascal-strings option error stdenv = if stdenv.isDarwin From b5099669ace72ef8a9f3f3dd9808c34a7493dab9 Mon Sep 17 00:00:00 2001 From: Spencer Whitt Date: Thu, 5 Mar 2015 15:56:41 -0500 Subject: [PATCH 2/2] SDL_image: Enable building on Darwin --- pkgs/development/libraries/SDL_image/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/SDL_image/default.nix b/pkgs/development/libraries/SDL_image/default.nix index 2aa122a8fb2..a1d83950477 100644 --- a/pkgs/development/libraries/SDL_image/default.nix +++ b/pkgs/development/libraries/SDL_image/default.nix @@ -23,6 +23,6 @@ stdenv.mkDerivation rec { description = "SDL image library"; homepage = http://www.libsdl.org/projects/SDL_image/; maintainers = with maintainers; [ lovek323 ]; - platforms = platforms.linux; + platforms = platforms.unix; }; }