the Fink project is an effort to port
popular Unix programs to Mac OS X
Info2: <<
Package: nethack%type_pkg[-x11]%type_pkg[-gnome]%type_pkg[-qt]
Version: 3.4.3
Revision: 1002
Maintainer: Matthias Neeracher
Type: -x11 (boolean), -gnome (boolean), -qt (boolean)
BuildDepends: <<
fink (>= 0.24.12),
gettext-dev,
(%type_raw[-x11] = -x11) x11-dev,
(%type_raw[-gnome] = -gnome) libjpeg, (%type_raw[-gnome] = -gnome) libpng3,
(%type_raw[-gnome] = -gnome) libtiff, (%type_raw[-gnome] = -gnome) netpbm,
(%type_raw[-gnome] = -gnome) audiofile, (%type_raw[-gnome] = -gnome) esound,
(%type_raw[-gnome] = -gnome) glib, (%type_raw[-gnome] = -gnome) gtk+,
(%type_raw[-gnome] = -gnome) gnome-libs-dev, (%type_raw[-gnome] = -gnome) imlib
,
(%type_raw[-qt] = -qt) qt3 (>= 3.3.5-1023)
<<
Depends: <<
passwd (>= 20011007-1),
(%type_raw[-x11] = -x11) x11,
(%type_raw[-gnome] = -gnome) gnome-libs,
(%type_raw[-qt] = -qt) qt3-shlibs (>= 3.3.5-1023)
<<
Conflicts: nethack, nethack-x11, nethack-gnome, nethack-x11-gnome, nethack-qt, nethack-x11-qt, nethack-x11-gnome-qt, nethack-gnome-qt
Replaces: nethack, nethack-x11, nethack-gnome, nethack-x11-gnome, nethack-qt, nethack-x11-qt, nethack-x11-gnome-qt, nethack-gnome-qt
Source: mirror:sourceforge:%{Ni}/%{Ni}-343-src.tgz
Source-MD5: 21479c95990eefe7650df582426457f9
SourceDirectory: %{Ni}-%v
PatchFile: %{Ni}.patch
PatchFile-MD5: bd8f44a121e6855ad94aa4c16e8c45af
PatchScript: <<
#!/bin/bash -ev
sed 's:@PREFIX@:%p:g' < %{PatchFile} | patch -p1
if [ "%type_raw[-x11]" == "-x11" ]; then
perl -i.bak -pe 's|.*define X11_GRAPHICS.*|#define X11_GRAPHICS|' include/config.h
perl -i.bak -pe 's#^(WIN(SRC|OBJ|LIB).*)#\1 \$(WINX11\2)#' sys/unix/Makefile.src
fi
if [ "%type_raw[-gnome]" == "-gnome" ]; then
perl -i.bak -pe "s|.*define GNOME_GRAPHICS.*|#define GNOME_GRAPHICS|" include/config.h
perl -i.bak -pe 's#^(WIN(SRC|OBJ|LIB).*)#\1 \$(WINGNOME\2)#' sys/unix/Makefile.src
if [ "%type_raw[-qt]" == "-qt" -o "%type_raw[-x11]" == "-x11" ]; then
perl -i.bak -pe 's#gnworn.o\s+tile.o#gnworn.o#' sys/unix/Makefile.src
fi
fi
if [ "%type_raw[-qt]" == "-qt" ]; then
perl -i.bak -pe "s|.*define QT_GRAPHICS.*|#define QT_GRAPHICS|" include/config.h
perl -i.bak -pe 's#^(WIN(SRC|OBJ|LIB).*)#\1 \$(WINQT\2)#; s#^(CFLAGS.*)#\1 -I%p/include/qt#; s#^(LINK).*#\1 = c++#' sys/unix/Makefile.src
if [ "%type_raw[-x11]" == "-x11" ]; then
perl -i.bak -pe 's#qttableview.o\s+tile.o#qttableview.o#' sys/unix/Makefile.src
fi
fi
<<
CompileScript: <<
(cd sys/unix; sh ./setup.sh)
make GAMEDIR=%p/lib/nethack HACKDIR=%p/lib/nethack
<<
InstallScript: <<
make HACKDIR=%p/lib/nethack GAMEDIR=%i/lib/nethack SHELLDIR=%i/bin install
mkdir -p %i/share/man/man6
cd doc; make MANDIR=%i/share/man/man6 manpages
<<
DocFiles: doc/*.txt dat/license
Description: Console/X11 based graphical adventure game
DescPort: <<
The nethack configuration system is horrible (maybe deliberately so),
so this package requires extensive patches to the makefiles.
<<
DescPackaging: <<
This package deliberately tries to exercise the new (fink > 0.19.2)
package variant support to the fullest extent.
<<
License: GPL
Homepage: http://www.nethack.org
<<
diff -ru nethack-3.4.3-orig/include/config.h nethack-3.4.3/include/config.h
--- nethack-3.4.3-orig/include/config.h 2005-12-19 15:34:20.000000000 -0800
+++ nethack-3.4.3/include/config.h 2005-12-19 15:34:30.000000000 -0800
@@ -103,6 +103,12 @@
# endif
#endif
+#ifdef X11_GRAPHICS
+# ifndef DEFAULT_WINDOW_SYS
+# define DEFAULT_WINDOW_SYS "x11"
+# endif
+#endif
+
#ifdef MSWIN_GRAPHICS
# ifdef TTY_GRAPHICS
# undef TTY_GRAPHICS
diff -ru nethack-3.4.3-orig/include/system.h nethack-3.4.3/include/system.h
--- nethack-3.4.3-orig/include/system.h 2005-12-19 15:34:20.000000000 -0800
+++ nethack-3.4.3/include/system.h 2005-12-19 15:34:30.000000000 -0800
@@ -72,7 +72,7 @@
#if !defined(__cplusplus) && !defined(__GO32__)
-#if defined(BSD) || defined(ULTRIX) || defined(RANDOM)
+#if (defined(BSD) && !defined(__APPLE__)) || defined(ULTRIX) || defined(RANDOM)
# ifdef random
# undef random
# endif
diff -ru nethack-3.4.3-orig/include/unixconf.h nethack-3.4.3/include/unixconf.h
--- nethack-3.4.3-orig/include/unixconf.h 2005-12-19 15:34:20.000000000 -0800
+++ nethack-3.4.3/include/unixconf.h 2005-12-19 15:34:31.000000000 -0800
@@ -19,20 +19,20 @@
*/
/* define exactly one of the following four choices */
-/* #define BSD 1 */ /* define for 4.n/Free/Open/Net BSD */
+#define BSD 1 /* define for 4.n/Free/Open/Net BSD */
/* also for relatives like SunOS 4.x, DG/UX, and */
/* older versions of Linux */
/* #define ULTRIX */ /* define for Ultrix v3.0 or higher (but not lower) */
/* Use BSD for < v3.0 */
/* "ULTRIX" not to be confused with "ultrix" */
-#define SYSV /* define for System V, Solaris 2.x, newer versions */
+/* #define SYSV */ /* define for System V, Solaris 2.x, newer versions */
/* of Linux */
/* #define HPUX */ /* Hewlett-Packard's Unix, version 6.5 or higher */
/* use SYSV for < v6.5 */
/* define any of the following that are appropriate */
-#define SVR4 /* use in addition to SYSV for System V Release 4 */
+/* #define SVR4 */ /* use in addition to SYSV for System V Release 4 */
/* including Solaris 2+ */
#define NETWORK /* if running on a networked system */
/* e.g. Suns sharing a playground through NFS */
@@ -284,7 +284,7 @@
#endif
#if defined(BSD) || defined(ULTRIX)
-# if !defined(DGUX) && !defined(SUNOS4)
+# if !defined(DGUX) && !defined(SUNOS4) && !defined(__APPLE__)
#define memcpy(d, s, n) bcopy(s, d, n)
#define memcmp(s1, s2, n) bcmp(s2, s1, n)
# endif
@@ -331,7 +331,7 @@
# define GETRES_SUPPORT
# endif
#else
-# if defined(BSD) || defined(SVR4)
+# if (defined(BSD) && !defined(__APPLE__)) || defined(SVR4)
/*
* [ALI] We assume that SVR4 means we can safely include syscall.h
* (although it's really a BSDism). This is certainly true for Solaris 2.5,
diff -ru nethack-3.4.3-orig/src/files.c nethack-3.4.3/src/files.c
--- nethack-3.4.3-orig/src/files.c 2005-12-19 15:34:20.000000000 -0800
+++ nethack-3.4.3/src/files.c 2005-12-19 15:34:31.000000000 -0800
@@ -1341,7 +1341,7 @@
nesting--;
return FALSE;
case EACCES:
- HUP raw_printf("No write permission to lock %s!", filename);
+ HUP raw_printf("No write permission to lock %s [%s]!", filename, lockname);
nesting--;
return FALSE;
# ifdef VMS /* c__translate(vmsfiles.c) */
@@ -1556,17 +1556,6 @@
Sprintf(tmp_config, "%s/%s", envp, configfile);
if ((fp = fopenp(tmp_config, "r")) != (FILE *)0)
return(fp);
-# if defined(__APPLE__)
- /* try an alternative */
- if (envp) {
- Sprintf(tmp_config, "%s/%s", envp, "Library/Preferences/NetHack Defaults");
- if ((fp = fopenp(tmp_config, "r")) != (FILE *)0)
- return(fp);
- Sprintf(tmp_config, "%s/%s", envp, "Library/Preferences/NetHack Defaults.txt");
- if ((fp = fopenp(tmp_config, "r")) != (FILE *)0)
- return(fp);
- }
-# endif
if (errno != ENOENT) {
char *details;
diff -ru nethack-3.4.3-orig/sys/unix/Makefile.src nethack-3.4.3/sys/unix/Makefile.src
--- nethack-3.4.3-orig/sys/unix/Makefile.src 2005-12-19 15:34:20.000000000 -0800
+++ nethack-3.4.3/sys/unix/Makefile.src 2005-12-19 15:34:31.000000000 -0800
@@ -146,13 +146,13 @@
# directories. The ones given below is the usual spot for linux systems.
# The paths are for glibconfig.h and gnomesupport.h respectively.
#
-GNOMEINC=-I/usr/lib/glib/include -I/usr/lib/gnome-libs/include -I../win/gnome
+GNOMEINC=`gnome-config --cflags gnome` -I../win/gnome
# flags for debugging:
# CFLAGS = -g -I../include
-CFLAGS = -O -I../include
-LFLAGS =
+CFLAGS = -O -I../include -DHACKDIR=\"$(HACKDIR)\" -I@PREFIX@/include -I/usr/X11R6/include
+LFLAGS = -L@PREFIX@/lib -L/usr/X11R6/lib
# The Qt and Be window systems are written in C++, while the rest of
# NetHack is standard C. If using Qt, uncomment the LINK line here to get
@@ -230,24 +230,24 @@
# WINTTYLIB = -ltermcap
# WINTTYLIB = -lcurses
# WINTTYLIB = -lcurses16
-# WINTTYLIB = -lncurses
-WINTTYLIB = -ltermlib
+WINTTYLIB = -lncurses
+# WINTTYLIB = -ltermlib
#
# libraries for X11
# If USE_XPM is defined in config.h, you will also need -lXpm here.
-WINX11LIB = -lXaw -lXmu -lXext -lXt -lX11
+WINX11LIB = -lXaw -lXmu -lXext -lXt -lXpm -lX11
# WINX11LIB = -lXaw -lXmu -lXt -lX11
# WINX11LIB = -lXaw -lXmu -lXext -lXt -lXpm -lX11 -lm
# WINX11LIB = -lXaw -lXmu -lXpm -lXext -lXt -lX11 -lSM -lICE -lm # BSD/OS 2.0
#
# libraries for Qt
-WINQTLIB = -L$(QTDIR)/lib -lqt
+WINQTLIB = -L$(QTDIR)/lib -lqt-mt
#
# libraries for KDE (with Qt)
WINKDELIB = -lkdecore -lkdeui -lXext
#
# libraries for Gnome
-WINGNOMELIB = -lgnomeui -lgnome -lart_lgpl -lgtk -lgdk -lpopt
+WINGNOMELIB = `gnome-config --libs gnome gnomeui`
#
# libraries for Gem port
WINGEMLIB = -le_gem -lgem
diff -ru nethack-3.4.3-orig/sys/unix/Makefile.top nethack-3.4.3/sys/unix/Makefile.top
--- nethack-3.4.3-orig/sys/unix/Makefile.top 2005-12-19 15:34:20.000000000 -0800
+++ nethack-3.4.3/sys/unix/Makefile.top 2005-12-19 15:34:31.000000000 -0800
@@ -40,7 +40,7 @@
SHELLDIR = $(PREFIX)/games
# per discussion in Install.X11 and Install.Qt
-VARDATND =
+# VARDATND =
# VARDATND = x11tiles NetHack.ad pet_mark.xbm
# VARDATND = x11tiles NetHack.ad pet_mark.xbm rip.xpm
# for Atari/Gem
@@ -48,7 +48,7 @@
# for BeOS
# VARDATND = beostiles
# for Gnome
-# VARDATND = x11tiles pet_mark.xbm rip.xpm mapbg.xpm
+VARDATND = x11tiles NetHack.ad pet_mark.xbm rip.xpm mapbg.xpm
VARDATD = data oracles options quest.dat rumors
VARDAT = $(VARDATD) $(VARDATND)
@@ -186,7 +186,7 @@
cp src/$(GAME) $(GAMEDIR)
cp util/recover $(GAMEDIR)
-rm -f $(SHELLDIR)/$(GAME)
- sed -e 's;/usr/games/lib/nethackdir;$(GAMEDIR);' \
+ sed -e 's;/usr/games/lib/nethackdir;$(HACKDIR);' \
-e 's;HACKDIR/nethack;HACKDIR/$(GAME);' \
< sys/unix/nethack.sh \
> $(SHELLDIR)/$(GAME)
diff -ru nethack-3.4.3-orig/sys/unix/unixmain.c nethack-3.4.3/sys/unix/unixmain.c
--- nethack-3.4.3-orig/sys/unix/unixmain.c 2005-12-19 15:34:20.000000000 -0800
+++ nethack-3.4.3/sys/unix/unixmain.c 2005-12-19 15:34:31.000000000 -0800
@@ -88,7 +88,7 @@
hackpid = getpid();
(void) umask(0777 & ~FCMASK);
- choose_windows(DEFAULT_WINDOW_SYS);
+ choose_windows(getenv("DISPLAY") ? DEFAULT_WINDOW_SYS : "tty");
#ifdef CHDIR /* otherwise no chdir() */
/*
diff -ru nethack-3.4.3-orig/sys/unix/unixres.c nethack-3.4.3/sys/unix/unixres.c
--- nethack-3.4.3-orig/sys/unix/unixres.c 2005-12-19 15:34:20.000000000 -0800
+++ nethack-3.4.3/sys/unix/unixres.c 2005-12-19 15:34:31.000000000 -0800
@@ -18,6 +18,10 @@
#ifdef GETRES_SUPPORT
+# if defined(__APPLE__)
+#include
+# endif
+
# if defined(LINUX)
/* requires dynamic linking with libc */
diff -ru nethack-3.4.3-orig/win/Qt/qt_win.cpp nethack-3.4.3/win/Qt/qt_win.cpp
--- nethack-3.4.3-orig/win/Qt/qt_win.cpp 2005-12-19 15:34:20.000000000 -0800
+++ nethack-3.4.3/win/Qt/qt_win.cpp 2005-12-19 15:34:31.000000000 -0800
@@ -102,7 +102,7 @@
#include "qt_xpms.h"
#include
-#ifdef Q_WS_MACX
+#ifdef __APPLE__
# include
#else
# include
diff -ru nethack-3.4.3-orig/win/gnome/gnmain.c nethack-3.4.3/win/gnome/gnmain.c
--- nethack-3.4.3-orig/win/gnome/gnmain.c 2005-12-19 15:34:20.000000000 -0800
+++ nethack-3.4.3/win/gnome/gnmain.c 2005-12-19 15:34:31.000000000 -0800
@@ -725,7 +725,7 @@
uid = getuid();
euid = geteuid();
if (uid != euid)
- setuid(uid);
+ seteuid(uid);
hide_privileges(TRUE);
/* XXX gnome_init must print nethack options for --help, but does not */
gnome_init ("nethack", VERSION_STRING, argc, argv);
@@ -768,7 +768,7 @@
* to not refresh the window when adding widgets after the window
* has already been shown */
if (uid != euid)
- setuid(euid);
+ seteuid(euid);
for(i = 0; i < SIZE(ghack_chain); i++)
ghack_chain[i].handler =
signal(ghack_chain[i].signum, ghack_sig_handler);
diff -ru nethack-3.4.3-orig/win/tty/termcap.c nethack-3.4.3/win/tty/termcap.c
--- nethack-3.4.3-orig/win/tty/termcap.c 2005-12-19 15:34:20.000000000 -0800
+++ nethack-3.4.3/win/tty/termcap.c 2005-12-19 15:34:51.000000000 -0800
@@ -835,10 +835,6 @@
#include
-#ifndef LINUX
-extern char *tparm();
-#endif
-
# ifdef COLOR_BLACK /* trust include file */
#undef COLOR_BLACK
# else
Info2: <<
Package: nethack%type_pkg[-x11]%type_pkg[-gnome]%type_pkg[-qt]
Version: 3.4.3
Revision: 1002
Maintainer: Matthias Neeracher
Type: -x11 (boolean), -gnome (boolean), -qt (boolean)
BuildDepends: <<
fink (>= 0.24.12),
gettext-dev,
(%type_raw[-x11] = -x11) x11-dev,
(%type_raw[-gnome] = -gnome) libjpeg, (%type_raw[-gnome] = -gnome) libpng3,
(%type_raw[-gnome] = -gnome) libtiff, (%type_raw[-gnome] = -gnome) netpbm,
(%type_raw[-gnome] = -gnome) audiofile, (%type_raw[-gnome] = -gnome) esound,
(%type_raw[-gnome] = -gnome) glib, (%type_raw[-gnome] = -gnome) gtk+,
(%type_raw[-gnome] = -gnome) gnome-libs-dev, (%type_raw[-gnome] = -gnome) imlib
,
(%type_raw[-qt] = -qt) qt3 (>= 3.3.5-1023)
<<
Depends: <<
passwd (>= 20011007-1),
(%type_raw[-x11] = -x11) x11,
(%type_raw[-gnome] = -gnome) gnome-libs,
(%type_raw[-qt] = -qt) qt3-shlibs (>= 3.3.5-1023)
<<
Conflicts: nethack, nethack-x11, nethack-gnome, nethack-x11-gnome, nethack-qt, nethack-x11-qt, nethack-x11-gnome-qt, nethack-gnome-qt
Replaces: nethack, nethack-x11, nethack-gnome, nethack-x11-gnome, nethack-qt, nethack-x11-qt, nethack-x11-gnome-qt, nethack-gnome-qt
Source: mirror:sourceforge:%{Ni}/%{Ni}-343-src.tgz
Source-MD5: 21479c95990eefe7650df582426457f9
SourceDirectory: %{Ni}-%v
PatchFile: %{Ni}.patch
PatchFile-MD5: bd8f44a121e6855ad94aa4c16e8c45af
PatchScript: <<
#!/bin/bash -ev
sed 's:@PREFIX@:%p:g' < %{PatchFile} | patch -p1
if [ "%type_raw[-x11]" == "-x11" ]; then
perl -i.bak -pe 's|.*define X11_GRAPHICS.*|#define X11_GRAPHICS|' include/config.h
perl -i.bak -pe 's#^(WIN(SRC|OBJ|LIB).*)#\1 \$(WINX11\2)#' sys/unix/Makefile.src
fi
if [ "%type_raw[-gnome]" == "-gnome" ]; then
perl -i.bak -pe "s|.*define GNOME_GRAPHICS.*|#define GNOME_GRAPHICS|" include/config.h
perl -i.bak -pe 's#^(WIN(SRC|OBJ|LIB).*)#\1 \$(WINGNOME\2)#' sys/unix/Makefile.src
if [ "%type_raw[-qt]" == "-qt" -o "%type_raw[-x11]" == "-x11" ]; then
perl -i.bak -pe 's#gnworn.o\s+tile.o#gnworn.o#' sys/unix/Makefile.src
fi
fi
if [ "%type_raw[-qt]" == "-qt" ]; then
perl -i.bak -pe "s|.*define QT_GRAPHICS.*|#define QT_GRAPHICS|" include/config.h
perl -i.bak -pe 's#^(WIN(SRC|OBJ|LIB).*)#\1 \$(WINQT\2)#; s#^(CFLAGS.*)#\1 -I%p/include/qt#; s#^(LINK).*#\1 = c++#' sys/unix/Makefile.src
if [ "%type_raw[-x11]" == "-x11" ]; then
perl -i.bak -pe 's#qttableview.o\s+tile.o#qttableview.o#' sys/unix/Makefile.src
fi
fi
<<
CompileScript: <<
(cd sys/unix; sh ./setup.sh)
make GAMEDIR=%p/lib/nethack HACKDIR=%p/lib/nethack
<<
InstallScript: <<
make HACKDIR=%p/lib/nethack GAMEDIR=%i/lib/nethack SHELLDIR=%i/bin install
mkdir -p %i/share/man/man6
cd doc; make MANDIR=%i/share/man/man6 manpages
<<
DocFiles: doc/*.txt dat/license
Description: Console/X11 based graphical adventure game
DescPort: <<
The nethack configuration system is horrible (maybe deliberately so),
so this package requires extensive patches to the makefiles.
<<
DescPackaging: <<
This package deliberately tries to exercise the new (fink > 0.19.2)
package variant support to the fullest extent.
<<
License: GPL
Homepage: http://www.nethack.org
<<
diff -ru nethack-3.4.3-orig/include/config.h nethack-3.4.3/include/config.h
--- nethack-3.4.3-orig/include/config.h 2005-12-19 15:34:20.000000000 -0800
+++ nethack-3.4.3/include/config.h 2005-12-19 15:34:30.000000000 -0800
@@ -103,6 +103,12 @@
# endif
#endif
+#ifdef X11_GRAPHICS
+# ifndef DEFAULT_WINDOW_SYS
+# define DEFAULT_WINDOW_SYS "x11"
+# endif
+#endif
+
#ifdef MSWIN_GRAPHICS
# ifdef TTY_GRAPHICS
# undef TTY_GRAPHICS
diff -ru nethack-3.4.3-orig/include/system.h nethack-3.4.3/include/system.h
--- nethack-3.4.3-orig/include/system.h 2005-12-19 15:34:20.000000000 -0800
+++ nethack-3.4.3/include/system.h 2005-12-19 15:34:30.000000000 -0800
@@ -72,7 +72,7 @@
#if !defined(__cplusplus) && !defined(__GO32__)
-#if defined(BSD) || defined(ULTRIX) || defined(RANDOM)
+#if (defined(BSD) && !defined(__APPLE__)) || defined(ULTRIX) || defined(RANDOM)
# ifdef random
# undef random
# endif
diff -ru nethack-3.4.3-orig/include/unixconf.h nethack-3.4.3/include/unixconf.h
--- nethack-3.4.3-orig/include/unixconf.h 2005-12-19 15:34:20.000000000 -0800
+++ nethack-3.4.3/include/unixconf.h 2005-12-19 15:34:31.000000000 -0800
@@ -19,20 +19,20 @@
*/
/* define exactly one of the following four choices */
-/* #define BSD 1 */ /* define for 4.n/Free/Open/Net BSD */
+#define BSD 1 /* define for 4.n/Free/Open/Net BSD */
/* also for relatives like SunOS 4.x, DG/UX, and */
/* older versions of Linux */
/* #define ULTRIX */ /* define for Ultrix v3.0 or higher (but not lower) */
/* Use BSD for < v3.0 */
/* "ULTRIX" not to be confused with "ultrix" */
-#define SYSV /* define for System V, Solaris 2.x, newer versions */
+/* #define SYSV */ /* define for System V, Solaris 2.x, newer versions */
/* of Linux */
/* #define HPUX */ /* Hewlett-Packard's Unix, version 6.5 or higher */
/* use SYSV for < v6.5 */
/* define any of the following that are appropriate */
-#define SVR4 /* use in addition to SYSV for System V Release 4 */
+/* #define SVR4 */ /* use in addition to SYSV for System V Release 4 */
/* including Solaris 2+ */
#define NETWORK /* if running on a networked system */
/* e.g. Suns sharing a playground through NFS */
@@ -284,7 +284,7 @@
#endif
#if defined(BSD) || defined(ULTRIX)
-# if !defined(DGUX) && !defined(SUNOS4)
+# if !defined(DGUX) && !defined(SUNOS4) && !defined(__APPLE__)
#define memcpy(d, s, n) bcopy(s, d, n)
#define memcmp(s1, s2, n) bcmp(s2, s1, n)
# endif
@@ -331,7 +331,7 @@
# define GETRES_SUPPORT
# endif
#else
-# if defined(BSD) || defined(SVR4)
+# if (defined(BSD) && !defined(__APPLE__)) || defined(SVR4)
/*
* [ALI] We assume that SVR4 means we can safely include syscall.h
* (although it's really a BSDism). This is certainly true for Solaris 2.5,
diff -ru nethack-3.4.3-orig/src/files.c nethack-3.4.3/src/files.c
--- nethack-3.4.3-orig/src/files.c 2005-12-19 15:34:20.000000000 -0800
+++ nethack-3.4.3/src/files.c 2005-12-19 15:34:31.000000000 -0800
@@ -1341,7 +1341,7 @@
nesting--;
return FALSE;
case EACCES:
- HUP raw_printf("No write permission to lock %s!", filename);
+ HUP raw_printf("No write permission to lock %s [%s]!", filename, lockname);
nesting--;
return FALSE;
# ifdef VMS /* c__translate(vmsfiles.c) */
@@ -1556,17 +1556,6 @@
Sprintf(tmp_config, "%s/%s", envp, configfile);
if ((fp = fopenp(tmp_config, "r")) != (FILE *)0)
return(fp);
-# if defined(__APPLE__)
- /* try an alternative */
- if (envp) {
- Sprintf(tmp_config, "%s/%s", envp, "Library/Preferences/NetHack Defaults");
- if ((fp = fopenp(tmp_config, "r")) != (FILE *)0)
- return(fp);
- Sprintf(tmp_config, "%s/%s", envp, "Library/Preferences/NetHack Defaults.txt");
- if ((fp = fopenp(tmp_config, "r")) != (FILE *)0)
- return(fp);
- }
-# endif
if (errno != ENOENT) {
char *details;
diff -ru nethack-3.4.3-orig/sys/unix/Makefile.src nethack-3.4.3/sys/unix/Makefile.src
--- nethack-3.4.3-orig/sys/unix/Makefile.src 2005-12-19 15:34:20.000000000 -0800
+++ nethack-3.4.3/sys/unix/Makefile.src 2005-12-19 15:34:31.000000000 -0800
@@ -146,13 +146,13 @@
# directories. The ones given below is the usual spot for linux systems.
# The paths are for glibconfig.h and gnomesupport.h respectively.
#
-GNOMEINC=-I/usr/lib/glib/include -I/usr/lib/gnome-libs/include -I../win/gnome
+GNOMEINC=`gnome-config --cflags gnome` -I../win/gnome
# flags for debugging:
# CFLAGS = -g -I../include
-CFLAGS = -O -I../include
-LFLAGS =
+CFLAGS = -O -I../include -DHACKDIR=\"$(HACKDIR)\" -I@PREFIX@/include -I/usr/X11R6/include
+LFLAGS = -L@PREFIX@/lib -L/usr/X11R6/lib
# The Qt and Be window systems are written in C++, while the rest of
# NetHack is standard C. If using Qt, uncomment the LINK line here to get
@@ -230,24 +230,24 @@
# WINTTYLIB = -ltermcap
# WINTTYLIB = -lcurses
# WINTTYLIB = -lcurses16
-# WINTTYLIB = -lncurses
-WINTTYLIB = -ltermlib
+WINTTYLIB = -lncurses
+# WINTTYLIB = -ltermlib
#
# libraries for X11
# If USE_XPM is defined in config.h, you will also need -lXpm here.
-WINX11LIB = -lXaw -lXmu -lXext -lXt -lX11
+WINX11LIB = -lXaw -lXmu -lXext -lXt -lXpm -lX11
# WINX11LIB = -lXaw -lXmu -lXt -lX11
# WINX11LIB = -lXaw -lXmu -lXext -lXt -lXpm -lX11 -lm
# WINX11LIB = -lXaw -lXmu -lXpm -lXext -lXt -lX11 -lSM -lICE -lm # BSD/OS 2.0
#
# libraries for Qt
-WINQTLIB = -L$(QTDIR)/lib -lqt
+WINQTLIB = -L$(QTDIR)/lib -lqt-mt
#
# libraries for KDE (with Qt)
WINKDELIB = -lkdecore -lkdeui -lXext
#
# libraries for Gnome
-WINGNOMELIB = -lgnomeui -lgnome -lart_lgpl -lgtk -lgdk -lpopt
+WINGNOMELIB = `gnome-config --libs gnome gnomeui`
#
# libraries for Gem port
WINGEMLIB = -le_gem -lgem
diff -ru nethack-3.4.3-orig/sys/unix/Makefile.top nethack-3.4.3/sys/unix/Makefile.top
--- nethack-3.4.3-orig/sys/unix/Makefile.top 2005-12-19 15:34:20.000000000 -0800
+++ nethack-3.4.3/sys/unix/Makefile.top 2005-12-19 15:34:31.000000000 -0800
@@ -40,7 +40,7 @@
SHELLDIR = $(PREFIX)/games
# per discussion in Install.X11 and Install.Qt
-VARDATND =
+# VARDATND =
# VARDATND = x11tiles NetHack.ad pet_mark.xbm
# VARDATND = x11tiles NetHack.ad pet_mark.xbm rip.xpm
# for Atari/Gem
@@ -48,7 +48,7 @@
# for BeOS
# VARDATND = beostiles
# for Gnome
-# VARDATND = x11tiles pet_mark.xbm rip.xpm mapbg.xpm
+VARDATND = x11tiles NetHack.ad pet_mark.xbm rip.xpm mapbg.xpm
VARDATD = data oracles options quest.dat rumors
VARDAT = $(VARDATD) $(VARDATND)
@@ -186,7 +186,7 @@
cp src/$(GAME) $(GAMEDIR)
cp util/recover $(GAMEDIR)
-rm -f $(SHELLDIR)/$(GAME)
- sed -e 's;/usr/games/lib/nethackdir;$(GAMEDIR);' \
+ sed -e 's;/usr/games/lib/nethackdir;$(HACKDIR);' \
-e 's;HACKDIR/nethack;HACKDIR/$(GAME);' \
< sys/unix/nethack.sh \
> $(SHELLDIR)/$(GAME)
diff -ru nethack-3.4.3-orig/sys/unix/unixmain.c nethack-3.4.3/sys/unix/unixmain.c
--- nethack-3.4.3-orig/sys/unix/unixmain.c 2005-12-19 15:34:20.000000000 -0800
+++ nethack-3.4.3/sys/unix/unixmain.c 2005-12-19 15:34:31.000000000 -0800
@@ -88,7 +88,7 @@
hackpid = getpid();
(void) umask(0777 & ~FCMASK);
- choose_windows(DEFAULT_WINDOW_SYS);
+ choose_windows(getenv("DISPLAY") ? DEFAULT_WINDOW_SYS : "tty");
#ifdef CHDIR /* otherwise no chdir() */
/*
diff -ru nethack-3.4.3-orig/sys/unix/unixres.c nethack-3.4.3/sys/unix/unixres.c
--- nethack-3.4.3-orig/sys/unix/unixres.c 2005-12-19 15:34:20.000000000 -0800
+++ nethack-3.4.3/sys/unix/unixres.c 2005-12-19 15:34:31.000000000 -0800
@@ -18,6 +18,10 @@
#ifdef GETRES_SUPPORT
+# if defined(__APPLE__)
+#include
+# endif
+
# if defined(LINUX)
/* requires dynamic linking with libc */
diff -ru nethack-3.4.3-orig/win/Qt/qt_win.cpp nethack-3.4.3/win/Qt/qt_win.cpp
--- nethack-3.4.3-orig/win/Qt/qt_win.cpp 2005-12-19 15:34:20.000000000 -0800
+++ nethack-3.4.3/win/Qt/qt_win.cpp 2005-12-19 15:34:31.000000000 -0800
@@ -102,7 +102,7 @@
#include "qt_xpms.h"
#include
-#ifdef Q_WS_MACX
+#ifdef __APPLE__
# include
#else
# include
diff -ru nethack-3.4.3-orig/win/gnome/gnmain.c nethack-3.4.3/win/gnome/gnmain.c
--- nethack-3.4.3-orig/win/gnome/gnmain.c 2005-12-19 15:34:20.000000000 -0800
+++ nethack-3.4.3/win/gnome/gnmain.c 2005-12-19 15:34:31.000000000 -0800
@@ -725,7 +725,7 @@
uid = getuid();
euid = geteuid();
if (uid != euid)
- setuid(uid);
+ seteuid(uid);
hide_privileges(TRUE);
/* XXX gnome_init must print nethack options for --help, but does not */
gnome_init ("nethack", VERSION_STRING, argc, argv);
@@ -768,7 +768,7 @@
* to not refresh the window when adding widgets after the window
* has already been shown */
if (uid != euid)
- setuid(euid);
+ seteuid(euid);
for(i = 0; i < SIZE(ghack_chain); i++)
ghack_chain[i].handler =
signal(ghack_chain[i].signum, ghack_sig_handler);
diff -ru nethack-3.4.3-orig/win/tty/termcap.c nethack-3.4.3/win/tty/termcap.c
--- nethack-3.4.3-orig/win/tty/termcap.c 2005-12-19 15:34:20.000000000 -0800
+++ nethack-3.4.3/win/tty/termcap.c 2005-12-19 15:34:51.000000000 -0800
@@ -835,10 +835,6 @@
#include
-#ifndef LINUX
-extern char *tparm();
-#endif
-
# ifdef COLOR_BLACK /* trust include file */
#undef COLOR_BLACK
# else