openmw-0.45.0.recipe revision df2959f8
1SUMMARY="Open source reimplementation of TES III: Morrowind"
2DESCRIPTION="OpenMW is a new and modern engine based on the one that runs the \
32002 open-world RPG Morrowind. The engine (OpenMW) will come with its own editor \
4(OpenCS) which will allow the user to edit or create their own games. Both OpenCS \
5and OpenMW are written from scratch and aren���t made to support any third party \
6programs the original Morrowind engine uses to improve its functionality."
7HOMEPAGE="https://openmw.org/"
8COPYRIGHT="2008-2019 OpenMW"
9LICENSE="
10	GNU GPL v3
11	MIT
12	Zlib
13	"
14REVISION="2"
15SOURCE_URI="https://github.com/OpenMW/openmw/archive/openmw-$portVersion.tar.gz"
16SOURCE_FILENAME="openmw-$portVersion.tar.gz"
17CHECKSUM_SHA256="b63cf971f406ef5f28019f65e9e2bd9641a227459ede45d147562917f67e1c64"
18SOURCE_DIR="openmw-openmw-$portVersion"
19osgVersion="3.6.4-rc3"
20SOURCE_URI_2="https://github.com/openscenegraph/OpenSceneGraph/archive/OpenSceneGraph-$osgVersion.tar.gz"
21CHECKSUM_SHA256_2="cb32908b8e81b22c7c00a404e6eb1ded15b53bf79e848497643ff9c120999cff"
22SOURCE_DIR_2="OpenSceneGraph-OpenSceneGraph-$osgVersion"
23PATCHES="openmw-$portVersion.patchset"
24PATCHES_2="osg-$osgVersion.patchset"
25
26ADDITIONAL_FILES="
27	openmw.rdef.in
28	haikuicons.zip
29	"
30
31ARCHITECTURES="!x86_gcc2 x86_64"
32if [ "$targetArchitecture" = x86_gcc2 ]; then
33SECONDARY_ARCHITECTURES="x86"
34fi
35
36PROVIDES="
37	openmw$secondaryArchSuffix = $portVersion
38	app:OpenMW$secondaryArchSuffix = $portVersion
39	app:OpenMW_Launcher$secondaryArchSuffix = $portVersion
40	app:OpenMW_Wizard$secondaryArchSuffix = $portVersion
41	app:OpenMW_CS$secondaryArchSuffix = $portVersion
42	"
43REQUIRES="
44	haiku$secondaryArchSuffix
45	lib:libavcodec$secondaryArchSuffix
46	lib:libavformat$secondaryArchSuffix
47	lib:libavutil$secondaryArchSuffix
48	lib:libboost_filesystem$secondaryArchSuffix
49	lib:libboost_system$secondaryArchSuffix
50	lib:libboost_program_options$secondaryArchSuffix
51	lib:libBulletCollision$secondaryArchSuffix
52	lib:libfreetype$secondaryArchSuffix
53	lib:libGL$secondaryArchSuffix
54	lib:libGLU$secondaryArchSuffix
55	lib:libintl$secondaryArchSuffix
56	lib:libjpeg$secondaryArchSuffix
57	lib:libLinearMath$secondaryArchSuffix
58	lib:libMyGUIEngine$secondaryArchSuffix
59	lib:libopenal$secondaryArchSuffix
60	lib:libpng$secondaryArchSuffix
61	lib:libQt5Gui$secondaryArchSuffix
62	lib:libQt5Widgets$secondaryArchSuffix
63	lib:libSDL2_2.0$secondaryArchSuffix
64	lib:libSDL2_image_2.0$secondaryArchSuffix
65	lib:libtiff$secondaryArchSuffix
66	lib:libunshield$secondaryArchSuffix
67	lib:libxml2$secondaryArchSuffix
68	lib:libz$secondaryArchSuffix
69	"
70
71BUILD_REQUIRES="
72	haiku${secondaryArchSuffix}_devel
73	devel:libavcodec$secondaryArchSuffix
74	devel:libavformat$secondaryArchSuffix
75	devel:libavutil$secondaryArchSuffix
76	devel:libboost_filesystem$secondaryArchSuffix
77	devel:libboost_system$secondaryArchSuffix
78	devel:libboost_program_options$secondaryArchSuffix
79	devel:libBulletCollision$secondaryArchSuffix
80	devel:libfreetype$secondaryArchSuffix
81	devel:libGL$secondaryArchSuffix
82	devel:libGLU$secondaryArchSuffix
83	devel:libintl$secondaryArchSuffix
84	devel:libjpeg$secondaryArchSuffix
85	devel:libLinearMath$secondaryArchSuffix
86	devel:libMyGUIEngine$secondaryArchSuffix
87	devel:libopenal$secondaryArchSuffix
88	devel:libpng16$secondaryArchSuffix
89	devel:libQt5Gui$secondaryArchSuffix
90	devel:libQt5Widgets$secondaryArchSuffix
91	devel:libSDL2_2.0$secondaryArchSuffix
92	devel:libSDL2_image_2.0$secondaryArchSuffix
93	devel:libtiff$secondaryArchSuffix
94	devel:libunshield$secondaryArchSuffix
95	devel:libxml2$secondaryArchSuffix
96	devel:libz$secondaryArchSuffix
97	"
98BUILD_PREREQUIRES="
99	cmd:cmake
100	cmd:gcc$secondaryArchSuffix
101	cmd:git
102	cmd:lrelease$secondaryArchSuffix >= 5
103	cmd:make
104	cmd:zip
105	"
106
107PATCH()
108{
109	unzip -o $sourceDir/../../additional-files/haikuicons.zip -d $sourceDir
110}
111
112BUILD()
113{
114	mkdir -p $sourceDir2/build
115	cd $sourceDir2/build
116	cmake .. \
117		-DCMAKE_INSTALL_PREFIX=$appsDir/OpenMW \
118		-DCMAKE_BUILD_TYPE=Release \
119		-DSDL2_INCLUDE_DIR=/system/$relativeIncludeDir/SDL2 \
120		-DBUILD_OSG_PLUGINS_BY_DEFAULT=OFF \
121		-DBUILD_OSG_PLUGIN_OSG=ON \
122		-DBUILD_OSG_PLUGIN_DDS=ON \
123		-DBUILD_OSG_PLUGIN_TGA=ON \
124		-DBUILD_OSG_PLUGIN_BMP=ON \
125		-DBUILD_OSG_PLUGIN_JPEG=ON \
126		-DBUILD_OSG_PLUGIN_PNG=ON \
127		-DBUILD_OSG_DEPRECATED_SERIALIZERS=OFF \
128		-DBUILD_OSG_APPLICATIONS=OFF \
129		-DOSG_GL3_AVAILABLE=OFF \
130		-DOSG_WINDOWING_SYSTEM=None
131	make $jobArgs
132	make install
133	export OSG_DIR=$appsDir/OpenMW
134
135	mkdir -p $sourceDir/build
136	cd $sourceDir/build
137	cmake .. \
138		-DCMAKE_INSTALL_PREFIX=$appsDir/OpenMW \
139		-DCMAKE_BUILD_TYPE=Release \
140		-DBullet_INCLUDE_DIR=/system/$relativeIncludeDir/bullet \
141		-DDESIRED_QT_VERSION=5 \
142		-DBUILD_BSATOOL=ON \
143		-DBUILD_DOCS=OFF \
144		-DBUILD_ESMTOOL=OFF \
145		-DBUILD_LAUNCHER=ON \
146		-DBUILD_NIFTEST=OFF \
147		-DBUILD_OPENCS=ON \
148		-DBUILD_UNITTESTS=OFF \
149		-DBUILD_WIZARD=ON
150	make $jobArgs
151}
152
153INSTALL()
154{
155	cd $sourceDir2/build
156	make install
157	cd $sourceDir/build
158	make install
159
160	mv -f $appsDir/OpenMW/games/openmw/* $appsDir/OpenMW
161	rm -rf $appsDir/OpenMW/{applications,data,games,include,licenses,lib/pkgconfig,metainfo,pixmaps}
162
163	# capitalize application names
164	mv $appsDir/OpenMW/openmw $appsDir/OpenMW/OpenMW
165	mv $appsDir/OpenMW/openmw-launcher $appsDir/OpenMW/OpenMW-Launcher
166	mv $appsDir/OpenMW/openmw-wizard $appsDir/OpenMW/OpenMW-Wizard
167	mv $appsDir/OpenMW/openmw-cs $appsDir/OpenMW/OpenMW-CS
168
169	# tune default settings
170	sed -i "s|crosshair = .*|crosshair = false|" \
171		$appsDir/OpenMW/config/openmw/settings-default.cfg
172	sed -i "s|viewing distance = .*|viewing distance = 4500.0|" \
173		$appsDir/OpenMW/config/openmw/settings-default.cfg
174	sed -i "s|anisotropy = .*|anisotropy = 0|" \
175		$appsDir/OpenMW/config/openmw/settings-default.cfg
176	sed -i "s|minimize on focus loss = .*|minimize on focus loss = false|" \
177		$appsDir/OpenMW/config/openmw/settings-default.cfg
178
179	local APP_SIGNATURE="application/x-vnd.openmw"
180	local MAJOR="`echo "$portVersion" | cut -d. -f1`"
181	local MIDDLE="`echo "$portVersion" | cut -d. -f2`"
182	local MINOR="`echo "$portVersion" | cut -d. -f3 | cut -d~ -f1`"
183	local LONG_INFO="$SUMMARY"
184	sed \
185		-e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \
186		-e "s|@MAJOR@|$MAJOR|" \
187		-e "s|@MIDDLE@|$MIDDLE|" \
188		-e "s|@MINOR@|$MINOR|" \
189		-e "s|@LONG_INFO@|$LONG_INFO|" \
190		$portDir/additional-files/openmw.rdef.in > $sourceDir/build/openmw.rdef
191	addResourcesToBinaries  $sourceDir/build/openmw.rdef $appsDir/OpenMW/OpenMW
192
193	local APP_SIGNATURE="application/x-vnd.openmw-launcher"
194	sed \
195		-e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \
196		-e "s|@MAJOR@|$MAJOR|" \
197		-e "s|@MIDDLE@|$MIDDLE|" \
198		-e "s|@MINOR@|$MINOR|" \
199		-e "s|@LONG_INFO@|$LONG_INFO|" \
200		$portDir/additional-files/openmw.rdef.in > $sourceDir/build/openmw-launcher.rdef
201	addResourcesToBinaries  $sourceDir/build/openmw-launcher.rdef $appsDir/OpenMW/OpenMW-Launcher
202
203	local APP_SIGNATURE="application/x-vnd.openmw-cs"
204	sed \
205		-e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \
206		-e "s|@MAJOR@|$MAJOR|" \
207		-e "s|@MIDDLE@|$MIDDLE|" \
208		-e "s|@MINOR@|$MINOR|" \
209		-e "s|@LONG_INFO@|$LONG_INFO|" \
210		$portDir/additional-files/openmw.rdef.in > $sourceDir/build/openmw-cs.rdef
211	addResourcesToBinaries  $sourceDir/build/openmw-cs.rdef $appsDir/OpenMW/OpenMW-CS
212
213	local APP_SIGNATURE="application/x-vnd.openmw-wizard"
214	sed \
215		-e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \
216		-e "s|@MAJOR@|$MAJOR|" \
217		-e "s|@MIDDLE@|$MIDDLE|" \
218		-e "s|@MINOR@|$MINOR|" \
219		-e "s|@LONG_INFO@|$LONG_INFO|" \
220		$portDir/additional-files/openmw.rdef.in > $sourceDir/build/openmw-wizard.rdef
221	addResourcesToBinaries  $sourceDir/build/openmw-wizard.rdef $appsDir/OpenMW/OpenMW-Wizard
222	mimeset -f $appsDir/OpenMW/OpenMW-Launcher
223
224	addAppDeskbarSymlink $appsDir/OpenMW/OpenMW-Launcher Morrowind
225}
226