beret: Fix build on darwin (close #923)

This commit is contained in:
Jason \"Don\" O'Conal 2013-09-06 11:47:49 +10:00 committed by Vladimír Čunát
parent 38d54cfc21
commit 834cd6c886
6 changed files with 74 additions and 56 deletions

View File

@ -23,10 +23,11 @@ let
''; '';
in in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "SDL-1.2.15"; version = "1.2.15";
name = "SDL-${version}";
src = fetchurl { src = fetchurl {
url = "http://www.libsdl.org/release/${name}.tar.gz"; url = "http://www.libsdl.org/release/${name}.tar.gz";
sha256 = "005d993xcac8236fpvd1iawkz4wqjybkpn8dbwaliqz5jfkidlyn"; sha256 = "005d993xcac8236fpvd1iawkz4wqjybkpn8dbwaliqz5jfkidlyn";
}; };
@ -49,8 +50,10 @@ stdenv.mkDerivation rec {
passthru = {inherit openglSupport;}; passthru = {inherit openglSupport;};
meta = { meta = with stdenv.lib; {
description = "A cross-platform multimedia library"; description = "A cross-platform multimedia library";
homepage = http://www.libsdl.org/; homepage = http://www.libsdl.org/;
maintainers = with maintainers; [ lovek323 ];
platforms = platforms.unix;
}; };
} }

View File

@ -4,11 +4,11 @@ stdenv.mkDerivation rec {
name = "SDL_image-1.2.12"; name = "SDL_image-1.2.12";
src = fetchurl { src = fetchurl {
url = "http://www.libsdl.org/projects/SDL_image/release/${name}.tar.gz"; url = "http://www.libsdl.org/projects/SDL_image/release/${name}.tar.gz";
sha256 = "16an9slbb8ci7d89wakkmyfvp7c0cval8xw4hkg0842nhhlp540b"; sha256 = "16an9slbb8ci7d89wakkmyfvp7c0cval8xw4hkg0842nhhlp540b";
}; };
buildInputs = [SDL libpng libjpeg libtiff libungif libXpm]; buildInputs = [ SDL libpng libjpeg libtiff libungif libXpm ];
postInstall = '' postInstall = ''
sed -i -e 's,"SDL.h",<SDL/SDL.h>,' \ sed -i -e 's,"SDL.h",<SDL/SDL.h>,' \
@ -19,9 +19,10 @@ stdenv.mkDerivation rec {
ln -sv SDL/SDL_image.h $out/include/SDL_image.h ln -sv SDL/SDL_image.h $out/include/SDL_image.h
''; '';
meta = { meta = with stdenv.lib; {
description = "SDL image library"; description = "SDL image library";
homepage = "http://www.libsdl.org/projects/SDL_image/"; homepage = http://www.libsdl.org/projects/SDL_image/;
platforms = stdenv.lib.platforms.linux; maintainers = with maintainers; [ lovek323 ];
platforms = platforms.unix;
}; };
} }

View File

@ -1,14 +1,13 @@
{ stdenv, fetchurl, SDL, libogg, libvorbis, enableNativeMidi ? false }: { stdenv, fetchurl, SDL, libogg, libvorbis, enableNativeMidi ? false }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "SDL_mixer"; pname = "SDL_mixer";
version = "1.2.8"; version = "1.2.12";
name = "${pname}-${version}";
name = "${pname}-${version}";
src = fetchurl { src = fetchurl {
url = "http://www.libsdl.org/projects/${pname}/release/${name}.tar.gz"; url = "http://www.libsdl.org/projects/${pname}/release/${name}.tar.gz";
sha256 = "a8222a274778ff16d0e3ee49a30db27a48a4d357169a915fc599a764e405e0b6"; sha256 = "0alrhqgm40p4c92s26mimg9cm1y7rzr6m0p49687jxd9g6130i0n";
}; };
buildInputs = [SDL libogg libvorbis]; buildInputs = [SDL libogg libvorbis];
@ -17,7 +16,10 @@ stdenv.mkDerivation rec {
postInstall = "ln -s $out/include/SDL/SDL_mixer.h $out/include/"; postInstall = "ln -s $out/include/SDL/SDL_mixer.h $out/include/";
meta = { meta = with stdenv.lib; {
description = "SDL multi-channel audio mixer library"; description = "SDL multi-channel audio mixer library";
homepage = http://www.libsdl.org/projects/SDL_mixer/;
maintainers = with maintainers; [ lovek323 ];
platforms = platforms.unix;
}; };
} }

