# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=qt5-qtvirtualkeyboard
pkgver=5.10.1
pkgrel=0
arch="all"
url='http://qt-project.org/'
license="GPL-3.0 GPL-2.0 LGPL-3.0"
pkgdesc='Virtual keyboard framework'
depends=""
depends_dev="qt5-qtbase-dev qt5-qtdeclarative-dev qt5-qtsvg-dev"
makedepends="$depends_dev hunspell-dev"
source="http://download.qt.io/official_releases/qt/${pkgver%.*}/$pkgver/submodules/${pkgname/qt5-/}-everywhere-src-$pkgver.tar.xz
	0001-include-sys-time.h-for-timeval.patch"
subpackages="$pkgname-dev"
builddir="$srcdir/${pkgname/qt5-/}-everywhere-src-$pkgver"
options="!check"

build() {
	qmake-qt5 CONFIG+="lang-all handwriting"
	make
}

package() {
	cd "$builddir"
	make INSTALL_ROOT="$pkgdir" install

	# Drop QMAKE_PRL_BUILD_DIR because reference the build dir
	find "$pkgdir/usr/lib" -type f -name '*.prl' \
		-exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;

	install -d "$pkgdir"/usr/share/licenses
	ln -s /usr/share/licenses/qt5-base "$pkgdir"/usr/share/licenses/$pkgname
}
sha512sums="e317e19aa98bf5e5f8fed1ef03daec06ba2344be5b12021277d1f472b1cad809f7370dc45fc0d68f4a9ea91324b957aeae9db8513f7b894d2a7254acf62a8f76  qtvirtualkeyboard-everywhere-src-5.10.1.tar.xz
e801336b9aaf0facdcf7347fa8cf7223362312c92ea5725c5260d777045cc9da9a6de514dc4c17904aab77ae799bdd154c4615b8f2a39d92ce55ca10ad218efb  0001-include-sys-time.h-for-timeval.patch"
