# Template file for 'wayfire'
pkgname=wayfire
version=0.6.0
revision=2
_utils_commit=f45641beef46babdc8f1b8d18a924e72beaf8ee6
_touch_commit=b1075c54a280f913edc26b9757262f4f9d6b62b0
build_style=meson
hostmakedepends="pkg-config wayland-devel"
makedepends="wf-config-devel wlroots-devel cairo-devel
 $(vopt_if image 'libjpeg-turbo-devel libpng-devel')"
depends="xorg-server-xwayland"
short_desc="3D wayland compositor"
maintainer="Érico Nogueira <ericonr@disroot.org>"
license="MIT"
homepage="https://wayfire.org"
distfiles="https://github.com/WayfireWM/wayfire/archive/${version}.tar.gz
 https://github.com/WayfireWM/wf-utils/archive/${_utils_commit}.tar.gz
 https://github.com/WayfireWM/wf-touch/archive/${_touch_commit}.tar.gz"
checksum="9c2bf92e6aecc9b800b87e4c086ff7a275393f7315501b8c39196baf9d245b33
 d172f8c21e0bac01e4116cd957fb0159c5cb39ddfdce897beb0d9c753796d5f1
 2b22e03d3a522baeff5798f630ffe5aa95899fd3233b291527503af5fd3e30be"

build_options="image"
build_options_default="image"
desc_option_image="Enable JPEG and PNG support"

if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
	makedepends+=" libexecinfo-devel"
fi

post_extract() {
	rmdir subprojects/wf-utils
	rmdir subprojects/wf-touch
	mv ../wf-utils-${_utils_commit} subprojects/wf-utils
	mv ../wf-touch-${_touch_commit} subprojects/wf-touch
}

post_install() {
	vlicense LICENSE
	vsconf wayfire.ini
	vinstall wayfire.desktop 0644 usr/share/wayland-sessions
}

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