View File

@ -6,8 +6,9 @@ stdenv.mkDerivation {
buildInputs = [ SDL SDL_image SDL_ttf SDL_mixer ]; buildInputs = [ SDL SDL_image SDL_ttf SDL_mixer ];
NIX_CFLAGS_COMPILE = "-I${SDL}/include/SDL"; NIX_CFLAGS_COMPILE = "-I${SDL}/include/SDL";
NIX_CFLAGS_LINK = stdenv.lib.optionalString (!stdenv.isDarwin) "-lgcc_s";
NIX_CFLAGS_LINK = "-lgcc_s"; NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin
"-framework CoreFoundation -framework OpenGL -framework Cocoa";
patches = [ ./use-home-dir.patch ]; patches = [ ./use-home-dir.patch ];
@ -28,11 +29,12 @@ stdenv.mkDerivation {
cp -av tahoma.ttf images music rooms sfx $out/share cp -av tahoma.ttf images music rooms sfx $out/share
''; '';
meta = { meta = with stdenv.lib; {
description = "A 2D puzzle-platformer game about a scientist with telekinetic abilities"; description = "A 2D puzzle-platformer game about a scientist with telekinetic abilities";
homepage = http://kiwisauce.com/beret/; homepage = http://kiwisauce.com/beret/;
platforms = stdenv.lib.platforms.all; license = licenses.lgpl2;
license = stdenv.lib.licenses.lgpl2; maintainers = with maintainers; [ lovek323 ];
platforms = platforms.all;
}; };
} }

View File

