# Contributor: Luca Weiss <luca@lucaweiss.eu>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=qt5-qtpim
pkgver=0_git20201102
_commit="f9a8f0fc914c040d48bbd0ef52d7a68eea175a98"
pkgrel=2
arch="all"
url="https://qt-project.org/"
license="LGPL-2.1-only AND LGPL-3.0-only AND GPL-3.0-only AND Qt-GPL-exception-1.0"
pkgdesc='Qt Personal Information Management'
depends_dev="qt5-qtdeclarative-dev"
makedepends="$depends_dev"
source="https://github.com/qt/qtpim/archive/$_commit/qtpim-$_commit.tar.gz
	0002-Set-PLUGIN_CLASS_NAME-in-.pro-files.patch
	0003-Set-MODULE_VERSION-to-5.0.0.patch
	"
subpackages="$pkgname-dev $pkgname-doc"
builddir="$srcdir/qtpim-$_commit"
options="!check"

build() {
	qmake-qt5 CONFIG+=git_build
	make
}

package() {
	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="
a293caa609fe9442161cae764a1014757084d704835bacc061c6b92fb8913e1b669ac64fb1b45ed2431f44e389db3fdfc4b5ffb52eb560b361b62193cf717787  qtpim-f9a8f0fc914c040d48bbd0ef52d7a68eea175a98.tar.gz
58d5ce29035506c4c922f8392ba59d956697d4f972c6e7d65b20b5ee4b9bf1edb14609e6800ebff9ec7f102ca360572b26d46ddcabed776ff3b901f137fbee6d  0002-Set-PLUGIN_CLASS_NAME-in-.pro-files.patch
a97d5cedb7f6cce848e135c3eff26931a38682a5bb85ef1b1a1c85aa5b7d08744bc111fde006f355c80d056aa901be7efa33fc84a997e66fc524c6d218d6c9a6  0003-Set-MODULE_VERSION-to-5.0.0.patch
"
