From e7f3a8df3cfe48753a9760df44b80f07e1c06287 Mon Sep 17 00:00:00 2001 From: novenary Date: Tue, 23 Dec 2025 13:05:19 +0200 Subject: [PATCH] vintagestory: add optional Wayland support --- pkgs/by-name/vi/vintagestory/package.nix | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/vi/vintagestory/package.nix b/pkgs/by-name/vi/vintagestory/package.nix index 1a9d4374c728..fc7026083f22 100644 --- a/pkgs/by-name/vi/vintagestory/package.nix +++ b/pkgs/by-name/vi/vintagestory/package.nix @@ -5,7 +5,6 @@ makeWrapper, makeDesktopItem, copyDesktopItems, - xorg, gtk2, sqlite, openal, @@ -17,8 +16,18 @@ pipewire, libpulseaudio, dotnet-runtime_8, + x11Support ? true, + xorg ? null, + waylandSupport ? false, + wayland ? null, + libxkbcommon ? null, }: +assert x11Support || waylandSupport; +assert x11Support -> xorg != null; +assert waylandSupport -> wayland != null; +assert waylandSupport -> libxkbcommon != null; + stdenv.mkDerivation (finalAttrs: { pname = "vintagestory"; version = "1.21.6"; @@ -45,10 +54,14 @@ stdenv.mkDerivation (finalAttrs: { pipewire libpulseaudio ] - ++ [ + ++ lib.optionals x11Support [ xorg.libX11 xorg.libXi xorg.libXcursor + ] + ++ lib.optionals waylandSupport [ + wayland + libxkbcommon ]; desktopItems = [ @@ -91,6 +104,9 @@ stdenv.mkDerivation (finalAttrs: { makeWrapper ${lib.meta.getExe dotnet-runtime_8} $out/bin/vintagestory \ --prefix LD_LIBRARY_PATH : "${runtimeLibs'}" \ --set-default mesa_glthread true \ + ${lib.strings.optionalString waylandSupport '' + --set-default OPENTK_4_USE_WAYLAND 1 \ + ''} \ --add-flags $out/share/vintagestory/Vintagestory.dll makeWrapper ${lib.meta.getExe dotnet-runtime_8} $out/bin/vintagestory-server \