SUMMARY="QML Box2D plugin"
DESCRIPTION="The goal is to expose the functionality of Box2D as QML components, \
in order to make it easy to write physics based games in QML."
HOMEPAGE="https://github.com/qml-box2d/qml-box2d/"
COPYRIGHT="
	2006-2010 Erin Catto
	2010-2011 Thorbjørn Lindeijer
	2011 Daker Fernandes Pinheiro
	2011 Tan Miaoqing
	2011 Antonio Aloisio
	2011 Alessandro Portale
	2011 Joonas Erkinheimo
	2011 Antti Krats
	2014 Moukhlynin Ruslan
	2011 Markus Kivioja
	2012 Adriano Rezende
	"
LICENSE="BSD (3-clause)"
REVISION="1"
srcGitRev="1b37be7d9dfb44ec6d520595a4e4f45f63717822"
SOURCE_URI="$HOMEPAGE/archive/$srcGitRev.tar.gz"
CHECKSUM_SHA256="9a15af5b1ecc0d67f641545a76a725494ebf21165e5903afa7fc02b3c5000154"
SOURCE_DIR="qml-box2d-$srcGitRev"

ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="?x86"

PROVIDES="
	qml_box2d$secondaryArchSuffix = $portVersion
	qt5:QmlBox2d
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libGL$secondaryArchSuffix
	lib:libQt5Core$secondaryArchSuffix
	lib:libQt5Gui$secondaryArchSuffix
	lib:libQt5Network$secondaryArchSuffix
	lib:libQt5Qml$secondaryArchSuffix
	lib:libQt5Quick$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libGL$secondaryArchSuffix
	devel:libQt5Core$secondaryArchSuffix
	devel:libQt5Gui$secondaryArchSuffix
	devel:libQt5Network$secondaryArchSuffix
	devel:libQt5Qml$secondaryArchSuffix
	devel:libQt5Quick$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:make
	cmd:qmake >= 5
	"

BUILD()
{
	qmake
	make $jobArgs
}

INSTALL()
{
	make INSTALL_ROOT=$prefix install

	mkdir -p $(dirname $dataDir)
	mv $prefix/packages/qt5-*/.self/data $dataDir
	rm -rf $prefix/packages
}
