diff options
Diffstat (limited to 'games/gtetrinet')
-rw-r--r-- | games/gtetrinet/README | 5 | ||||
-rw-r--r-- | games/gtetrinet/cli_opts.diff | 32 | ||||
-rw-r--r-- | games/gtetrinet/doinst.sh | 15 | ||||
-rw-r--r-- | games/gtetrinet/git2tarxz.sh | 50 | ||||
-rw-r--r-- | games/gtetrinet/gtetrinet.SlackBuild | 125 | ||||
-rw-r--r-- | games/gtetrinet/gtetrinet.info | 10 | ||||
-rw-r--r-- | games/gtetrinet/nolockup.diff | 12 | ||||
-rw-r--r-- | games/gtetrinet/slack-desc | 19 |
8 files changed, 268 insertions, 0 deletions
diff --git a/games/gtetrinet/README b/games/gtetrinet/README new file mode 100644 index 0000000000..b8995f2aea --- /dev/null +++ b/games/gtetrinet/README @@ -0,0 +1,5 @@ +gtetrinet (multiplayer networked Tetris-like game) + +GTetrinet is a clone of the popular Tetrinet game for Win95/NT. It is +designed to be fully compatible with, and to be identical in gameplay +to the original Tetrinet. diff --git a/games/gtetrinet/cli_opts.diff b/games/gtetrinet/cli_opts.diff new file mode 100644 index 0000000000..f31bac72c9 --- /dev/null +++ b/games/gtetrinet/cli_opts.diff @@ -0,0 +1,32 @@ +diff -Naur gtetrinet-0.8.0_20220828_6d816ee.orig/src/gtetrinet.c gtetrinet-0.8.0_20220828_6d816ee/src/gtetrinet.c +--- gtetrinet-0.8.0_20220828_6d816ee.orig/src/gtetrinet.c 2023-02-10 14:01:33.000000000 -0500 ++++ gtetrinet-0.8.0_20220828_6d816ee/src/gtetrinet.c 2023-02-13 01:31:08.820702289 -0500 +@@ -76,13 +76,13 @@ + GSettings* settings_keys; + GSettings* settings_themes; + +-static const struct poptOption options[] = { +- {"connect", 'c', POPT_ARG_STRING, &option_connect, 0, ("Connect to server"), ("SERVER")}, +- {"nickname", 'n', POPT_ARG_STRING, &option_nick, 0, ("Set nickname to use"), ("NICKNAME")}, +- {"team", 't', POPT_ARG_STRING, &option_team, 0, ("Set team name"), ("TEAM")}, +- {"spectate", 's', POPT_ARG_NONE, &option_spec, 0, ("Connect as a spectator"), NULL}, +- {"password", 'p', POPT_ARG_STRING, &option_pass, 0, ("Spectator password"), ("PASSWORD")}, +- {NULL, 0, 0, NULL, 0, NULL, NULL} ++static const GOptionEntry options[] = { ++ {"connect", 'c', 0, G_OPTION_ARG_STRING, &option_connect, ("Connect to server"), ("SERVER")}, ++ {"nickname", 'n', 0, G_OPTION_ARG_STRING, &option_nick, ("Set nickname to use"), ("NICKNAME")}, ++ {"team", 't', 0, G_OPTION_ARG_STRING, &option_team, ("Set team name"), ("TEAM")}, ++ {"spectate", 's', 0, G_OPTION_ARG_NONE, &option_spec, ("Connect as a spectator"), NULL}, ++ {"password", 'p', 0, G_OPTION_ARG_STRING, &option_pass, ("Spectator password"), ("PASSWORD")}, ++ {NULL, 0, 0, 0, NULL, NULL, NULL} + }; + + static int gtetrinet_poll_func(GPollFD *passed_fds, +@@ -134,7 +134,6 @@ + argc, argv, GNOME_PARAM_POPT_TABLE, options, + GNOME_PARAM_NONE); + */ +- GOptionEntry options[] = { {NULL}}; + if (!gtk_init_with_args(&argc,&argv,"gtetrinet",options,NULL,&err)) + { + fprintf (stderr, "Failed to init GTK: %s\n", err->message); diff --git a/games/gtetrinet/doinst.sh b/games/gtetrinet/doinst.sh new file mode 100644 index 0000000000..0254ea06d8 --- /dev/null +++ b/games/gtetrinet/doinst.sh @@ -0,0 +1,15 @@ +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 + +if [ -e usr/share/glib-2.0/schemas ]; then + if [ -x /usr/bin/glib-compile-schemas ]; then + /usr/bin/glib-compile-schemas usr/share/glib-2.0/schemas >/dev/null 2>&1 + fi +fi diff --git a/games/gtetrinet/git2tarxz.sh b/games/gtetrinet/git2tarxz.sh new file mode 100644 index 0000000000..b084ee153a --- /dev/null +++ b/games/gtetrinet/git2tarxz.sh @@ -0,0 +1,50 @@ +#!/bin/sh + +# Create source tarball from git repo, with generated version number. + +# This is not a generic git2tarxz script, it's specific to gtetrinet. +# Upstream doesn't use tags for version bumps, so the version number +# is extracted from configure.ac. + +# Takes one optional argument, which is the commit or tag to create a +# tarball of. With no arg, HEAD is used. + +# Version number example: 0.0.1+20200227_ad7ec17 + +## Config: +PRGNAM=gtetrinet +CLONE_URL=https://github.com/tatankat/gtetrinet +## End of config. + +set -e + +GITDIR=$( mktemp -dt $PRGNAM.git.XXXXXX ) +rm -rf $GITDIR +git clone $CLONE_URL $GITDIR + +CWD="$( pwd )" +cd $GITDIR + +if [ "$1" != "" ]; then + git reset --hard "$1" || exit 1 +fi + +GIT_SHA=$( git rev-parse --short HEAD ) + +DATE=$( git log --date=format:%Y%m%d --format=%cd | head -1 ) + +VERMAIN="$( grep AC_INIT configure.ac | cut -d, -f2 | sed 's,\[\(.*\)\],\1,' )" +VERSION=${VERMAIN}_${DATE}_${GIT_SHA} + +rm -rf .git +find . -name .gitignore -print0 | xargs -0 rm -f + +cd "$CWD" +rm -rf $PRGNAM-$VERSION $PRGNAM-$VERSION.tar.xz +mv $GITDIR $PRGNAM-$VERSION +tar cvfJ $PRGNAM-$VERSION.tar.xz $PRGNAM-$VERSION + +echo +echo "Created tarball: $PRGNAM-$VERSION.tar.xz" +echo "VERSION=\"$VERSION\"" +echo "MD5SUM=\"$( md5sum $PRGNAM-$VERSION.tar.xz | cut -d' ' -f1 )\"" diff --git a/games/gtetrinet/gtetrinet.SlackBuild b/games/gtetrinet/gtetrinet.SlackBuild new file mode 100644 index 0000000000..147c219419 --- /dev/null +++ b/games/gtetrinet/gtetrinet.SlackBuild @@ -0,0 +1,125 @@ +#!/bin/bash + +# Slackware build script for gtetrinet + +# Written by B. Watson (urchlay@slackware.uk) + +# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. + +# This game has been around since the 90s, I used to play it on +# Slackware back when Slackware still had GNOME. +# For a long time, gtetrinet required a lot of gnome dependencies, +# so I never bothered making a SlackBuild for it. Thanks to r0ni for +# finding this gtk3 port of it. + +# 20230213 bkw: BUILD=2 +# - add nolockup.diff +# - fix command-line options + +cd $(dirname $0) ; CWD=$(pwd) + +PRGNAM=gtetrinet +VERSION=${VERSION:-0.8.0_20220828_6d816ee} +BUILD=${BUILD:-2} +TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$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" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.xz +cd $PRGNAM-$VERSION +chown -R root:root . +find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \ + \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+ + +# Reinstate the command-line options, which were removed when porting +# from GNOME to Gtk3. +patch -p1 < $CWD/cli_opts.diff + +# If gtetrinet tries to connect in TetriFAST mode to a server +# that doesn't support TetriFAST, the server will drop the +# connection immediately. This patch prevents gtetrinet's UI +# from going completely unresponsive if that happens: now we'll +# get a "connecting..." dialog with a Cancel button that actually +# works. There is surely a better way to fix it (have it actually pop +# up a "Server doesn't support TetriFAST" dialog), but this is a tiny +# change to the code and works well enough. +patch -p1 < $CWD/nolockup.diff + +# desktop-file-validate complains a bit... also use absolute path +# to binary. +sed -i -e 's,GNOME;Application;,,' \ + -e '/^Exec/s,gtetrinet,/usr/games/&,' \ + $PRGNAM.desktop.in + +autoreconf -if + +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +./configure \ + --prefix=/usr \ + --bindir=/usr/games \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --mandir=/usr/man \ + --docdir=/usr/doc/$PRGNAM-$VERSION \ + --disable-static \ + --build=$ARCH-slackware-linux + +make +make install-strip DESTDIR=$PKG +gzip $PKG/usr/man/man?/* + +# only icon included is 40x40, pre-upscale to 48x48 too. +HICOLOR=$PKG/usr/share/icons/hicolor +mkdir -p $HICOLOR/{40x40,48x48}/apps +ln -s ../../../../pixmaps/$PRGNAM.png $HICOLOR/40x40/apps/$PRGNAM.png +convert -resize 48x48 $PRGNAM.png $HICOLOR/48x48/apps/$PRGNAM.png + +PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION +mkdir -p $PKGDOC +cp -a AUTHORS COPYING NEWS README* TODO $PKGDOC +cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$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-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/games/gtetrinet/gtetrinet.info b/games/gtetrinet/gtetrinet.info new file mode 100644 index 0000000000..87a7df925c --- /dev/null +++ b/games/gtetrinet/gtetrinet.info @@ -0,0 +1,10 @@ +PRGNAM="gtetrinet" +VERSION="0.8.0_20220828_6d816ee" +HOMEPAGE="https://github.com/tatankat/gtetrinet" +DOWNLOAD="https://slackware.uk/~urchlay/src/gtetrinet-0.8.0_20220828_6d816ee.tar.xz" +MD5SUM="149e03efb889f7e2ae7ab80584e6007a" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="B. Watson" +EMAIL="urchlay@slackware.uk" diff --git a/games/gtetrinet/nolockup.diff b/games/gtetrinet/nolockup.diff new file mode 100644 index 0000000000..0cfbe0d599 --- /dev/null +++ b/games/gtetrinet/nolockup.diff @@ -0,0 +1,12 @@ +diff -Naur gtetrinet-0.8.0_20220828_6d816ee.orig/src/client.c gtetrinet-0.8.0_20220828_6d816ee/src/client.c +--- gtetrinet-0.8.0_20220828_6d816ee.orig/src/client.c 2023-02-10 14:01:33.000000000 -0500 ++++ gtetrinet-0.8.0_20220828_6d816ee/src/client.c 2023-02-12 23:55:28.980242462 -0500 +@@ -431,6 +431,8 @@ + { + case G_IO_STATUS_EOF : + g_warning ("End of file (server closed connection)."); ++ connected = 1; ++ client_disconnect(); + return -1; + break; + diff --git a/games/gtetrinet/slack-desc b/games/gtetrinet/slack-desc new file mode 100644 index 0000000000..89db12ef66 --- /dev/null +++ b/games/gtetrinet/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 ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +gtetrinet: gtetrinet (multiplayer networked Tetris-like game) +gtetrinet: +gtetrinet: GTetrinet is a clone of the popular Tetrinet game for Win95/NT. It is +gtetrinet: designed to be fully compatible with, and to be identical in gameplay +gtetrinet: to the original Tetrinet. +gtetrinet: +gtetrinet: +gtetrinet: +gtetrinet: +gtetrinet: +gtetrinet: |