# Template file for 'spice'
pkgname=spice
version=0.15.2
revision=1
build_style=gnu-configure
configure_args="--disable-tunnel --disable-opengl --enable-smartcard
 --with-sasl --disable-static --enable-xinerama --disable-celt051"
hostmakedepends="pkg-config python3"
makedepends="spice-protocol libjpeg-turbo-devel pixman-devel
 openssl-devel opus-devel alsa-lib-devel libXfixes-devel libXrender-devel
 libXrandr-devel libsasl-devel libXinerama-devel libglib-devel libcacard-devel
 nss-devel"
checkdepends="glib-networking"
short_desc="Implements the SPICE protocol"
maintainer="Anachron <gith@cron.world>"
license="LGPL-2.1-or-later"
homepage="https://www.spice-space.org/"
changelog="https://gitlab.freedesktop.org/spice/spice/-/raw/master/CHANGELOG.md"
distfiles="https://www.spice-space.org/download/releases/spice-server/spice-${version}.tar.bz2"
checksum=6d9eb6117f03917471c4bc10004abecff48a79fb85eb85a1c45f023377015b81

if [ "$XBPS_TARGET_ENDIAN" != "le" ]; then
	broken="SPICE server only works on little endian architectures"
fi

if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
	# tests depend on odd behaviour of glibc
	# in this case being that calling getnameinfo on an AF_LOCAL socket
	# will return successfully, with either hostname or "localhost"
	# musl errors out instead, thus failing the tests
	make_check=no
fi

spice-devel_package() {
	depends="${makedepends} ${sourcepkg}>=${version}_${revision}"
	short_desc+=" - development files"
	pkg_install() {
		vmove usr/include
		vmove usr/lib/pkgconfig
		vmove usr/lib/*.so
	}
}
