CorsixTH: update to 0.68.0, use Lua 5.4 (#12293)

This commit is contained in:
Peppersawce
2025-04-30 16:23:01 +00:00
committed by GitHub
parent cbb43a1fae
commit 2c14a77c87
2 changed files with 21 additions and 19 deletions

View File

@@ -5,21 +5,17 @@ Hospital, or a copy of the demo, in order to use CorsixTH. After most of the ori
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"
COPYRIGHT="2005-2024 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"
SOURCE_URI="https://github.com/CorsixTH/CorsixTH/archive/refs/tags/v$portVersion.tar.gz"
CHECKSUM_SHA256="54034b8434f5c583178405d2c84477f903fe2b15933b611f42230668e35d632e"
SOURCE_DIR="CorsixTH-$portVersion"
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
@@ -27,22 +23,24 @@ PROVIDES="
"
REQUIRES="
haiku$secondaryArchSuffix
lpeg1.1$secondaryArchSuffix # Standard one is still for 5.3
lib:libavcodec$secondaryArchSuffix
lib:libcurl$secondaryArchSuffix
lib:libfreetype$secondaryArchSuffix
lib:liblua$secondaryArchSuffix >= 5.3
lib:libsdl2_2.0$secondaryArchSuffix
lib:libsdl2_mixer_2.0$secondaryArchSuffix
lib:liblua$secondaryArchSuffix >= 5.4
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:libavcodec$secondaryArchSuffix
devel:libcurl$secondaryArchSuffix
devel:libfreetype$secondaryArchSuffix
devel:liblua$secondaryArchSuffix >= 5.3
devel:libsdl2$secondaryArchSuffix
devel:libsdl2_mixer$secondaryArchSuffix
devel:liblua$secondaryArchSuffix >= 5.4
devel:libSDL2_2.0$secondaryArchSuffix
devel:libSDL2_mixer_2.0$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:cmake
@@ -55,7 +53,7 @@ BUILD_PREREQUIRES="
PATCH()
{
LUAC_DIR=$(finddir B_SYSTEM_LIB_DIRECTORY)$secondaryArchSubDir/lua/5.3/?.so
LUAC_DIR=$(finddir B_SYSTEM_LIB_DIRECTORY)$secondaryArchSubDir/liblua.so.5.4
sed -i \
-e "s|package.cpath = base_dir .. '?.so;' .. package.cpath|package.cpath = base_dir .. '?.so;' .. package.cpath .. ';$LUAC_DIR'|" \
CorsixTH/CorsixTH.lua
@@ -65,12 +63,12 @@ BUILD()
{
cmake . \
-DCMAKE_BUILD_TYPE=Release \
-DLUA_LIBRARY=/system/$relativeLibDir/liblua.so.5.3 \
-DLUA_LIBRARY=/system/$relativeLibDir/liblua.so.5.4 \
-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
-DLUA_INCLUDE_DIR=/system/$relativeIncludeDir/lua54
cd CorsixTH
make $jobArgs
}
@@ -79,6 +77,10 @@ INSTALL()
{
touch CorsixTH/LICENSE.txt
make install
# Remove unneeded files
rm -rf $dataDir/{applications,icons,metainfo}
local MAJOR="`echo "$portVersion" | cut -d. -f1`"
local MIDDLE="`echo "$portVersion" | cut -d. -f2`"
sed \