aboutsummaryrefslogtreecommitdiff
path: root/games
diff options
context:
space:
mode:
authori3slkiller <i3sl.1.3.3.0@gmail.com>2024-03-27 07:42:44 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2024-03-27 08:25:20 +0700
commitbc0b6485e85e42439147bb3c112c956fe905d09e (patch)
tree781e2e09cc7ae9794c5fffeacce326a3736663e1 /games
parent2ac9ed1f2574d51e0a83ac04896d5bbe3fbea81c (diff)
games/ddnet: Added (Multiplayer games).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'games')
-rw-r--r--games/ddnet/README35
-rw-r--r--games/ddnet/ddnet.SlackBuild223
-rw-r--r--games/ddnet/ddnet.info28
-rw-r--r--games/ddnet/doinst.sh9
-rw-r--r--games/ddnet/slack-desc19
5 files changed, 314 insertions, 0 deletions
diff --git a/games/ddnet/README b/games/ddnet/README
new file mode 100644
index 000000000000..9c09af28a081
--- /dev/null
+++ b/games/ddnet/README
@@ -0,0 +1,35 @@
+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!
+
+Default build options:
+
+# Whether to enable WebSocket support for server
+# Requires libwebsockets from SBo
+WEBSOCKETS=no
+
+# Whether to enable MySQL/MariaDB support for server
+MYSQL=no
+
+# Whether to add video recording support using FFmpeg to the client
+# Requires x264 from SBo
+VIDEORECORDER=yes
+
+# Whether to enable UPnP support for the server
+# Requires miniupnpc from SBo
+UPNP=no
+
+# Whether to enable the vulkan backend
+VULKAN=yes
+
+# Enable interprocedural optimizations, also known as
+# Link Time Optimization (LTO)
+IPO=no
+
+# Whether to set security-relevant compiler flags
+# like -D_FORTIFY_SOURCE=2 and -fstack-protector-all
+SECURITY_COMPILER_FLAGS=yes
diff --git a/games/ddnet/ddnet.SlackBuild b/games/ddnet/ddnet.SlackBuild
new file mode 100644
index 000000000000..40ac8cd364fe
--- /dev/null
+++ b/games/ddnet/ddnet.SlackBuild
@@ -0,0 +1,223 @@
+#!/bin/bash
+
+# Slackware build script for ddnet
+
+# Copyright 2024 i3slkiller <i3sl.1.3.3.0@gmail.com> (PGP fingerprint: 7B69 A55C 4533 F5E2 44C2 4889 095A 0992 0ECC A5AF)
+# All rights reserved.
+#
+# Permission to use, copy, modify, and distribute this software for
+# any purpose with or without fee is hereby granted, provided that
+# the above copyright notice and this permission notice appear in all
+# copies.
+#
+# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+# -----------------------------------------------------------------------------
+
+cd $(dirname $0) ; CWD=$(pwd)
+
+PRGNAM=ddnet
+SRCNAM=DDNet
+VERSION=${VERSION:-18.1}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
+
+# These variables are for proper matching version of source and package.
+# Regardless whether eg. 18.1-rc1 or 18.1_rc1 was passed into VERSION,
+# this script will unpack DDNet-18.1-rc1.tar.xz source tarball (SRCVER=18.1-rc1)
+# and produce ddnet-18.1_rc1-ARCH-1_SBo.tgz package (PKGVER=18.1_rc1).
+# For stable versions SRCVER and PKGVER will have the same value (SRCVER=PKGVER=18.1).
+SRCVER=${VERSION/_/-}
+PKGVER=${VERSION/-/_}
+
+# Whether to enable WebSocket support for server
+# Requires libwebsockets from SBo
+[ ${WEBSOCKETS:-no} == yes ] && USE_WEBSOCKETS=ON || USE_WEBSOCKETS=OFF
+
+# Whether to enable MySQL/MariaDB support for server
+[ ${MYSQL:-no} == yes ] && USE_MYSQL=ON || USE_MYSQL=OFF
+
+# Whether to add video recording support using FFmpeg to the client
+# Requires x264 from SBo
+[ ${VIDEORECORDER:-yes} == yes ] && USE_VIDEORECORDER=ON || USE_VIDEORECORDER=OFF
+
+# Whether to enable UPnP support for the server
+# Requires miniupnpc from SBo
+[ ${UPNP:-no} == yes ] && USE_UPNP=ON || USE_UPNP=OFF
+
+# Whether to enable the vulkan backend
+[ ${VULKAN:-yes} == yes ] && USE_VULKAN=ON || USE_VULKAN=OFF
+
+# Enable interprocedural optimizations, also known as Link Time Optimization (LTO)
+[ ${IPO:-no} == yes ] && USE_IPO=ON || USE_IPO=OFF
+
+# Whether to set security-relevant compiler flags like -D_FORTIFY_SOURCE=2 and -fstack-protector-all
+[ ${SECURITY_COMPILER_FLAGS:-yes} == yes ] && USE_SECURITY_COMPILER_FLAGS=ON || USE_SECURITY_COMPILER_FLAGS=OFF
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i586 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
+# the name of the created package would be, and then exit. This information
+# could be useful to other scripts.
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PRGNAM-$PKGVER-$ARCH-$BUILD$TAG.$PKGTYPE"
+ exit 0
+fi
+
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+elif [ "$ARCH" = "aarch64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+else
+ SLKCFLAGS="-O2"
+fi
+
+set -e
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $SRCNAM-$SRCVER
+tar xvf $CWD/$SRCNAM-$SRCVER.tar.?z
+cd $SRCNAM-$SRCVER
+chown -R root:root .
+find -L . \
+ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
+ -o -perm 511 \) -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+
+# build offline
+# configuration tells cargo to use the configured directory
+# for dependencies instead of downloading from crates.io
+cat << EOF >> .cargo/config.toml
+[source]
+[source.crates-io]
+replace-with = "vendored-sources"
+
+[source.vendored-sources]
+directory = "vendor"
+EOF
+
+# deps and versions come from Cargo.lock
+mkdir vendor
+(
+ cd vendor
+
+ grep -h -A 4 "\[\[package\]\]" \
+ $(find "../" -maxdepth 1 -mindepth 1 -name Cargo.lock | tr '\n' ' ') | \
+ sed 's/[[:space:]]*=[[:space:]]*/=/g;s/^--//;s/^\[\[/--\n[[/' | \
+ awk 'BEGIN { RS = "--\n" ; FS="\n" } { print $2, $3, $4, $5 }' | \
+ sed 's/"//g;s/name=//;s/ version=/=/' | \
+ grep " source=" | \
+ sed 's/ dependencies=.*$//' | \
+ sed 's/ source=[^ ]*//' | \
+ sed 's/ checksum=/=/' | \
+ sort -u | \
+ while read -r dep ; do
+
+ cksum="$(printf "%s\n" "$dep" | cut -d= -f3)"
+ ver="$(printf "%s\n" "$dep" | cut -d= -f2)"
+ dep="$(printf "%s\n" "$dep" | cut -d= -f1)"
+
+ CRATE_FILE="$CWD/$dep-$ver.crate"
+
+ if [ -z "$cksum" ] ; then
+ mkdir $dep-$ver
+ tar xvf $CRATE_FILE -C $dep-$ver --strip-components=1
+ cksum="null"
+ else
+ tar xvf $CRATE_FILE
+ fi
+
+ touch $dep-$ver/.cargo-ok
+
+ # generate checksum
+ {
+ printf "{\n"
+ printf ' "files": {\n'
+
+ (
+ cd $dep-$ver
+ find . -type f -print0 | xargs -0 sha256sum | sed -n '/\.cargo-checksum\.json/!p' | sed 's/\.\///;s/^\([^ ]*\)[[:space:]][[:space:]]*\(.*\)$/"\2":"\1",/'
+ ) | sed '$ s/,$//'
+
+ printf " },\n"
+ printf ' "package": "%s"' "$cksum"
+
+ printf "}\n"
+ } | python3 -c "import sys, json; data = sys.stdin.read(); print(json.dumps(json.loads(data), sort_keys=True, indent=4, separators=(',', ' : ')))" > $dep-$ver/.cargo-checksum.json
+ done
+)
+
+chown -R root:root .
+find -L . \
+ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+
+export CARGO_HOME=.cargo
+
+mkdir -p build
+cd build
+ cmake .. \
+ -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
+ -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DPREFER_BUNDLED_LIBS=OFF \
+ -DWEBSOCKETS=$USE_WEBSOCKETS \
+ -DMYSQL=$USE_MYSQL \
+ -DAUTOUPDATE=OFF \
+ -DCLIENT=ON \
+ -DVIDEORECORDER=$USE_VIDEORECORDER \
+ -DUPNP=$USE_UPNP \
+ -DVULKAN=$USE_VULKAN \
+ -DIPO=$USE_IPO \
+ -DSECURITY_COMPILER_FLAGS=$USE_SECURITY_COMPILER_FLAGS \
+ -DCMAKE_BUILD_TYPE=Release \
+ -GNinja
+ ninja
+ DESTDIR=$PKG ninja install/strip
+cd ..
+
+install -D -m0644 man/DDNet.6 -t $PKG/usr/man/man6
+install -D -m0644 man/DDNet-Server.6 -t $PKG/usr/man/man6
+find $PKG/usr/man -type f -exec gzip -9 {} \;
+for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
+
+mkdir -p "$PKG/usr/doc/$PRGNAM-$PKGVER"
+cp -a \
+ README.md license.txt \
+ $PKG/usr/doc/$PRGNAM-$PKGVER
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$PKGVER/$PRGNAM.SlackBuild
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+cat $CWD/doinst.sh > $PKG/install/doinst.sh
+
+cd $PKG
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$PKGVER-$ARCH-$BUILD$TAG.$PKGTYPE
diff --git a/games/ddnet/ddnet.info b/games/ddnet/ddnet.info
new file mode 100644
index 000000000000..718eaa839f5a
--- /dev/null
+++ b/games/ddnet/ddnet.info
@@ -0,0 +1,28 @@
+PRGNAM="ddnet"
+VERSION="18.1"
+HOMEPAGE="https://ddnet.org/"
+DOWNLOAD="https://ddnet.org/downloads/DDNet-18.1.tar.xz \
+ https://static.crates.io/crates/cc/cc-1.0.73.crate \
+ https://static.crates.io/crates/cxx/cxx-1.0.71.crate \
+ https://static.crates.io/crates/cxxbridge-flags/cxxbridge-flags-1.0.71.crate \
+ https://static.crates.io/crates/cxxbridge-macro/cxxbridge-macro-1.0.71.crate \
+ https://static.crates.io/crates/link-cplusplus/link-cplusplus-1.0.6.crate \
+ https://static.crates.io/crates/proc-macro2/proc-macro2-1.0.40.crate \
+ https://static.crates.io/crates/quote/quote-1.0.20.crate \
+ https://static.crates.io/crates/syn/syn-1.0.98.crate \
+ https://static.crates.io/crates/unicode-ident/unicode-ident-1.0.1.crate"
+MD5SUM="248c4beb3f27b5f75c209e81cbbd563b \
+ 8e3a4d0980acef2c4e74485a45de29a9 \
+ fda5c633e604f175e07829961763f18f \
+ a8b59a9c52b44b92ec73248f3c85c608 \
+ bc90dc352e1bb9251acfc87a38360b4a \
+ 3c40fc3b1a1484ef260cc3237eb97588 \
+ 76c12c914deb8149bffb7437aab133b0 \
+ 37812acc7a616d54221d786d215ef8cf \
+ 56aba66d1843b03c542c3558631eecbd \
+ 07327370ffe0d5e4c5b49a7d7a1452aa"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES="x264"
+MAINTAINER="i3slkiller"
+EMAIL="i3sl.1.3.3.0@gmail.com"
diff --git a/games/ddnet/doinst.sh b/games/ddnet/doinst.sh
new file mode 100644
index 000000000000..3e5691a052b5
--- /dev/null
+++ b/games/ddnet/doinst.sh
@@ -0,0 +1,9 @@
+if [ -x /usr/bin/update-desktop-database ]; then
+ /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
+fi
+
+if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then
+ if [ -x /usr/bin/gtk-update-icon-cache ]; then
+ /usr/bin/gtk-update-icon-cache usr/share/icons/hicolor >/dev/null 2>&1
+ fi
+fi
diff --git a/games/ddnet/slack-desc b/games/ddnet/slack-desc
new file mode 100644
index 000000000000..1a739efd647a
--- /dev/null
+++ b/games/ddnet/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in. You must
+# make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':'.
+
+ |-----handy-ruler------------------------------------------------------|
+ddnet: ddnet (DDraceNetwork)
+ddnet: DDraceNetwork (DDNet) is an actively maintained version of DDRace,
+ddnet: a Teeworlds modification with a unique cooperative gameplay. Help
+ddnet: each other play through custom maps with up to 64 players, compete
+ddnet: against the best in international tournaments, design your own maps,
+ddnet: or run your own server. The official servers are around the world.
+ddnet: All ranks made on official servers are available worldwide and you
+ddnet: can collect points!
+ddnet:
+ddnet:
+ddnet: Home: https://ddnet.org/