2021-04-17 13:40:17 +00:00
|
|
|
#!/usr/bin/env -S bash ../.port_include.sh
|
2023-08-12 21:17:57 +00:00
|
|
|
port='openttd'
|
2023-08-12 21:09:17 +00:00
|
|
|
version='13.4'
|
2023-08-12 21:17:57 +00:00
|
|
|
depends=(
|
|
|
|
'freetype'
|
|
|
|
'libicu'
|
|
|
|
'libpng'
|
|
|
|
'openttd-opengfx'
|
|
|
|
'openttd-opensfx'
|
|
|
|
'SDL2'
|
|
|
|
'xz'
|
|
|
|
'zlib'
|
|
|
|
)
|
2023-07-10 11:10:29 +00:00
|
|
|
files=(
|
2023-09-02 04:32:27 +00:00
|
|
|
"https://cdn.openttd.org/openttd-releases/${version}/openttd-${version}-source.tar.xz#2a1deba01bfe58e2188879f450c3fa4f3819271ab49bf348dd66545f040d146f"
|
2023-07-10 11:10:29 +00:00
|
|
|
)
|
2023-08-12 21:17:57 +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
|
2023-08-12 21:17:57 +00:00
|
|
|
mkdir -p "${workdir}/host-build"
|
2021-04-17 13:40:17 +00:00
|
|
|
(
|
2023-08-12 21:17:57 +00:00
|
|
|
cd "${workdir}/host-build"
|
2021-04-17 13:40:17 +00:00
|
|
|
cmake .. -DOPTION_TOOLS_ONLY=1
|
|
|
|
)
|
|
|
|
|
|
|
|
target_env
|
2023-08-12 21:17:57 +00:00
|
|
|
mkdir -p "${workdir}/build"
|
2021-04-17 13:40:17 +00:00
|
|
|
(
|
2023-08-12 21:17:57 +00:00
|
|
|
cd "${workdir}/build"
|
|
|
|
cmake .. "${configopts[@]}" -DHOST_BINARY_DIR="$(pwd)/../host-build"
|
2021-04-17 13:40:17 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
|
|
|
host_env
|
|
|
|
(
|
2023-08-12 21:17:57 +00:00
|
|
|
cd "${workdir}/host-build"
|
2021-09-26 22:16:18 +00:00
|
|
|
make "${makeopts[@]}"
|
2021-04-17 13:40:17 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
target_env
|
|
|
|
(
|
2023-08-12 21:17:57 +00:00
|
|
|
cd "${workdir}/build"
|
2021-09-26 22:16:18 +00:00
|
|
|
make "${makeopts[@]}"
|
2021-04-17 13:40:17 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
install() {
|
|
|
|
(
|
2023-08-12 21:17:57 +00:00
|
|
|
cd "${workdir}/build"
|
2021-04-17 13:40:17 +00:00
|
|
|
make install
|
|
|
|
)
|
|
|
|
|
2023-08-12 21:17:57 +00:00
|
|
|
ln -sf /usr/local/games/openttd "${SERENITY_INSTALL_ROOT}/usr/local/bin/openttd"
|
2021-04-17 13:40:17 +00:00
|
|
|
}
|