From 005a9e14c377e50f6b30061a581ba37b59da11aa Mon Sep 17 00:00:00 2001 From: Infinidoge Date: Mon, 19 Dec 2022 01:24:18 -0500 Subject: [PATCH 1/5] prismlauncher: use jdk17 instead of jdk Prism Launcher only officially supports jdk 17/18 for running newer versions of Minecraft, as they found that jdk 19 introduced a number of edge cases. This fixes an issue where the newer version of Java that the launcher proposes is incompatible with the launcher itself, leading to errors when running instances on newer versions of Minecraft. (cherry picked from commit 3350d422445fab17d302caa912d909ad947e2849) --- pkgs/games/prismlauncher/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/games/prismlauncher/default.nix b/pkgs/games/prismlauncher/default.nix index 3fceefc2d98d..76785c47b29f 100644 --- a/pkgs/games/prismlauncher/default.nix +++ b/pkgs/games/prismlauncher/default.nix @@ -3,7 +3,7 @@ , fetchFromGitHub , cmake , jdk8 -, jdk +, jdk17 , zlib , file , wrapQtAppsHook @@ -20,7 +20,7 @@ , tomlplusplus , ghc_filesystem , msaClientID ? "" -, jdks ? [ jdk jdk8 ] +, jdks ? [ jdk17 jdk8 ] }: let @@ -43,7 +43,7 @@ stdenv.mkDerivation rec { sha256 = "sha256-sKAhcbDoRbWf/DuwcBmDjb+VSMM0K2C33gu1K9AlPoQ="; }; - nativeBuildInputs = [ extra-cmake-modules cmake file jdk wrapQtAppsHook ]; + nativeBuildInputs = [ extra-cmake-modules cmake file jdk17 wrapQtAppsHook ]; buildInputs = [ qtbase qtsvg From 06e3c20b3efc5686e7065bcfa06154dad09c7cb9 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Fri, 3 Feb 2023 18:08:43 +0100 Subject: [PATCH 2/5] prismlauncher: 5.2 -> 6.3 Signed-off-by: Sefa Eyeoglu (cherry picked from commit a11a5070d2e2d0e469c91ce36f8f7b275e09b2e3) this release fixes multiple high severity vulnerabilities. see https://github.com/PrismLauncher/PrismLauncher/security/advisories/GHSA-wxgx-8v36-mj2m and https://github.com/PrismLauncher/PrismLauncher/security/advisories/GHSA-gq28-qx55-mh2r --- pkgs/games/prismlauncher/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/games/prismlauncher/default.nix b/pkgs/games/prismlauncher/default.nix index 76785c47b29f..4abd40e24ab0 100644 --- a/pkgs/games/prismlauncher/default.nix +++ b/pkgs/games/prismlauncher/default.nix @@ -34,13 +34,13 @@ in stdenv.mkDerivation rec { pname = "prismlauncher"; - version = "5.2"; + version = "6.3"; src = fetchFromGitHub { owner = "PrismLauncher"; repo = "PrismLauncher"; rev = version; - sha256 = "sha256-sKAhcbDoRbWf/DuwcBmDjb+VSMM0K2C33gu1K9AlPoQ="; + sha256 = "sha256-7tptHKWkbdxTn6VIPxXE1K3opKRiUW2zv9r6J05dcS8="; }; nativeBuildInputs = [ extra-cmake-modules cmake file jdk17 wrapQtAppsHook ]; From 2dae6fd990f03ee56c4a0690d656e0e0519a3c9f Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Wed, 8 Mar 2023 11:05:26 +0100 Subject: [PATCH 3/5] prismlauncher: use qtWrapperArgs Signed-off-by: Sefa Eyeoglu (cherry picked from commit 2f9b913c50b0966192b96a857ad2edd534197c31) this fixes issues with path detection --- pkgs/games/prismlauncher/default.nix | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/pkgs/games/prismlauncher/default.nix b/pkgs/games/prismlauncher/default.nix index 4abd40e24ab0..b3875245f872 100644 --- a/pkgs/games/prismlauncher/default.nix +++ b/pkgs/games/prismlauncher/default.nix @@ -55,7 +55,6 @@ stdenv.mkDerivation rec { cmakeFlags = lib.optionals (msaClientID != "") [ "-DLauncher_MSA_CLIENT_ID=${msaClientID}" ] ++ lib.optionals (lib.versionAtLeast qtbase.version "6") [ "-DLauncher_QT_VERSION_MAJOR=6" ]; - dontWrapQtApps = true; postUnpack = '' rm -rf source/libraries/libnbtplusplus @@ -65,7 +64,7 @@ stdenv.mkDerivation rec { chown -R $USER: source/libraries/libnbtplusplus ''; - postInstall = + qtWrapperArgs = let libpath = with xorg; lib.makeLibraryPath [ @@ -81,13 +80,12 @@ stdenv.mkDerivation rec { stdenv.cc.cc.lib ]; in - '' + [ + "--set LD_LIBRARY_PATH /run/opengl-driver/lib:${libpath}" + "--prefix PRISMLAUNCHER_JAVA_PATHS : ${lib.makeSearchPath "bin/java" jdks}" # xorg.xrandr needed for LWJGL [2.9.2, 3) https://github.com/LWJGL/lwjgl/issues/128 - wrapQtApp $out/bin/prismlauncher \ - --set LD_LIBRARY_PATH /run/opengl-driver/lib:${libpath} \ - --prefix PRISMLAUNCHER_JAVA_PATHS : ${lib.makeSearchPath "bin/java" jdks} \ - --prefix PATH : ${lib.makeBinPath [xorg.xrandr]} - ''; + "--prefix PATH : ${lib.makeBinPath [xorg.xrandr]}" + ]; meta = with lib; { homepage = "https://prismlauncher.org/"; From 11a823d60a7f9945b610b7217e148a7081647d18 Mon Sep 17 00:00:00 2001 From: seth Date: Sat, 1 Apr 2023 18:55:58 +0000 Subject: [PATCH 4/5] prismlauncher: use ninja (cherry picked from commit e93cb0ad0f5f044cd43cdbe61371ff450b908cc7) this allows for faster builds and follows changes from upstream --- pkgs/games/prismlauncher/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/games/prismlauncher/default.nix b/pkgs/games/prismlauncher/default.nix index b3875245f872..fe3c7c9268f5 100644 --- a/pkgs/games/prismlauncher/default.nix +++ b/pkgs/games/prismlauncher/default.nix @@ -2,6 +2,7 @@ , stdenv , fetchFromGitHub , cmake +, ninja , jdk8 , jdk17 , zlib @@ -43,7 +44,7 @@ stdenv.mkDerivation rec { sha256 = "sha256-7tptHKWkbdxTn6VIPxXE1K3opKRiUW2zv9r6J05dcS8="; }; - nativeBuildInputs = [ extra-cmake-modules cmake file jdk17 wrapQtAppsHook ]; + nativeBuildInputs = [ extra-cmake-modules cmake file jdk17 ninja wrapQtAppsHook ]; buildInputs = [ qtbase qtsvg From 640f1d008141426071b98f8f802de42993951af5 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Thu, 30 Mar 2023 14:53:00 +0200 Subject: [PATCH 5/5] prismlauncher: add support for GameMode Signed-off-by: Sefa Eyeoglu (cherry picked from commit 86361b5767e678f72c5356acaa6ab0c1ffa53209) --- pkgs/games/prismlauncher/default.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pkgs/games/prismlauncher/default.nix b/pkgs/games/prismlauncher/default.nix index fe3c7c9268f5..617dcc547473 100644 --- a/pkgs/games/prismlauncher/default.nix +++ b/pkgs/games/prismlauncher/default.nix @@ -22,6 +22,8 @@ , ghc_filesystem , msaClientID ? "" , jdks ? [ jdk17 jdk8 ] +, gamemodeSupport ? true +, gamemode }: let @@ -52,7 +54,9 @@ stdenv.mkDerivation rec { quazip ghc_filesystem tomlplusplus - ] ++ lib.optional (lib.versionAtLeast qtbase.version "6") qtwayland; + ] + ++ lib.optional (lib.versionAtLeast qtbase.version "6") qtwayland + ++ lib.optional gamemodeSupport gamemode.dev; cmakeFlags = lib.optionals (msaClientID != "") [ "-DLauncher_MSA_CLIENT_ID=${msaClientID}" ] ++ lib.optionals (lib.versionAtLeast qtbase.version "6") [ "-DLauncher_QT_VERSION_MAJOR=6" ]; @@ -68,7 +72,7 @@ stdenv.mkDerivation rec { qtWrapperArgs = let libpath = with xorg; - lib.makeLibraryPath [ + lib.makeLibraryPath ([ libX11 libXext libXcursor @@ -79,7 +83,7 @@ stdenv.mkDerivation rec { glfw openal stdenv.cc.cc.lib - ]; + ] ++ lib.optional gamemodeSupport gamemode.lib); in [ "--set LD_LIBRARY_PATH /run/opengl-driver/lib:${libpath}"