Merge pull request #34089 from mnacamura/sdl2-darwin-fix

SDL2_{gfx,mixer,net,ttf}: fix Darwin build
This commit is contained in:
Daiderd Jordan 2018-01-21 00:30:36 +01:00 committed by GitHub
commit 1fa5c8abae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 23 additions and 13 deletions

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, SDL2 }:
{ stdenv, darwin, fetchurl, SDL2 }:
stdenv.mkDerivation rec {
name = "SDL2_gfx-${version}";
@ -9,7 +9,8 @@ stdenv.mkDerivation rec {
sha256 = "16jrijzdp095qf416zvj9gs2fqqn6zkyvlxs5xqybd0ip37cp6yn";
};
buildInputs = [ SDL2 ];
buildInputs = [ SDL2 ]
++ stdenv.lib.optional stdenv.isDarwin darwin.libobjc;
configureFlags = if stdenv.isi686 || stdenv.isx86_64 then "--enable-mmx" else "--disable-mmx";
@ -38,6 +39,6 @@ stdenv.mkDerivation rec {
license = licenses.zlib;
maintainers = with maintainers; [ bjg ];
platforms = platforms.linux;
platforms = platforms.unix;
};
}

View File

@ -1,5 +1,6 @@
{ stdenv, lib, fetchurl, autoreconfHook, pkgconfig, which
, SDL2, libogg, libvorbis, smpeg2, flac, libmodplug
, CoreServices, AudioUnit, AudioToolbox
, enableNativeMidi ? false, fluidsynth ? null }:
stdenv.mkDerivation rec {
@ -17,6 +18,8 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ autoreconfHook pkgconfig which ];
buildInputs = stdenv.lib.optionals stdenv.isDarwin [ CoreServices AudioUnit AudioToolbox ];
propagatedBuildInputs = [ SDL2 libogg libvorbis fluidsynth smpeg2 flac libmodplug ];
configureFlags = [ "--disable-music-ogg-shared" ]
@ -24,7 +27,7 @@ stdenv.mkDerivation rec {
meta = with stdenv.lib; {
description = "SDL multi-channel audio mixer library";
platforms = platforms.linux;
platforms = platforms.unix;
homepage = https://www.libsdl.org/projects/SDL_mixer/;
maintainers = with maintainers; [ MP2E ];
license = licenses.zlib;

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, SDL2 }:
{ stdenv, darwin, fetchurl, SDL2 }:
stdenv.mkDerivation rec {
name = "SDL2_net-${version}";
@ -9,6 +9,8 @@ stdenv.mkDerivation rec {
sha256 = "08cxc1bicmyk89kiks7izw1rlx5ng5n6xpy8fy0zxni3b9z8mkhm";
};
buildInputs = stdenv.lib.optional stdenv.isDarwin darwin.libobjc;
propagatedBuildInputs = [ SDL2 ];
meta = with stdenv.lib; {
@ -16,6 +18,6 @@ stdenv.mkDerivation rec {
homepage = https://www.libsdl.org/projects/SDL_net;
license = licenses.zlib;
maintainers = with maintainers; [ MP2E ];
platforms = platforms.linux;
platforms = platforms.unix;
};
}

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, SDL2, freetype, mesa_noglu }:
{ stdenv, darwin, fetchurl, SDL2, freetype, mesa_noglu }:
stdenv.mkDerivation rec {
name = "SDL2_ttf-${version}";
@ -9,11 +9,12 @@ stdenv.mkDerivation rec {
sha256 = "0xljwcpvd2knrjdfag5b257xqayplz55mqlszrqp0kpnphh5xnrl";
};
buildInputs = [ SDL2 freetype mesa_noglu ];
buildInputs = [ SDL2 freetype mesa_noglu ]
++ stdenv.lib.optional stdenv.isDarwin darwin.libobjc;
meta = with stdenv.lib; {
description = "SDL TrueType library";
platforms = platforms.linux;
platforms = platforms.unix;
license = licenses.zlib;
homepage = https://www.libsdl.org/projects/SDL_ttf/;
};

View File

@ -1,4 +1,4 @@
{ stdenv, fetchsvn, autoconf, automake, libtool, m4, pkgconfig, makeWrapper, SDL2 }:
{ stdenv, darwin, fetchsvn, autoconf, automake, libtool, m4, pkgconfig, makeWrapper, SDL2 }:
stdenv.mkDerivation rec {
name = "smpeg2-svn${version}";
@ -17,7 +17,8 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ autoconf automake pkgconfig makeWrapper ];
buildInputs = [ SDL2 ];
buildInputs = [ SDL2 ]
++ stdenv.lib.optional stdenv.isDarwin darwin.libobjc;
preConfigure = ''
sh autogen.sh
@ -37,7 +38,7 @@ stdenv.mkDerivation rec {
homepage = http://icculus.org/smpeg/;
description = "SDL2 MPEG Player Library";
license = licenses.lgpl2;
platforms = platforms.linux;
platforms = platforms.unix;
maintainers = with maintainers; [ orivej ];
};
}

View File

@ -10961,7 +10961,9 @@ with pkgs;
inherit (darwin.apple_sdk.frameworks) Foundation;
};
SDL2_mixer = callPackage ../development/libraries/SDL2_mixer { };
SDL2_mixer = callPackage ../development/libraries/SDL2_mixer {
inherit (darwin.apple_sdk.frameworks) CoreServices AudioUnit AudioToolbox;
};
SDL2_net = callPackage ../development/libraries/SDL2_net { };