Merge pull request #224412 from getchoo/backport-prism

[22.11] prismlauncher: use jdk17 instead of jdk, prismlauncher: 6.1 -> 6.3, prismlauncher: use qtWrapperArgs, prismlauncher: use ninja
This commit is contained in:
Pierre Bourdon
2023-04-18 08:46:41 +02:00
committed by GitHub

View File

@@ -2,8 +2,9 @@
, stdenv
, fetchFromGitHub
, cmake
, ninja
, jdk8
, jdk
, jdk17
, zlib
, file
, wrapQtAppsHook
@@ -20,7 +21,9 @@
, tomlplusplus
, ghc_filesystem
, msaClientID ? ""
, jdks ? [ jdk jdk8 ]
, jdks ? [ jdk17 jdk8 ]
, gamemodeSupport ? true
, gamemode
}:
let
@@ -34,16 +37,16 @@ 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 jdk wrapQtAppsHook ];
nativeBuildInputs = [ extra-cmake-modules cmake file jdk17 ninja wrapQtAppsHook ];
buildInputs = [
qtbase
qtsvg
@@ -51,11 +54,12 @@ 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" ];
dontWrapQtApps = true;
postUnpack = ''
rm -rf source/libraries/libnbtplusplus
@@ -65,10 +69,10 @@ stdenv.mkDerivation rec {
chown -R $USER: source/libraries/libnbtplusplus
'';
postInstall =
qtWrapperArgs =
let
libpath = with xorg;
lib.makeLibraryPath [
lib.makeLibraryPath ([
libX11
libXext
libXcursor
@@ -79,15 +83,14 @@ stdenv.mkDerivation rec {
glfw
openal
stdenv.cc.cc.lib
];
] ++ lib.optional gamemodeSupport gamemode.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/";