prismlauncher: deprecate withWaylandGLFW option

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
Sefa Eyeoglu 2024-05-08 12:34:01 +02:00
parent 8dce7dafcf
commit 2a5017a555
No known key found for this signature in database
GPG Key ID: E13DFD4B47127951

View File

@ -7,9 +7,7 @@
alsa-lib,
flite,
gamemode,
glfw,
glfw-wayland-minecraft,
mesa-demos,
glfw3-minecraft,
jdk8,
jdk17,
jdk21,
@ -18,7 +16,7 @@
libjack2,
libpulseaudio,
libusb1,
makeWrapper,
mesa-demos,
openal,
pciutils,
pipewire,
@ -37,15 +35,6 @@
],
msaClientID ? null,
textToSpeechSupport ? stdenv.isLinux,
# Adds `glfw-wayland-minecraft` to `LD_LIBRARY_PATH`
# when launched on wayland, allowing for the game to be run natively.
# Make sure to enable "Use system installation of GLFW" in instance settings
# for this to take effect
#
# Warning: This build of glfw may be unstable, and the launcher
# itself can take slightly longer to start
withWaylandGLFW ? false,
}:
assert lib.assertMsg (
@ -56,10 +45,6 @@ assert lib.assertMsg (
textToSpeechSupport -> stdenv.isLinux
) "textToSpeechSupport only has an effect on Linux.";
assert lib.assertMsg (
withWaylandGLFW -> stdenv.isLinux
) "withWaylandGLFW is only available on Linux.";
let
prismlauncher' = prismlauncher-unwrapped.override { inherit msaClientID gamemodeSupport; };
in
@ -69,11 +54,7 @@ symlinkJoin {
paths = [ prismlauncher' ];
nativeBuildInputs =
[ kdePackages.wrapQtAppsHook ]
# purposefully using a shell wrapper here for variable expansion
# see https://github.com/NixOS/nixpkgs/issues/172583
++ lib.optional withWaylandGLFW makeWrapper;
nativeBuildInputs = [ kdePackages.wrapQtAppsHook ];
buildInputs =
[
@ -84,30 +65,17 @@ symlinkJoin {
lib.versionAtLeast kdePackages.qtbase.version "6" && stdenv.isLinux
) kdePackages.qtwayland;
env = {
waylandPreExec = lib.optionalString withWaylandGLFW ''
if [ -n "$WAYLAND_DISPLAY" ]; then
export LD_LIBRARY_PATH=${lib.getLib glfw-wayland-minecraft}/lib:"$LD_LIBRARY_PATH"
fi
'';
};
postBuild =
lib.optionalString withWaylandGLFW ''
qtWrapperArgs+=(--run "$waylandPreExec")
''
+ ''
wrapQtAppsHook
'';
postBuild = ''
wrapQtAppsHook
'';
qtWrapperArgs =
let
runtimeLibs =
[
# lwjgl
stdenv.cc.cc.lib
## native versions
glfw
glfw3-minecraft
openal
## openal