From 560c08f2cc92e2a432212d6c81ace7b0c16d7ebc Mon Sep 17 00:00:00 2001 From: Haylin Moore Date: Sat, 6 Sep 2025 14:59:56 +0200 Subject: [PATCH] minecraft: drop The package has been broken for over a year and multiple major minecraft releases. There are better launchers for minecraft like prismlauncher. --- nixos/tests/all-tests.nix | 1 - nixos/tests/minecraft.nix | 40 ------ pkgs/by-name/mi/minecraft/package.nix | 172 -------------------------- pkgs/by-name/mi/minecraft/update.sh | 7 -- pkgs/top-level/aliases.nix | 1 + 5 files changed, 1 insertion(+), 220 deletions(-) delete mode 100644 nixos/tests/minecraft.nix delete mode 100644 pkgs/by-name/mi/minecraft/package.nix delete mode 100755 pkgs/by-name/mi/minecraft/update.sh diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 2b435d699dbd..398fa4157388 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -913,7 +913,6 @@ in metabase = runTest ./metabase.nix; mihomo = runTest ./mihomo.nix; mindustry = runTest ./mindustry.nix; - minecraft = runTest ./minecraft.nix; minecraft-server = runTest ./minecraft-server.nix; minidlna = runTest ./minidlna.nix; miniflux = runTest ./miniflux.nix; diff --git a/nixos/tests/minecraft.nix b/nixos/tests/minecraft.nix deleted file mode 100644 index db577a573b23..000000000000 --- a/nixos/tests/minecraft.nix +++ /dev/null @@ -1,40 +0,0 @@ -{ pkgs, lib, ... }: -{ - name = "minecraft"; - meta = with lib.maintainers; { - maintainers = [ nequissimus ]; - }; - - nodes.client = - { nodes, ... }: - let - user = nodes.client.config.users.users.alice; - in - { - imports = [ - ./common/user-account.nix - ./common/x11.nix - ]; - - environment.systemPackages = [ pkgs.minecraft ]; - - nixpkgs.config.allowUnfree = true; - - test-support.displayManager.auto.user = user.name; - }; - - enableOCR = true; - - testScript = - { nodes, ... }: - let - user = nodes.client.config.users.users.alice; - in - '' - client.wait_for_x() - client.execute("su - alice -c minecraft-launcher >&2 &") - client.wait_for_text("Create a new Microsoft account") - client.sleep(10) - client.screenshot("launcher") - ''; -} diff --git a/pkgs/by-name/mi/minecraft/package.nix b/pkgs/by-name/mi/minecraft/package.nix deleted file mode 100644 index 9df658a2ae5a..000000000000 --- a/pkgs/by-name/mi/minecraft/package.nix +++ /dev/null @@ -1,172 +0,0 @@ -{ - lib, - stdenv, - fetchurl, - nixosTests, - copyDesktopItems, - makeDesktopItem, - makeWrapper, - wrapGAppsHook3, - 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, - pango, - cairo, - expat, - alsa-lib, - cups, - dbus, - atk, - gtk3-x11, - gtk2-x11, - gdk-pixbuf, - glib, - curl, - freetype, - libpulseaudio, - libuuid, - 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"; - categories = [ "Game" ]; - }; - - envLibPath = lib.makeLibraryPath [ - curl - libpulseaudio - systemd - alsa-lib # needed for narrator - flite # needed for narrator - libXxf86vm # needed only for versions <1.13 - ]; - - libPath = lib.makeLibraryPath ( - [ - alsa-lib - atk - cairo - cups - dbus - expat - fontconfig - freetype - gdk-pixbuf - glib - pango - gtk3-x11 - gtk2-x11 - nspr - nss - stdenv.cc.cc - zlib - libuuid - ] - ++ (with xorg; [ - libX11 - libxcb - libXcomposite - libXcursor - libXdamage - libXext - libXfixes - libXi - libXrandr - libXrender - libXtst - libXScrnSaver - ]) - ); -in -stdenv.mkDerivation rec { - pname = "minecraft-launcher"; - - version = "2.2.1441"; - - src = fetchurl { - url = "https://launcher.mojang.com/download/linux/x86_64/minecraft-launcher_${version}.tar.gz"; - sha256 = "03q579hvxnsh7d00j6lmfh53rixdpf33xb5zlz7659pvb9j5w0cm"; - }; - - icon = fetchurl { - url = "https://launcher.mojang.com/download/minecraft-launcher.svg"; - sha256 = "0w8z21ml79kblv20wh5lz037g130pxkgs8ll9s3bi94zn2pbrhim"; - }; - - nativeBuildInputs = [ - makeWrapper - wrapGAppsHook3 - copyDesktopItems - gobject-introspection - ]; - - sourceRoot = "."; - - dontWrapGApps = true; - dontConfigure = true; - dontBuild = true; - - installPhase = '' - runHook preInstall - - mkdir -p $out/opt - mv minecraft-launcher $out/opt - - install -D $icon $out/share/icons/hicolor/symbolic/apps/minecraft-launcher.svg - - runHook postInstall - ''; - - 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 : ${lib.makeBinPath [ jre ]} \ - --set JAVA_HOME ${lib.getBin jre} \ - --chdir /tmp \ - "''${gappsWrapperArgs[@]}" - ''; - - desktopItems = [ desktopItem ]; - - meta = with lib; { - description = "Official launcher for Minecraft, a sandbox-building game"; - homepage = "https://minecraft.net"; - maintainers = with maintainers; [ ryantm ]; - sourceProvenance = with sourceTypes; [ binaryNativeCode ]; - license = licenses.unfree; - platforms = [ "x86_64-linux" ]; - # "minecraft-launcher will fail on NixOS for minecraft versions >1.19 - # try prismlauncher or atlauncher instead" - broken = true; - }; - - passthru = { - tests = { inherit (nixosTests) minecraft; }; - updateScript = ./update.sh; - }; -} diff --git a/pkgs/by-name/mi/minecraft/update.sh b/pkgs/by-name/mi/minecraft/update.sh deleted file mode 100755 index 485fb5a560f6..000000000000 --- a/pkgs/by-name/mi/minecraft/update.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env nix-shell -#!nix-shell -i bash -p curl jq common-updater-scripts - -set -eu -o pipefail - -version=$(curl -s 'https://launchermeta.mojang.com/v1/products/launcher/6f083b80d5e6fabbc4236f81d0d8f8a350c665a9/linux.json' | jq -r '."launcher-core"[0].version.name') -update-source-version minecraft "${version}" diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 839044f332d3..b30c209d5036 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -1602,6 +1602,7 @@ mapAliases { mihomo-party = throw "'mihomo-party' has been removed due to upstream license violation"; # Added 2025-08-20 mikutter = throw "'mikutter' has been removed because the package was broken and had no maintainers"; # Added 2024-10-01 mime-types = mailcap; # Added 2022-01-21 + minecraft = throw "'minecraft' has been removed because the package was broken. Consider using 'prismlauncher' instead"; # Added 2025-09-06 minetest = luanti; # Added 2024-11-11 minetestclient = luanti-client; # Added 2024-11-11 minetestserver = luanti-server; # Added 2024-11-11