2018-07-18 22:05:53 +00:00
|
|
|
{ stdenv, fetchurl, makeDesktopItem, makeWrapper
|
2018-12-01 22:56:01 +00:00
|
|
|
, jdk, jre, libpulseaudio, libXxf86vm
|
2018-07-18 22:05:53 +00:00
|
|
|
}:
|
2014-07-28 09:30:31 +00:00
|
|
|
|
2016-02-14 18:24:46 +00:00
|
|
|
let
|
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = "minecraft";
|
|
|
|
exec = "minecraft";
|
2016-06-09 14:02:26 +00:00
|
|
|
icon = "minecraft";
|
2016-02-14 18:24:46 +00:00
|
|
|
comment = "A sandbox-building game";
|
|
|
|
desktopName = "Minecraft";
|
|
|
|
genericName = "minecraft";
|
|
|
|
categories = "Game;";
|
|
|
|
};
|
|
|
|
|
2018-12-01 22:56:01 +00:00
|
|
|
libPath = stdenv.lib.makeLibraryPath [
|
|
|
|
libpulseaudio
|
|
|
|
libXxf86vm # Needed only for versions <1.13
|
|
|
|
];
|
|
|
|
|
2016-02-14 18:24:46 +00:00
|
|
|
in stdenv.mkDerivation {
|
2018-07-18 22:05:53 +00:00
|
|
|
name = "minecraft-2015-07-24";
|
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
|
|
|
};
|
|
|
|
|
2018-07-18 22:05:53 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2012-04-29 14:09:58 +00:00
|
|
|
|
2018-07-18 22:05:53 +00:00
|
|
|
unpackPhase = "${jdk}/bin/jar xf $src favicon.png";
|
2012-04-29 14:09:58 +00:00
|
|
|
|
2018-07-18 22:05:53 +00:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin $out/share/minecraft
|
2016-02-14 18:24:46 +00:00
|
|
|
|
2018-07-18 22:05:53 +00:00
|
|
|
makeWrapper ${jre}/bin/java $out/bin/minecraft \
|
|
|
|
--add-flags "-jar $out/share/minecraft/minecraft.jar" \
|
2018-12-01 22:56:01 +00:00
|
|
|
--suffix LD_LIBRARY_PATH : ${libPath}
|
2016-06-09 14:02:26 +00:00
|
|
|
|
2018-07-18 22:05:53 +00:00
|
|
|
cp $src $out/share/minecraft/minecraft.jar
|
|
|
|
cp -r ${desktopItem}/share/applications $out/share
|
2016-06-09 14:02:26 +00:00
|
|
|
install -D favicon.png $out/share/icons/hicolor/32x32/apps/minecraft.png
|
2012-04-29 14:09:58 +00:00
|
|
|
'';
|
|
|
|
|
2018-07-18 22:05:53 +00:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "A sandbox-building game";
|
|
|
|
homepage = https://minecraft.net;
|
|
|
|
maintainers = with maintainers; [ cpages ryantm infinisil ];
|
|
|
|
license = licenses.unfreeRedistributable;
|
2012-04-29 14:09:58 +00:00
|
|
|
};
|
|
|
|
}
|