# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=ubuntu-ui-toolkit
pkgver=0_git20190208
_commit="cee7f49f493f37ebf0690137ed85700f94bacdf9"
pkgrel=0
pkgdesc='The Ubuntu UI toolkit used in Ubuntu Touch'
arch="x86_64"
url="https://unity8.io"
license="LGPL-3.0"
depends="qt5-qtfeedback"
depends_dev="libnih-dev qt5-qtsvg-dev qt5-qtpim-dev qt5-qtsystems-dev lttng-ust-dev libxi-dev eudev-dev mir-dev libevdev-dev qt5-qtgraphicaleffects qt5-qtfeedback-dev"
makedepends="$depends_dev qt5-qttools-dev qt5-qtdeclarative-dev"
source="$pkgname-$_commit.tar.gz::https://github.com/ubports/$pkgname/archive/$_commit.tar.gz
	0004-Make-it-compile-with-Qt-5.12.patch
	replace-bash-for-sh.patch"
subpackages="$pkgname-dev $pkgname-lang"
options="!check" # Complaining about a non-existing file
builddir="$srcdir/$pkgname-$_commit"

prepare() {
	default_prepare

	# Lets warnings be warnings and not errors
	sed -i 's|warning_clean|warn_off|' "$builddir"/.qmake.conf
}

build() {
	cd "$builddir"
	qmake-qt5 "CONFIG+=no_docs"
	make
}

check() {
	cd "$builddir"
	make check
}

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

sha512sums="bdbef210a353349d26b273979a5fca67d47cee16fc56f8386247ff6c7871635e2cf7dbca8e69bc258a46db536885bc3350de2a7706ef4a01b1dcced505e31600  ubuntu-ui-toolkit-cee7f49f493f37ebf0690137ed85700f94bacdf9.tar.gz
5b5c00bd365ee4068e2e0622a0ce31c7b67b0c6cf136b0d717dd68ac9559bc2d9c54e1e0c9106fa1d6e3438de974fa8b44c023888fe87bc1d1ed584023184eba  0004-Make-it-compile-with-Qt-5.12.patch
e01567f2426f78b0862e7b09cd99cabf3d885b600592e6a4f0e07dc077fae2ba8dd1d2deba3bb89d31171a90db6de909281664bcbc7736b9432f2bc0b26544e1  replace-bash-for-sh.patch"
