1SUMMARY="Innovative new Real Time Strategy game"
2DESCRIPTION="Globulation 2 is an innovative Real-Time Strategy (RTS) game which reduces \
3micromanagement by automatically assigning tasks to units."
4HOMEPAGE="https://globulation2.org/"
5COPYRIGHT="Globulation2 team"
6LICENSE="GNU GPL v3"
7REVISION="2"
8SOURCE_URI="http://mirror.netcologne.de/savannah/glob2/0.9.4/glob2-$portVersion.tar.gz"
9SOURCE_FILENAME="glob2-$portVersion.tar.gz"
10SOURCE_DIR="glob2-$portVersion"
11CHECKSUM_SHA256="0f4d898ec6b05ce27b4a12ef242cc26571304b90d2509932a4743c71311314b8"
12PATCHES="globulation2-0.9.4.4.patchset"
13ADDITIONAL_FILES="globulation2.rdef.in"
14
15ARCHITECTURES="all !x86_gcc2"
16SECONDARY_ARCHITECTURES="x86"
17
18USER_SETTINGS_FILES="
19	settings/glob2 directory"
20
21PROVIDES="
22	globulation2$secondaryArchSuffix = $portVersion
23	app:Globulation2
24	"
25REQUIRES="
26	haiku$secondaryArchSuffix
27	lib:libboost_thread$secondaryArchSuffix
28	lib:libfribidi$secondaryArchSuffix
29	lib:libGL$secondaryArchSuffix
30	lib:libglu$secondaryArchSuffix
31	lib:libogg$secondaryArchSuffix
32	lib:libSDL_1.2$secondaryArchSuffix
33	lib:libSDL_ttf_2.0$secondaryArchSuffix
34	lib:libSDL_image_1.2$secondaryArchSuffix
35	lib:libSDL_net_1.2$secondaryArchSuffix
36	lib:libspeex$secondaryArchSuffix
37	lib:libvorbis$secondaryArchSuffix
38	lib:libz$secondaryArchSuffix
39	"
40
41BUILD_REQUIRES="
42	haiku${secondaryArchSuffix}_devel
43	boost170${secondaryArchSuffix}_devel
44	devel:libfribidi$secondaryArchSuffix
45	devel:libglu$secondaryArchSuffix
46	devel:libogg$secondaryArchSuffix
47	devel:libSDL_1.2$secondaryArchSuffix
48	devel:libSDL_ttf_2.0$secondaryArchSuffix
49	devel:libSDL_image_1.2$secondaryArchSuffix
50	devel:libSDL_net_1.2$secondaryArchSuffix
51	devel:libspeex$secondaryArchSuffix
52	devel:libvorbis$secondaryArchSuffix
53	devel:libz$secondaryArchSuffix
54	"
55BUILD_PREREQUIRES="
56	cmd:gcc$secondaryArchSuffix
57	cmd:g++$secondaryArchSuffix
58	cmd:scons
59	python3$secondaryArchSuffix
60	"
61
62BUILD() {
63	mkdir -p $appsDir
64	mkdir -p $dataDir/globulation2
65	scons -j$jobs INSTALLDIR=$dataDir/globulation2 BINDIR=$appsDir DATADIR=$dataDir/globulation2 \
66		release=0 LDFLAGS=-g
67}
68
69INSTALL() {
70	scons -j$jobs INSTALLDIR=$dataDir/globulation2 BINDIR=$appsDir DATADIR=$dataDir/globulation2 \
71		release=0 LDFLAGS=-g install
72
73	mv $appsDir/glob2 $appsDir/Globulation2
74
75	# remove unnecessary data files
76	rm -r $dataDir/globulation2/applications/
77	rm -r $dataDir/globulation2/icons/
78
79	# apply the rdef.in file
80	local MAJOR="`echo "$portVersion" | cut -d. -f1`"
81	local MIDDLE="`echo "$portVersion" | cut -d. -f2`"
82	local MINOR="`echo "$portVersion" | cut -d. -f3`"
83	local LONG_INFO="$SUMMARY"
84	sed \
85		-e "s|@MAJOR@|$MAJOR|" \
86		-e "s|@MIDDLE@|$MIDDLE|" \
87		-e "s|@MINOR@|$MINOR|" \
88		-e "s|@LONG_INFO@|$LONG_INFO|" \
89		$portDir/additional-files/globulation2.rdef.in > $portDir/globulation2.rdef
90
91	addResourcesToBinaries $portDir/globulation2.rdef $appsDir/Globulation2
92	addAppDeskbarSymlink $appsDir/Globulation2
93}
94