# NOTE: This program includes external libraries in their source code: pnglite, wavpack and zlib. Due to how this program is built, it's hard to link with the system ones instead.
name=teeworlds
version=0.6.4
version_bam=0.4.0
dlextract "https://downloads.teeworlds.com/$name-$version-src.tar.gz" \
'9733800c12462ac4d5a5a4f6ea750af0'
( name=bam version="$version_bam"
dlextract "http://github.com/downloads/matricks/$name/$name-$version.tar.bz2" \
'f8b62ad553c3615a725a034df4fb4257'
)
extrafile "$name.desktop"
_
( cd "bam-$version_bam"
sh -v make_unix.sh
)
cd "$name-$version-src"
convert other/icons/Teeworlds.ico "$name.png"
# Allow for custom CFLAGS
sed -i -e "/CONF_RELEASE/arelease_settings.cc.flags:Add('$CFLAGS')\nrelease_settings.link.flags:Add('$LDFLAGS')" bam.lua
# Fix data path
sed -i -e "s/\/usr\/share\/$name\/data/$(safe_sed "$dir_sysroot/$dir_prefix/$dir_data/$name")/" src/engine/shared/storage.cpp
"../bam-$version_bam/bam" $BAMFLAGS game_release
mkdir -p "$dir_install/$dir_prefix/$dir_data/$name"
cp -a data/* "$dir_install/$dir_prefix/$dir_data/$name/"
install -Dm755 "$name" "$dir_install/$dir_prefix/$dir_bin/$name"
install -Dm755 "${name}_srv" "$dir_install/$dir_prefix/$dir_bin/${name}_srv"
install -Dm644 "$name-0.png" "$dir_install/$dir_prefix/$dir_data/pixmaps/$name.png"
install -Dm644 "../$name.desktop" "$dir_install/$dir_prefix/$dir_data/applications/$name.desktop"
# vim:set tabstop=4 shiftwidth=4 syntax=sh expandtab: