From b1f23d4045bbc9388a1125fccea59ab72fff93b8 Mon Sep 17 00:00:00 2001 From: j-brn Date: Tue, 12 Mar 2024 12:07:23 +0100 Subject: [PATCH 1/3] looking-glass-client: B6 -> B7-rc1 --- .../looking-glass-client/default.nix | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/pkgs/applications/virtualization/looking-glass-client/default.nix b/pkgs/applications/virtualization/looking-glass-client/default.nix index 67baa3ab91bd..bd45e4ebff4e 100644 --- a/pkgs/applications/virtualization/looking-glass-client/default.nix +++ b/pkgs/applications/virtualization/looking-glass-client/default.nix @@ -22,6 +22,7 @@ , libXinerama , libXcursor , libXpresent +, libXdmcp , wayland , wayland-protocols @@ -30,6 +31,7 @@ , pulseaudio , libsamplerate +, openGLSupport ? false , xorgSupport ? true , waylandSupport ? true , pipewireSupport ? true @@ -43,35 +45,35 @@ let type = "Application"; exec = "looking-glass-client"; icon = "lg-logo"; - terminal = true; }; in stdenv.mkDerivation rec { pname = "looking-glass-client"; - version = "B6"; + version = "B7-rc1"; src = fetchFromGitHub { owner = "gnif"; repo = "LookingGlass"; rev = version; - sha256 = "sha256-6vYbNmNJBCoU23nVculac24tHqH7F4AZVftIjL93WJU="; + sha256 = "sha256-ne1Q+67+P8RHcTsqdiSSwkFf0g3pSNT91WN/lsSzssU="; fetchSubmodules = true; }; nativeBuildInputs = [ cmake pkg-config ]; - buildInputs = [ libGL libX11 freefont_ttf spice-protocol expat libbfd nettle fontconfig libffi ] - ++ lib.optionals xorgSupport [ libxkbcommon libXi libXScrnSaver libXinerama libXcursor libXpresent libXext libXrandr ] + buildInputs = [ libGL freefont_ttf spice-protocol expat libbfd nettle fontconfig libffi ] + ++ lib.optionals xorgSupport [ libX11 libxkbcommon libXi libXScrnSaver libXinerama libXcursor libXpresent libXext libXrandr libXdmcp ] ++ lib.optionals waylandSupport [ libxkbcommon wayland wayland-protocols ] ++ lib.optionals pipewireSupport [ pipewire libsamplerate ] ++ lib.optionals pulseSupport [ pulseaudio libsamplerate ]; cmakeFlags = [ "-DOPTIMIZE_FOR_NATIVE=OFF" ] - ++ lib.optional (!xorgSupport) "-DENABLE_X11=no" - ++ lib.optional (!waylandSupport) "-DENABLE_WAYLAND=no" - ++ lib.optional (!pulseSupport) "-DENABLE_PULSEAUDIO=no" - ++ lib.optional (!pipewireSupport) "-DENABLE_PIPEWIRE=no"; - + ++ lib.optionals (!openGLSupport) [ "-DENABLE_OPENGL=no" ] + ++ lib.optionals (!xorgSupport) [ "-DENABLE_X11=no" ] + ++ lib.optionals (!waylandSupport) [ "-DENABLE_WAYLAND=no" ] + ++ lib.optionals (waylandSupport) [ "-DENABLE_WAYLAND=yes" ] + ++ lib.optionals (!pulseSupport) [ "-DENABLE_PULSEAUDIO=no" ] + ++ lib.optionals (!pipewireSupport) [ "-DENABLE_PIPEWIRE=no" ]; postUnpack = '' echo ${src.rev} > source/VERSION From 9f6652732882f32067f35bc44f5a5eee83fd8375 Mon Sep 17 00:00:00 2001 From: j-brn Date: Tue, 12 Mar 2024 14:20:50 +0100 Subject: [PATCH 2/3] looking-glass-client: enable support for opengl by default doesn't add any additional dependencies, so there is not really a reason to disable it. --- .../virtualization/looking-glass-client/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/virtualization/looking-glass-client/default.nix b/pkgs/applications/virtualization/looking-glass-client/default.nix index bd45e4ebff4e..b19117c73e97 100644 --- a/pkgs/applications/virtualization/looking-glass-client/default.nix +++ b/pkgs/applications/virtualization/looking-glass-client/default.nix @@ -31,7 +31,7 @@ , pulseaudio , libsamplerate -, openGLSupport ? false +, openGLSupport ? true , xorgSupport ? true , waylandSupport ? true , pipewireSupport ? true From 7e409bb2f28be292945742ae8262125cf93f879b Mon Sep 17 00:00:00 2001 From: j-brn Date: Wed, 13 Mar 2024 02:21:03 +0100 Subject: [PATCH 3/3] looking-glass-client: add patch to fix wayland only build --- ...e-X11-config-directives-to-displayse.patch | 57 +++++++++++++++++++ .../looking-glass-client/default.nix | 10 +++- 2 files changed, 64 insertions(+), 3 deletions(-) create mode 100644 pkgs/applications/virtualization/looking-glass-client/0001-client-cmake-move-X11-config-directives-to-displayse.patch diff --git a/pkgs/applications/virtualization/looking-glass-client/0001-client-cmake-move-X11-config-directives-to-displayse.patch b/pkgs/applications/virtualization/looking-glass-client/0001-client-cmake-move-X11-config-directives-to-displayse.patch new file mode 100644 index 000000000000..b044fb47c2e1 --- /dev/null +++ b/pkgs/applications/virtualization/looking-glass-client/0001-client-cmake-move-X11-config-directives-to-displayse.patch @@ -0,0 +1,57 @@ +From: Geoffrey McRae +Date: Wed, 13 Mar 2024 11:17:25 +1100 +Subject: [PATCH] [client] cmake: move X11 config directives to + `displayservers` + +--- + client/CMakeLists.txt | 7 ------- + client/displayservers/CMakeLists.txt | 7 +++++++ + 2 files changed, 7 insertions(+), 7 deletions(-) + +diff --git client/CMakeLists.txt client/CMakeLists.txt +index 3755adcf..eeeb3eb0 100644 +--- client/CMakeLists.txt ++++ client/CMakeLists.txt +@@ -42,19 +42,12 @@ add_feature_info(ENABLE_ASAN ENABLE_ASAN "AddressSanitizer support.") + option(ENABLE_UBSAN "Build with UndefinedBehaviorSanitizer" OFF) + add_feature_info(ENABLE_UBSAN ENABLE_UBSAN "UndefinedBehaviorSanitizer support.") + +-option(ENABLE_X11 "Build with X11 support" ON) +-add_feature_info(ENABLE_X11 ENABLE_X11 "X11 support.") +- + option(ENABLE_PIPEWIRE "Build with PipeWire audio output support" ON) + add_feature_info(ENABLE_PIPEWIRE ENABLE_PIPEWIRE "PipeWire audio support.") + + option(ENABLE_PULSEAUDIO "Build with PulseAudio audio output support" ON) + add_feature_info(ENABLE_PULSEAUDIO ENABLE_PULSEAUDIO "PulseAudio audio support.") + +-if (NOT ENABLE_X11 AND NOT ENABLE_WAYLAND) +- message(FATAL_ERROR "Either ENABLE_X11 or ENABLE_WAYLAND must be on") +-endif() +- + add_compile_options( + "-Wall" + "-Wextra" +diff --git client/displayservers/CMakeLists.txt client/displayservers/CMakeLists.txt +index 5b5f827a..e7c4b25a 100644 +--- client/displayservers/CMakeLists.txt ++++ client/displayservers/CMakeLists.txt +@@ -18,9 +18,16 @@ function(add_displayserver name) + add_subdirectory(${name}) + endfunction() + ++option(ENABLE_X11 "Build with X11 support" ON) ++add_feature_info(ENABLE_X11 ENABLE_X11 "X11 support.") ++ + option(ENABLE_WAYLAND "Build with Wayland support" ON) + add_feature_info(ENABLE_WAYLAND ENABLE_WAYLAND "Wayland support.") + ++if (NOT ENABLE_X11 AND NOT ENABLE_WAYLAND) ++ message(FATAL_ERROR "Either ENABLE_X11 or ENABLE_WAYLAND must be on") ++endif() ++ + # Add/remove displayservers here! + if (ENABLE_WAYLAND) + add_displayserver(Wayland) +-- +2.43.1 diff --git a/pkgs/applications/virtualization/looking-glass-client/default.nix b/pkgs/applications/virtualization/looking-glass-client/default.nix index b19117c73e97..4b224c745c9f 100644 --- a/pkgs/applications/virtualization/looking-glass-client/default.nix +++ b/pkgs/applications/virtualization/looking-glass-client/default.nix @@ -59,10 +59,15 @@ stdenv.mkDerivation rec { fetchSubmodules = true; }; + patches = [ + # Fix failing cmake assertion when disabling X11 whithout explicitly enabling Wayland. + ./0001-client-cmake-move-X11-config-directives-to-displayse.patch + ]; + nativeBuildInputs = [ cmake pkg-config ]; - buildInputs = [ libGL freefont_ttf spice-protocol expat libbfd nettle fontconfig libffi ] - ++ lib.optionals xorgSupport [ libX11 libxkbcommon libXi libXScrnSaver libXinerama libXcursor libXpresent libXext libXrandr libXdmcp ] + buildInputs = [ libX11 libGL freefont_ttf spice-protocol expat libbfd nettle fontconfig libffi ] + ++ lib.optionals xorgSupport [ libxkbcommon libXi libXScrnSaver libXinerama libXcursor libXpresent libXext libXrandr libXdmcp ] ++ lib.optionals waylandSupport [ libxkbcommon wayland wayland-protocols ] ++ lib.optionals pipewireSupport [ pipewire libsamplerate ] ++ lib.optionals pulseSupport [ pulseaudio libsamplerate ]; @@ -71,7 +76,6 @@ stdenv.mkDerivation rec { ++ lib.optionals (!openGLSupport) [ "-DENABLE_OPENGL=no" ] ++ lib.optionals (!xorgSupport) [ "-DENABLE_X11=no" ] ++ lib.optionals (!waylandSupport) [ "-DENABLE_WAYLAND=no" ] - ++ lib.optionals (waylandSupport) [ "-DENABLE_WAYLAND=yes" ] ++ lib.optionals (!pulseSupport) [ "-DENABLE_PULSEAUDIO=no" ] ++ lib.optionals (!pipewireSupport) [ "-DENABLE_PIPEWIRE=no" ];