3
0
Fork 0
forked from mirrors/nixpkgs

fix sound in minecraft for pulseaudio users

This commit is contained in:
Aristid Breitkreuz 2014-10-05 19:50:35 +02:00
parent 5c0816567d
commit 6c7786074f
3 changed files with 13 additions and 6 deletions

View file

@ -1,5 +1,5 @@
{ stdenv, fetchurl, jre, libX11, libXext, libXcursor, libXrandr, libXxf86vm { stdenv, fetchurl, jre, libX11, libXext, libXcursor, libXrandr, libXxf86vm
, mesa, openal, alsaOss }: , mesa, openal, alsaOss, pulseaudioSupport ? false, pulseaudio }:
assert jre ? architecture; assert jre ? architecture;
@ -23,7 +23,8 @@ stdenv.mkDerivation {
# wrapper for minecraft # 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/ 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 EOF
chmod +x $out/bin/minecraft chmod +x $out/bin/minecraft

View file

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

View file

@ -1628,7 +1628,10 @@ let
mfoc = callPackage ../tools/security/mfoc { }; 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 { }; minecraft-server = callPackage ../games/minecraft-server { };