about summary refs log tree commit diff
path: root/pkgs/applications/emulators/wine
diff options
context:
space:
mode:
authorDaniel Hill <daniel@gluo.nz>2023-09-18 19:26:04 +1200
committerDaniel Hill <daniel@gluo.nz>2023-09-19 19:42:34 +1200
commit965c4299171c8af08554ff0b5a0f957e4a5830af (patch)
treecd2169d0b42bfc4c06c7cd792bbe18c4848e0d44 /pkgs/applications/emulators/wine
parent25da3e556aa846ee0d0169dd067259f6653dbdac (diff)
downloadnixlib-965c4299171c8af08554ff0b5a0f957e4a5830af.tar
nixlib-965c4299171c8af08554ff0b5a0f957e4a5830af.tar.gz
nixlib-965c4299171c8af08554ff0b5a0f957e4a5830af.tar.bz2
nixlib-965c4299171c8af08554ff0b5a0f957e4a5830af.tar.lz
nixlib-965c4299171c8af08554ff0b5a0f957e4a5830af.tar.xz
nixlib-965c4299171c8af08554ff0b5a0f957e4a5830af.tar.zst
nixlib-965c4299171c8af08554ff0b5a0f957e4a5830af.zip
wine: Fix missing X11 libraries for Wayland build
The Wayland build provides both Wayland and X11 support

Wine still prioritizes X11 over Wayland by default, without these
support libraries some things don't work, including causing some games
to crash.
Diffstat (limited to 'pkgs/applications/emulators/wine')
-rw-r--r--pkgs/applications/emulators/wine/base.nix4
-rw-r--r--pkgs/applications/emulators/wine/default.nix3
2 files changed, 4 insertions, 3 deletions
diff --git a/pkgs/applications/emulators/wine/base.nix b/pkgs/applications/emulators/wine/base.nix
index 8b1b4966ddab..c49fe9f1de54 100644
--- a/pkgs/applications/emulators/wine/base.nix
+++ b/pkgs/applications/emulators/wine/base.nix
@@ -78,7 +78,7 @@ stdenv.mkDerivation ((lib.optionalAttrs (buildScript != null) {
   ++ lib.optional fontconfigSupport      pkgs.fontconfig
   ++ lib.optional alsaSupport            pkgs.alsa-lib
   ++ lib.optional pulseaudioSupport      pkgs.libpulseaudio
-  ++ lib.optional (xineramaSupport && !waylandSupport) pkgs.xorg.libXinerama
+  ++ lib.optional (xineramaSupport && x11Support) pkgs.xorg.libXinerama
   ++ lib.optional udevSupport            pkgs.udev
   ++ lib.optional vulkanSupport          (if stdenv.isDarwin then moltenvk else pkgs.vulkan-loader)
   ++ lib.optional sdlSupport             pkgs.SDL2
@@ -93,7 +93,7 @@ stdenv.mkDerivation ((lib.optionalAttrs (buildScript != null) {
      CoreServices Foundation ForceFeedback AppKit OpenGL IOKit DiskArbitration PCSC Security
      ApplicationServices AudioToolbox CoreAudio AudioUnit CoreMIDI OpenCL Cocoa Carbon
   ])
-  ++ lib.optionals (stdenv.isLinux && !waylandSupport) (with pkgs.xorg; [
+  ++ lib.optionals (x11Support) (with pkgs.xorg; [
      libX11 libXi libXcursor libXrandr libXrender libXxf86vm libXcomposite libXext
   ])
   ++ lib.optionals waylandSupport (with pkgs; [
diff --git a/pkgs/applications/emulators/wine/default.nix b/pkgs/applications/emulators/wine/default.nix
index d3b285f36d78..2dc9b2625bf4 100644
--- a/pkgs/applications/emulators/wine/default.nix
+++ b/pkgs/applications/emulators/wine/default.nix
@@ -37,6 +37,7 @@
   usbSupport ? false,
   mingwSupport ? wineRelease != "stable",
   waylandSupport ? wineRelease == "wayland",
+  x11Support ? stdenv.isLinux,
   embedInstallers ? false, # The Mono and Gecko MSI installers
   moltenvk ? darwin.moltenvk # Allow users to override MoltenVK easily
 }:
@@ -51,7 +52,7 @@ let wine-build = build: release:
             v4lSupport saneSupport gphoto2Support krb5Support fontconfigSupport
             alsaSupport pulseaudioSupport xineramaSupport gtkSupport openclSupport
             tlsSupport openglSupport gstreamerSupport udevSupport vulkanSupport
-            sdlSupport usbSupport mingwSupport waylandSupport embedInstallers;
+            sdlSupport usbSupport mingwSupport waylandSupport x11Support embedInstallers;
         };
         inherit moltenvk;
       });