36 , openGLSupport ? true
38 , waylandSupport ? true
39 , pipewireSupport ? true
44 desktopItem = makeDesktopItem {
45 name = "looking-glass-client";
46 desktopName = "Looking Glass Client";
48 exec = "looking-glass-client";
52 stdenv.mkDerivation (finalAttrs: {
53 pname = "looking-glass-client";
56 src = fetchFromGitHub {
58 repo = "LookingGlass";
59 rev = finalAttrs.version;
60 hash = "sha256-ne1Q+67+P8RHcTsqdiSSwkFf0g3pSNT91WN/lsSzssU=";
61 fetchSubmodules = true;
65 # Fix failing cmake assertion when disabling X11 whithout explicitly enabling Wayland.
67 url = "https://github.com/gnif/LookingGlass/commit/20972cfd9b940fddf9e7f3d2887a271d16398979.patch";
68 hash = "sha256-CqB8AmOZ4YxnEsQkyu/ZEaun6ywpSh4B7PM+MFJF0qU=";
73 nativeBuildInputs = [ cmake pkg-config wayland-scanner ];
75 buildInputs = [ libX11 libGL freefont_ttf spice-protocol expat libbfd nettle fontconfig libffi ]
76 ++ lib.optionals xorgSupport [ libxkbcommon libXi libXScrnSaver libXinerama libXcursor libXpresent libXext libXrandr libXdmcp ]
77 ++ lib.optionals waylandSupport [ libxkbcommon wayland wayland-protocols ]
78 ++ lib.optionals pipewireSupport [ pipewire libsamplerate ]
79 ++ lib.optionals pulseSupport [ pulseaudio libsamplerate ];
81 cmakeFlags = [ "-DOPTIMIZE_FOR_NATIVE=OFF" ]
82 ++ lib.optionals (!openGLSupport) [ "-DENABLE_OPENGL=no" ]
83 ++ lib.optionals (!xorgSupport) [ "-DENABLE_X11=no" ]
84 ++ lib.optionals (!waylandSupport) [ "-DENABLE_WAYLAND=no" ]
85 ++ lib.optionals (!pulseSupport) [ "-DENABLE_PULSEAUDIO=no" ]
86 ++ lib.optionals (!pipewireSupport) [ "-DENABLE_PIPEWIRE=no" ];
89 echo ${finalAttrs.src.rev} > source/VERSION
90 export sourceRoot="source/client"
94 mkdir -p $out/share/pixmaps
95 ln -s ${desktopItem}/share/applications $out/share/
96 cp $src/resources/lg-logo.png $out/share/pixmaps
100 description = "KVM Frame Relay (KVMFR) implementation";
102 Looking Glass is an open source application that allows the use of a KVM
103 (Kernel-based Virtual Machine) configured for VGA PCI Pass-through
104 without an attached physical monitor, keyboard or mouse. This is the final
105 step required to move away from dual booting with other operating systems
106 for legacy programs that require high performance graphics.
108 homepage = "https://looking-glass.io/";
109 license = licenses.gpl2Plus;
110 mainProgram = "looking-glass-client";
111 maintainers = with maintainers; [ alexbakker babbaj j-brn ];
112 platforms = [ "x86_64-linux" ];