.github/workflows: fix dev-util/android-studio
[gentoo-zh.git] / app-emulation / looking-glass / looking-glass-0_beta6-r1.ebuild
blob8c1275fab1ee81cf45e4d1763daaa4263a6dd0e3
1 # Copyright 2023 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=8
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"
14 LICENSE="GPL-2"
15 SLOT="0"
16 KEYWORDS="~amd64"
17 IUSE="X wayland pipewire pulseaudio +backtrace gnome host obs"
18 REQUIRED_USE="|| ( X wayland )
19 || ( pipewire pulseaudio )"
21 DEPEND="gui-libs/egl-wayland
22 media-libs/fontconfig
23 media-libs/libsamplerate
24 dev-libs/nettle[gmp]
25 app-emulation/spice-protocol
26 X? (
27 x11-libs/libX11
28 x11-libs/libXfixes
29 x11-libs/libXi
30 x11-libs/libXinerama
31 x11-libs/libXcursor
32 x11-libs/libXScrnSaver
33 x11-libs/libXpresent
35 wayland? (
36 dev-libs/wayland
37 x11-libs/libxkbcommon
38 gnome? (
39 gui-libs/libdecor
42 pipewire? (
43 media-video/pipewire
45 pulseaudio? (
46 media-libs/libpulse
48 obs? (
49 media-video/obs-studio
51 RDEPEND="${DEPEND}"
53 S="${WORKDIR}/${PN}-${MY_PV}"
55 MY_CMAKE_PROJECT="client "
57 src_prepare() {
58 default
59 # add other project
60 if use host; then
61 MY_CMAKE_PROJECT+="host "
63 if use obs; then
64 MY_CMAKE_PROJECT+="obs "
66 # cmake prepare loop
67 for prj in ${MY_CMAKE_PROJECT}
69 CMAKE_USE_DIR="${S}/${prj}"
70 cmake_src_prepare "$@"
71 done
74 src_configure() {
75 # cmake configure by use flags
76 if ! use X; then
77 local mycmakeargs+=(
78 -DENABLE_X11=no
81 if ! use wayland; then
82 local mycmakeargs+=(
83 -DENABLE_WAYLAND=no
86 if ! use pipewire; then
87 local mycmakeargs+=(
88 -DENABLE_PIPEWIRE=no
91 if ! use pulseaudio; then
92 local mycmakeargs+=(
93 -DENABLE_PULSEAUDIO=no
96 if use gnome && use wayland; then
97 local mycmakeargs+=(
98 -DENABLE_LIBDECOR=yes
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 "$@"
107 done
108 set_arch_to_kernel
111 src_compile() {
112 # cmake compile loop
113 for prj in ${MY_CMAKE_PROJECT}
115 CMAKE_USE_DIR="${S}/${prj}"
116 BUILD_DIR="${CMAKE_USE_DIR}_build"
117 cmake_src_compile "$@"
118 done
121 src_install() {
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 "$@"
128 done
129 # install docs
130 einstalldocs
131 # install tmpfiles config
132 newtmpfiles "${FILESDIR}"/${PN}-tmpfiles.conf ${PN}.conf
133 # install desktop
134 domenu "${FILESDIR}/${PN}.desktop"
135 newicon -s 128 "${S}/resources/icon-128x128.png" "${PN}.png"