nixpkgs/pkgs/games/minecraft/default.nix
Eelco Dolstra f64d84698e Merge remote-tracking branch 'origin/master' into staging
Conflicts:
	pkgs/applications/audio/espeak/edit.nix
	pkgs/applications/audio/lmms/default.nix
	pkgs/desktops/e18/enlightenment.nix
	pkgs/games/exult/default.nix
	pkgs/os-specific/linux/alsa-plugins/default.nix
2014-07-28 11:30:49 +02:00

39 lines
1.0 KiB
Nix

{ stdenv, fetchurl, jre, libX11, libXext, libXcursor, libXrandr, libXxf86vm
, mesa, openal, alsaOss }:
assert jre ? architecture;
stdenv.mkDerivation {
name = "minecraft-2013.07.01";
src = fetchurl {
url = "https://s3.amazonaws.com/Minecraft.Download/launcher/Minecraft.jar";
sha256 = "04pj4l5q0a64jncm2kk45r7nxnxa2z9n110dcxbbahdi6wk0png8";
};
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/
${alsaOss}/bin/aoss ${jre}/bin/java -jar $out/minecraft.jar
EOF
chmod +x $out/bin/minecraft
'';
meta = {
description = "A sandbox-building game";
homepage = http://www.minecraft.net;
maintainers = [ stdenv.lib.maintainers.page ];
license = "unfree-redistributable";
};
}