# Contributor: A. Wilcox <awilfox@adelielinux.org>
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=gcompris-qt
pkgver=0.91
pkgrel=0
pkgdesc="Educational software suite in many languages"
url="http://gcompris.net/"
arch=""
options="!check"  # No test suite.
license="GPL-3.0-only"
depends="gst-plugins-base qml-box2d"
makedepends="cmake extra-cmake-modules qt5-qtbase-dev qt5-qtdeclarative-dev
	qt5-qtmultimedia-dev qt5-qtsvg-dev qt5-qtxmlpatterns-dev gstreamer-dev
	qt5-qttools-dev qt5-qtsensors-dev kdoctools-dev"
langdir="/usr/share/gcompris-qt/translations"
subpackages="$pkgname-doc $pkgname-lang"
source="http://gcompris.net/download/qt/src/gcompris-qt-$pkgver.tar.xz"

build() {
	cd "$builddir"
	mkdir build
	cd build
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=RelWithDebugInfo \
		-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
		-DCMAKE_C_FLAGS="$CFLAGS" \
		${CMAKE_CROSSOPTS} \
		..
	make
}

package() {
	cd "$builddir"/build
	make DESTDIR="$pkgdir" install
}

sha512sums="bc4515acc5c58869997e44c0c3c38d2904f34a7a5efede1ee7aefcbd1ae5907fe00b29a3ecf8e5e46396031736d10df64523e280dfffe3bac2df7e34fe9a8eda  gcompris-qt-0.91.tar.xz"