Skip to content

Instantly share code, notes, and snippets.

@jesstelford
Last active June 12, 2016 12:00
Show Gist options
  • Save jesstelford/67eceb7a7fa08405f6b7 to your computer and use it in GitHub Desktop.
Save jesstelford/67eceb7a7fa08405f6b7 to your computer and use it in GitHub Desktop.
nethack 3.6.0 hints file for debian: `sys/unix/hints/linux`. More: http://jes.st/2015/compiling-playing-nethack-360-on-ubuntu/
#
# NetHack 3.6 linux $NHDT-Date: 1432512814 2015/05/25 00:13:34 $ $NHDT-Branch: master $:$NHDT-Revision: 1.12 $
# Copyright (c) Kenneth Lorber, Kensington, Maryland, 2007.
# NetHack may be freely redistributed. See license for details.
#
#-PRE
# Linux hints file
# This hints file provides a single-user tty build for Linux, specifically
# for Ubuntu dapper.
# install in the global folder, not a user folder
PREFIX=/usr
#PREFIX=$(wildcard ~)/nh/install
HACKDIR=$(PREFIX)/games/lib/$(GAME)dir
SHELLDIR = $(PREFIX)/games
INSTDIR=$(HACKDIR)
# a better location for game files
VARDIR = /var/games/nethack
# the global config file
SYSCONFFILE=/etc/nethackrc
# Ubuntu's group for games
GAMEGRP=games
# permissions on config file
POSTINSTALL=cp -n sys/unix/sysconf $(SYSCONFFILE); $(CHOWN) $(GAMEUID) $(SYSCONFFILE); $(CHGRP) $(GAMEGRP) $(SYSCONFFILE); chmod $(VARFILEPERM) $(SYSCONFFILE);
CFLAGS=-g -O -I../include -DNOTPARMDECL $(CFLAGS1) -DDLB
CFLAGS1=-DCOMPRESS=\"/bin/gzip\" -DCOMPRESS_EXTENSION=\".gz\"
# Point to the correct config file
CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(SYSCONFFILE)\" -DSECURE
CFLAGS+=-DHACKDIR=\"$(HACKDIR)\"
# tell nethack where the game files are
CFLAGS+=-DVAR_PLAYGROUND=\"$(VARDIR)\"
LINK=$(CC)
# Only needed for GLIBC stack trace:
LFLAGS=-rdynamic
WINSRC = $(WINTTYSRC)
WINOBJ = $(WINTTYOBJ)
WINLIB = $(WINTTYLIB)
# use ncurses
WINTTYLIB=-lncurses
# actually execute the chown
CHOWN=chown
# actually execute the chgrp
CHGRP=chgrp
VARDIRPERM = 0777
VARFILEPERM = 0777
GAMEPERM = 0777
diff --git a/sys/unix/hints/linux b/sys/unix/hints/linux
index a9b612e..ac758de 100644
--- a/sys/unix/hints/linux
+++ b/sys/unix/hints/linux
@@ -8,22 +8,29 @@
# This hints file provides a single-user tty build for Linux, specifically
# for Ubuntu dapper.
-
-#PREFIX=/usr
-PREFIX=$(wildcard ~)/nh/install
+# install in the global folder, not a user folder
+PREFIX=/usr
+#PREFIX=$(wildcard ~)/nh/install
HACKDIR=$(PREFIX)/games/lib/$(GAME)dir
SHELLDIR = $(PREFIX)/games
INSTDIR=$(HACKDIR)
-VARDIR = $(HACKDIR)
-
+# a better location for game files
+VARDIR = /var/games/nethack
+# the global config file
+SYSCONFFILE=/etc/nethackrc
+# Ubuntu's group for games
+GAMEGRP=games
-
-POSTINSTALL=cp -n sys/unix/sysconf $(INSTDIR)/sysconf; $(CHOWN) $(GAMEUID) $(INSTDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(INSTDIR)/sysconf; chmod $
+# permissions on config file
+POSTINSTALL=cp -n sys/unix/sysconf $(SYSCONFFILE); $(CHOWN) $(GAMEUID) $(SYSCONFFILE); $(CHGRP) $(GAMEGRP) $(SYSCONFFILE); chmod $(VARFILEPERM
CFLAGS=-g -O -I../include -DNOTPARMDECL $(CFLAGS1) -DDLB
CFLAGS1=-DCOMPRESS=\"/bin/gzip\" -DCOMPRESS_EXTENSION=\".gz\"
-CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE
+# Point to the correct config file
+CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(SYSCONFFILE)\" -DSECURE
CFLAGS+=-DHACKDIR=\"$(HACKDIR)\"
+# tell nethack where the game files are
+CFLAGS+=-DVAR_PLAYGROUND=\"$(VARDIR)\"
LINK=$(CC)
# Only needed for GLIBC stack trace:
@@ -33,11 +40,15 @@ WINSRC = $(WINTTYSRC)
WINOBJ = $(WINTTYOBJ)
WINLIB = $(WINTTYLIB)
-WINTTYLIB=-lcurses
+# use ncurses
+WINTTYLIB=-lncurses
+
+# actually execute the chown
+CHOWN=chown
+# actually execute the chgrp
+CHGRP=chgrp
-CHOWN=true
-CHGRP=true
+VARDIRPERM = 0777
+VARFILEPERM = 0777
+GAMEPERM = 0777
-VARDIRPERM = 0755
-VARFILEPERM = 0600
-GAMEPERM = 0755
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment