pkgsrc/games/nethack-lib/patches/patch-ad
2011-06-01 11:20:29 +00:00

40 lines
746 B
Text

$NetBSD: patch-ad,v 1.8 2011/06/01 11:20:29 wiz Exp $
Make configurable.
--- sys/unix/nethack.sh.orig 2003-12-07 23:39:13.000000000 +0000
+++ sys/unix/nethack.sh
@@ -1,9 +1,31 @@
#!/bin/sh
# SCCS Id: @(#)nethack.sh 3.4 1990/02/26
-HACKDIR=/usr/games/lib/nethackdir
+UILIST="tty x11 qt"
+findbin ()
+{
+ for x in $UILIST; do
+ if [ -x @PREFIX@/bin/nethack-$x ]; then
+ echo $x
+ return
+ fi
+ done
+}
+
+if [ -z "$1" -o -z "${1%%-*}" ]; then
+ TTY=`findbin`
+else
+ TTY=$1
+fi
+
+if [ -z "$TTY" ]; then
+ echo "No UI ($UILIST) found"
+ exit 1
+fi
+
+HACKDIR=@GAMEDIR@
export HACKDIR
-HACK=$HACKDIR/nethack
+HACK=@PREFIX@/bin/nethack-$TTY
MAXNROFPLAYERS=4
# Since Nethack.ad is installed in HACKDIR, add it to XUSERFILESEARCHPATH