1SUMMARY="A game of action and puzzle solving"
2DESCRIPTION="KGoldrunner is an action game where the hero runs through \
3a maze, climbs stairs, dig holes and dodges enemies in order to collect \
4all the gold nuggets and escape to the next level. Your enemies are also \
5after the gold. Worse still, they are after you!."
6HOMEPAGE="https://github.com/KDE/kgoldrunner"
7COPYRIGHT="2010-2024 KDE Organisation"
8LICENSE="GNU GPL v2"
9REVISION="1"
10SOURCE_URI="https://download.kde.org/stable/release-service/$portVersion/src/kgoldrunner-$portVersion.tar.xz"
11CHECKSUM_SHA256="ec621250b3ac510ce1a752cc405ee6ff38a7e832cbaf05fd30a31581be005b0c"
12SOURCE_DIR="kgoldrunner-$portVersion"
13ADDITIONAL_FILES="kgoldrunner.rdef.in"
14
15ARCHITECTURES="all !x86_gcc2"
16SECONDARY_ARCHITECTURES="x86"
17
18PROVIDES="
19	kgoldrunner$secondaryArchSuffix = $portVersion
20	app:KGoldRunner$secondaryArchSuffix = $portVersion
21	"
22REQUIRES="
23	haiku$secondaryArchSuffix
24	lib:libKF5Archive$secondaryArchSuffix
25	lib:libKF5Auth$secondaryArchSuffix
26	lib:libKF5Bookmarks$secondaryArchSuffix
27	lib:libKF5Codecs$secondaryArchSuffix
28	lib:libKF5Completion$secondaryArchSuffix
29	lib:libKF5ConfigCore$secondaryArchSuffix
30	lib:libKF5ConfigGui$secondaryArchSuffix
31	lib:libKF5ConfigWidgets$secondaryArchSuffix
32	lib:libKF5CoreAddons$secondaryArchSuffix
33	lib:libKF5Crash$secondaryArchSuffix
34	lib:libKF5DBusAddons$secondaryArchSuffix
35	lib:libKF5GuiAddons$secondaryArchSuffix
36	lib:libKF5I18n$secondaryArchSuffix
37	lib:libKF5IconThemes$secondaryArchSuffix
38	lib:libKF5ItemViews$secondaryArchSuffix
39	lib:libKF5JobWidgets$secondaryArchSuffix
40	lib:libKF5KDEGames$secondaryArchSuffix
41	lib:libKF5KIOCore$secondaryArchSuffix
42	lib:libKF5Service$secondaryArchSuffix
43	lib:libKF5Solid$secondaryArchSuffix
44	lib:libKF5TextEditor$secondaryArchSuffix
45	lib:libKF5TextWidgets$secondaryArchSuffix
46	lib:libKF5WidgetsAddons$secondaryArchSuffix
47	lib:libKF5WindowSystem$secondaryArchSuffix
48	lib:libKF5XmlGui$secondaryArchSuffix
49	lib:libQt5Core$secondaryArchSuffix
50	lib:libQt5DBus$secondaryArchSuffix
51	lib:libQt5Gui$secondaryArchSuffix
52	lib:libQt5Widgets$secondaryArchSuffix
53	lib:libQt5Xml$secondaryArchSuffix
54	"
55
56BUILD_REQUIRES="
57	haiku${secondaryArchSuffix}_devel
58	extra_cmake_modules$secondaryArchSuffix >= 5.115
59	devel:libKF5Archive$secondaryArchSuffix
60	devel:libKF5Auth$secondaryArchSuffix
61	devel:libKF5Bookmarks$secondaryArchSuffix
62	devel:libKF5Codecs$secondaryArchSuffix
63	devel:libKF5Completion$secondaryArchSuffix
64	devel:libKF5ConfigCore$secondaryArchSuffix
65	devel:libKF5ConfigWidgets$secondaryArchSuffix
66	devel:libKF5CoreAddons$secondaryArchSuffix
67	devel:libKF5Crash$secondaryArchSuffix
68	devel:libKF5DBusAddons$secondaryArchSuffix
69	devel:libKF5DocTools$secondaryArchSuffix
70	devel:libKF5GuiAddons$secondaryArchSuffix
71	devel:libKF5I18n$secondaryArchSuffix
72	devel:libKF5IconThemes$secondaryArchSuffix
73	devel:libKF5ItemModels$secondaryArchSuffix
74	devel:libKF5ItemViews$secondaryArchSuffix
75	devel:libKF5JobWidgets$secondaryArchSuffix
76	devel:libKF5KDEGames$secondaryArchSuffix
77	devel:libKF5KIOCore$secondaryArchSuffix
78	devel:libKF5Service$secondaryArchSuffix
79	devel:libKF5Solid$secondaryArchSuffix
80	devel:libKF5TextEditor$secondaryArchSuffix
81	devel:libKF5TextWidgets$secondaryArchSuffix
82	devel:libKF5WidgetsAddons$secondaryArchSuffix
83	devel:libKF5WindowSystem$secondaryArchSuffix
84	devel:libKF5XmlGui$secondaryArchSuffix
85	devel:libQt5Core$secondaryArchSuffix
86	"
87BUILD_PREREQUIRES="
88	cmd:cmake
89	cmd:g++$secondaryArchSuffix
90	cmd:lrelease$secondaryArchSuffix >= 5
91	cmd:make
92	cmd:pkg_config$secondaryArchSuffix
93	"
94
95BUILD()
96{
97	# disable docs generation
98	sed -e '/add_subdirectory(doc)/ s/^#*/#/' -i CMakeLists.txt
99	sed -e '/kdoctools_install(po)/ s/^#*/#/' -i CMakeLists.txt
100	# remove dbus
101	sed -e '/KDBusService service;/d' -i src/main.cpp
102
103	mkdir -p build
104	cd build
105
106	cmake .. \
107		-DCMAKE_BUILD_TYPE=Release \
108		-DCMAKE_INSTALL_PREFIX=$appsDir \
109		-DCMAKE_INSTALL_DATADIR=$dataDir \
110		-DCMAKE_INSTALL_DATAROOTDIR=$dataDir \
111		-DSHARE_INSTALL_PREFIX=$dataDir \
112		-DECM_DIR=/system/data/cmake/Modules/ECM/cmake
113	make $jobArgs
114}
115
116INSTALL()
117{
118	cd build
119	make install
120
121	mv $appsDir/bin/kgoldrunner $appsDir/KGoldRunner
122	rm -rf $appsDir/bin
123
124	local APP_SIGNATURE="application/x-vnd.kde-kgoldrunner"
125	local MAJOR="`echo "$portVersion" | cut -d. -f1`"
126	local MIDDLE="`echo "$portVersion" | cut -d. -f2`"
127	local MINOR="`echo "$portVersion" | cut -d. -f3`"
128	local LONG_INFO="$SUMMARY"
129	sed \
130		-e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \
131		-e "s|@MAJOR@|$MAJOR|" \
132		-e "s|@MIDDLE@|$MIDDLE|" \
133		-e "s|@MINOR@|$MINOR|" \
134		-e "s|@LONG_INFO@|$LONG_INFO|" \
135		$portDir/additional-files/kgoldrunner.rdef.in > kgoldrunner.rdef
136
137	addResourcesToBinaries kgoldrunner.rdef $appsDir/KGoldRunner
138	addAppDeskbarSymlink $appsDir/KGoldRunner
139}
140