Merge pull request #4388 from NixOS/minecraft-sound

Minecraft sound with Pulseaudio
This commit is contained in:
Aristid Breitkreuz 2014-10-06 20:08:29 +02:00
commit a839129fde
3 changed files with 13 additions and 6 deletions

View File

@ -1,5 +1,5 @@
{ stdenv, fetchurl, jre, libX11, libXext, libXcursor, libXrandr, libXxf86vm
, mesa, openal, alsaOss }:
, mesa, openal, alsaOss, pulseaudioSupport ? false, pulseaudio }:
assert jre ? architecture;
@ -23,7 +23,8 @@ stdenv.mkDerivation {
# wrapper for minecraft
export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:${jre}/lib/${jre.architecture}/:${libX11}/lib/:${libXext}/lib/:${libXcursor}/lib/:${libXrandr}/lib/:${libXxf86vm}/lib/:${mesa}/lib/:${openal}/lib/
${alsaOss}/bin/aoss ${jre}/bin/java -jar $out/minecraft.jar
${if pulseaudioSupport then "${pulseaudio}/bin/padsp" else "${alsaOss}/bin/aoss" } \
${jre}/bin/java -jar $out/minecraft.jar
EOF
chmod +x $out/bin/minecraft

View File

@ -3,7 +3,8 @@
, bluez, sbc, udev, libcap, json_c
, jackaudioSupport ? false, jack2 ? null
, x11Support ? false, xlibs
, useSystemd ? false, systemd ? null }:
, useSystemd ? false, systemd ? null
, ossWrapper ? false }:
assert jackaudioSupport -> jack2 != null;
@ -49,11 +50,13 @@ stdenv.mkDerivation rec {
"--disable-solaris"
"--disable-jack"
"--disable-oss-output"
"--disable-oss-wrapper"
] ++ stdenv.lib.optional (!ossWrapper) "--disable-oss-wrapper" ++
[
"--localstatedir=/var"
"--sysconfdir=/etc"
"--with-access-group=audio"
] ++ stdenv.lib.optional jackaudioSupport "--enable-jack"
]
++ stdenv.lib.optional jackaudioSupport "--enable-jack"
++ stdenv.lib.optional stdenv.isDarwin "--with-mac-sysroot=/";
enableParallelBuilding = true;

View File

@ -1628,7 +1628,10 @@ let
mfoc = callPackage ../tools/security/mfoc { };
minecraft = callPackage ../games/minecraft { };
minecraft = callPackage ../games/minecraft {
pulseaudioSupport = config.pulseaudio or true;
pulseaudio = pulseaudio.override { ossWrapper = true; };
};
minecraft-server = callPackage ../games/minecraft-server { };