serenity/Ports/openttd/package.sh

64 lines
1.2 KiB
Bash
Raw Normal View History

2021-04-17 13:40:17 +00:00
#!/usr/bin/env -S bash ../.port_include.sh
port='openttd'
2023-08-12 21:09:17 +00:00
version='13.4'
depends=(
'freetype'
'libicu'
'libpng'
'openttd-opengfx'
'openttd-opensfx'
'SDL2'
'xz'
'zlib'
)
2023-07-10 11:10:29 +00:00
files=(
"https://cdn.openttd.org/openttd-releases/${version}/openttd-${version}-source.tar.xz#2a1deba01bfe58e2188879f450c3fa4f3819271ab49bf348dd66545f040d146f"
2023-07-10 11:10:29 +00:00
)
useconfigure='true'
configopts=(
"-DCMAKE_TOOLCHAIN_FILE=${SERENITY_BUILD_DIR}/CMakeToolchain.txt"
)
launcher_name='OpenTTD'
launcher_category='Games'
launcher_command='/usr/local/games/openttd'
2023-08-12 21:11:06 +00:00
icon_file='media/openttd.32.png'
2021-04-17 13:40:17 +00:00
configure() {
host_env
mkdir -p "${workdir}/host-build"
2021-04-17 13:40:17 +00:00
(
cd "${workdir}/host-build"
2021-04-17 13:40:17 +00:00
cmake .. -DOPTION_TOOLS_ONLY=1
)
target_env
mkdir -p "${workdir}/build"
2021-04-17 13:40:17 +00:00
(
cd "${workdir}/build"
cmake .. "${configopts[@]}" -DHOST_BINARY_DIR="$(pwd)/../host-build"
2021-04-17 13:40:17 +00:00
)
}
build() {
host_env
(
cd "${workdir}/host-build"
make "${makeopts[@]}"
2021-04-17 13:40:17 +00:00
)
target_env
(
cd "${workdir}/build"
make "${makeopts[@]}"
2021-04-17 13:40:17 +00:00
)
}
install() {
(
cd "${workdir}/build"
2021-04-17 13:40:17 +00:00
make install
)
ln -sf /usr/local/games/openttd "${SERENITY_INSTALL_ROOT}/usr/local/bin/openttd"
2021-04-17 13:40:17 +00:00
}