# Template file for 'gsettings-qt'
pkgname=gsettings-qt
version=0.1+17.10.20170824
revision=1
build_style=qmake
hostmakedepends="qt5-qmake pkg-config qt5-declarative"
makedepends="qt5-devel qt5-declarative-devel glib-devel"
short_desc="Qml bindings for GSettings"
maintainer="John <johnz@posteo.net>"
license="LGPL-3.0-only"
homepage="https://launchpad.net/gsettings-qt"
distfiles="$DEBIAN_SITE/main/g/gsettings-qt/gsettings-qt_${version}.orig.tar.gz"
checksum=a3d1020d526ece2319f1e8f05876e456e85279741653008e05c5d7e8b019c9b9

if [ "$CROSS_BUILD" ]; then
	hostmakedepends+=" qt5-devel qt5-declarative-devel"
fi

pre_configure() {
	#disable generation for qmltypes file while cross building
	#also makes trouble x86_64-musl so just remove it for everything
	if [ "$CROSS_BUILD" ] || [ "${XBPS_TARGET_MACHINE#*-musl}" != "$XBPS_TARGET_MACHINE" ];then
		sed -i -e '/qmltypes/ d' GSettings/gsettings-qt.pro
	fi
}

post_install() {
	rm -r ${DESTDIR}/usr/tests
}

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