Unverified Commit 2a5017a5 authored by Sefa Eyeoglu's avatar Sefa Eyeoglu
Browse files

prismlauncher: deprecate withWaylandGLFW option

parent 8dce7daf
Loading
Loading
Loading
Loading
+7 −39
Original line number Diff line number Diff line
@@ -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,19 +65,7 @@ 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")
    ''
    + ''
  postBuild = ''
    wrapQtAppsHook
  '';

@@ -104,10 +73,9 @@ symlinkJoin {
    let
      runtimeLibs =
        [
          # lwjgl
          stdenv.cc.cc.lib
          ## native versions
          glfw
          glfw3-minecraft
          openal

          ## openal