games/koules: Added to 12.2 repository

This commit is contained in:
B. Watson 2010-05-12 23:29:24 +02:00 committed by David Somero
parent ded2ffc51a
commit 4336529878
12 changed files with 338 additions and 0 deletions

21
games/koules/README Normal file
View file

@ -0,0 +1,21 @@
Koules is a fast action arcade-style game for UNIX and OS/2. This version
supports X window system, SVGAlib for Linux and OS/2. It works in fine
(up to 900x620) resolution with cool 256 color graphics, multiplayer mode
up to 5 players, full sound and, of course, network support. Koules is
an original idea. First version of Koules was developed from scratch
by Jan Hubicka in July 1995.
Yes, koules used to packaged on disk y1 of Slackware 3.3. It needed
quite a bit of patching to work well on a modern system...
If you're building this for use on a slow system, try setting MITSHM=yes
in the environment; it may speed things up (or not).
If you have Tcl/Tk installed, and you're running KDE, you'll get a nice
GUI launcher dialog when you run Koules from the K menu. If you're not
running KDE, try running "koules-launcher".
Note: When playing as player #2 in multiplayer, the default keys are WASD,
not the arrows (this is confusing). Players 3 and above don't seem to
have default key maps, so be sure to configure the keys before starting
the game (or set the control type to mouse or joystick instead).

3
games/koules/doinst.sh Normal file
View file

@ -0,0 +1,3 @@
if [ -x /usr/bin/update-desktop-database ]; then
/usr/bin/update-desktop-database -q usr/share/applications &> /dev/null
fi

View file

