2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv
|
2019-09-05 21:23:51 +00:00
|
|
|
, fetchurl
|
2020-11-28 17:42:10 +00:00
|
|
|
, nixosTests
|
2020-11-27 12:45:31 +00:00
|
|
|
, copyDesktopItems
|
2019-09-05 21:23:51 +00:00
|
|
|
, makeDesktopItem
|
|
|
|
, makeWrapper
|
2024-04-26 20:24:03 +00:00
|
|
|
, wrapGAppsHook3
|
2020-03-09 15:15:54 +00:00
|
|
|
, gobject-introspection
|
2019-09-05 21:23:51 +00:00
|
|
|
, 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
|
2020-10-25 19:38:25 +00:00
|
|
|
, pango
|
2019-09-05 21:23:51 +00:00
|
|
|
, cairo
|
|
|
|
, expat
|
2021-06-10 02:57:09 +00:00
|
|
|
, alsa-lib
|
2019-09-05 21:23:51 +00:00
|
|
|
, cups
|
|
|
|
, dbus
|
|
|
|
, atk
|
2019-10-26 20:55:05 +00:00
|
|
|
, gtk3-x11
|
2019-09-05 21:23:51 +00:00
|
|
|
, gtk2-x11
|
|
|
|
, gdk-pixbuf
|
|
|
|
, glib
|
|
|
|
, curl
|
|
|
|
, freetype
|
|
|
|
, libpulseaudio
|
2020-05-30 12:07:06 +00:00
|
|
|
, libuuid
|
2019-09-05 21:23:51 +00:00
|
|
|
, systemd
|
|
|
|
, flite ? null
|
|
|
|
, libXxf86vm ? null
|
2018-07-18 22:05:53 +00:00
|
|
|
}:
|
2016-02-14 18:24:46 +00:00
|
|
|
let
|
|
|
|
desktopItem = makeDesktopItem {
|
2019-09-05 21:23:51 +00:00
|
|
|
name = "minecraft-launcher";
|
|
|
|
exec = "minecraft-launcher";
|
|
|
|
icon = "minecraft-launcher";
|
|
|
|
comment = "Official launcher for Minecraft, a sandbox-building game";
|
|
|
|
desktopName = "Minecraft Launcher";
|
2022-02-22 14:56:15 +00:00
|
|
|
categories = [ "Game" ];
|
2016-02-14 18:24:46 +00:00
|
|
|
};
|
|
|
|
|
2021-01-15 04:31:39 +00:00
|
|
|
envLibPath = lib.makeLibraryPath [
|
2020-05-30 12:07:06 +00:00
|
|
|
curl
|
|
|
|
libpulseaudio
|
|
|
|
systemd
|
2021-06-10 02:57:09 +00:00
|
|
|
alsa-lib # needed for narrator
|
2020-05-30 12:07:06 +00:00
|
|
|
flite # needed for narrator
|
|
|
|
libXxf86vm # needed only for versions <1.13
|
|
|
|
];
|
2018-12-01 22:56:01 +00:00
|
|
|
|
2021-01-15 04:31:39 +00:00
|
|
|
libPath = lib.makeLibraryPath ([
|
2021-06-10 02:57:09 +00:00
|
|
|
alsa-lib
|
2019-09-05 21:23:51 +00:00
|
|
|
atk
|
|
|
|
cairo
|
|
|
|
cups
|
|
|
|
dbus
|
|
|
|
expat
|
|
|
|
fontconfig
|
|
|
|
freetype
|
|
|
|
gdk-pixbuf
|
|
|
|
glib
|
2020-10-25 19:38:25 +00:00
|
|
|
pango
|
2019-10-26 20:55:05 +00:00
|
|
|
gtk3-x11
|
2019-09-05 21:23:51 +00:00
|
|
|
gtk2-x11
|
|
|
|
nspr
|
|
|
|
nss
|
|
|
|
stdenv.cc.cc
|
|
|
|
zlib
|
2020-05-30 12:07:06 +00:00
|
|
|
libuuid
|
2019-09-05 21:23:51 +00:00
|
|
|
] ++
|
|
|
|
(with xorg; [
|
|
|
|
libX11
|
|
|
|
libxcb
|
|
|
|
libXcomposite
|
|
|
|
libXcursor
|
|
|
|
libXdamage
|
|
|
|
libXext
|
|
|
|
libXfixes
|
|
|
|
libXi
|
|
|
|
libXrandr
|
|
|
|
libXrender
|
|
|
|
libXtst
|
|
|
|
libXScrnSaver
|
|
|
|
]));
|
|
|
|
in
|
2020-05-30 12:07:06 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-09-05 21:23:51 +00:00
|
|
|
pname = "minecraft-launcher";
|
|
|
|
|
2021-04-26 19:23:42 +00:00
|
|
|
version = "2.2.1441";
|
2012-04-29 14:09:58 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-09-05 21:23:51 +00:00
|
|
|
url = "https://launcher.mojang.com/download/linux/x86_64/minecraft-launcher_${version}.tar.gz";
|
2021-04-26 19:23:42 +00:00
|
|
|
sha256 = "03q579hvxnsh7d00j6lmfh53rixdpf33xb5zlz7659pvb9j5w0cm";
|
2019-09-05 21:23:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
icon = fetchurl {
|
|
|
|
url = "https://launcher.mojang.com/download/minecraft-launcher.svg";
|
|
|
|
sha256 = "0w8z21ml79kblv20wh5lz037g130pxkgs8ll9s3bi94zn2pbrhim";
|
2012-04-29 14:09:58 +00:00
|
|
|
};
|
|
|
|
|
2024-04-26 20:24:03 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper wrapGAppsHook3 copyDesktopItems gobject-introspection ];
|
2012-04-29 14:09:58 +00:00
|
|
|
|
2019-09-05 21:23:51 +00:00
|
|
|
sourceRoot = ".";
|
|
|
|
|
2020-03-09 15:15:54 +00:00
|
|
|
dontWrapGApps = true;
|
2019-09-05 21:23:51 +00:00
|
|
|
dontConfigure = true;
|
|
|
|
dontBuild = true;
|
2012-04-29 14:09:58 +00:00
|
|
|
|
2018-07-18 22:05:53 +00:00
|
|
|
installPhase = ''
|
2020-11-27 12:45:31 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2019-09-05 21:23:51 +00:00
|
|
|
mkdir -p $out/opt
|
|
|
|
mv minecraft-launcher $out/opt
|
2016-02-14 18:24:46 +00:00
|
|
|
|
2019-09-05 21:23:51 +00:00
|
|
|
install -D $icon $out/share/icons/hicolor/symbolic/apps/minecraft-launcher.svg
|
2020-11-27 12:45:31 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
2019-09-05 21:23:51 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
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
|
2012-04-29 14:09:58 +00:00
|
|
|
'';
|
|
|
|
|
2020-03-09 15:15:54 +00:00
|
|
|
postFixup = ''
|
|
|
|
# Do not create `GPUCache` in current directory
|
|
|
|
makeWrapper $out/opt/minecraft-launcher/minecraft-launcher $out/bin/minecraft-launcher \
|
|
|
|
--prefix LD_LIBRARY_PATH : ${envLibPath} \
|
2021-01-15 04:31:39 +00:00
|
|
|
--prefix PATH : ${lib.makeBinPath [ jre ]} \
|
|
|
|
--set JAVA_HOME ${lib.getBin jre} \
|
2022-03-14 18:06:00 +00:00
|
|
|
--chdir /tmp \
|
2020-03-09 15:15:54 +00:00
|
|
|
"''${gappsWrapperArgs[@]}"
|
|
|
|
'';
|
|
|
|
|
2020-11-27 12:45:31 +00:00
|
|
|
desktopItems = [ desktopItem ];
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2019-09-05 21:23:51 +00:00
|
|
|
description = "Official launcher for Minecraft, a sandbox-building game";
|
|
|
|
homepage = "https://minecraft.net";
|
2024-04-09 15:26:37 +00:00
|
|
|
maintainers = with maintainers; [ cpages ryantm ];
|
2022-06-10 20:12:22 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
2019-09-05 21:23:51 +00:00
|
|
|
license = licenses.unfree;
|
2020-05-30 11:56:15 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2024-03-28 03:12:28 +00:00
|
|
|
# "minecraft-launcher will fail on NixOS for minecraft versions >1.19
|
|
|
|
# try prismlauncher or atlauncher instead"
|
|
|
|
broken = true;
|
2012-04-29 14:09:58 +00:00
|
|
|
};
|
2019-09-05 21:23:51 +00:00
|
|
|
|
2020-11-28 17:42:10 +00:00
|
|
|
passthru = {
|
|
|
|
tests = { inherit (nixosTests) minecraft; };
|
|
|
|
updateScript = ./update.sh;
|
|
|
|
};
|
2012-04-29 14:09:58 +00:00
|
|
|
}
|