1 # Copyright 2023 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}"
10 DESCRIPTION
="A low latency KVMFR application for guests with VGA PCI Passthrough"
11 HOMEPAGE
="https://looking-glass.io"
12 SRC_URI
="https://looking-glass.io/artifact/${MY_PV}/source -> ${P}.tar.gz"
17 IUSE
="X wayland pipewire pulseaudio +backtrace gnome host obs"
18 REQUIRED_USE
="|| ( X wayland )
19 || ( pipewire pulseaudio )"
21 DEPEND
="gui-libs/egl-wayland
23 media-libs/libsamplerate
25 app-emulation/spice-protocol
32 x11-libs/libXScrnSaver
49 media-video/obs-studio
53 S
="${WORKDIR}/${PN}-${MY_PV}"
55 MY_CMAKE_PROJECT
="client "
61 MY_CMAKE_PROJECT
+="host "
64 MY_CMAKE_PROJECT
+="obs "
67 for prj
in ${MY_CMAKE_PROJECT}
69 CMAKE_USE_DIR
="${S}/${prj}"
70 cmake_src_prepare
"$@"
75 # cmake configure by use flags
81 if ! use wayland
; then
86 if ! use pipewire
; then
91 if ! use pulseaudio
; then
93 -DENABLE_PULSEAUDIO=no
96 if use gnome
&& use wayland
; then
101 # cmake configure loop
102 for prj
in ${MY_CMAKE_PROJECT}
104 CMAKE_USE_DIR
="${S}/${prj}"
105 BUILD_DIR
="${CMAKE_USE_DIR}_build"
106 cmake_src_configure
"$@"
113 for prj
in ${MY_CMAKE_PROJECT}
115 CMAKE_USE_DIR
="${S}/${prj}"
116 BUILD_DIR
="${CMAKE_USE_DIR}_build"
117 cmake_src_compile
"$@"
122 # install cmake projects
123 for prj
in ${MY_CMAKE_PROJECT}
125 CMAKE_USE_DIR
="${S}/${prj}"
126 BUILD_DIR
="${CMAKE_USE_DIR}_build"
127 cmake_src_install
"$@"
131 # install tmpfiles config
132 newtmpfiles
"${FILESDIR}"/${PN}-tmpfiles.conf ${PN}.conf
134 domenu "${FILESDIR}/${PN}.desktop
"
135 newicon -s 128 "${S}/resources
/icon-128x128.png
" "${PN}.png
"