looking-glass-client: add patch to fix wayland only build

j-brn 7e409bb2 9f665273

+64 -3
+57
pkgs/applications/virtualization/looking-glass-client/0001-client-cmake-move-X11-config-directives-to-displayse.patch
··· 1 + From: Geoffrey McRae <geoff@hostfission.com> 2 + Date: Wed, 13 Mar 2024 11:17:25 +1100 3 + Subject: [PATCH] [client] cmake: move X11 config directives to 4 + `displayservers` 5 + 6 + --- 7 + client/CMakeLists.txt | 7 ------- 8 + client/displayservers/CMakeLists.txt | 7 +++++++ 9 + 2 files changed, 7 insertions(+), 7 deletions(-) 10 + 11 + diff --git client/CMakeLists.txt client/CMakeLists.txt 12 + index 3755adcf..eeeb3eb0 100644 13 + --- client/CMakeLists.txt 14 + +++ client/CMakeLists.txt 15 + @@ -42,19 +42,12 @@ add_feature_info(ENABLE_ASAN ENABLE_ASAN "AddressSanitizer support.") 16 + option(ENABLE_UBSAN "Build with UndefinedBehaviorSanitizer" OFF) 17 + add_feature_info(ENABLE_UBSAN ENABLE_UBSAN "UndefinedBehaviorSanitizer support.") 18 + 19 + -option(ENABLE_X11 "Build with X11 support" ON) 20 + -add_feature_info(ENABLE_X11 ENABLE_X11 "X11 support.") 21 + - 22 + option(ENABLE_PIPEWIRE "Build with PipeWire audio output support" ON) 23 + add_feature_info(ENABLE_PIPEWIRE ENABLE_PIPEWIRE "PipeWire audio support.") 24 + 25 + option(ENABLE_PULSEAUDIO "Build with PulseAudio audio output support" ON) 26 + add_feature_info(ENABLE_PULSEAUDIO ENABLE_PULSEAUDIO "PulseAudio audio support.") 27 + 28 + -if (NOT ENABLE_X11 AND NOT ENABLE_WAYLAND) 29 + - message(FATAL_ERROR "Either ENABLE_X11 or ENABLE_WAYLAND must be on") 30 + -endif() 31 + - 32 + add_compile_options( 33 + "-Wall" 34 + "-Wextra" 35 + diff --git client/displayservers/CMakeLists.txt client/displayservers/CMakeLists.txt 36 + index 5b5f827a..e7c4b25a 100644 37 + --- client/displayservers/CMakeLists.txt 38 + +++ client/displayservers/CMakeLists.txt 39 + @@ -18,9 +18,16 @@ function(add_displayserver name) 40 + add_subdirectory(${name}) 41 + endfunction() 42 + 43 + +option(ENABLE_X11 "Build with X11 support" ON) 44 + +add_feature_info(ENABLE_X11 ENABLE_X11 "X11 support.") 45 + + 46 + option(ENABLE_WAYLAND "Build with Wayland support" ON) 47 + add_feature_info(ENABLE_WAYLAND ENABLE_WAYLAND "Wayland support.") 48 + 49 + +if (NOT ENABLE_X11 AND NOT ENABLE_WAYLAND) 50 + + message(FATAL_ERROR "Either ENABLE_X11 or ENABLE_WAYLAND must be on") 51 + +endif() 52 + + 53 + # Add/remove displayservers here! 54 + if (ENABLE_WAYLAND) 55 + add_displayserver(Wayland) 56 + -- 57 + 2.43.1
+7 -3
pkgs/applications/virtualization/looking-glass-client/default.nix
··· 59 59 fetchSubmodules = true; 60 60 }; 61 61 62 + patches = [ 63 + # Fix failing cmake assertion when disabling X11 whithout explicitly enabling Wayland. 64 + ./0001-client-cmake-move-X11-config-directives-to-displayse.patch 65 + ]; 66 + 62 67 nativeBuildInputs = [ cmake pkg-config ]; 63 68 64 - buildInputs = [ libGL freefont_ttf spice-protocol expat libbfd nettle fontconfig libffi ] 65 - ++ lib.optionals xorgSupport [ libX11 libxkbcommon libXi libXScrnSaver libXinerama libXcursor libXpresent libXext libXrandr libXdmcp ] 69 + buildInputs = [ libX11 libGL freefont_ttf spice-protocol expat libbfd nettle fontconfig libffi ] 70 + ++ lib.optionals xorgSupport [ libxkbcommon libXi libXScrnSaver libXinerama libXcursor libXpresent libXext libXrandr libXdmcp ] 66 71 ++ lib.optionals waylandSupport [ libxkbcommon wayland wayland-protocols ] 67 72 ++ lib.optionals pipewireSupport [ pipewire libsamplerate ] 68 73 ++ lib.optionals pulseSupport [ pulseaudio libsamplerate ]; ··· 71 76 ++ lib.optionals (!openGLSupport) [ "-DENABLE_OPENGL=no" ] 72 77 ++ lib.optionals (!xorgSupport) [ "-DENABLE_X11=no" ] 73 78 ++ lib.optionals (!waylandSupport) [ "-DENABLE_WAYLAND=no" ] 74 - ++ lib.optionals (waylandSupport) [ "-DENABLE_WAYLAND=yes" ] 75 79 ++ lib.optionals (!pulseSupport) [ "-DENABLE_PULSEAUDIO=no" ] 76 80 ++ lib.optionals (!pipewireSupport) [ "-DENABLE_PIPEWIRE=no" ]; 77 81