2020-04-24 23:36:52 +00:00
|
|
|
{ stdenv
|
|
|
|
, fetchurl
|
|
|
|
, makeDesktopItem
|
|
|
|
, makeWrapper
|
|
|
|
, wrapGAppsHook
|
|
|
|
, gobject-introspection
|
|
|
|
, jre # old or modded versions of the game may require Java 8 (https://aur.archlinux.org/packages/minecraft-launcher/#pinned-674960)
|
|
|
|
, xorg
|
|
|
|
, zlib
|
|
|
|
, nss
|
|
|
|
, nspr
|
|
|
|
, fontconfig
|
|
|
|
, gnome2
|
|
|
|
, cairo
|
|
|
|
, expat
|
|
|
|
, alsaLib
|
|
|
|
, cups
|
|
|
|
, dbus
|
|
|
|
, atk
|
|
|
|
, gtk3-x11
|
|
|
|
, gtk2-x11
|
|
|
|
, gdk-pixbuf
|
|
|
|
, glib
|
|
|
|
, curl
|
|
|
|
, freetype
|
|
|
|
, libpulseaudio
|
2020-06-02 18:00:15 +00:00
|
|
|
, libuuid
|
2020-04-24 23:36:52 +00:00
|
|
|
, systemd
|
|
|
|
, flite ? null
|
|
|
|
, libXxf86vm ? null
|
|
|
|
}:
|
|
|
|
let
|
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = "minecraft-launcher";
|
|
|
|
exec = "minecraft-launcher";
|
|
|
|
icon = "minecraft-launcher";
|
|
|
|
comment = "Official launcher for Minecraft, a sandbox-building game";
|
|
|
|
desktopName = "Minecraft Launcher";
|
2020-07-18 16:06:22 +00:00
|
|
|
categories = "Game;";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
envLibPath = stdenv.lib.makeLibraryPath [
|
2020-06-02 18:00:15 +00:00
|
|
|
curl
|
|
|
|
libpulseaudio
|
|
|
|
systemd
|
|
|
|
alsaLib # needed for narrator
|
|
|
|
flite # needed for narrator
|
|
|
|
libXxf86vm # needed only for versions <1.13
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
libPath = stdenv.lib.makeLibraryPath ([
|
|
|
|
alsaLib
|
|
|
|
atk
|
|
|
|
cairo
|
|
|
|
cups
|
|
|
|
dbus
|
|
|
|
expat
|
|
|
|
fontconfig
|
|
|
|
freetype
|
|
|
|
gdk-pixbuf
|
|
|
|
glib
|
|
|
|
gnome2.pango
|
|
|
|
gtk3-x11
|
|
|
|
gtk2-x11
|
|
|
|
nspr
|
|
|
|
nss
|
|
|
|
stdenv.cc.cc
|
|
|
|
zlib
|
2020-06-02 18:00:15 +00:00
|
|
|
libuuid
|
2020-04-24 23:36:52 +00:00
|
|
|
] ++
|
|
|
|
(with xorg; [
|
|
|
|
libX11
|
|
|
|
libxcb
|
|
|
|
libXcomposite
|
|
|
|
libXcursor
|
|
|
|
libXdamage
|
|
|
|
libXext
|
|
|
|
libXfixes
|
|
|
|
libXi
|
|
|
|
libXrandr
|
|
|
|
libXrender
|
|
|
|
libXtst
|
|
|
|
libXScrnSaver
|
|
|
|
]));
|
|
|
|
in
|
2020-06-02 18:00:15 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "minecraft-launcher";
|
|
|
|
|
2020-10-19 09:53:12 +00:00
|
|
|
version = "2.1.17785";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://launcher.mojang.com/download/linux/x86_64/minecraft-launcher_${version}.tar.gz";
|
2020-10-19 09:53:12 +00:00
|
|
|
sha256 = "1r70myf6hqcnkd6v2m2r8cpj060vsjdyp4rfw6d93vwsyqi90jkc";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
icon = fetchurl {
|
|
|
|
url = "https://launcher.mojang.com/download/minecraft-launcher.svg";
|
|
|
|
sha256 = "0w8z21ml79kblv20wh5lz037g130pxkgs8ll9s3bi94zn2pbrhim";
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper wrapGAppsHook ];
|
|
|
|
buildInputs = [ gobject-introspection ];
|
|
|
|
|
|
|
|
sourceRoot = ".";
|
|
|
|
|
|
|
|
dontWrapGApps = true;
|
|
|
|
dontConfigure = true;
|
|
|
|
dontBuild = true;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/opt
|
|
|
|
mv minecraft-launcher $out/opt
|
|
|
|
|
|
|
|
${desktopItem.buildCommand}
|
|
|
|
install -D $icon $out/share/icons/hicolor/symbolic/apps/minecraft-launcher.svg
|
|
|
|
'';
|
|
|
|
|
|
|
|
preFixup = ''
|
|
|
|
patchelf \
|
|
|
|
--set-interpreter ${stdenv.cc.bintools.dynamicLinker} \
|
|
|
|
--set-rpath '$ORIGIN/'":${libPath}" \
|
|
|
|
$out/opt/minecraft-launcher/minecraft-launcher
|
|
|
|
patchelf \
|
|
|
|
--set-rpath '$ORIGIN/'":${libPath}" \
|
|
|
|
$out/opt/minecraft-launcher/libcef.so
|
|
|
|
patchelf \
|
|
|
|
--set-rpath '$ORIGIN/'":${libPath}" \
|
|
|
|
$out/opt/minecraft-launcher/liblauncher.so
|
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
# Do not create `GPUCache` in current directory
|
|
|
|
makeWrapper $out/opt/minecraft-launcher/minecraft-launcher $out/bin/minecraft-launcher \
|
|
|
|
--prefix LD_LIBRARY_PATH : ${envLibPath} \
|
|
|
|
--prefix PATH : ${stdenv.lib.makeBinPath [ jre ]} \
|
2020-07-18 16:06:22 +00:00
|
|
|
--set JAVA_HOME ${stdenv.lib.makeBinPath [ jre ]} \
|
2020-04-24 23:36:52 +00:00
|
|
|
--run "cd /tmp" \
|
|
|
|
"''${gappsWrapperArgs[@]}"
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Official launcher for Minecraft, a sandbox-building game";
|
|
|
|
homepage = "https://minecraft.net";
|
|
|
|
maintainers = with maintainers; [ cpages ryantm infinisil ];
|
|
|
|
license = licenses.unfree;
|
2020-06-02 18:00:15 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
passthru.updateScript = ./update.sh;
|
|
|
|
}
|