2014-07-28 09:30:31 +00:00
|
|
|
{ stdenv, fetchurl, jre, libX11, libXext, libXcursor, libXrandr, libXxf86vm
|
2015-05-27 19:42:15 +00:00
|
|
|
, mesa, openal, alsaOss, pulseaudioSupport ? false, libpulseaudio }:
|
2012-04-29 14:09:58 +00:00
|
|
|
|
2014-07-28 09:30:31 +00:00
|
|
|
assert jre ? architecture;
|
|
|
|
|
2012-04-29 14:09:58 +00:00
|
|
|
stdenv.mkDerivation {
|
2014-03-30 17:34:33 +00:00
|
|
|
name = "minecraft-2013.07.01";
|
2012-04-29 14:09:58 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2014-03-30 17:34:33 +00:00
|
|
|
url = "https://s3.amazonaws.com/Minecraft.Download/launcher/Minecraft.jar";
|
|
|
|
sha256 = "04pj4l5q0a64jncm2kk45r7nxnxa2z9n110dcxbbahdi6wk0png8";
|
2012-04-29 14:09:58 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
phases = "installPhase";
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
set -x
|
|
|
|
mkdir -pv $out/bin
|
|
|
|
cp -v $src $out/minecraft.jar
|
|
|
|
|
|
|
|
cat > $out/bin/minecraft << EOF
|
|
|
|
#!${stdenv.shell}
|
|
|
|
|
|
|
|
# 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/
|
2015-05-27 19:42:15 +00:00
|
|
|
${if pulseaudioSupport then "${libpulseaudio}/bin/padsp" else "${alsaOss}/bin/aoss" } \
|
2014-10-05 17:50:35 +00:00
|
|
|
${jre}/bin/java -jar $out/minecraft.jar
|
2012-04-29 14:09:58 +00:00
|
|
|
EOF
|
|
|
|
|
|
|
|
chmod +x $out/bin/minecraft
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "A sandbox-building game";
|
|
|
|
homepage = http://www.minecraft.net;
|
2014-01-22 03:34:41 +00:00
|
|
|
maintainers = [ stdenv.lib.maintainers.page ];
|
2014-11-06 00:44:33 +00:00
|
|
|
license = stdenv.lib.licenses.unfreeRedistributable;
|
2012-04-29 14:09:58 +00:00
|
|
|
};
|
|
|
|
}
|