Files
frank-nix/packages/looking-glass-client/package.nix
T

147 lines
2.9 KiB
Nix

{
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,
libunwind,
elfutils,
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-605-574e8edb";
src = fetchurl {
url = "https://looking-glass.io/artifact/B7-605-574e8edb/source";
sha256 = "sha256-srUsiU5wbdQZkCIdxdV0ZHL2Cbyy/7Bf2FO5AOtr7a4=";
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
libunwind
elfutils
]
++ 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" ];
};
})