openmw-0.45.0.recipe revision 099d54ff
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="3"
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"
20SOURCE_URI_2="https://github.com/openscenegraph/OpenSceneGraph/archive/OpenSceneGraph-$osgVersion.tar.gz"
21CHECKSUM_SHA256_2="81394d1b484c631028b85d21c5535280c21bbd911cb058e8746c87e93e7b9d33"
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:pkg_config$secondaryArchSuffix
105	cmd:zip
106	"
107
108PATCH()
109{
110	unzip -o $sourceDir/../../additional-files/haikuicons.zip -d $sourceDir
111}
112
113BUILD()
114{
115	mkdir -p $sourceDir2/build
116	cd $sourceDir2/build
117	cmake .. \
118		-DCMAKE_INSTALL_PREFIX=$appsDir/OpenMW \
119		-DCMAKE_BUILD_TYPE=Release \
120		-DSDL2_INCLUDE_DIR=/system/$relativeIncludeDir/SDL2 \
121		-DBUILD_OSG_PLUGINS_BY_DEFAULT=OFF \
122		-DBUILD_OSG_PLUGIN_OSG=ON \
123		-DBUILD_OSG_PLUGIN_DDS=ON \
124		-DBUILD_OSG_PLUGIN_TGA=ON \
125		-DBUILD_OSG_PLUGIN_BMP=ON \
126		-DBUILD_OSG_PLUGIN_JPEG=ON \
127		-DBUILD_OSG_PLUGIN_PNG=ON \
128		-DBUILD_OSG_DEPRECATED_SERIALIZERS=OFF \
129		-DBUILD_OSG_APPLICATIONS=OFF \
130		-DOSG_GL3_AVAILABLE=OFF \
131		-DOSG_WINDOWING_SYSTEM=None
132	make $jobArgs
133	make install
134	export OSG_DIR=$appsDir/OpenMW
135
136	mkdir -p $sourceDir/build
137	cd $sourceDir/build
138	cmake .. \
139		-DCMAKE_INSTALL_PREFIX=$appsDir/OpenMW \
140		-DCMAKE_BUILD_TYPE=Release \
141		-DBullet_INCLUDE_DIR=/system/$relativeIncludeDir/bullet \
142		-DDESIRED_QT_VERSION=5 \
143		-DBUILD_BSATOOL=ON \
144		-DBUILD_DOCS=OFF \
145		-DBUILD_ESMTOOL=OFF \
146		-DBUILD_LAUNCHER=ON \
147		-DBUILD_NIFTEST=OFF \
148		-DBUILD_OPENCS=ON \
149		-DBUILD_UNITTESTS=OFF \
150		-DBUILD_WIZARD=ON
151	make $jobArgs
152}
153
154INSTALL()
155{
156	cd $sourceDir2/build
157	make install
158	cd $sourceDir/build
159	make install
160
161	mv -f $appsDir/OpenMW/games/openmw/* $appsDir/OpenMW
162	rm -rf $appsDir/OpenMW/{applications,data,games,include,licenses,lib/pkgconfig,metainfo,pixmaps}
163
164	# capitalize application names
165	mv $appsDir/OpenMW/openmw $appsDir/OpenMW/OpenMW
166	mv $appsDir/OpenMW/openmw-launcher $appsDir/OpenMW/OpenMW-Launcher
167	mv $appsDir/OpenMW/openmw-wizard $appsDir/OpenMW/OpenMW-Wizard
168	mv $appsDir/OpenMW/openmw-cs $appsDir/OpenMW/OpenMW-CS
169
170	# tune default settings
171	sed -i "s|crosshair = .*|crosshair = false|" \
172		$appsDir/OpenMW/config/openmw/settings-default.cfg
173	sed -i "s|viewing distance = .*|viewing distance = 4500.0|" \
174		$appsDir/OpenMW/config/openmw/settings-default.cfg
175	sed -i "s|anisotropy = .*|anisotropy = 0|" \
176		$appsDir/OpenMW/config/openmw/settings-default.cfg
177	sed -i "s|minimize on focus loss = .*|minimize on focus loss = false|" \
178		$appsDir/OpenMW/config/openmw/settings-default.cfg
179
180	local APP_SIGNATURE="application/x-vnd.openmw"
181	local MAJOR="`echo "$portVersion" | cut -d. -f1`"
182	local MIDDLE="`echo "$portVersion" | cut -d. -f2`"
183	local MINOR="`echo "$portVersion" | cut -d. -f3 | cut -d~ -f1`"
184	local LONG_INFO="$SUMMARY"
185	sed \
186		-e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \
187		-e "s|@MAJOR@|$MAJOR|" \
188		-e "s|@MIDDLE@|$MIDDLE|" \
189		-e "s|@MINOR@|$MINOR|" \
190		-e "s|@LONG_INFO@|$LONG_INFO|" \
191		$portDir/additional-files/openmw.rdef.in > $sourceDir/build/openmw.rdef
192	addResourcesToBinaries  $sourceDir/build/openmw.rdef $appsDir/OpenMW/OpenMW
193
194	local APP_SIGNATURE="application/x-vnd.openmw-launcher"
195	sed \
196		-e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \
197		-e "s|@MAJOR@|$MAJOR|" \
198		-e "s|@MIDDLE@|$MIDDLE|" \
199		-e "s|@MINOR@|$MINOR|" \
200		-e "s|@LONG_INFO@|$LONG_INFO|" \
201		$portDir/additional-files/openmw.rdef.in > $sourceDir/build/openmw-launcher.rdef
202	addResourcesToBinaries  $sourceDir/build/openmw-launcher.rdef $appsDir/OpenMW/OpenMW-Launcher
203
204	local APP_SIGNATURE="application/x-vnd.openmw-cs"
205	sed \
206		-e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \
207		-e "s|@MAJOR@|$MAJOR|" \
208		-e "s|@MIDDLE@|$MIDDLE|" \
209		-e "s|@MINOR@|$MINOR|" \
210		-e "s|@LONG_INFO@|$LONG_INFO|" \
211		$portDir/additional-files/openmw.rdef.in > $sourceDir/build/openmw-cs.rdef
212	addResourcesToBinaries  $sourceDir/build/openmw-cs.rdef $appsDir/OpenMW/OpenMW-CS
213
214	local APP_SIGNATURE="application/x-vnd.openmw-wizard"
215	sed \
216		-e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \
217		-e "s|@MAJOR@|$MAJOR|" \
218		-e "s|@MIDDLE@|$MIDDLE|" \
219		-e "s|@MINOR@|$MINOR|" \
220		-e "s|@LONG_INFO@|$LONG_INFO|" \
221		$portDir/additional-files/openmw.rdef.in > $sourceDir/build/openmw-wizard.rdef
222	addResourcesToBinaries  $sourceDir/build/openmw-wizard.rdef $appsDir/OpenMW/OpenMW-Wizard
223	mimeset -f $appsDir/OpenMW/OpenMW-Launcher
224
225	addAppDeskbarSymlink $appsDir/OpenMW/OpenMW-Launcher Morrowind
226}
227