1SUMMARY="Realistic physics simulation game"
2DESCRIPTION="The Butterfly Effect is a free and open source game that uses realistic \
3physics simulations to combine lots of simple mechanical elements to achieve a simple \
4goal in the most complex way possible."
5HOMEPAGE="http://the-butterfly-effect.org/"
6COPYRIGHT="Peter van Ginneken, Klaas van Gend"
7LICENSE="GNU GPL v2"
8REVISION="1"
9SOURCE_URI="https://github.com/the-butterfly-effect/tbe/archive/v$portVersion.tar.gz"
10CHECKSUM_SHA256="7e59ddb1d28c589e3e4aff756dbf76eab0e85f1dc9288c151cd4eff6dcb913a3"
11SOURCE_DIR="tbe-$portVersion"
12PATCHES="tbe-$portVersion.patchset"
13ADDITIONAL_FILES="tbe.rdef.in"
14
15ARCHITECTURES="all !x86_gcc2"
16SECONDARY_ARCHITECTURES="x86"
17
18PROVIDES="
19	tbe$secondaryArchSuffix = $portVersion
20	app:TheButterflyEffect$secondaryArchSuffix = $portVersion
21	"
22REQUIRES="
23	haiku$secondaryArchSuffix
24	lib:libGL$secondaryArchSuffix
25	lib:libintl$secondaryArchSuffix
26	lib:libQt5Core$secondaryArchSuffix
27	lib:libQt5Gui$secondaryArchSuffix
28	lib:libQt5Widgets$secondaryArchSuffix
29	"
30
31BUILD_REQUIRES="
32	haiku${secondaryArchSuffix}_devel
33	devel:libQt5Core$secondaryArchSuffix
34	devel:libQt5Gui$secondaryArchSuffix
35	devel:libQt5Widgets$secondaryArchSuffix
36	"
37BUILD_PREREQUIRES="
38	cmd:cmake
39	cmd:gcc$secondaryArchSuffix
40	cmd:ld$secondaryArchSuffix
41	cmd:make
42	"
43
44BUILD()
45{
46	cmake . -DCMAKE_INSTALL_PREFIX=$appsDir/TBE
47	make $jobArgs
48}
49
50INSTALL()
51{
52	make install
53
54	mv $appsDir/TBE/tbe "$appsDir/TBE/The Butterfly Effect"
55	rm -rf $appsDir/TBE/{applications,icons}
56
57	local APP_SIGNATURE="application/x-vnd.the-butterfly-effect"
58	local MAJOR="`echo "$portVersion" | cut -d. -f1`"
59	local MIDDLE="`echo "$portVersion" | cut -d. -f2`"
60	local MINOR="`echo "$portVersion" | cut -d. -f3`"
61	local INTERNAL="`echo "$portVersion" | cut -d. -f4`"
62	local LONG_INFO="$SUMMARY"
63	sed \
64		-e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \
65		-e "s|@MAJOR@|$MAJOR|" \
66		-e "s|@MIDDLE@|$MIDDLE|" \
67		-e "s|@MINOR@|$MINOR|" \
68		-e "s|@INTERNAL@|$INTERNAL|" \
69		-e "s|@LONG_INFO@|$LONG_INFO|" \
70		$portDir/additional-files/tbe.rdef.in > $sourceDir/tbe.rdef
71
72	addResourcesToBinaries  $sourceDir/tbe.rdef \
73		"$appsDir/TBE/The Butterfly Effect"
74
75	mimeset -f "$appsDir/TBE/The Butterfly Effect"
76
77	addAppDeskbarSymlink "$appsDir/TBE/The Butterfly Effect"
78}
79