# Maintainer: Omar Pakker pkgbase=looking-glass pkgname=("${pkgbase}" "${pkgbase}-module-dkms" "${pkgbase}-host" "obs-plugin-${pkgbase}") epoch=2 pkgver=B6 pkgrel=7 pkgdesc="An extremely low latency KVMFR (KVM FrameRelay) implementation for guests with VGA PCI Passthrough" url="https://looking-glass.io/" arch=('x86_64') license=('GPL2') makedepends=('cmake' 'fontconfig' 'libpipewire' 'libpulse' 'libsamplerate' 'libxi' 'libxpresent' 'libxss' 'obs-studio' 'spice-protocol' 'wayland-protocols') source=("looking-glass-${pkgver}.tar.gz::https://looking-glass.io/artifact/${pkgver}/source" "module-kernel-64.patch") sha512sums=('558981d6b32098076ef0775a748da349941551352cbef836e37310e43e5cd6072df3dec6fa2418a9abecc7729ef0c1c6869e3168d05a3d76bea46c6eb8c4e82c' '562c6714f480cbbc144fd4a2e9ca9047292ca89800425e627f7e2d87cb0ba8741ad31e88d70952c381196fd70368308c9d8f8bf9cba0c4fec7431f37307d5bf5') _lgdir="${pkgbase}-${pkgver}" prepare() { cd "${srcdir}/${_lgdir}" patch -p1 < "${srcdir}/module-kernel-64.patch" sed -i '1 i\#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"' \ "host/platform/Linux/capture/pipewire/src/portal.c" } build() { cd "${srcdir}/${_lgdir}" for b in {client,host,obs}/build; do mkdir "${b}" pushd "${b}" cmake -DCMAKE_INSTALL_PREFIX=/usr .. make popd done } package_looking-glass() { pkgdesc="A client application for accessing the LookingGlass IVSHMEM device of a VM" depends=('binutils' 'fontconfig' 'gcc-libs' 'glibc' 'gmp' 'libegl' 'libgl' 'libpipewire' 'libpulse' 'libsamplerate' 'libx11' 'libxcursor' 'libxfixes' 'libxi' 'libxinerama' 'libxkbcommon' 'libxpresent' 'libxss' 'nettle' 'wayland' 'zlib' 'zstd') cd "${srcdir}/${_lgdir}/client/build" make DESTDIR="${pkgdir}" install } package_looking-glass-module-dkms() { pkgdesc="A kernel module that implements a basic interface to the IVSHMEM device for when using LookingGlass in VM->VM mode" depends=('dkms') cd "${srcdir}/${_lgdir}/module" install -Dm644 -t "${pkgdir}/usr/src/${pkgbase}-${pkgver}" \ Makefile \ dkms.conf \ kvmfr.{h,c} } package_looking-glass-host() { pkgdesc="Linux host application for pushing frame data to the LookingGlass IVSHMEM device" depends=('binutils' 'gcc-libs' 'glib2' 'glibc' 'libpipewire' 'libxcb' 'zlib' 'zstd') cd "${srcdir}/${_lgdir}/host/build" make DESTDIR="${pkgdir}" install } package_obs-plugin-looking-glass() { pkgdesc="Plugin for OBS Studio to stream directly from Looking Glass without having to record the Looking Glass client" depends=('glibc' 'obs-studio') install -Dm644 -t "${pkgdir}/usr/lib/obs-plugins" \ "${srcdir}/${_lgdir}/obs/build/liblooking-glass-obs.so" }