minecraft: clean and fix up

The launcher now downloads almost all required libraries itself into
~/.minecraft and there's nothing one can do about it. Sound only works
with libpulseaudio though
This commit is contained in:
Silvan Mosberger 2018-07-19 00:05:53 +02:00
parent 35c069ea02
commit 47f78cd36a
No known key found for this signature in database
GPG Key ID: 9424360B4B85C9E7
2 changed files with 19 additions and 34 deletions

View File

@ -1,11 +1,6 @@
{ stdenv, fetchurl, makeDesktopItem
, jre, libX11, libXext, libXcursor, libXrandr, libXxf86vm
, openjdk
, libGLU_combined, openal
, useAlsa ? false, alsaOss ? null }:
with stdenv.lib;
assert useAlsa -> alsaOss != null;
{ stdenv, fetchurl, makeDesktopItem, makeWrapper
, jdk, jre, libpulseaudio
}:
let
desktopItem = makeDesktopItem {
@ -19,41 +14,33 @@ let
};
in stdenv.mkDerivation {
name = "minecraft-2015.07.24";
name = "minecraft-2015-07-24";
src = fetchurl {
url = "https://s3.amazonaws.com/Minecraft.Download/launcher/Minecraft.jar";
sha256 = "04pj4l5q0a64jncm2kk45r7nxnxa2z9n110dcxbbahdi6wk0png8";
};
phases = "installPhase";
nativeBuildInputs = [ makeWrapper ];
unpackPhase = "${jdk}/bin/jar xf $src favicon.png";
installPhase = ''
set -x
mkdir -pv $out/bin
cp -v $src $out/minecraft.jar
mkdir -p $out/bin $out/share/minecraft
cat > $out/bin/minecraft << EOF
#!${stdenv.shell}
makeWrapper ${jre}/bin/java $out/bin/minecraft \
--add-flags "-jar $out/share/minecraft/minecraft.jar" \
--suffix LD_LIBRARY_PATH : ${stdenv.lib.makeLibraryPath [ libpulseaudio ]}
export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:${makeLibraryPath [ libX11 libXext libXcursor libXrandr libXxf86vm libGLU_combined openal ]}
${if useAlsa then "${alsaOss}/bin/aoss" else "" } \
${jre}/bin/java -jar $out/minecraft.jar
EOF
chmod +x $out/bin/minecraft
mkdir -p $out/share/applications
ln -s ${desktopItem}/share/applications/* $out/share/applications/
${openjdk}/bin/jar xf $out/minecraft.jar favicon.png
cp $src $out/share/minecraft/minecraft.jar
cp -r ${desktopItem}/share/applications $out/share
install -D favicon.png $out/share/icons/hicolor/32x32/apps/minecraft.png
'';
meta = {
description = "A sandbox-building game";
homepage = http://www.minecraft.net;
maintainers = with stdenv.lib.maintainers; [ cpages ryantm ];
license = stdenv.lib.licenses.unfreeRedistributable;
meta = with stdenv.lib; {
description = "A sandbox-building game";
homepage = https://minecraft.net;
maintainers = with maintainers; [ cpages ryantm infinisil ];
license = licenses.unfreeRedistributable;
};
}

View File

@ -19661,9 +19661,7 @@ with pkgs;
megaglest = callPackage ../games/megaglest {};
minecraft = callPackage ../games/minecraft {
useAlsa = config.minecraft.alsa or false;
};
minecraft = callPackage ../games/minecraft { };
minecraft-server = callPackage ../games/minecraft-server { };