From c348927b90983b0f29f9e295bb829efe450b2c22 Mon Sep 17 00:00:00 2001 From: Seth Flynn Date: Wed, 1 Jul 2026 22:56:31 -0400 Subject: [PATCH] prismlauncher: target final wrapper in instance shortcuts Previously the unwrapped binary of Prism would be used in the `Exec` line of desktop files, leading to Weird behavior - like the instance hanging with no window created --- pkgs/by-name/pr/prismlauncher-unwrapped/package.nix | 6 ++++++ pkgs/by-name/pr/prismlauncher/package.nix | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/pr/prismlauncher-unwrapped/package.nix b/pkgs/by-name/pr/prismlauncher-unwrapped/package.nix index b1c6e194d927..ded8fff6818d 100644 --- a/pkgs/by-name/pr/prismlauncher-unwrapped/package.nix +++ b/pkgs/by-name/pr/prismlauncher-unwrapped/package.nix @@ -42,6 +42,12 @@ stdenv.mkDerivation (finalAttrs: { ln -s ${libnbtplusplus} source/libraries/libnbtplusplus ''; + # Ensure that instance shortucts point to our final wrapper, rather than this unwrapped version + postPatch = '' + substituteInPlace launcher/minecraft/ShortcutUtils.cpp \ + --replace-fail 'QApplication::applicationFilePath()' 'QProcessEnvironment::systemEnvironment().value("NIX_LAUNCHER_WRAPPER", "${placeholder "out"}/bin/prismlauncher")' + ''; + nativeBuildInputs = [ cmake pkg-config diff --git a/pkgs/by-name/pr/prismlauncher/package.nix b/pkgs/by-name/pr/prismlauncher/package.nix index 751a34c520e5..ec5a189be201 100644 --- a/pkgs/by-name/pr/prismlauncher/package.nix +++ b/pkgs/by-name/pr/prismlauncher/package.nix @@ -122,7 +122,10 @@ symlinkJoin { ++ additionalPrograms; in - [ "--prefix PRISMLAUNCHER_JAVA_PATHS : ${lib.makeSearchPath "bin/java" jdks}" ] + [ + "--set NIX_LAUNCHER_WRAPPER ${placeholder "out"}/bin/prismlauncher" + "--prefix PRISMLAUNCHER_JAVA_PATHS : ${lib.makeSearchPath "bin/java" jdks}" + ] ++ lib.optionals stdenv.hostPlatform.isLinux [ "--set LD_LIBRARY_PATH ${addDriverRunpath.driverLink}/lib:${lib.makeLibraryPath runtimeLibs}" "--prefix PATH : ${lib.makeBinPath runtimePrograms}"