# Template file for 'gnome-remote-desktop'
pkgname=gnome-remote-desktop
version=40.1
revision=1
build_style=meson
configure_args="$(vopt_bool rdp rdp) $(vopt_bool vnc vnc)
 -Dsystemd_user_unit_dir=/tmp"
hostmakedepends="pkg-config glib-devel"
makedepends="glib-devel pipewire-devel libsecret-devel libnotify-devel
 $(vopt_if rdp "freerdp-devel freerdp-server-devel fuse3-devel")
 $(vopt_if vnc libvncserver-devel)"
short_desc="GNOME remote desktop server"
maintainer="Michal Vasilek <michal@vasilek.cz>"
license="GPL-2.0-or-later"
homepage="https://wiki.gnome.org/Projects/Mutter/RemoteDesktop"
distfiles="${GNOME_SITE}/gnome-remote-desktop/${version%%.*}/gnome-remote-desktop-${version}.tar.xz"
checksum=9afa6e525570a372093f9730338270903894f3b1f9f8a9df5f57836ea1d29de9
make_check=no # xvfb failed to start

build_options="rdp vnc"
desc_option_rdp="RDP support"
desc_option_vnc="VNC support"
# RDP doesn't currently have GUI in gcs, so it's disabled by default
build_options_default="vnc"

pre_configure() {
	if [ -z "$build_option_rdp" ] && [ -z "$build_option_vnc" ]; then
		echo at least one of vnc and rdp options has to be enabled
		exit 1
	fi

	vsed -e '/systemd_dep/d' -i meson.build
}

post_install() {
	rm -rf ${DESTDIR}/tmp
}
