1SUMMARY="A Boulder Dash like game"
2DESCRIPTION="Supaplex is a Boulder Dash like game where you control a \
3red Pac-Man like character called Murphy who needs to collect \
4\"Infotrons\" while exploring inside a computer. Watch out for \
5various hazards though! Like in Boulder Dash, the \"boulders\" \
6that are freed from support will fall down and can crush Murphy \
7or block further passage through a level. Other obstacles and \
8hazards exist too, and will require some thinking ahead to \
9overcome safely.
10
11OpenSupaplex is a 1:1 reimplementation of the original \
12game in C and SDL, with just a few changes to make it easy to use \
13with game controllers, and also easy to port to any platform."
14HOMEPAGE="https://github.com/sergiou87/open-supaplex"
15COPYRIGHT="Philip Jespersen, Michael Stopp, Robin Heydon, Matt Smith, David Whittaker, Sergio Padrino"
16LICENSE="GNU GPL v3"
17REVISION="1"
18SOURCE_URI="https://github.com/sergiou87/open-supaplex/archive/refs/tags/v${portVersion}.tar.gz"
19CHECKSUM_SHA256="769f7cf8684e8d42849581a210d11bbe5c487a24738560f574a084e9d749164b"
20SOURCE_DIR="open-supaplex-$portVersion"
21PATCHES="open_supaplex-$portVersion.patchset"
22ADDITIONAL_FILES="open_supaplex.rdef.in"
23
24ARCHITECTURES="all !x86_gcc2"
25SECONDARY_ARCHITECTURES="x86"
26
27PROVIDES="
28	open_supaplex$secondaryArchSuffix = $portVersion
29	app:OpenSupaplex
30	"
31REQUIRES="
32	haiku$secondaryArchSuffix
33	lib:libGL$secondaryArchSuffix
34	lib:libogg$secondaryArchSuffix
35	lib:libSDL2_2.0$secondaryArchSuffix
36	lib:libSDL2_mixer_2.0$secondaryArchSuffix
37	lib:libvorbis$secondaryArchSuffix
38	"
39
40BUILD_REQUIRES="
41	haiku${secondaryArchSuffix}_devel
42	devel:libGL$secondaryArchSuffix
43	devel:libglu$secondaryArchSuffix
44	devel:libogg$secondaryArchSuffix
45	devel:libSDL2_2.0$secondaryArchSuffix
46	devel:libSDL2_mixer_2.0$secondaryArchSuffix
47	devel:libvorbis$secondaryArchSuffix
48	"
49BUILD_PREREQUIRES="
50	cmd:gcc$secondaryArchSuffix
51	cmd:ld$secondaryArchSuffix
52	cmd:make
53	cmd:pkg_config$secondaryArchSuffix
54	"
55
56BUILD()
57{
58	cd linux
59	make $jobArgs
60}
61
62INSTALL()
63{
64	mkdir -p $appsDir/OpenSupaplex/data
65	cp linux/opensupaplex $appsDir/OpenSupaplex/OpenSupaplex
66	cp -R resources/* $appsDir/OpenSupaplex/data
67	mv $appsDir/OpenSupaplex/data/audio-hq $appsDir/OpenSupaplex
68	rm -rf $appsDir/OpenSupaplex/data/audio-{lq,mq}
69
70	local APP_SIGNATURE="application/x-vnd.open-supaplex"
71	local MAJOR="`echo "$portVersion" | cut -d. -f1`"
72	local MIDDLE="`echo "$portVersion" | cut -d. -f2`"
73	local MINOR="`echo "$portVersion" | cut -d. -f3`"
74	local LONG_INFO="$SUMMARY"
75	sed \
76		-e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \
77		-e "s|@MAJOR@|$MAJOR|" \
78		-e "s|@MIDDLE@|$MIDDLE|" \
79		-e "s|@MINOR@|$MINOR|" \
80		-e "s|@LONG_INFO@|$LONG_INFO|" \
81		$portDir/additional-files/open_supaplex.rdef.in > $sourceDir/open_supaplex.rdef
82
83	addResourcesToBinaries  $sourceDir/open_supaplex.rdef \
84		$appsDir/OpenSupaplex/OpenSupaplex
85	addAppDeskbarSymlink $appsDir/OpenSupaplex/OpenSupaplex
86}
87