Files
haikuports/games-action/ddnet/ddnet-2023.03.12~git.recipe

131 lines
3.8 KiB
Bash

SUMMARY="A free cooperative platformer game based on Teeworlds"
DESCRIPTION="DDraceNetwork (DDNet) is an actively maintained version of \
DDRace, a Teeworlds modification with a unique cooperative gameplay. Help \
each other play through custom maps with up to 64 players, compete against \
the best in international tournaments, design your own maps, or run your own \
server. The official servers are around the world. All ranks made on official \
servers are available worldwide and you can collect points!"
HOMEPAGE="https://ddnet.org"
COPYRIGHT="2007-2014 Magnus Auvinen
2010-2011 Shereef Marzouk
2013-2022 Dennis Felsing"
LICENSE="Zlib
CC-BY-SA-3.0
SIL Open Font License v1.1"
REVISION="2"
srcGitRev="9878ca25f5b04909d44dc5509e30ec8acaac9abd"
SOURCE_URI="https://github.com/ddnet/ddnet/archive/$srcGitRev.tar.gz"
CHECKSUM_SHA256="fa309fe6c529bbadf58378073c3f72a296ac3dce9c028608ce436f7712b6d331"
SOURCE_DIR="ddnet-$srcGitRev"
ADDITIONAL_FILES="ddnet.rdef.in"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="!x86"
PROVIDES="
ddnet$secondaryArchSuffix = $portVersion
app:DDNet = $portVersion
cmd:ddnet_srv = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libavcodec$secondaryArchSuffix
lib:libavformat$secondaryArchSuffix
lib:libavutil$secondaryArchSuffix
lib:libcurl$secondaryArchSuffix
lib:libcrypto$secondaryArchSuffix
lib:libfreetype$secondaryArchSuffix
lib:libGL$secondaryArchSuffix
lib:libglew$secondaryArchSuffix
lib:libGLU$secondaryArchSuffix
lib:libogg$secondaryArchSuffix
lib:libopus$secondaryArchSuffix
lib:libopusfile$secondaryArchSuffix
lib:libpng16$secondaryArchSuffix
lib:libSDL2_2.0$secondaryArchSuffix
lib:libssl$secondaryArchSuffix
lib:libswscale$secondaryArchSuffix
lib:libswresample$secondaryArchSuffix
lib:libsqlite3$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libavcodec$secondaryArchSuffix
devel:libavformat$secondaryArchSuffix
devel:libavutil$secondaryArchSuffix
devel:libcurl$secondaryArchSuffix
devel:libcrypto$secondaryArchSuffix
devel:libfreetype$secondaryArchSuffix
devel:libGL$secondaryArchSuffix
devel:libglew$secondaryArchSuffix
devel:libGLU$secondaryArchSuffix
devel:libogg$secondaryArchSuffix
devel:libopus$secondaryArchSuffix
devel:libopusfile$secondaryArchSuffix
devel:libpng16$secondaryArchSuffix
devel:libSDL2_2.0$secondaryArchSuffix
devel:libssl$secondaryArchSuffix
devel:libsqlite3$secondaryArchSuffix
devel:libswscale$secondaryArchSuffix
devel:libswresample$secondaryArchSuffix
devel:libz$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:cargo$secondaryArchSuffix >= 0.61.0
cmd:cmake
cmd:gcc$secondaryArchSuffix
cmd:make
cmd:ninja
cmd:python3
"
BUILD()
{
cmake -B build -S . \
-DCMAKE_INSTALL_PREFIX=$appsDir/DDNet \
-DCMAKE_BUILD_TYPE=Release \
-DCLIENT=ON \
-DVULKAN=OFF \
-GNinja
ninja -C build $jobArgs
}
INSTALL()
{
ninja -C build install
mkdir -p $prefix/bin
mv $appsDir/DDNet/bin/DDNet $appsDir/DDNet/DDNet
mv $appsDir/DDNet/bin/DDNet-Server $appsDir/DDNet/ddnet_srv
mv $appsDir/DDNet/share/ddnet/data/ $appsDir/DDNet
rm -rf $appsDir/DDNet/{bin,share}
cat >$prefix/bin/ddnet_srv << EOF
#!/bin/bash
cd $appsDir/DDNet
ddnet_srv "$@"
EOF
chmod +x $prefix/bin/ddnet_srv
local APP_SIGNATURE="application/x-vnd.ddnet"
local MAJOR="`echo "$portVersion" | cut -d. -f1`"
local MIDDLE="`echo "$portVersion" | cut -d. -f2`"
local MINOR="`echo "$portVersion" | cut -d. -f3`"
# Remove ~git suffix, if it exists
local MINOR="`echo "$MINOR" | cut -d~ -f1`"
local LONG_INFO="$SUMMARY"
sed \
-e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \
-e "s|@MAJOR@|$MAJOR|" \
-e "s|@MIDDLE@|$MIDDLE|" \
-e "s|@MINOR@|$MINOR|" \
-e "s|@LONG_INFO@|$LONG_INFO|" \
$portDir/additional-files/ddnet.rdef.in > $sourceDir/ddnet.rdef
addResourcesToBinaries $sourceDir/ddnet.rdef \
$appsDir/DDNet/DDNet
addAppDeskbarSymlink $appsDir/DDNet/DDNet
}