2018-07-18 22:05:53 +00:00
|
|
|
{ stdenv, fetchurl, makeDesktopItem, makeWrapper
|
|
|
|
, jdk, jre, libpulseaudio
|
|
|
|
}:
|
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;";
|
|
|
|
};
|
|
|
|
|
|
|
|
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" \
|
|
|
|
--suffix LD_LIBRARY_PATH : ${stdenv.lib.makeLibraryPath [ libpulseaudio ]}
|
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
|
|
|
};
|
|
|
|
}
|