@ -1,11 +1,9 @@
{ stdenv, fetchurl, pkgconfig, gnum4, gdbm, libtool, glib, dbus, avahi { stdenv, fetchurl, pkgconfig, gnum4, gdbm, libtool, glib, dbus, avahi
, gconf, gtk, intltool, gettext , gconf, gtk, intltool, gettext, alsaLib, libsamplerate, libsndfile, speex
, alsaLib, libsamplerate, libsndfile, speex, bluez, sbc, udev, libcap , bluez, sbc, udev, libcap, json_c
, jackaudioSupport ? false, jackaudio ? null , jackaudioSupport ? false, jackaudio ? null
, x11Support ? false, xlibs , x11Support ? false, xlibs
, json_c , useSystemd ? false, systemd ? null }:
, useSystemd ? false, systemd ? null
}:
assert jackaudioSupport -> jackaudio != null; assert jackaudioSupport -> jackaudio != null;
@ -18,20 +16,18 @@ stdenv.mkDerivation rec {
}; };
# Since `libpulse*.la' contain `-lgdbm' and `-lcap', it must be propagated. # Since `libpulse*.la' contain `-lgdbm' and `-lcap', it must be propagated.
propagatedBuildInputs = [ gdbm libcap ]; propagatedBuildInputs
= [ gdbm ] ++ stdenv.lib.optionals (!stdenv.isDarwin) [ libcap ];
buildInputs = buildInputs =
[ pkgconfig gnum4 libtool intltool glib dbus avahi [ pkgconfig gnum4 libtool intltool glib dbus avahi libsamplerate libsndfile
libsamplerate libsndfile speex alsaLib bluez sbc udev speex json_c ]
json_c
#gtk gconf
]
++ stdenv.lib.optional jackaudioSupport jackaudio ++ stdenv.lib.optional jackaudioSupport jackaudio
++ stdenv.lib.optionals x11Support [ xlibs.xlibs xlibs.libXtst xlibs.libXi ] ++ stdenv.lib.optionals x11Support [ xlibs.xlibs xlibs.libXtst xlibs.libXi ]
++ stdenv.lib.optional useSystemd systemd; ++ stdenv.lib.optional useSystemd systemd
++ stdenv.lib.optionals (!stdenv.isDarwin) [ alsaLib bluez sbc udev ];
preConfigure = '' preConfigure = ''
# Move the udev rules under $(prefix). # Move the udev rules under $(prefix).
sed -i "src/Makefile.in" \ sed -i "src/Makefile.in" \
-e "s|udevrulesdir[[:blank:]]*=.*$|udevrulesdir = $out/lib/udev/rules.d|g" -e "s|udevrulesdir[[:blank:]]*=.*$|udevrulesdir = $out/lib/udev/rules.d|g"
@ -42,19 +38,32 @@ stdenv.mkDerivation rec {
-e "s|chmod r+s |true |" -e "s|chmod r+s |true |"
''; '';
configureFlags = '' configureFlags =
--disable-solaris --disable-hal --disable-jack [ "--disable-solaris" "--disable-jack" "--disable-oss-output"
--disable-oss-output --disable-oss-wrapper "--disable-oss-wrapper" "--localstatedir=/var" "--sysconfdir=/etc" ]
--localstatedir=/var --sysconfdir=/etc ++ stdenv.lib.optional jackaudioSupport "--enable-jack"
${if jackaudioSupport then "--enable-jack" else ""} ++ stdenv.lib.optional stdenv.isDarwin "--with-mac-sysroot=/";
'';
installFlags = "sysconfdir=$(out)/etc pulseconfdir=$(out)/etc/pulse";
enableParallelBuilding = true; enableParallelBuilding = true;
meta = { # not sure what the best practices are here -- can't seem to find a way
# for the compiler to bring in stdlib and stdio (etc.) properly
# the alternative is to copy the files from /usr/include to src, but there are
# probably a large number of files that would need to be copied (I stopped
# after the seventh)
NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin
"-I/usr/include";
installFlags = "sysconfdir=$(out)/etc pulseconfdir=$(out)/etc/pulse";
meta = with stdenv.lib; {
description = "PulseAudio, a sound server for POSIX and Win32 systems"; description = "PulseAudio, a sound server for POSIX and Win32 systems";
homepage = http://www.pulseaudio.org/;
# Note: Practically, the server is under the GPL due to the
# dependency on `libsamplerate'. See `LICENSE' for details.
licenses = licenses.lgpl2Plus;
maintainers = with maintainers; [ lovek323 ];
platforms = platforms.unix;
longDescription = '' longDescription = ''
PulseAudio is a sound server for POSIX and Win32 systems. A PulseAudio is a sound server for POSIX and Win32 systems. A
@ -65,14 +74,5 @@ stdenv.mkDerivation rec {
sample format or channel count and mixing several sounds into sample format or channel count and mixing several sounds into
one are easily achieved using a sound server. one are easily achieved using a sound server.
''; '';
homepage = http://www.pulseaudio.org/;
# Note: Practically, the server is under the GPL due to the
# dependency on `libsamplerate'. See `LICENSE' for details.
licenses = "LGPLv2+";
maintainers = [ ];
platforms = stdenv.lib.platforms.gnu;
}; };
} }

View File

@ -5402,14 +5402,24 @@ let
SDL = callPackage ../development/libraries/SDL { SDL = callPackage ../development/libraries/SDL {
openglSupport = mesaSupported; openglSupport = mesaSupported;
alsaSupport = true; alsaSupport = (!stdenv.isDarwin);
x11Support = true; x11Support = true;
pulseaudioSupport = false; # better go through ALSA pulseaudioSupport = stdenv.isDarwin; # better go through ALSA
# resolve the unrecognized -fpascal-strings option error
stdenv = if stdenv.isDarwin
then clangStdenv
else stdenv;
}; };
SDL_gfx = callPackage ../development/libraries/SDL_gfx { }; SDL_gfx = callPackage ../development/libraries/SDL_gfx { };
SDL_image = callPackage ../development/libraries/SDL_image { }; SDL_image = callPackage ../development/libraries/SDL_image {
# provide an Objective-C compiler
stdenv = if stdenv.isDarwin
then clangStdenv
else stdenv;
};
SDL_mixer = callPackage ../development/libraries/SDL_mixer { }; SDL_mixer = callPackage ../development/libraries/SDL_mixer { };