From 45f966f0e99d7dffc1e0a643c19ff279bef3975d Mon Sep 17 00:00:00 2001 From: Frank LoTurco Date: Fri, 24 Jul 2026 22:20:40 -0400 Subject: [PATCH] nixos: update looking-glass-client to newest version with IDD support. --- hosts/shared/nixos.nix | 2 +- packages/looking-glass-client/package.nix | 142 ++++++++++++++++++ .../patches/nanosvg-unvendor.diff | 28 ++++ 3 files changed, 171 insertions(+), 1 deletion(-) create mode 100644 packages/looking-glass-client/package.nix create mode 100644 packages/looking-glass-client/patches/nanosvg-unvendor.diff diff --git a/hosts/shared/nixos.nix b/hosts/shared/nixos.nix index 3ad420c..c33b1bd 100644 --- a/hosts/shared/nixos.nix +++ b/hosts/shared/nixos.nix @@ -280,7 +280,6 @@ in guestfs-tools unrar btrfs-assistant - looking-glass-client nil bash-language-server devenv @@ -296,6 +295,7 @@ in (callPackage ../../packages/virtiofsd-looking-glass/package.nix { }) (callPackage ../../packages/heidisql/package.nix { }) + (callPackage ../../packages/looking-glass-client/package.nix { }) ]; shellAliases = { diff --git a/packages/looking-glass-client/package.nix b/packages/looking-glass-client/package.nix new file mode 100644 index 0000000..db8e214 --- /dev/null +++ b/packages/looking-glass-client/package.nix @@ -0,0 +1,142 @@ +{ + stdenv, + lib, + fetchurl, + pkg-config, + cmake, + freefont_ttf, + spice-protocol, + nettle, + libbfd, + fontconfig, + libffi, + expat, + libGL, + nanosvg, + + libx11, + libxkbcommon, + libxext, + libxrandr, + libxi, + libxscrnsaver, + libxinerama, + libxcursor, + libxpresent, + libxdmcp, + + wayland, + wayland-protocols, + wayland-scanner, + + pipewire, + pulseaudio, + libsamplerate, + + openGLSupport ? true, + xorgSupport ? true, + waylandSupport ? true, + pipewireSupport ? true, + pulseSupport ? true, +}: +stdenv.mkDerivation (finalAttrs: { + pname = "looking-glass-client"; + version = "B7-355-d3d1d48e"; + + src = fetchurl { + url = "https://looking-glass.io/artifact/bleeding/source"; + sha256 = "sha256-x/YS4BVVGz6ztrd4ItaVUj0zS6vH/HKdh1Oxeoz3Ikk="; + name = "looking-glass-bleeding.tar.gz"; + }; + + patches = [ + ./patches/nanosvg-unvendor.diff + ]; + + nativeBuildInputs = [ + cmake + pkg-config + wayland-scanner + ]; + + buildInputs = [ + libx11 + libGL + freefont_ttf + spice-protocol + expat + libbfd + nettle + fontconfig + libffi + nanosvg + ] + ++ 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 + ]; + + cmakeFlags = [ + "-DOPTIMIZE_FOR_NATIVE=OFF" + ] + ++ lib.optionals (!openGLSupport) [ "-DENABLE_OPENGL=no" ] + ++ lib.optionals (!xorgSupport) [ "-DENABLE_X11=no" ] + ++ lib.optionals (!waylandSupport) [ "-DENABLE_WAYLAND=no" ] + ++ lib.optionals (!pulseSupport) [ "-DENABLE_PULSEAUDIO=no" ] + ++ lib.optionals (!pipewireSupport) [ "-DENABLE_PIPEWIRE=no" ]; + + setSourceRoot = '' + sourceRoot=$(echo */) + ''; + + postUnpack = '' + echo ${finalAttrs.version} > VERSION + export projRoot=$sourceRoot + export sourceRoot="$sourceRoot/client" + ''; + + postInstall = '' + mkdir -p $out/share/pixmaps + #cp resources/lg-logo.png $out/share/pixmaps + ''; + + meta = { + description = "KVM Frame Relay (KVMFR) implementation"; + longDescription = '' + Looking Glass is an open source application that allows the use of a KVM + (Kernel-based Virtual Machine) configured for VGA PCI Pass-through + without an attached physical monitor, keyboard or mouse. This is the final + step required to move away from dual booting with other operating systems + for legacy programs that require high performance graphics. + ''; + homepage = "https://looking-glass.io/"; + license = lib.licenses.gpl2Plus; + mainProgram = "looking-glass-client"; + maintainers = with lib.maintainers; [ + alexbakker + babbaj + j-brn + ]; + platforms = [ "x86_64-linux" ]; + }; +}) diff --git a/packages/looking-glass-client/patches/nanosvg-unvendor.diff b/packages/looking-glass-client/patches/nanosvg-unvendor.diff new file mode 100644 index 0000000..08f7d4c --- /dev/null +++ b/packages/looking-glass-client/patches/nanosvg-unvendor.diff @@ -0,0 +1,28 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 3755adc..55e1eb3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -25,6 +25,7 @@ include(OptimizeForNative) # option(OPTIMIZE_FOR_NATIVE) + include(UninstallTarget) + + find_package(PkgConfig) ++find_package(NanoSVG REQUIRED) + pkg_check_modules(FONTCONFIG REQUIRED IMPORTED_TARGET fontconfig) + + option(ENABLE_OPENGL "Enable the OpenGL renderer" ON) +@@ -106,7 +107,6 @@ include_directories( + ${PROJECT_SOURCE_DIR}/include + ${CMAKE_BINARY_DIR} + ${CMAKE_BINARY_DIR}/include +- ${PROJECT_TOP}/repos/nanosvg/src + ) + + link_libraries( +@@ -161,6 +161,7 @@ target_compile_definitions(looking-glass-client PRIVATE CIMGUI_DEFINE_ENUMS_AND_ + target_link_libraries(looking-glass-client + ${EXE_FLAGS} + PkgConfig::FONTCONFIG ++ NanoSVG::nanosvg + lg_resources + lg_common + displayservers