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}"