refactor(nix): use qtWrapperArgs

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
Sefa Eyeoglu 2023-04-02 11:33:04 +02:00
parent bc1a7d2890
commit ea7f03770c
No known key found for this signature in database
GPG Key ID: E13DFD4B47127951

View File

@ -50,7 +50,6 @@ stdenv.mkDerivation rec {
cmakeFlags = cmakeFlags =
lib.optionals (msaClientID != "") ["-DLauncher_MSA_CLIENT_ID=${msaClientID}"] lib.optionals (msaClientID != "") ["-DLauncher_MSA_CLIENT_ID=${msaClientID}"]
++ lib.optionals (lib.versionOlder qtbase.version "6") ["-DLauncher_QT_VERSION_MAJOR=5"]; ++ lib.optionals (lib.versionOlder qtbase.version "6") ["-DLauncher_QT_VERSION_MAJOR=5"];
dontWrapQtApps = true;
postUnpack = '' postUnpack = ''
rm -rf source/libraries/libnbtplusplus rm -rf source/libraries/libnbtplusplus
@ -60,7 +59,7 @@ stdenv.mkDerivation rec {
chown -R $USER: source/libraries/libnbtplusplus chown -R $USER: source/libraries/libnbtplusplus
''; '';
postInstall = let qtWrapperArgs = let
libpath = with xorg; libpath = with xorg;
lib.makeLibraryPath [ lib.makeLibraryPath [
libX11 libX11
@ -74,13 +73,12 @@ stdenv.mkDerivation rec {
openal openal
stdenv.cc.cc.lib stdenv.cc.cc.lib
]; ];
in '' 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 # xorg.xrandr needed for LWJGL [2.9.2, 3) https://github.com/LWJGL/lwjgl/issues/128
wrapQtApp $out/bin/prismlauncher \ "--prefix PATH : ${lib.makeBinPath [xorg.xrandr]}"
--set LD_LIBRARY_PATH /run/opengl-driver/lib:${libpath} \ ];
--prefix PRISMLAUNCHER_JAVA_PATHS : ${lib.makeSearchPath "bin/java" jdks} \
--prefix PATH : ${lib.makeBinPath [xorg.xrandr]}
'';
meta = with lib; { meta = with lib; {
homepage = "https://prismlauncher.org/"; homepage = "https://prismlauncher.org/";