Skip to content

Commit

Permalink
Ports/openttd: Update formatting to be consistent with other ports
Browse files Browse the repository at this point in the history
  • Loading branch information
tcl3 authored and timschumi committed Aug 14, 2023
1 parent c8dbed0 commit bf5a17d
Showing 1 changed file with 27 additions and 16 deletions.
43 changes: 27 additions & 16 deletions Ports/openttd/package.sh
Original file line number Diff line number Diff line change
@@ -1,52 +1,63 @@
#!/usr/bin/env -S bash ../.port_include.sh
port=openttd
port='openttd'
version='13.4'
depends=("freetype" "SDL2" "libicu" "libpng" "zlib" "xz" "openttd-opengfx" "openttd-opensfx")
depends=(
'freetype'
'libicu'
'libpng'
'openttd-opengfx'
'openttd-opensfx'
'SDL2'
'xz'
'zlib'
)
files=(
"https://cdn.openttd.org/openttd-releases/${version}/openttd-${version}-source.tar.xz 2a1deba01bfe58e2188879f450c3fa4f3819271ab49bf348dd66545f040d146f"
)
useconfigure=true
configopts=("-DCMAKE_TOOLCHAIN_FILE=${SERENITY_BUILD_DIR}/CMakeToolchain.txt")
launcher_name=OpenTTD
launcher_category=Games
launcher_command=/usr/local/games/openttd
useconfigure='true'
configopts=(
"-DCMAKE_TOOLCHAIN_FILE=${SERENITY_BUILD_DIR}/CMakeToolchain.txt"
)
launcher_name='OpenTTD'
launcher_category='Games'
launcher_command='/usr/local/games/openttd'
icon_file='media/openttd.32.png'

configure() {
host_env
mkdir -p $workdir/host-build
mkdir -p "${workdir}/host-build"
(
cd $workdir/host-build
cd "${workdir}/host-build"
cmake .. -DOPTION_TOOLS_ONLY=1
)

target_env
mkdir -p $workdir/build
mkdir -p "${workdir}/build"
(
cd $workdir/build
cmake .. "${configopts[@]}" -DHOST_BINARY_DIR=$(pwd)/../host-build
cd "${workdir}/build"
cmake .. "${configopts[@]}" -DHOST_BINARY_DIR="$(pwd)/../host-build"
)
}

build() {
host_env
(
cd $workdir/host-build
cd "${workdir}/host-build"
make "${makeopts[@]}"
)

target_env
(
cd $workdir/build
cd "${workdir}/build"
make "${makeopts[@]}"
)
}

install() {
(
cd $workdir/build
cd "${workdir}/build"
make install
)

ln -sf /usr/local/games/openttd $DESTDIR/usr/local/bin/openttd
ln -sf /usr/local/games/openttd "${SERENITY_INSTALL_ROOT}/usr/local/bin/openttd"
}

0 comments on commit bf5a17d

Please sign in to comment.