/
corsix_th-0.65.2~git.recipe
90 lines (84 loc) · 2.84 KB
/
corsix_th-0.65.2~git.recipe
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
SUMMARY="Open source clone of Theme Hospital"
DESCRIPTION="CorsixTH aims to reimplement the game engine of Theme Hospital, and be able to \
load the original game data files. This means that you will need a purchased copy of Theme \
Hospital, or a copy of the demo, in order to use CorsixTH. After most of the original engine has \
been reimplemented in open source code, the project will serve as a base from which extensions \
and improvements to the original game can be made."
HOMEPAGE="https://github.com/CorsixTH"
COPYRIGHT="2005-2022 Corsix"
LICENSE="MIT"
REVISION="1"
srcGitRev="88c2d9e664c88f62d610fdcfb21e4726e76a0242"
SOURCE_URI="https://github.com/CorsixTH/CorsixTH/archive/$srcGitRev.tar.gz"
CHECKSUM_SHA256="dacda03d9320692e5ba4592ca2c6252d693e9602ab6e73b31af473e2d0aa9870"
SOURCE_FILENAME="CorsixTH-$portVersion.tar.gz"
SOURCE_DIR="CorsixTH-$srcGitRev"
PATCHES="corsix_th-$portVersion.patchset"
ADDITIONAL_FILES="corsix_th.rdef.in"
ARCHITECTURES="all !x86_gcc2"
if [ "$targetArchitecture" = x86_gcc2 ]; then
SECONDARY_ARCHITECTURES="x86"
fi
PROVIDES="
corsix_th$secondaryArchSuffix = $portVersion
cmd:corsix_th = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libavcodec$secondaryArchSuffix
lib:libfreetype$secondaryArchSuffix
lib:liblua$secondaryArchSuffix >= 5.3
lib:libsdl2_2.0$secondaryArchSuffix
lib:libsdl2_mixer_2.0$secondaryArchSuffix
lib:lfs$secondaryArchSuffix
lib:lpeg$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libavcodec$secondaryArchSuffix >= 59.18
devel:libfreetype$secondaryArchSuffix
devel:liblua$secondaryArchSuffix >= 5.3
devel:libsdl2$secondaryArchSuffix
devel:libsdl2_mixer$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:cmake
cmd:gcc$secondaryArchSuffix
cmd:git
cmd:make
cmd:pkg_config$secondaryArchSuffix
cmd:sed
"
PATCH()
{
LUAC_DIR=$(finddir B_SYSTEM_LIB_DIRECTORY)$secondaryArchSubDir/lua/5.3/?.so
sed -i \
-e "s|package.cpath = base_dir .. '?.so;' .. package.cpath|package.cpath = base_dir .. '?.so;' .. package.cpath .. ';$LUAC_DIR'|" \
CorsixTH/CorsixTH.lua
}
BUILD()
{
cmake . \
-DCMAKE_BUILD_TYPE=Release \
-DLUA_LIBRARY=/system/$relativeLibDir/liblua.so.5.3 \
-DCMAKE_INSTALL_PREFIX=$prefix \
-DCMAKE_INSTALL_DATAROOTDIR=$dataDir \
-DSDL_INCLUDE_DIR=/system/$relativeIncludeDir/SDL2 \
-DSDL_MIXER_INCLUDE_DIR=/system/$relativeIncludeDir/SDL2 \
-DLUA_INCLUDE_DIR=/system/$relativeIncludeDir/lua53
cd CorsixTH
make $jobArgs
}
INSTALL()
{
touch CorsixTH/LICENSE.txt
make install
local MAJOR="`echo "$portVersion" | cut -d. -f1`"
local MIDDLE="`echo "$portVersion" | cut -d. -f2`"
sed \
-e "s|@MAJOR@|$MAJOR|" \
-e "s|@MIDDLE@|$MIDDLE|" \
$portDir/additional-files/corsix_th.rdef.in > $sourceDir/corsix_th.rdef
addResourcesToBinaries $sourceDir/corsix_th.rdef $prefix/bin/corsix-th
addAppDeskbarSymlink $prefix/bin/corsix-th "Corsix Theme Hospital"
}