-
-
Save hyperfekt/841be248f3dd8bfad9966d8495ee844a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ stdenv, fetchurl, dpkg, makeWrapper, jre, libpulseaudio | |
}: | |
stdenv.mkDerivation rec { | |
pname = "minecraft-launcher"; | |
version = "2.1.5965"; | |
src = fetchurl { | |
url = "https://launcher.mojang.com/download/Minecraft.deb"; | |
sha256 = "1n559ywicg72ia1szmncifpfvjbvrnw1c8b477zmyjmfcd1lirbn"; | |
}; | |
buildInputs = [ dpkg makeWrapper ]; | |
sourceRoot = "."; | |
unpackPhase = "dpkg-deb -x $src ."; | |
dontConfigure = true; | |
dontBuild = true; | |
installPhase = '' | |
mkdir -p $out/bin | |
mv opt $out/opt | |
mv usr/share $out/share | |
substituteInPlace $out/share/applications/minecraft-launcher.desktop --replace /opt $out/opt | |
makeWrapper $out/opt/minecraft-launcher/minecraft-launcher $out/bin/minecraft-launcher --prefix PATH : ${stdenv.lib.makeBinPath [ jre ]} | |
''; | |
preFixup = let | |
libPath = stdenv.lib.makeLibraryPath [ | |
stdenv.cc.cc.lib # libstdc++.so.6 | |
]; | |
in '' | |
patchelf \ | |
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ | |
--set-rpath "$out/opt/minecraft-launcher:${libPath}" \ | |
$out/opt/minecraft-launcher/minecraft-launcher | |
''; | |
meta = with stdenv.lib; { | |
description = "A sandbox-building game"; | |
homepage = https://minecraft.net; | |
maintainers = with maintainers; [ cpages ryantm infinisil ]; | |
license = licenses.unfreeRedistributable; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment