1 # Copyright 2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit cmake tmpfiles linux-info desktop xdg
8 MY_PV
="${PV//0_beta/B}"
11 DESCRIPTION
="A low latency KVMFR application for guests with VGA PCI Passthrough"
12 HOMEPAGE
="https://looking-glass.io"
13 SRC_URI
="https://looking-glass.io/artifact/${MY_PV}/source -> ${P}.tar.gz"
18 IUSE
="X wayland pipewire pulseaudio +backtrace gnome host obs"
19 REQUIRED_USE
="|| ( X wayland )
20 || ( pipewire pulseaudio )"
22 DEPEND
="gui-libs/egl-wayland
24 media-libs/libsamplerate
26 app-emulation/spice-protocol
33 x11-libs/libXScrnSaver
50 media-video/obs-studio
54 S
="${WORKDIR}/${PN}-${MY_PV}"
56 MY_CMAKE_PROJECT
="client "
62 MY_CMAKE_PROJECT
+="host "
65 MY_CMAKE_PROJECT
+="obs "
68 for prj
in ${MY_CMAKE_PROJECT}
70 CMAKE_USE_DIR
="${S}/${prj}"
71 cmake_src_prepare
"$@"
76 # cmake configure by use flags
82 if ! use wayland
; then
87 if ! use pipewire
; then
92 if ! use pulseaudio
; then
94 -DENABLE_PULSEAUDIO=no
97 if use gnome
&& use wayland
; then
102 # cmake configure loop
103 for prj
in ${MY_CMAKE_PROJECT}
105 CMAKE_USE_DIR
="${S}/${prj}"
106 BUILD_DIR
="${WORKDIR}/${prj}"
107 cmake_src_configure
"$@"
114 for prj
in ${MY_CMAKE_PROJECT}
116 CMAKE_USE_DIR
="${S}/${prj}"
117 BUILD_DIR
="${WORKDIR}/${prj}"
118 cmake_src_compile
"$@"
123 # install cmake projects
124 for prj
in ${MY_CMAKE_PROJECT}
126 CMAKE_USE_DIR
="${S}/${prj}"
127 BUILD_DIR
="${WORKDIR}/${prj}"
128 cmake_src_install
"$@"
132 # install tmpfiles config
133 newtmpfiles
"${FILESDIR}"/${PN}-tmpfiles.conf ${PN}.conf
135 domenu "${FILESDIR}/${PN}.desktop
"
136 newicon -s 128 "${S}/resources
/icon-128x128.png
" "${PN}.png
"