@ -0,0 +1,122 @@
#!/bin/sh
# Slackware build script for koules
# Written by B. Watson (yalhcru@gmail.com)
# This game used to be distributed on disk Y1 of Slackware 3.3.
# This script doesn't share any code with whatever build script
# existed back then (partly because I couldn't find a copy)
PRGNAM=koules
VERSION=${VERSION:-1.4}
ARCH=${ARCH:-i486}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
# Use MIT shared memory?
# On some systems, MITSHM speeds things up. On others, it slows them
# down or (on 64-bit systems) causes the game to crash on startup.
# If you set MITSHM=yes and have problems, try running koules with
# the -M flag. If the problems go away, rebuild with MITSHM=no to avoid
# having to give the -M flag all the time...
# I'm defaulting this to no, because modern systems should be fast enough
# to play this simple game without it.
MITSHM=${MITSHM:-no}
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
fi
set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM$VERSION
tar xvf $CWD/$PRGNAM$VERSION-src.tar.gz
cd $PRGNAM$VERSION
chown -R root:root .
chmod -R a-s,u+w,go+r-w .
# sound server in /usr/libexec, game data in /usr/share/koules
# also, enable sound and joystick support.
patch -p1 < $CWD/patches/slackware.diff
# Grrr. Need this to compile with MITSHM disabled.
patch -p1 < $CWD/patches/compile_fix.diff
# Modern gcc seems to hate the inline assembly. Anyway I bet gcc's code
# with -O2 is the same or faster...
patch -p1 < $CWD/patches/no_inline_asm.diff
# The author forgot to mention the -E option in the help and man page
patch -p1 < $CWD/patches/document_E_option.diff
# Some people might like the launcher...
patch -p1 < $CWD/patches/tcl_launcher_paths.diff
# I hate Imake even worse than autoconf...
if [ "$MITSHM" = "no" ]; then
sed -i -e '/#define MITSHM/d' Iconfig
fi
xmkmf -a
# Did I mention I hate Imake?
find . -name Makefile | \
xargs sed -i -e "s/-O2.*/$SLKCFLAGS/"
touch xkoules.man
make
# Don't trust 'make install', it doesn't fully support DESTDIR, and
# installs things with weird permissions. Again, Imake sucks.
# Also, we want to call the binary and manpage "koules", not "xkoules",
# so there'd be some manual stuff going on anyway.
mkdir -p $PKG/usr/games
strip x$PRGNAM
install -m0755 x$PRGNAM -o root -g root $PKG/usr/games/$PRGNAM
install -m0755 $PRGNAM.tcl -o root -g root $PKG/usr/games/$PRGNAM-launcher
mkdir -p $PKG/usr/libexec
strip $PRGNAM.sndsrv.linux
install -m0755 $PRGNAM.sndsrv.linux -o root -g root $PKG/usr/libexec/
install -m0755 $CWD/koules.kde -o root -g root $PKG/usr/libexec/
mkdir -p $PKG/usr/share/$PRGNAM
cp sounds/*.raw $PKG/usr/share/$PRGNAM
mkdir -p $PKG/usr/man/man6
gzip -9c x$PRGNAM.6 > $PKG/usr/man/man6/$PRGNAM.6.gz
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp README TODO ANNOUNCE BUGS COPYING Card Koules.FAQ \
$PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
cat $CWD/README > $PKG/usr/doc/$PRGNAM-$VERSION/README.SBo
mkdir -p $PKG/usr/share/pixmaps
cp Koules.xpm $PKG/usr/share/pixmaps/$PRGNAM.xpm
mkdir -p $PKG/usr/share/applications
cat $CWD/$PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop
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.tgz

View file

@ -0,0 +1,8 @@
[Desktop Entry]
Encoding=UTF-8
Name=Koules
Exec=/usr/libexec/koules.kde
Type=Application
Icon=koules
GenericName=Koules
Categories=Game;Arcade;

8
games/koules/koules.info Normal file
View file

@ -0,0 +1,8 @@
PRGNAM="koules"
VERSION="1.4"
HOMEPAGE="http://www.ucw.cz/~hubicka/koules/English/koules.html"
DOWNLOAD="http://www.ucw.cz/~hubicka/koules/packages/koules1.4-src.tar.gz"
MD5SUM="0a5ac9e57c8b72e9fc200bc98273235c"
MAINTAINER="B. Watson"
EMAIL="yalhcru@gmail.com"
APPROVED="dsomero"

13
games/koules/koules.kde Normal file
View file

@ -0,0 +1,13 @@
#!/bin/sh
# koules.kde
# Wrapper script to launch koules from a KDE shortcut
# Author: B. Watson (yalhcru@gmail.com)
# If the GUI launcher can't run (probably because Tcl/Tk isn't
# installed), just start the game with default options.
# Wrap with artsdsp, since koules only knows how to use OSS /dev/dsp
# style audio (if it used ALSA, dmix would take care of us).
artsdsp -n Koules koules-launcher || artsdsp -n Koules koules

View file

@ -0,0 +1,16 @@
diff -Naur koules1.4/xlib/init.c koules1.4.patched/xlib/init.c
--- koules1.4/xlib/init.c 1998-03-05 12:03:01.000000000 -0500
+++ koules1.4.patched/xlib/init.c 2009-04-15 06:12:07.000000000 -0400
@@ -88,11 +88,11 @@
return (pixmap);
}
+static int bpp;
#ifdef MITSHM
extern int XShmQueryExtension (Display * dpy);
static int haderror;
static int (*origerrorhandler) (Display *, XErrorEvent *);
-static int bpp;
static int

View file

@ -0,0 +1,24 @@
diff -Naur koules1.4/xkoules.6 koules1.4.patched/xkoules.6
--- koules1.4/xkoules.6 1998-03-04 13:59:19.000000000 -0500
+++ koules1.4.patched/xkoules.6 2009-04-15 06:30:32.000000000 -0400
@@ -69,6 +69,9 @@
for large display(640x480)
default size
.TP
+.B \-E
+for extra large display(900x600)
+.TP
.B \-m
for monochrome displays
.TP
diff -Naur koules1.4/xlib/init.c koules1.4.patched/xlib/init.c
--- koules1.4/xlib/init.c 1998-03-05 12:03:01.000000000 -0500
+++ koules1.4.patched/xlib/init.c 2009-04-15 06:29:13.000000000 -0400
@@ -775,6 +775,7 @@
" -m for monochrome displays\n"
" -s for small display(320x250)\n"
" -l for large display(640x480)\n"
+ " -E for extra large display(900x600)\n"
" -p use private colormap\n"
" -y Synchronize with X(for debugging)\n"
" -f nofade(for debugging)\n"

View file

@ -0,0 +1,48 @@
diff -Naur koules1.4/xlib/shmbitmap.c koules1.4.patched/xlib/shmbitmap.c
--- koules1.4/xlib/shmbitmap.c 1998-03-04 13:59:19.000000000 -0500
+++ koules1.4.patched/xlib/shmbitmap.c 2009-04-15 06:44:35.000000000 -0400
@@ -237,7 +237,7 @@
#define __clipy1 0
#undef __clipy2
#define __clipy2 (MAPHEIGHT+19)
-#ifdef __i386__
+#if 0
static INLINE int
muldiv64 (int CONST m1, int CONST m2, int CONST d)
{
@@ -333,7 +333,7 @@
}
if (r1 & 1)
{ /* left */
-#ifdef __i386__
+#if 0
y1 += muldiv64 (__clipx1 - x1, y2 - y1, x2 - x1);
#else
y1 += (long) (__clipx1 - x1) * (long) (y2 - y1) / (long) (x2 - x1);
@@ -342,7 +342,7 @@
}
else if (r1 & 2)
{ /* right */
-#ifdef __i386__
+#if 0
y1 += muldiv64 (__clipx2 - x1, y2 - y1, x2 - x1);
#else
y1 += (long) (__clipx2 - x1) * (long) (y2 - y1) / (long) (x2 - x1);
@@ -351,7 +351,7 @@
}
else if (r1 & 4)
{ /* top */
-#ifdef __i386__
+#if 0
x1 += muldiv64 (__clipy1 - y1, x2 - x1, y2 - y1);
#else
x1 += (long) (__clipy1 - y1) * (long) (x2 - x1) / (long) (y2 - y1);
@@ -360,7 +360,7 @@
}
else if (r1 & 8)
{ /* bottom */
-#ifdef __i386__
+#if 0
x1 += muldiv64 (__clipy2 - y1, x2 - x1, y2 - y1);
#else
x1 += (long) (__clipy2 - y1) * (long) (x2 - x1) / (long) (y2 - y1);

View file

@ -0,0 +1,40 @@
diff -Naur koules1.4/Iconfig koules1.4.patched/Iconfig
--- koules1.4/Iconfig 1998-03-04 15:29:05.000000000 -0500
+++ koules1.4.patched/Iconfig 2009-04-15 05:54:44.000000000 -0400
@@ -29,13 +29,14 @@
/* linux joystick support
Now compiles w/o joystick toolkit. For using joystick support is
joystick toolikit required...of course */
-/*#define JOYSTICK*/
+#define JOYSTICK
/*for fast 386 based assembler routines
recomended for linux*/
/*#define I386ASSEMBLY*/
+#define LinuxArchitecture
/* directories*/
KOULESDIR =/usr/bin/X11
-SOUNDDIR =/usr/local/lib/koules
+SOUNDDIR =/usr/share/koules
MANDIR =/usr/local/man/man6
/*You need some extra libraryes for BSD sockets compatibility?*/
@@ -51,7 +52,6 @@
SUBDIRS = xlib
#if defined(LinuxArchitecture)
- SYSDEFS = -Wall -fomit-frame-pointer -O6 -ffast-math
#if !defined(NAS_SOUND)&&!defined(RSOUND)
#define SOUND
SOUNDSERVER = koules.sndsrv.linux
diff -Naur koules1.4/Imakefile koules1.4.patched/Imakefile
--- koules1.4/Imakefile 1998-03-04 13:59:19.000000000 -0500
+++ koules1.4.patched/Imakefile 2009-04-15 05:35:39.000000000 -0400
@@ -56,7 +56,7 @@
DEFINES = -DONLYANSI -DSOUND $(JOYSTICK1) $(NET) $(MITSHM1) $(HAVEUSLEEP1) $(SYSDEFS) $(JOYSTICK) -Ixlib\
$(NAMEDEF) $(ASMDEF)\
- -DSOUNDSERVER=\"$(SOUNDDIR)/$(SOUNDSERVER)\" \
+ -DSOUNDSERVER=\"/usr/libexec/$(SOUNDSERVER)\" \
-DSOUNDDIR=\"$(SOUNDDIR)\" \
-DSOUNDDEV=\"$(SOUNDDEV)\"
#endif

View file

@ -0,0 +1,16 @@
diff -Naur koules1.4/koules.tcl koules1.4.patched/koules.tcl
--- koules1.4/koules.tcl 1998-03-04 13:59:19.000000000 -0500
+++ koules1.4.patched/koules.tcl 2009-04-15 08:00:38.000000000 -0400
@@ -3,9 +3,9 @@
# This is simple user (anti)friendly dialog for starting koules
# Only reason why I did it is that I wanted to try tcl/tk
#files - configure here if paths are differ
-set xkoules "/usr/bin/X11/xkoules"
-set koulessvga "/usr/local/bin/koules.svga"
-set koulessound "/usr/local/lib/koules/creator1.raw"
+set xkoules "/usr/games/koules"
+set koulessvga "@@@NOSUCHFILE@@@"
+set koulessound "/usr/share/koules/creator1.raw"
set config "~/.xkoules.opt"
set revision 1.1
# Set default

19
games/koules/slack-desc Normal file
View file

@ -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------------------------------------------------------|
koules: koules (fast action arcade-style game)
koules:
koules: Koules is a fast action arcade-style game for UNIX and OS/2. This
koules: version supports X window system, SVGAlib for Linux and OS/2. It
koules: works in fine (up to 900x620) resolution with cool 256 color graphics,
koules: multiplayer mode up to 5 players, full sound and, of course, network
koules: support. Koules is an original idea. First version of Koules was
koules: developed from scratch by Jan Hubicka in July 1995.
koules:
koules:
koules: