hints updates

move out-of-date hints files to the outdated folder.

rename the hints files, and hints/include files that are currently
named *.2020 to *.370 (next release number).
This commit is contained in:
nhmall
2021-12-30 16:46:07 -05:00
parent f0d971fc2a
commit 7a44b3b52e
27 changed files with 56 additions and 56 deletions

View File

@@ -3,7 +3,7 @@ matrix:
include:
- name: linux-xenial-gcc-win-all
os: linux
env: HINTS=linux.2020 LUA_VERSION=5.4.3
env: HINTS=linux.370 LUA_VERSION=5.4.3
compiler: gcc
addons:
apt:
@@ -21,7 +21,7 @@ matrix:
- make LUA_VERSION=$LUA_VERSION WANT_WIN_ALL=1 QT_SELECT=5 MOC=moc install
- name: linux-bionic-gcc-win-all
os: linux
env: HINTS=linux.2020 LUA_VERSION=5.4.3
env: HINTS=linux.370 LUA_VERSION=5.4.3
dist: bionic
compiler: gcc
addons:
@@ -40,7 +40,7 @@ matrix:
- make LUA_VERSION=$LUA_VERSION WANT_WIN_ALL=1 QT_SELECT=5 MOC=moc install
- name: linux-focal-clang-win-all
os: linux
env: HINTS=linux.2020 LUA_VERSION=5.4.3
env: HINTS=linux.370 LUA_VERSION=5.4.3
dist: focal
compiler: clang
addons:
@@ -59,7 +59,7 @@ matrix:
- make LUA_VERSION=$LUA_VERSION WANT_WIN_ALL=1 QT_SELECT=5 MOC=moc install
- name: linux-xenial-gcc-nocommon
os: linux
env: HINTS=linux.2020 LUA_VERSION=5.4.3
env: HINTS=linux.370 LUA_VERSION=5.4.3
dist: xenial
compiler: gcc
script:
@@ -70,7 +70,7 @@ matrix:
- make install
- name: linux-focal-gcc9-win-all
os: linux
env: HINTS=linux.2020 LUA_VERSION=5.4.3
env: HINTS=linux.370 LUA_VERSION=5.4.3
dist: focal
compiler: gcc
addons:
@@ -138,7 +138,7 @@ matrix:
- mingw32-make LUA_VERSION=$LUA_VERSION install
- name: msdos-linux-focal-djgpp-crosscompile
os: linux
env: HINTS=linux.2020 LUA_VERSION=5.4.3
env: HINTS=linux.370 LUA_VERSION=5.4.3
dist: focal
compiler: gcc
script:

View File

@@ -0,0 +1,62 @@
#
# NetHack 3.7 linux $NHDT-Date: 1596498415 2020/08/03 23:46:55 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.32 $
# 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.
#PREFIX=/usr
PREFIX=$(wildcard ~)/nh/install
HACKDIR=$(PREFIX)/games/lib/$(GAME)dir
SHELLDIR = $(PREFIX)/games
INSTDIR=$(HACKDIR)
VARDIR = $(HACKDIR)
POSTINSTALL=cp -n sys/unix/sysconf $(INSTDIR)/sysconf; $(CHOWN) $(GAMEUID) $(INSTDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(INSTDIR)/sysconf; chmod $(VARFILEPERM) $(INSTDIR)/sysconf;
CFLAGS=-g -O -I../include -DNOTPARMDECL
CFLAGS+=-DDLB
CFLAGS+=-DCOMPRESS=\"/bin/gzip\" -DCOMPRESS_EXTENSION=\".gz\"
CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE
CFLAGS+=-DTIMED_DELAY
CFLAGS+=-DHACKDIR=\"$(HACKDIR)\"
CFLAGS+=-DDUMPLOG
CFLAGS+=-DCONFIG_ERROR_SECURE=FALSE
CFLAGS+=-DCURSES_GRAPHICS
#CFLAGS+=-DEXTRA_SANITY_CHECKS
#CFLAGS+=-DEDIT_GETLIN
#CFLAGS+=-DSCORE_ON_BOTL
#CFLAGS+=-DMSGHANDLER
#CFLAGS+=-DTTY_TILES_ESCCODES
# when building liblua.a, avoid warning that use of tmpnam() should be
# replaced by mkstemp(); the lua code doesn't use nethack's config.h so
# this needs to be passed via make rather than defined in unixconf.h
SYSCFLAGS=-DLUA_USE_POSIX
LINK=$(CC)
# Only needed for GLIBC stack trace:
LFLAGS=-rdynamic
WINSRC = $(WINTTYSRC) $(WINCURSESSRC)
WINOBJ = $(WINTTYOBJ) $(WINCURSESOBJ)
WINLIB = $(WINTTYLIB) $(WINCURSESLIB)
# if TTY_TILES_ESCCODES
#WINSRC += tile.c
#WINOBJ += tile.o
WINTTYLIB=-lncurses -ltinfo
CHOWN=true
CHGRP=true
VARDIRPERM = 0755
VARFILEPERM = 0600
GAMEPERM = 0755

View File

@@ -0,0 +1,54 @@
#
# NetHack 3.5 linux $NHDT-Date: 1589828479 2020/05/18 19:01:19 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.3 $
# NetHack 3.5 linux $Date: 2010/01/15 19:54:37 $ $Revision: 1.8 $
# 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 chrooted build for Linux, specifically
# for Ubuntu dapper.
# Does not copy required libraries or termcap files into the chroot.
COMPILEREVISION?=1
# this is the chroot dir
PREFIX=$(wildcard ~)/nh/install
# this is the dir where NetHack is inside the chroot
HACKDIR=/nh.$(shell date +%Y%m%d)-$(COMPILEREVISION)
INSTDIR=$(PREFIX)$(HACKDIR)
SHELLDIR=$(PREFIX)/games
VARDIR=$(INSTDIR)/var
POSTINSTALL=cp -n sys/unix/sysconf $(INSTDIR)/sysconf; $(CHOWN) $(GAMEUID) $(INSTDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(INSTDIR)/sysconf; chmod $(VARFILEPERM) $(INSTDIR)/sysconf;
CFLAGS1=-DCOMPRESS=\"/bin/gzip\" -DCOMPRESS_EXTENSION=\".gz\"
CFLAGS=-g -O -I../include -DNOTPARMDECL $(CFLAGS1) -DDLB
CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE
CFLAGS+=-DTIMED_DELAY
CFLAGS+=-DHACKDIR=\"$(HACKDIR)\"
CFLAGS+=-DVAR_PLAYGROUND=\"$(HACKDIR)/var\"
# when building liblua.a, avoid warning that use of tmpnam() should be
# replaced by mkstemp(); the lua code doesn't use nethack's config.h so
# this needs to be passed via make rather than defined in unixconf.h
SYSCFLAGS=-DLUA_USE_POSIX
LINK=$(CC)
# Only needed for GLIBC stack trace:
LFLAGS=-rdynamic
WINSRC = $(WINTTYSRC)
WINOBJ = $(WINTTYOBJ)
WINLIB = $(WINTTYLIB)
WINTTYLIB=-lncurses -ltinfo
CHOWN=true
CHGRP=true
VARDIRPERM = 0755
VARFILEPERM = 0600
GAMEPERM = 0755

View File

@@ -0,0 +1,36 @@
#
# NetHack 3.7 linux $NHDT-Date: 1596498416 2020/08/03 23:46:56 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.2 $
# Copyright (c) Patric Mueller
# NetHack may be freely redistributed. See license for details.
#
#-PRE
# Hints file for a minimal build
# This hints file provides the base for a minimal tty build for Linux
PREFIX=$(wildcard ~)/nethack-minimal
HACKDIR=$(PREFIX)/games/lib/$(GAME)dir
SHELLDIR=$(PREFIX)/games
INSTDIR=$(HACKDIR)
VARDIR=$(HACKDIR)
CFLAGS=-g -I../include
# when building liblua.a, avoid warning that use of tmpnam() should be
# replaced by mkstemp(); the lua code doesn't use nethack's config.h so
# this needs to be passed via make rather than defined in unixconf.h
SYSCFLAGS=-DLUA_USE_POSIX
LINK=$(CC)
WINSRC = $(WINTTYSRC)
WINOBJ = $(WINTTYOBJ)
WINLIB = $(WINTTYLIB)
WINTTYLIB=-lncurses -ltinfo
CHOWN=true
CHGRP=true
VARDIRPERM = 0755
VARFILEPERM = 0600
GAMEPERM = 0755

View File

@@ -0,0 +1,56 @@
#
# NetHack 3.7 linux-qt4 $NHDT-Date: 1596498416 2020/08/03 23:46:56 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.29 $
# 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 Qt4 build for Linux, specifically
# for Ubuntu dapper.
#PREFIX=/usr
PREFIX=$(wildcard ~)/nh/install
HACKDIR=$(PREFIX)/games/lib/$(GAME)dir
SHELLDIR = $(PREFIX)/games
INSTDIR=$(HACKDIR)
VARDIR = $(HACKDIR)
POSTINSTALL= cp -n sys/unix/sysconf $(INSTDIR)/sysconf; $(CHOWN) $(GAMEUID) $(INSTDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(INSTDIR)/sysconf; chmod $(VARFILEPERM) $(INSTDIR)/sysconf;
POSTINSTALL+= bdftopcf win/X11/nh10.bdf > $(INSTDIR)/nh10.pcf; ( cd $(INSTDIR); mkfontdir -x .lev );
CFLAGS=-g -O -I../include -DNOTPARMDECL
CFLAGS+=-DHACKDIR=\"$(HACKDIR)\"
CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\"
CFLAGS+=-DCOMPRESS=\"/bin/gzip\" -DCOMPRESS_EXTENSION=\".gz\"
CFLAGS+=-DTIMED_DELAY
CFLAGS+=-DDUMPLOG
CFLAGS+=-DCONFIG_ERROR_SECURE=FALSE
CFLAGS+=-DQT_GRAPHICS -DDEFAULT_WINDOW_SYS=\"Qt\" -DNOTTYGRAPHICS
CFLAGS+=`pkg-config QtGui --cflags`
# when building liblua.a, avoid warning that use of tmpnam() should be
# replaced by mkstemp(); the lua code doesn't use nethack's config.h so
# this needs to be passed via make rather than defined in unixconf.h
SYSCFLAGS=-DLUA_USE_POSIX
LINK=g++
CXX=g++ -std=gnu++11
WINSRC = $(WINQT4SRC)
WINOBJ = $(WINQT4OBJ)
WINLIB = $(WINQT4LIB)
MOC = moc-qt4
VARDATND = nhtiles.bmp rip.xpm nhsplash.xpm pet_mark.xbm pilemark.xbm
QTDIR=/usr
CHOWN=true
CHGRP=true
VARDIRPERM = 0755
VARFILEPERM = 0600
GAMEPERM = 0755
# note: needs libxt-dev libxaw7-dev libx11-dev bdftopcf

View File

@@ -0,0 +1,59 @@
#
# NetHack 3.7 linux-qt5 $NHDT-Date: 1596498417 2020/08/03 23:46:57 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.30 $
# 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 Qt5 build for Linux, specifically
# for Fedora 26.
#PREFIX=/usr
PREFIX=$(wildcard ~)/nh/install
HACKDIR=$(PREFIX)/games/lib/$(GAME)dir
SHELLDIR = $(PREFIX)/games
INSTDIR=$(HACKDIR)
VARDIR = $(HACKDIR)
POSTINSTALL= cp -n sys/unix/sysconf $(INSTDIR)/sysconf; $(CHOWN) $(GAMEUID) $(INSTDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(INSTDIR)/sysconf; chmod $(VARFILEPERM) $(INSTDIR)/sysconf;
POSTINSTALL+= bdftopcf win/X11/nh10.bdf > $(INSTDIR)/nh10.pcf; ( cd $(INSTDIR); mkfontdir -x .lev );
CFLAGS=-g -O -I../include -DNOTPARMDECL
CFLAGS+=-DHACKDIR=\"$(HACKDIR)\"
CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\"
CFLAGS+=-DCOMPRESS=\"/bin/gzip\" -DCOMPRESS_EXTENSION=\".gz\"
CFLAGS+=-DTIMED_DELAY
CFLAGS+=-DDUMPLOG
CFLAGS+=-DCONFIG_ERROR_SECURE=FALSE
CFLAGS+=-DQT_GRAPHICS -DDEFAULT_WINDOW_SYS=\"Qt\" -DNOTTYGRAPHICS
CFLAGS+=`pkg-config Qt5Gui Qt5Widgets Qt5Multimedia --cflags` -fPIC
# when building liblua.a, avoid warning that use of tmpnam() should be
# replaced by mkstemp(); the lua code doesn't use nethack's config.h so
# this needs to be passed via make rather than defined in unixconf.h
SYSCFLAGS=-DLUA_USE_POSIX
LINK=g++
CXX=g++ -std=gnu++11
CCXXFLAGS = $(CFLAGS)
WINSRC = $(WINQTSRC)
WINOBJ = $(WINQTOBJ)
WINLIB = $(WINQT5LIB)
#MOC = moc
MOC = moc-qt5
VARDATND = nhtiles.bmp rip.xpm nhsplash.xpm pet_mark.xbm pilemark.xbm
QTDIR=/usr
CHOWN=true
CHGRP=true
VARDIRPERM = 0755
VARFILEPERM = 0600
GAMEPERM = 0755
# note: needs libxt-dev libxaw7-dev libx11-dev bdftopcf

View File

@@ -0,0 +1,56 @@
#
# NetHack 3.7 linux-x11 $NHDT-Date: 1596498418 2020/08/03 23:46:58 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.26 $
# 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 x11 build for Linux, specifically
# for Ubuntu dapper.
#PREFIX=/usr
PREFIX=$(wildcard ~)/nh/install
HACKDIR=$(PREFIX)/games/lib/$(GAME)dir
SHELLDIR = $(PREFIX)/games
INSTDIR=$(HACKDIR)
VARDIR = $(HACKDIR)
POSTINSTALL= cp -n sys/unix/sysconf $(INSTDIR)/sysconf; $(CHOWN) $(GAMEUID) $(INSTDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(INSTDIR)/sysconf; chmod $(VARFILEPERM) $(INSTDIR)/sysconf;
POSTINSTALL+= bdftopcf win/X11/nh10.bdf > $(INSTDIR)/nh10.pcf; ( cd $(INSTDIR); mkfontdir -x .lev );
CFLAGS=-g -O -I../include -DNOTPARMDECL
CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\"
CFLAGS+=-DCOMPRESS=\"/bin/gzip\" -DCOMPRESS_EXTENSION=\".gz\"
CFLAGS+=-DX11_GRAPHICS -DDEFAULT_WINDOW_SYS=\"X11\" -DNOTTYGRAPHICS
CFLAGS+=-DDUMPLOG
CFLAGS+=-DCONFIG_ERROR_SECURE=FALSE
# when building liblua.a, avoid warning that use of tmpnam() should be
# replaced by mkstemp(); the lua code doesn't use nethack's config.h so
# this needs to be passed via make rather than defined in unixconf.h
SYSCFLAGS=-DLUA_USE_POSIX
LINK=$(CC)
WINSRC = $(WINX11SRC)
WINOBJ = $(WINX11OBJ)
WINLIB = $(WINX11LIB)
VARDATND = x11tiles NetHack.ad pet_mark.xbm pilemark.xbm
WINX11LIB = -lXaw -lXmu -lXext -lXt -lX11
CHOWN=true
CHGRP=true
VARDIRPERM = 0755
VARFILEPERM = 0600
GAMEPERM = 0755
# Use XPM format tile file
CFLAGS+=-DUSE_XPM
WINX11LIB+=-lXpm
VARDATND+=rip.xpm
# note: needs libxt-dev libxaw7-dev libx11-dev bdftopcf

View File

@@ -0,0 +1,144 @@
#
# NetHack 3.7 macosx $NHDT-Date: 1596498419 2020/08/03 23:46:59 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.21 $
# Copyright (c) Kenneth Lorber, Kensington, Maryland, 2007.
# NetHack may be freely redistributed. See license for details.
#
#-PRE
# Mac OS X (Darwin) hints file
# This is for Mac OS X 10.4 (Darwin 8.10). Use one of the more specific
# hints files for later versions.
# Useful info: http://www.opensource.apple.com/darwinsource/index.html
# This hints file can build several different types of installations.
# Edit the next section to match the type of build you need.
# 1. Which window system(s) should be included in this binary?
WANT_WIN_TTY=1
#WANT_WIN_X11=1
#WANT_WIN_QT=1
# 1a. What is the default window system?
WANT_DEFAULT=tty
#WANT_DEFAULT=x11
#WANT_DEFAULT=qt
# 1b. If you set WANT_WIN_QT, you need to
# A) set QTDIR either here or in the environment to point to the Qt2 or Qt3
# library installation root. (Qt4 will not work; Qt3 does not presently
# compile under Leopard (MacOSX 10.5) out-of-the-box.)
# B) set XPMLIB to point to the Xpm library
ifdef WANT_WIN_QT
QTDIR=/Developer/Qt
LIBXPM= -L/Developer/SDKs/MacOSX10.3.9.sdk/usr/X11R6/lib -lXpm
endif
# 2. Is this a build for a binary that will be shared among different users
# or will it be private to you?
# If it is shared:
# - it will be owned by the user and group listed
# - you MUST create the user using System Preferences (this will also
# create the group if it is the same as the user)
# - 'make install' must be run as "sudo make install"
#WANT_SHARE_INSTALL=1
GAMEUID = games
GAMEGRP = $(GAMEUID)
#CC=gcc -W -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -DGCC_WARN
CC=gcc -Wall -Wextra -Wno-missing-field-initializers -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wwrite-strings -DGCC_WARN
#
# You shouldn't need to change anything below here.
#
# XXX -g vs -O should go here, -I../include goes in the makefile
CFLAGS=-g -I../include
CFLAGS+=-DNOCLIPPING -DNOMAIL -DNOTPARMDECL -DHACKDIR=\"$(HACKDIR)\"
CFLAGS+= -DDEFAULT_WINDOW_SYS=\"$(WANT_DEFAULT)\" -DDLB
ifdef WANT_WIN_TTY
WINSRC = $(WINTTYSRC)
WINOBJ = $(WINTTYOBJ)
WINLIB = $(WINTTYLIB)
WINTTYLIB=-lncurses
else
CFLAGS += -DNOTTYGRAPHICS
endif
ifdef WANT_WIN_X11
WINSRC += $(WINX11SRC)
WINOBJ += $(WINX11OBJ)
WINLIB += $(WINX11LIB)
LFLAGS=-L/usr/X11R6/lib
VARDATND = x11tiles NetHack.ad pet_mark.xbm pilemark.xbm
POSTINSTALL= bdftopcf win/X11/nh10.bdf > $(INSTDIR)/nh10.pcf; ( cd $(INSTDIR); mkfontdir -x .lev )
CFLAGS += -DX11_GRAPHICS
endif
ifdef WANT_WIN_QT
CFLAGS += -DQT_GRAPHICS -DNOUSER_SOUNDS
CFLAGS += -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4
LINK=g++
WINSRC += $(WINQTSRC)
WINLIB += $(WINQTLIB) $(LIBXPM)
WINLIB += -framework Carbon -framework QuickTime -lz -framework OpenGL
WINLIB += -framework AGL
ifdef WANT_WIN_X11
# prevent duplicate tile.o in WINOBJ
WINOBJ = $(sort $(WINQTOBJ) $(WINX11OBJ))
ifdef WANT_WIN_TTY
WINOBJ += $(WINTTYOBJ)
endif
else
WINOBJ += $(WINQTOBJ)
endif
# XXX if /Developer/qt exists and QTDIR not set, use that
ifndef QTDIR
$(error QTDIR not defined in the environment or Makefile)
endif
# XXX make sure QTDIR points to something reasonable
else
LINK=$(CC)
endif
ifdef WANT_SHARE_INSTALL
# NB: do NOT use $(wildcard ~$(GAMEUID)) since the user may not exist yet.
PREFIX:=/Users/$(GAMEUID)
SHELLDIR=$(PREFIX)/bin
HACKDIR=$(PREFIX)/nethackdir
INSTDIR=$(HACKDIR)
VARDIR=$(HACKDIR)
CHOWN=chown
CHGRP=chgrp
# We run sgid so the game has access to both HACKDIR and user preferences.
GAMEPERM = 02755
VARFILEPERM = 0664
VARDIRPERM = 0775
ROOTCHECK= [[ `id -u` == 0 ]] || ( echo "Must run install with sudo."; exit 1)
# make sure we have group GAMEUID and group GAMEGRP
PREINSTALL= . sys/unix/hints/macosx.sh user $(GAMEUID); . sys/unix/hints/macosx.sh group $(GAMEGRP); mkdir $(SHELLDIR); chown $(GAMEUID) $(SHELLDIR)
POSTINSTALL= touch $(INSTDIR)/sysconf; $(CHOWN) $(GAMEUID) $(INSTDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(INSTDIR)/sysconf; chmod $(VARFILEPERM) $(INSTDIR)/sysconf
CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE
else
PREFIX:=$(wildcard ~)
SHELLDIR=$(PREFIX)/bin
HACKDIR=$(PREFIX)/nethackdir
INSTDIR=$(HACKDIR)
VARDIR=$(HACKDIR)
CHOWN=true
CHGRP=true
GAMEPERM = 0700
VARFILEPERM = 0600
VARDIRPERM = 0700
ifdef WANT_WIN_X11
# XXX install nethack.rc as ~/.nethackrc if no ~/.nethackrc exists
endif
endif
# ~/Library/Preferences/NetHack Defaults
# OPTIONS=name:player,number_pad,menustyle:partial,!time,showexp
# OPTIONS=hilite_pet,toptenwin,msghistory:200,windowtype:Qt
#
# Install.Qt mentions a patch for macos - it's not there (it seems to be in the Qt binary
# package under the docs directory).

View File

@@ -0,0 +1,377 @@
#
# NetHack 3.7 macosx10.11 $NHDT-Date: 1596498420 2020/08/03 23:47:00 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.58 $
# Copyright (c) Kenneth Lorber, Kensington, Maryland, 2015.
# NetHack may be freely redistributed. See license for details.
#
#-PRE
# Mac OS X (Darwin) hints file
# This is for Mac OS X 10.10 through 10.13, and has been tested on 10.11
# (El Capitan) and 10.13. If this doesn't work for some other
# version of Mac OS X, make a new file for that OS, don't change this one.
# And let us know about it.
# Useful info: http://www.opensource.apple.com/darwinsource/index.html
# You'll need to obtain and install XQuartz if you want X11 support.
# (Attempting to run X11.app will describe where to get it.)
# This hints file can build several different types of installations.
# Edit the next section to match the type of build you need.
# 1. Which window system(s) should be included in this binary?
WANT_WIN_TTY=1
#WANT_WIN_X11=1
#WANT_WIN_QT=1
#WANT_WIN_CURSES=1
# 1a. What is the default window system?
WANT_DEFAULT=tty
#WANT_DEFAULT=x11
#WANT_DEFAULT=qt
#WANT_DEFAULT=curses
# 1b. If you set WANT_WIN_QT, you need to
# A) set QTDIR either here or in the environment to point to the Qt2 or Qt3
# library installation root. (Qt4 will not work; Qt3 does not presently
# compile under Leopard (MacOSX 10.5) out-of-the-box.)
# B) set XPMLIB to point to the Xpm library
ifdef WANT_WIN_QT
QTDIR=/Developer/Qt
LIBXPM= -L/opt/X11/lib -lXpm
endif # WANT_WIN_QT
# 2. Is this a build for a binary that will be shared among different users
# or will it be private to you?
# If it is shared:
# - it will be owned by the user and group listed
# - if the user does not exist, you MUST create it before installing
# NetHack
# - if the group does not exist, it will be created.
# NB: if the group already exists and is being used for something
# besides games, you probably want to specify a new group instead
# NB: the group will be created locally; if your computer is centrally
# administered this may not be what you (or your admin) want.
# Consider a non-shared install (WANT_SHARE_INSTALL=0) instead.
# - 'make install' must be run as "sudo make install"
#WANT_SHARE_INSTALL=1
GAMEUID = $(USER)
GAMEGRP = games
# build to run in the source tree - primarily for development. Build with "make all"
#WANT_SOURCE_INSTALL=1
CC=gcc
CXX=g++
# At the moment this is just for debugging, but in the future it could be
# useful for other things. Requires SYSCF and an ANSI compiler.
#WANT_WIN_CHAIN=1
#
# You shouldn't need to change anything below here.
#
ifdef WANT_WIN_QT
LINK = $(CXX)
else
LINK = $(CC)
endif
#CFLAGS+=-W -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -DGCC_WARN
CFLAGS+=-Wall -Wextra -Wno-missing-field-initializers -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wwrite-strings -DGCC_WARN
ifndef WANT_WIN_QT
# these are normally used when compiling nethack's core
CFLAGS+=-ansi -pedantic -Wno-long-long
# but -ansi -pendantic forces C90 sematics and win/Qt/qt_*.cpp trigger
#In file included from .../qt5/include/QtCore/qglobal.h:105:
#.../qt5/include/QtCore/qcompilerdetection.h:561:6:
# error Qt requires a C++11 compiler and yours does not seem to be that.
# so we suppress them when the build includes Qt
endif
# As of LLVM build 2336.1.00, this gives dozens of spurious messages, so
# leave it out by default.
#CFLAGS+=-Wunreachable-code
# XXX -g vs -O should go here, -I../include goes in the makefile
CFLAGS+=-g -I../include
# older binaries use NOCLIPPING, but that disables SIGWINCH
#CFLAGS+=-DNOCLIPPING
CFLAGS+= -DNOMAIL -DNOTPARMDECL -DHACKDIR=\"$(HACKDIR)\"
CFLAGS+= -DDEFAULT_WINDOW_SYS=\"$(WANT_DEFAULT)\" -DDLB
CFLAGS+= -DGREPPATH=\"/usr/bin/grep\"
ifdef WANT_WIN_CHAIN
CFLAGS+= -DWINCHAIN
HINTSRC=$(CHAINSRC)
HINTOBJ=$(CHAINOBJ)
endif
ifdef WANT_WIN_TTY
WINSRC = $(WINTTYSRC)
WINOBJ = $(WINTTYOBJ)
WINLIB = $(WINTTYLIB)
WINTTYLIB=-lncurses
else # !WANT_WIN_TTY
CFLAGS += -DNOTTYGRAPHICS
endif # !WANT_WIN_TTY
ifdef WANT_WIN_CURSES
CFLAGS += -DCURSES_GRAPHICS
WINSRC += $(WINCURSESSRC)
WINOBJ += $(WINCURSESOBJ)
WINLIB += -lncurses
endif
ifdef WANT_WIN_X11
WINX11LIB = -lXaw -lXmu -lXext -lXt -lX11
VARDATND = x11tiles NetHack.ad pet_mark.xbm pilemark.xbm
# -x: if built without dlb, some versions of mkfontdir think *.lev are fonts
POSTINSTALL+= bdftopcf win/X11/nh10.bdf > $(HACKDIR)/nh10.pcf; ( cd $(HACKDIR); mkfontdir -x .lev );
CFLAGS += -DX11_GRAPHICS
# separate from CFLAGS so that we don't pass it to every file
X11CFLAGS = -I/opt/X11/include
# avoid repeated complaints about _X_NONNULL(args...) in <X11/Xfuncproto.h>
X11CFLAGS += -Wno-variadic-macros
ifdef USE_XPM
CFLAGS += -DUSE_XPM
WINX11LIB += -lXpm
VARDATND += rip.xpm
endif
WINSRC += $(WINX11SRC)
WINOBJ += $(WINX11OBJ)
WINLIB += $(WINX11LIB)
LFLAGS=-L/opt/X11/lib
endif # WANT_WIN_X11
ifdef WANT_WIN_QT
CFLAGS += -DQT_GRAPHICS -DNOUSER_SOUNDS
CFLAGS += -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4
WINSRC += $(WINQTSRC)
WINLIB += $(WINQTLIB) $(LIBXPM)
WINLIB += -framework Carbon -framework QuickTime -lz -framework OpenGL
WINLIB += -framework AGL
ifdef WANT_WIN_X11
# prevent duplicate tile.o in WINOBJ
WINOBJ = $(sort $(WINQTOBJ) $(WINX11OBJ))
ifdef WANT_WIN_TTY
WINOBJ += $(WINTTYOBJ)
endif # WANT_WIN_TTY
else # !WANT_WIN_X11
WINOBJ += $(WINQTOBJ)
endif # !WANT_WIN_X11
# XXX if /Developer/qt exists and QTDIR not set, use that
ifndef QTDIR
$(error QTDIR not defined in the environment or Makefile)
endif # QTDIR
# XXX make sure QTDIR points to something reasonable
endif # !WANT_WIN_QT
ifdef WANT_SHARE_INSTALL
# if $GAMEUID is root, we install into roughly proper Mac locations, otherwise
# we install into ~/nethackdir
ifeq ($(GAMEUID),root)
PREFIX:=/Library/NetHack
SHELLDIR=/usr/local/bin
HACKDIR=$(PREFIX)/nethackdir
CHOWN=chown
CHGRP=chgrp
# We run sgid so the game has access to both HACKDIR and user preferences.
GAMEPERM = 02755
else # ! root
PREFIX:=/Users/$(GAMEUID)
SHELLDIR=$(PREFIX)/bin
HACKDIR=$(PREFIX)/Library/NetHack/nethackdir
CHOWN=/usr/bin/true
CHGRP=/usr/bin/true
GAMEPERM = 0500
endif # ! root
VARFILEPERM = 0664
VARDIRPERM = 0775
ROOTCHECK= [[ `id -u` == 0 ]] || ( echo "Must run install with sudo."; exit 1)
# XXX it's nice we don't write over sysconf, but we've already erased it
# make sure we have group GAMEUID and group GAMEGRP
PREINSTALL= . sys/unix/hints/macosx.sh user2 $(GAMEUID); . sys/unix/hints/macosx.sh group2 $(GAMEGRP); mkdir $(SHELLDIR); chown $(GAMEUID) $(SHELLDIR)
POSTINSTALL+= sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(HACKDIR)/sysconf; $(CHOWN) $(GAMEUID) $(HACKDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(HACKDIR)/sysconf; chmod $(VARFILEPERM) $(HACKDIR)/sysconf;
CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE
else ifdef WANT_SOURCE_INSTALL
PREFIX=$(abspath $(NHSROOT))
# suppress nethack.sh
#SHELLDIR=
HACKDIR=$(PREFIX)/playground
CHOWN=/usr/bin/true
CHGRP=/usr/bin/true
GAMEPERM = 0700
VARFILEPERM = 0600
VARDIRPERM = 0700
POSTINSTALL+= sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(HACKDIR)/sysconf;
# We can use "make all" to build the whole thing - but it misses some things:
MOREALL=$(MAKE) install
CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE
else # !WANT_SOURCE_INSTALL
PREFIX:=$(wildcard ~)
SHELLDIR=$(PREFIX)/bin
HACKDIR=$(PREFIX)/nethackdir
CHOWN=/usr/bin/true
CHGRP=/usr/bin/true
GAMEPERM = 0700
VARFILEPERM = 0600
VARDIRPERM = 0700
ifdef WANT_WIN_X11
# install nethack.rc as ~/.nethackrc if no ~/.nethackrc exists
PREINSTALL= cp -n win/X11/nethack.rc ~/.nethackrc || true
endif # WANT_WIN_X11
POSTINSTALL+= sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(HACKDIR)/sysconf; $(CHOWN) $(GAMEUID) $(HACKDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(HACKDIR)/sysconf; chmod $(VARFILEPERM) $(HACKDIR)/sysconf;
CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE
endif # !WANT_SOURCE_INSTALL
INSTDIR=$(HACKDIR)
VARDIR=$(HACKDIR)
# ~/Library/Preferences/NetHack Defaults
# OPTIONS=name:player,number_pad,menustyle:partial,!time,showexp
# OPTIONS=hilite_pet,toptenwin,msghistory:200,windowtype:Qt
#
# Install.Qt mentions a patch for macos - it's not there (it seems to be in the Qt binary
# package under the docs directory).
#-POST
ifdef MAKEFILE_TOP
###
### Packaging
###
# Notes:
# 1) The Apple developer utilities must be installed in the default location.
# 2) Do a normal build before trying to package the game.
# 3) This matches the 3.4.3 Term package, but there are some things that should
# be changed.
ifdef WANT_WIN_TTY
DEVUTIL=/Developer/Applications/Utilities
SVS=$(shell $(NHSROOT)/util/makedefs --svs)
SVSDOT=$(shell $(NHSROOT)/util/makedefs --svs .)
PKGROOT_UG = PKGROOT/$(PREFIX)
PKGROOT_UGLN = PKGROOT/$(HACKDIR)
PKGROOT_BIN = PKGROOT/$(SHELLDIR)
build_tty_pkg:
ifneq (,$(WANT_WIN_X11)$(WANT_WIN_QT))
-echo build_tty_pkg only works for a tty-only build
exit 1
else
rm -rf NetHack-$(SVS)-mac-Term.pkg NetHack-$(SVS)-mac-Term.dmg
$(MAKE) build_package_root
rm -rf RESOURCES
mkdir RESOURCES
#enscript --language=rtf -o - < dat/license >RESOURCES/License.rtf
sys/unix/hints/macosx.sh descplist > RESOURCES/Description.plist
sys/unix/hints/macosx.sh infoplist > Info.plist
mkdir PKGROOT/Applications
#osacompile -o NetHackQt/NetHackQt.app/nethackdir/NetHackRecover.app \
# win/macosx/NetHackRecover.applescript
#cp win/macosx/recover.pl NetHackQt/NetHackQt.app/nethackdir
osacompile -o PKGROOT/Applications/NetHackRecover.app \
win/macosx/NetHackRecover.applescript
cp win/macosx/recover.pl $(PKGROOT_UGLN)
osacompile -o PKGROOT/Applications/NetHackTerm.app \
win/macosx/NetHackTerm.applescript
# XXX integrate into Makefile.doc
(cd doc; cat Guidebook.mn | ../util/makedefs --grep --input - --output - \
| tbl tmac.n - | groff | pstopdf -i -o Guidebook.pdf)
cp doc/Guidebook.pdf $(PKGROOT_UG)/doc/NetHackGuidebook.pdf
osacompile -o PKGROOT/Applications/NetHackGuidebook.app \
win/macosx/NetHackGuidebook.applescript
mkdir -p PKG
pkgbuild --root PKGROOT --identifier org.nethack.term --scripts PKGSCRIPTS PKG/NH-Term.pkg
productbuild --synthesize --product Info.plist --package PKG/NH-Term.pkg Distribution.xml
productbuild --distribution Distribution.xml --resources RESOURCES --package-path PKG NetHack-$(SVS)-mac-Term.pkg
hdiutil create -verbose -srcfolder NetHack-$(SVS)-mac-Term.pkg NetHack-$(SVS)-mac-Term.dmg
build_package_root:
cd src/.. # make sure we are at TOP
rm -rf PKGROOT
mkdir -p $(PKGROOT_UG)/lib $(PKGROOT_BIN) $(PKGROOT_UG)/man/man6 $(PKGROOT_UG)/doc $(PKGROOT_UGLN)
install -p src/nethack $(PKGROOT_BIN)
# XXX should this be called nethackrecover?
install -p util/recover $(PKGROOT_BIN)
install -p doc/nethack.6 $(PKGROOT_UG)/man/man6
install -p doc/recover.6 $(PKGROOT_UG)/man/man6
install -p doc/Guidebook $(PKGROOT_UG)/doc
install -p dat/nhdat $(PKGROOT_UGLN)
sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(PKGROOT_UGLN)/sysconf
cd dat; install -p $(DATNODLB) ../$(PKGROOT_UGLN)
# XXX these files should be somewhere else for good Mac form
touch $(PKGROOT_UGLN)/perm $(PKGROOT_UGLN)/record $(PKGROOT_UGLN)/logfile $(PKGROOT_UGLN)/xlogfile
mkdir $(PKGROOT_UGLN)/save
# XXX what about a news file?
mkdir -p PKGSCRIPTS
echo '#!/bin/sh' > PKGSCRIPTS/postinstall
echo dseditgroup -o create -r '"Games Group"' -s 3600 $(GAMEGRP) >> PKGSCRIPTS/postinstall
echo $(CHOWN) -R $(GAMEUID) $(HACKDIR) >> PKGSCRIPTS/postinstall
echo $(CHGRP) -R $(GAMEGRP) $(HACKDIR) >> PKGSCRIPTS/postinstall
echo $(CHOWN) $(GAMEUID) $(SHELLDIR)/nethack >> PKGSCRIPTS/postinstall
echo $(CHGRP) $(GAMEGRP) $(SHELLDIR)/nethack >> PKGSCRIPTS/postinstall
echo $(CHOWN) $(GAMEUID) $(SHELLDIR)/recover >> PKGSCRIPTS/postinstall
echo $(CHGRP) $(GAMEGRP) $(SHELLDIR)/recover >> PKGSCRIPTS/postinstall
echo chmod $(VARDIRPERM) $(HACKDIR) >> PKGSCRIPTS/postinstall
echo chmod $(VARDIRPERM) $(HACKDIR)/save >> PKGSCRIPTS/postinstall
echo chmod $(FILEPERM) $(HACKDIR)/license >> PKGSCRIPTS/postinstall
echo chmod $(FILEPERM) $(HACKDIR)/nhdat >> PKGSCRIPTS/postinstall
echo chmod $(FILEPERM) $(HACKDIR)/symbols >> PKGSCRIPTS/postinstall
echo chmod $(VARFILEPERM) $(HACKDIR)/perm >> PKGSCRIPTS/postinstall
echo chmod $(VARFILEPERM) $(HACKDIR)/record >> PKGSCRIPTS/postinstall
echo chmod $(VARFILEPERM) $(HACKDIR)/logfile >> PKGSCRIPTS/postinstall
echo chmod $(VARFILEPERM) $(HACKDIR)/xlogfile >> PKGSCRIPTS/postinstall
echo chmod $(VARFILEPERM) $(HACKDIR)/sysconf >> PKGSCRIPTS/postinstall
echo chmod $(GAMEPERM) $(SHELLDIR)/nethack >> PKGSCRIPTS/postinstall
echo chmod $(EXEPERM) $(SHELLDIR)/recover >> PKGSCRIPTS/postinstall
chmod 0775 PKGSCRIPTS/postinstall
endif # end of build_tty_pkg
endif # WANT_WIN_TTY for packaging
ifdef WANT_WIN_QT
# XXX untested and incomplete (see below)
build_qt_pkg:
ifneq (,$(WANT_WIN_X11)$(WANT_WIN_TTY))
-echo build_qt_pkg only works for a qt-only build
exit 1
else
$(MAKE) build_package_root
rm -rf NetHackQt
mkdir -p NetHackQt/NetHackQt.app/nethackdir/save
mkdir NetHackQt/Documentation
cp doc/Guidebook.txt doc/nethack.txt doc/recover.txt NetHackQt/Documentation
osacompile -o NetHackQt/NetHackQt.app/nethackdir/NetHackRecover.app \
win/macosx/NetHackRecover.applescript
cp win/macosx/recover.pl NetHackQt/NetHackQt.app/nethackdir
mkdir -p NetHackQt/NetHackQt.app/Contents/Frameworks
cp $(QTDIR)/libqt-mt.3.dylib NetHackQt/NetHackQt.app/Contents/Frameworks
mkdir NetHackQt/NetHackQt.app/Contents/MacOS
mv PKGROOT/nethack NetHackQt/NetHackQt.app/Contents/MacOS
mv PKGROOT/lib/nethackdir NetHackQt/NetHackQt.app/nethackdir
# XXX still missing:
#NetHackQt/NetHackQt.app
# /Contents
# Info.plist
# Resources/nethack.icns
#NetHackQt/Documentation
#NetHackQtRecover.txt
#NetHack Defaults.txt
#changes.patch XXX is this still needed? why isn't it part of the tree?
# doesn't go here
hdiutil create -verbose -srcfolder NetHackQt NetHack-$(SVS)-macosx-qt.dmg
endif # end of build_qt_pkg
endif # WANT_WIN_QT for packaging
endif # MAKEFILE_TOP

View File

@@ -0,0 +1,371 @@
#
# NetHack 3.7 macosx10.10-qt $NHDT-Date: 1597704795 2020/08/17 22:53:15 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.63 $
# Copyright (c) Kenneth Lorber, Kensington, Maryland, 2015.
# NetHack may be freely redistributed. See license for details.
#
#-PRE
# Mac OS X (Darwin) hints file
# This is for the Qt interface on Mac OS X 10.10 through 10.13, and has
# been tested on 10.11 (El Capitan). If this doesn't work for some other
# version of Mac OS X, make a new file for that OS, don't change this one.
# And let us know about it.
# Useful info: http://www.opensource.apple.com/darwinsource/index.html
# You'll need to obtain and install XQuartz if you want X11 support.
# (Attempting to run X11.app will describe where to get it.)
# This hints file can build several different types of installations.
# Edit the next section to match the type of build you need.
# 1. Which window system(s) should be included in this binary?
WANT_WIN_TTY=1
#WANT_WIN_X11=1
WANT_WIN_QT=1
# 1a. What is the default window system?
#WANT_DEFAULT=tty
#WANT_DEFAULT=X11
WANT_DEFAULT=Qt
# 1b. If you set WANT_WIN_QT, you need to
# A) set QTDIR either here or in the environment to point to the Qt5
# library installation root. (Qt2 or Qt3 will not work.)
ifdef WANT_WIN_QT
# Qt installed via homebrew
QTDIR=$(shell brew --prefix)/opt/qt@5
# Qt installed via macports (qt511 package; 5.13 requires OSX 10.12 or later)
#QTDIR=/opt/local/libexec/qt5
endif # WANT_WIN_QT
# 2. Is this a build for a binary that will be shared among different users
# or will it be private to you?
# If it is shared:
# - it will be owned by the user and group listed
# - if the user does not exist, you MUST create it before installing
# NetHack
# - if the group does not exist, it will be created.
# NB: if the group already exists and is being used for something
# besides games, you probably want to specify a new group instead
# NB: the group will be created locally; if your computer is centrally
# administered this may not be what you (or your admin) want.
# Consider a non-shared install (WANT_SHARE_INSTALL=0) instead.
# - 'make install' must be run as "sudo make install"
#WANT_SHARE_INSTALL=1
GAMEUID = $(USER)
GAMEGRP = games
# build to run in the source tree - primarily for development. Build with "make all"
#WANT_SOURCE_INSTALL=1
CC=clang
CXX=clang++ -std=gnu++11
# At the moment this is just for debugging, but in the future it could be
# useful for other things. Requires SYSCF and an ANSI compiler.
#WANT_WIN_CHAIN=1
#
# You shouldn't need to change anything below here.
#
ifdef WANT_WIN_QT
LINK = $(CXX)
else
LINK = $(CC)
endif
#CFLAGS+=-W -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -DGCC_WARN
CFLAGS+=-Wall -Wextra -Wno-missing-field-initializers -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wwrite-strings -DGCC_WARN
ifndef WANT_WIN_QT
# these are normally used when compiling nethack's core
CFLAGS+=-ansi -pedantic -Wno-long-long
# but -ansi -pendantic forces C90 sematics and win/Qt/qt_*.cpp trigger
#In file included from .../qt5/include/QtCore/qglobal.h:105:
#.../qt5/include/QtCore/qcompilerdetection.h:561:6:
# error Qt requires a C++11 compiler and yours does not seem to be that.
# so we suppress them when the build includes Qt
endif
# As of LLVM build 2336.1.00, this gives dozens of spurious messages, so
# leave it out by default.
#CFLAGS+=-Wunreachable-code
# XXX -g vs -O should go here, -I../include goes in the makefile
CFLAGS+=-g -I../include
# older binaries use NOCLIPPING, but that disables SIGWINCH
#CFLAGS+=-DNOCLIPPING
CFLAGS+= -DNOMAIL -DNOTPARMDECL -DHACKDIR=\"$(HACKDIR)\"
CFLAGS+= -DDEFAULT_WINDOW_SYS=\"$(WANT_DEFAULT)\" -DDLB
CFLAGS+= -DGREPPATH=\"/usr/bin/grep\"
ifdef WANT_WIN_CHAIN
CFLAGS+= -DWINCHAIN
HINTSRC=$(CHAINSRC)
HINTOBJ=$(CHAINOBJ)
endif
WINSRC =
WINOBJ0 =
WINLIB =
VARDATND =
ifdef WANT_WIN_TTY
WINSRC += $(WINTTYSRC)
WINOBJ0 += $(WINTTYOBJ)
WINLIB += $(WINTTYLIB)
WINTTYLIB=-lncurses
else # !WANT_WIN_TTY
CFLAGS += -DNOTTYGRAPHICS
endif # !WANT_WIN_TTY
ifdef WANT_WIN_X11
WINX11LIB = -lXaw -lXmu -lXext -lXt -lX11
VARDATND0 = x11tiles NetHack.ad pet_mark.xbm pilemark.xbm
# -x: if built without dlb, some versions of mkfontdir think *.lev are fonts
POSTINSTALL+= bdftopcf win/X11/nh10.bdf > $(HACKDIR)/nh10.pcf; ( cd $(HACKDIR); mkfontdir -x .lev );
CFLAGS += -DX11_GRAPHICS
# separate from CFLAGS so that we don't pass it to every file
X11CFLAGS = -I/opt/X11/include
# avoid repeated complaints about _X_NONNULL(args...) in <X11/Xfuncproto.h>
X11CFLAGS += -Wno-variadic-macros
ifdef USE_XPM
CFLAGS += -DUSE_XPM
WINX11LIB += -lXpm
VARDATND0 += rip.xpm
endif
WINSRC += $(WINX11SRC)
WINOBJ0 += $(WINX11OBJ)
WINLIB += $(WINX11LIB)
LFLAGS=-L/opt/X11/lib
endif # WANT_WIN_X11
ifdef WANT_WIN_QT
CFLAGS += -DQT_GRAPHICS -DNOUSER_SOUNDS
QTCXXFLAGS += -Wno-deprecated-declarations
QTCXXFLAGS += $(shell PKG_CONFIG_PATH=$(QTDIR)/lib/pkgconfig pkg-config Qt5Gui Qt5Widgets Qt5Multimedia --cflags)
WINLIB += $(shell PKG_CONFIG_PATH=$(QTDIR)/lib/pkgconfig pkg-config Qt5Gui Qt5Widgets Qt5Multimedia --libs)
WINSRC += $(WINQTSRC)
WINOBJ0 += $(WINQTOBJ)
VARDATND0 = nhtiles.bmp rip.xpm nhsplash.xpm
MOC = moc
# XXX if /Developer/qt exists and QTDIR not set, use that
ifndef QTDIR
$(error QTDIR not defined in the environment or Makefile)
endif # QTDIR
# XXX make sure QTDIR points to something reasonable
endif # WANT_WIN_QT
# prevent duplicate tile.o in WINOBJ
WINOBJ = $(sort $(WINOBJ0))
# also prevent duplicate data files if both X11 and Qt are being supported
VARDATND+= $(sort $(VARDATND0))
ifdef WANT_SHARE_INSTALL
# if $GAMEUID is root, we install into roughly proper Mac locations, otherwise
# we install into ~/nethackdir
ifeq ($(GAMEUID),root)
PREFIX:=/Library/NetHack
SHELLDIR=/usr/local/bin
HACKDIR=$(PREFIX)/nethackdir
CHOWN=chown
CHGRP=chgrp
# We run sgid so the game has access to both HACKDIR and user preferences.
GAMEPERM = 02755
else # ! root
PREFIX:=/Users/$(GAMEUID)
SHELLDIR=$(PREFIX)/bin
HACKDIR=$(PREFIX)/Library/NetHack/nethackdir
CHOWN=/usr/bin/true
CHGRP=/usr/bin/true
GAMEPERM = 0500
endif # ! root
VARFILEPERM = 0664
VARDIRPERM = 0775
ROOTCHECK= [[ `id -u` == 0 ]] || ( echo "Must run install with sudo."; exit 1)
# XXX it's nice we don't write over sysconf, but we've already erased it
# make sure we have group GAMEUID and group GAMEGRP
PREINSTALL= . sys/unix/hints/macosx.sh user2 $(GAMEUID); . sys/unix/hints/macosx.sh group2 $(GAMEGRP); mkdir $(SHELLDIR); chown $(GAMEUID) $(SHELLDIR)
POSTINSTALL+= sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(HACKDIR)/sysconf; $(CHOWN) $(GAMEUID) $(HACKDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(HACKDIR)/sysconf; chmod $(VARFILEPERM) $(HACKDIR)/sysconf;
CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE
else ifdef WANT_SOURCE_INSTALL
PREFIX=$(abspath $(NHSROOT))
# suppress nethack.sh
#SHELLDIR=
HACKDIR=$(PREFIX)/playground
CHOWN=/usr/bin/true
CHGRP=/usr/bin/true
GAMEPERM = 0700
VARFILEPERM = 0600
VARDIRPERM = 0700
POSTINSTALL+= sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(HACKDIR)/sysconf;
# We can use "make all" to build the whole thing - but it misses some things:
MOREALL=$(MAKE) install
CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE
else # !WANT_SOURCE_INSTALL
PREFIX:=$(wildcard ~)
SHELLDIR=$(PREFIX)/bin
HACKDIR=$(PREFIX)/nethackdir
CHOWN=/usr/bin/true
CHGRP=/usr/bin/true
GAMEPERM = 0700
VARFILEPERM = 0600
VARDIRPERM = 0700
ifdef WANT_WIN_X11
# install nethack.rc as ~/.nethackrc if no ~/.nethackrc exists
PREINSTALL= cp -n win/X11/nethack.rc ~/.nethackrc || true
endif # WANT_WIN_X11
POSTINSTALL+= sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(HACKDIR)/sysconf; $(CHOWN) $(GAMEUID) $(HACKDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(HACKDIR)/sysconf; chmod $(VARFILEPERM) $(HACKDIR)/sysconf;
CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE
endif # !WANT_SOURCE_INSTALL
INSTDIR=$(HACKDIR)
VARDIR=$(HACKDIR)
# ~/Library/Preferences/NetHack Defaults
# OPTIONS=name:player,number_pad,menustyle:partial,!time,showexp
# OPTIONS=hilite_pet,toptenwin,msghistory:200,windowtype:Qt
#
# Install.Qt mentions a patch for macos - it's not there (it seems to be in the Qt binary
# package under the docs directory).
#-POST
ifdef MAKEFILE_TOP
###
### Packaging
###
# Notes:
# 1) The Apple developer utilities must be installed in the default location.
# 2) Do a normal build before trying to package the game.
# 3) This matches the 3.4.3 Term package, but there are some things that should
# be changed.
ifdef WANT_WIN_TTY
DEVUTIL=/Developer/Applications/Utilities
SVS=$(shell $(NHSROOT)/util/makedefs --svs)
SVSDOT=$(shell $(NHSROOT)/util/makedefs --svs .)
PKGROOT_UG = PKGROOT/$(PREFIX)
PKGROOT_UGLN = PKGROOT/$(HACKDIR)
PKGROOT_BIN = PKGROOT/$(SHELLDIR)
build_tty_pkg:
ifneq (,$(WANT_WIN_X11)$(WANT_WIN_QT))
-echo build_tty_pkg only works for a tty-only build
exit 1
else
rm -rf NetHack-$(SVS)-mac-Term.pkg NetHack-$(SVS)-mac-Term.dmg
$(MAKE) build_package_root
rm -rf RESOURCES
mkdir RESOURCES
#enscript --language=rtf -o - < dat/license >RESOURCES/License.rtf
sys/unix/hints/macosx.sh descplist > RESOURCES/Description.plist
sys/unix/hints/macosx.sh infoplist > Info.plist
mkdir PKGROOT/Applications
#osacompile -o NetHackQt/NetHackQt.app/nethackdir/NetHackRecover.app \
# win/macosx/NetHackRecover.applescript
#cp win/macosx/recover.pl NetHackQt/NetHackQt.app/nethackdir
osacompile -o PKGROOT/Applications/NetHackRecover.app \
win/macosx/NetHackRecover.applescript
cp win/macosx/recover.pl $(PKGROOT_UGLN)
osacompile -o PKGROOT/Applications/NetHackTerm.app \
win/macosx/NetHackTerm.applescript
# XXX integrate into Makefile.doc
(cd doc; cat Guidebook.mn | ../util/makedefs --grep --input - --output - \
| tbl tmac.n - | groff | pstopdf -i -o Guidebook.pdf)
cp doc/Guidebook.pdf $(PKGROOT_UG)/doc/NetHackGuidebook.pdf
osacompile -o PKGROOT/Applications/NetHackGuidebook.app \
win/macosx/NetHackGuidebook.applescript
mkdir -p PKG
pkgbuild --root PKGROOT --identifier org.nethack.term --scripts PKGSCRIPTS PKG/NH-Term.pkg
productbuild --synthesize --product Info.plist --package PKG/NH-Term.pkg Distribution.xml
productbuild --distribution Distribution.xml --resources RESOURCES --package-path PKG NetHack-$(SVS)-mac-Term.pkg
hdiutil create -verbose -srcfolder NetHack-$(SVS)-mac-Term.pkg NetHack-$(SVS)-mac-Term.dmg
build_package_root:
cd src/.. # make sure we are at TOP
rm -rf PKGROOT
mkdir -p $(PKGROOT_UG)/lib $(PKGROOT_BIN) $(PKGROOT_UG)/man/man6 $(PKGROOT_UG)/doc $(PKGROOT_UGLN)
install -p src/nethack $(PKGROOT_BIN)
# XXX should this be called nethackrecover?
install -p util/recover $(PKGROOT_BIN)
install -p doc/nethack.6 $(PKGROOT_UG)/man/man6
install -p doc/recover.6 $(PKGROOT_UG)/man/man6
install -p doc/Guidebook $(PKGROOT_UG)/doc
install -p dat/nhdat $(PKGROOT_UGLN)
sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(PKGROOT_UGLN)/sysconf
cd dat; install -p $(DATNODLB) ../$(PKGROOT_UGLN)
# XXX these files should be somewhere else for good Mac form
touch $(PKGROOT_UGLN)/perm $(PKGROOT_UGLN)/record $(PKGROOT_UGLN)/logfile $(PKGROOT_UGLN)/xlogfile
mkdir $(PKGROOT_UGLN)/save
# XXX what about a news file?
mkdir -p PKGSCRIPTS
echo '#!/bin/sh' > PKGSCRIPTS/postinstall
echo dseditgroup -o create -r '"Games Group"' -s 3600 $(GAMEGRP) >> PKGSCRIPTS/postinstall
echo $(CHOWN) -R $(GAMEUID) $(HACKDIR) >> PKGSCRIPTS/postinstall
echo $(CHGRP) -R $(GAMEGRP) $(HACKDIR) >> PKGSCRIPTS/postinstall
echo $(CHOWN) $(GAMEUID) $(SHELLDIR)/nethack >> PKGSCRIPTS/postinstall
echo $(CHGRP) $(GAMEGRP) $(SHELLDIR)/nethack >> PKGSCRIPTS/postinstall
echo $(CHOWN) $(GAMEUID) $(SHELLDIR)/recover >> PKGSCRIPTS/postinstall
echo $(CHGRP) $(GAMEGRP) $(SHELLDIR)/recover >> PKGSCRIPTS/postinstall
echo chmod $(VARDIRPERM) $(HACKDIR) >> PKGSCRIPTS/postinstall
echo chmod $(VARDIRPERM) $(HACKDIR)/save >> PKGSCRIPTS/postinstall
echo chmod $(FILEPERM) $(HACKDIR)/license >> PKGSCRIPTS/postinstall
echo chmod $(FILEPERM) $(HACKDIR)/nhdat >> PKGSCRIPTS/postinstall
echo chmod $(FILEPERM) $(HACKDIR)/symbols >> PKGSCRIPTS/postinstall
echo chmod $(VARFILEPERM) $(HACKDIR)/perm >> PKGSCRIPTS/postinstall
echo chmod $(VARFILEPERM) $(HACKDIR)/record >> PKGSCRIPTS/postinstall
echo chmod $(VARFILEPERM) $(HACKDIR)/logfile >> PKGSCRIPTS/postinstall
echo chmod $(VARFILEPERM) $(HACKDIR)/xlogfile >> PKGSCRIPTS/postinstall
echo chmod $(VARFILEPERM) $(HACKDIR)/sysconf >> PKGSCRIPTS/postinstall
echo chmod $(GAMEPERM) $(SHELLDIR)/nethack >> PKGSCRIPTS/postinstall
echo chmod $(EXEPERM) $(SHELLDIR)/recover >> PKGSCRIPTS/postinstall
chmod 0775 PKGSCRIPTS/postinstall
endif # end of build_tty_pkg
endif # WANT_WIN_TTY for packaging
ifdef WANT_WIN_QT
# XXX untested and incomplete (see below)
build_qt_pkg:
ifneq (,$(WANT_WIN_X11)$(WANT_WIN_TTY))
-echo build_qt_pkg only works for a qt-only build
exit 1
else
$(MAKE) build_package_root
rm -rf NetHackQt
mkdir -p NetHackQt/NetHackQt.app/nethackdir/save
mkdir NetHackQt/Documentation
cp doc/Guidebook.txt doc/nethack.txt doc/recover.txt NetHackQt/Documentation
osacompile -o NetHackQt/NetHackQt.app/nethackdir/NetHackRecover.app \
win/macosx/NetHackRecover.applescript
cp win/macosx/recover.pl NetHackQt/NetHackQt.app/nethackdir
mkdir -p NetHackQt/NetHackQt.app/Contents/Frameworks
cp $(QTDIR)/libqt-mt.3.dylib NetHackQt/NetHackQt.app/Contents/Frameworks
mkdir NetHackQt/NetHackQt.app/Contents/MacOS
mv PKGROOT/nethack NetHackQt/NetHackQt.app/Contents/MacOS
mv PKGROOT/lib/nethackdir NetHackQt/NetHackQt.app/nethackdir
# XXX still missing:
#NetHackQt/NetHackQt.app
# /Contents
# Info.plist
# Resources/nethack.icns
#NetHackQt/Documentation
#NetHackQtRecover.txt
#NetHack Defaults.txt
#changes.patch XXX is this still needed? why isn't it part of the tree?
# doesn't go here
hdiutil create -verbose -srcfolder NetHackQt NetHack-$(SVS)-macosx-qt.dmg
endif # end of build_qt_pkg
endif # WANT_WIN_QT for packaging
endif # MAKEFILE_TOP

View File

@@ -0,0 +1,405 @@
#
# NetHack 3.7 macosx10.14 $NHDT-Date: 1596498422 2020/08/03 23:47:02 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.64 $
# Copyright (c) Kenneth Lorber, Kensington, Maryland, 2015.
# NetHack may be freely redistributed. See license for details.
#
#-PRE
# Mac OS X (Darwin) hints file
# This is for Mac OS X 10.14 or later.
# If this doesn't work for some other
# version of Mac OS X, make a new file for that OS, don't change this one.
# And let us know about it.
# Useful info: http://www.opensource.apple.com/darwinsource/index.html
# You'll need to obtain and install XQuartz if you want X11 support.
# (Attempting to run X11.app will describe where to get it.)
# This hints file can build several different types of installations.
# Edit the next section to match the type of build you need.
# 1. Which window system(s) should be included in this binary?
WANT_WIN_TTY=1
#WANT_WIN_X11=1
#WANT_WIN_QT=1
#WANT_WIN_CURSES=1
# 1a. What is the default window system?
WANT_DEFAULT=tty
#WANT_DEFAULT=x11
#WANT_DEFAULT=qt
#WANT_DEFAULT=curses
# 1b. If you set WANT_WIN_QT, you need to
# A) set QTDIR either here or in the environment to point to the Qt2 or Qt3
# library installation root. (Qt4 will not work; Qt3 does not presently
# compile under Leopard (MacOSX 10.5) out-of-the-box.)
# B) set XPMLIB to point to the Xpm library
ifdef WANT_WIN_QT
QTDIR=/Developer/Qt
LIBXPM= -L/opt/X11/lib -lXpm
endif # WANT_WIN_QT
# 2. Is this a build for a binary that will be shared among different users
# or will it be private to you?
# If it is shared:
# - it will be owned by the user and group listed
# - if the user does not exist, you MUST create it before installing
# NetHack
# - if the group does not exist, it will be created.
# NB: if the group already exists and is being used for something
# besides games, you probably want to specify a new group instead
# NB: the group will be created locally; if your computer is centrally
# administered this may not be what you (or your admin) want.
# Consider a non-shared install (WANT_SHARE_INSTALL=0) instead.
# - 'make install' must be run as "sudo make install"
#WANT_SHARE_INSTALL=1
GAMEUID = $(USER)
GAMEGRP = games
# build to run in the source tree - primarily for development. Build with "make all"
#WANT_SOURCE_INSTALL=1
CC=gcc
# At the moment this is just for debugging, but in the future it could be
# useful for other things. Requires SYSCF and an ANSI compiler.
#WANT_WIN_CHAIN=1
#
# You shouldn't need to change anything below here.
#
#CFLAGS+=-W -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -DGCC_WARN
CFLAGS+=-Wall -Wextra -Wno-missing-field-initializers -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wwrite-strings -DGCC_WARN -ansi -pedantic -Wno-long-long
# As of LLVM build 2336.1.00, this gives dozens of spurious messages, so
# leave it out by default.
#CFLAGS+=-Wunreachable-code
# XXX -g vs -O should go here, -I../include goes in the makefile
CFLAGS+=-g -I../include
# older binaries use NOCLIPPING, but that disables SIGWINCH
#CFLAGS+=-DNOCLIPPING
CFLAGS+= -DNOMAIL -DNOTPARMDECL -DHACKDIR=\"$(HACKDIR)\"
CFLAGS+= -DDEFAULT_WINDOW_SYS=\"$(WANT_DEFAULT)\" -DDLB
CFLAGS+= -DGREPPATH=\"/usr/bin/grep\"
ifdef WANT_WIN_CHAIN
CFLAGS+= -DWINCHAIN
HINTSRC=$(CHAINSRC)
HINTOBJ=$(CHAINOBJ)
endif
ifdef WANT_WIN_TTY
WINSRC = $(WINTTYSRC)
WINOBJ = $(WINTTYOBJ)
WINLIB = $(WINTTYLIB)
WINTTYLIB=-lncurses
else # !WANT_WIN_TTY
CFLAGS += -DNOTTYGRAPHICS
endif # !WANT_WIN_TTY
ifdef WANT_WIN_CURSES
CFLAGS += -DCURSES_GRAPHICS
WINSRC += $(WINCURSESSRC)
WINOBJ += $(WINCURSESOBJ)
WINLIB += -lncurses
endif
ifdef WANT_WIN_X11
WINX11LIB = -lXaw -lXmu -lXext -lXt -lX11
VARDATND = x11tiles NetHack.ad pet_mark.xbm pilemark.xbm
POSTINSTALL+= bdftopcf win/X11/nh10.bdf > $(HACKDIR)/nh10.pcf; ( cd $(HACKDIR); mkfontdir -x .lev );
# separate from CFLAGS so that we don't pass it to every file
X11CFLAGS = -I/opt/X11/include
CFLAGS += -DX11_GRAPHICS
# avoid repeated complaints about _X_NONNULL(args...) in <X11/Xfuncproto.h>
X11CFLAGS += -Wno-variadic-macros
ifdef USE_XPM
CFLAGS += -DUSE_XPM
WINX11LIB += -lXpm
VARDATND += rip.xpm
endif
WINSRC += $(WINX11SRC)
WINOBJ += $(WINX11OBJ)
WINLIB += $(WINX11LIB)
LFLAGS=-L/opt/X11/lib
endif # WANT_WIN_X11
ifdef WANT_WIN_QT
CFLAGS += -DQT_GRAPHICS -DNOUSER_SOUNDS
CFLAGS += -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4
LINK=g++
WINSRC += $(WINQTSRC)
WINLIB += $(WINQTLIB) $(LIBXPM)
WINLIB += -framework Carbon -framework QuickTime -lz -framework OpenGL
WINLIB += -framework AGL
ifdef WANT_WIN_X11
# prevent duplicate tile.o in WINOBJ
WINOBJ = $(sort $(WINQTOBJ) $(WINX11OBJ))
ifdef WANT_WIN_TTY
WINOBJ += $(WINTTYOBJ)
endif # WANT_WIN_TTY
else # !WANT_WIN_X11
WINOBJ += $(WINQTOBJ)
endif # !WANT_WIN_X11
# XXX if /Developer/qt exists and QTDIR not set, use that
ifndef QTDIR
$(error QTDIR not defined in the environment or Makefile)
endif # QTDIR
# XXX make sure QTDIR points to something reasonable
else # !WANT_WIN_QT
LINK=$(CC)
endif # !WANT_WIN_QT
ifdef WANT_SHARE_INSTALL
# if $GAMEUID is root, we install into roughly proper Mac locations, otherwise
# we install into ~/nethackdir
ifeq ($(GAMEUID),root)
PREFIX:=/Library/NetHack
SHELLDIR=/usr/local/bin
HACKDIR=$(PREFIX)/nethackdir
CHOWN=chown
CHGRP=chgrp
# We run sgid so the game has access to both HACKDIR and user preferences.
GAMEPERM = 02755
else # ! root
PREFIX:=/Users/$(GAMEUID)
SHELLDIR=$(PREFIX)/bin
HACKDIR=$(PREFIX)/Library/NetHack/nethackdir
CHOWN=/usr/bin/true
CHGRP=/usr/bin/true
GAMEPERM = 0500
endif # ! root
VARFILEPERM = 0664
VARDIRPERM = 0775
ROOTCHECK= [[ `id -u` == 0 ]] || ( echo "Must run install with sudo."; exit 1)
# XXX it's nice we don't write over sysconf, but we've already erased it
# make sure we have group GAMEUID and group GAMEGRP
PREINSTALL= . sys/unix/hints/macosx.sh user2 $(GAMEUID); . sys/unix/hints/macosx.sh group2 $(GAMEGRP); mkdir $(SHELLDIR); chown $(GAMEUID) $(SHELLDIR)
POSTINSTALL+= sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(HACKDIR)/sysconf; $(CHOWN) $(GAMEUID) $(HACKDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(HACKDIR)/sysconf; chmod $(VARFILEPERM) $(HACKDIR)/sysconf;
CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE
else ifdef WANT_SOURCE_INSTALL
PREFIX=$(abspath $(NHSROOT))
# suppress nethack.sh
#SHELLDIR=
HACKDIR=$(PREFIX)/playground
CHOWN=/usr/bin/true
CHGRP=/usr/bin/true
GAMEPERM = 0700
VARFILEPERM = 0600
VARDIRPERM = 0700
POSTINSTALL+= sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(HACKDIR)/sysconf;
# We can use "make all" to build the whole thing - but it misses some things:
MOREALL=$(MAKE) install
CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE
else # !WANT_SOURCE_INSTALL
PREFIX:=$(wildcard ~)
SHELLDIR=$(PREFIX)/bin
HACKDIR=$(PREFIX)/nethackdir
CHOWN=/usr/bin/true
CHGRP=/usr/bin/true
GAMEPERM = 0700
VARFILEPERM = 0600
VARDIRPERM = 0700
ifdef WANT_WIN_X11
# install nethack.rc as ~/.nethackrc if no ~/.nethackrc exists
PREINSTALL= cp -n win/X11/nethack.rc ~/.nethackrc || true
endif # WANT_WIN_X11
POSTINSTALL+= sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(HACKDIR)/sysconf; $(CHOWN) $(GAMEUID) $(HACKDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(HACKDIR)/sysconf; chmod $(VARFILEPERM) $(HACKDIR)/sysconf;
CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE
endif # !WANT_SOURCE_INSTALL
INSTDIR=$(HACKDIR)
VARDIR=$(HACKDIR)
# ~/Library/Preferences/NetHack Defaults
# OPTIONS=name:player,number_pad,menustyle:partial,!time,showexp
# OPTIONS=hilite_pet,toptenwin,msghistory:200,windowtype:Qt
#
# Install.Qt mentions a patch for macos - it's not there (it seems to be in the Qt binary
# package under the docs directory).
#-POST
ifdef MAKEFILE_TOP
###
### Packaging
###
# Notes:
# 1) The Apple developer utilities must be installed in the default location.
# 2) Do a normal build before trying to package the game.
# 3) This matches the 3.4.3 Term package, but there are some things that
# should be changed.
#
# Packages that are being distributed must be signed by a Developer ID
# Installer certificate. Set DEVELOPER_CERT to the name of the certificate
# if you wish for your package to be signed for distribution.
#
# If building a package for signing, you must use sudo approriately.
# the binaries and package using sudo but you DO NOT use sudo to sign the
# package. If you use sudo to sign the package, it will fail.
#
# sudo make all
# sudo make build_tty_pkg
# make sign_tty_pkg
#
ifdef WANT_WIN_TTY
DEVUTIL=/Developer/Applications/Utilities
SVS=$(shell $(NHSROOT)/util/makedefs --svs)
SVSDOT=$(shell $(NHSROOT)/util/makedefs --svs .)
PKGROOT_UG = PKGROOT/$(PREFIX)
PKGROOT_UGLN = PKGROOT/$(HACKDIR)
PKGROOT_BIN = PKGROOT/$(SHELLDIR)
#DEVELOPER_CERT = Developer ID Installer: Bart House
DEVELOPER_CERT = NONE
spotless::
rm -rf RESOURCES
rm -rf PKG
rm -rf PKGSCRIPTS
rm -rf PKGROOT
rm -f Info.plist
rm -f Distribution.xml
rm -f NetHack-*-mac-Term*
build_tty_pkg:
ifneq (,$(WANT_WIN_X11)$(WANT_WIN_QT))
-echo build_tty_pkg only works for a tty-only build
exit 1
else
rm -rf NetHack-$(SVS)-mac-Term.pkg NetHack-$(SVS)-mac-Term.dmg
$(MAKE) build_package_root
rm -rf RESOURCES
mkdir RESOURCES
#enscript --language=rtf -o - < dat/license >RESOURCES/License.rtf
sys/unix/hints/macosx.sh descplist > RESOURCES/Description.plist
sys/unix/hints/macosx.sh infoplist > Info.plist
mkdir PKGROOT/Applications
#osacompile -o NetHackQt/NetHackQt.app/nethackdir/NetHackRecover.app \
# win/macosx/NetHackRecover.applescript
#cp win/macosx/recover.pl NetHackQt/NetHackQt.app/nethackdir
osacompile -o PKGROOT/Applications/NetHackRecover.app \
win/macosx/NetHackRecover.applescript
cp win/macosx/recover.pl $(PKGROOT_UGLN)
osacompile -o PKGROOT/Applications/NetHackTerm.app \
win/macosx/NetHackTerm.applescript
# XXX integrate into Makefile.doc
(cd doc; cat Guidebook.mn | ../util/makedefs --grep --input - --output - \
| tbl tmac.n - | groff | pstopdf -i -o Guidebook.pdf)
cp doc/Guidebook.pdf $(PKGROOT_UG)/doc/NetHackGuidebook.pdf
osacompile -o PKGROOT/Applications/NetHackGuidebook.app \
win/macosx/NetHackGuidebook.applescript
mkdir -p PKG
pkgbuild --root PKGROOT --identifier org.nethack.term --scripts PKGSCRIPTS PKG/NH-Term.pkg
productbuild --synthesize --product Info.plist --package PKG/NH-Term.pkg Distribution.xml
productbuild --distribution Distribution.xml --resources RESOURCES --package-path PKG NetHack-$(SVS)-mac-Term-unsigned.pkg
ifeq ($(DEVELOPER_CERT),NONE)
cp NetHack-$(SVS)-mac-Term-unsigned.pkg NetHack-$(SVS)-mac-Term.pkg
hdiutil create -verbose -srcfolder NetHack-$(SVS)-mac-Term-unsigned.pkg NetHack-$(SVS)-mac-Term-unsigned.dmg
@echo -------------------------------------------
@echo PACKAGE IS NOT SIGNED FOR DISTRIBUTION!!!!!
@echo ===========================================
else
@echo "run 'make sign_tty_pkg' to complete package"
endif
sign_tty_pkg:
productsign --timestamp=none --sign "$(DEVELOPER_CERT)" NetHack-$(SVS)-mac-Term-unsigned.pkg NetHack-$(SVS)-mac-Term.pkg || (echo "Package signing failed"; exit 1)
spctl -a -v --type install NetHack-$(SVS)-mac-Term.pkg || (echo "Package not signed properly"; exit 1)
hdiutil create -verbose -srcfolder NetHack-$(SVS)-mac-Term.pkg NetHack-$(SVS)-mac-Term.dmg
build_package_root:
cd src/.. # make sure we are at TOP
rm -rf PKGROOT
mkdir -p $(PKGROOT_UG)/lib $(PKGROOT_BIN) $(PKGROOT_UG)/man/man6 $(PKGROOT_UG)/doc $(PKGROOT_UGLN)
install -p src/nethack $(PKGROOT_BIN)
# XXX should this be called nethackrecover?
install -p util/recover $(PKGROOT_BIN)
install -p doc/nethack.6 $(PKGROOT_UG)/man/man6
install -p doc/recover.6 $(PKGROOT_UG)/man/man6
install -p doc/Guidebook $(PKGROOT_UG)/doc
install -p dat/nhdat $(PKGROOT_UGLN)
sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(PKGROOT_UGLN)/sysconf
cd dat; install -p $(DATNODLB) ../$(PKGROOT_UGLN)
# XXX these files should be somewhere else for good Mac form
touch $(PKGROOT_UGLN)/perm $(PKGROOT_UGLN)/record $(PKGROOT_UGLN)/logfile $(PKGROOT_UGLN)/xlogfile
mkdir $(PKGROOT_UGLN)/save
# XXX what about a news file?
mkdir -p PKGSCRIPTS
echo '#!/bin/sh' > PKGSCRIPTS/postinstall
echo dseditgroup -o create -r '"Games Group"' -s 3600 $(GAMEGRP) >> PKGSCRIPTS/postinstall
echo $(CHOWN) $(GAMEUID) $(HACKDIR) >> PKGSCRIPTS/postinstall
echo $(CHOWN) $(GAMEUID) $(HACKDIR)/* >> PKGSCRIPTS/postinstall
echo $(CHGRP) $(GAMEGRP) $(HACKDIR) >> PKGSCRIPTS/postinstall
echo $(CHGRP) $(GAMEGRP) $(HACKDIR)/* >> PKGSCRIPTS/postinstall
echo $(CHOWN) $(GAMEUID) $(SHELLDIR)/nethack >> PKGSCRIPTS/postinstall
echo $(CHGRP) $(GAMEGRP) $(SHELLDIR)/nethack >> PKGSCRIPTS/postinstall
echo $(CHOWN) $(GAMEUID) $(SHELLDIR)/recover >> PKGSCRIPTS/postinstall
echo $(CHGRP) $(GAMEGRP) $(SHELLDIR)/recover >> PKGSCRIPTS/postinstall
echo chmod $(VARDIRPERM) $(HACKDIR) >> PKGSCRIPTS/postinstall
echo chmod $(VARDIRPERM) $(HACKDIR)/save >> PKGSCRIPTS/postinstall
echo chmod $(FILEPERM) $(HACKDIR)/license >> PKGSCRIPTS/postinstall
echo chmod $(FILEPERM) $(HACKDIR)/nhdat >> PKGSCRIPTS/postinstall
echo chmod $(FILEPERM) $(HACKDIR)/symbols >> PKGSCRIPTS/postinstall
echo chmod $(VARFILEPERM) $(HACKDIR)/perm >> PKGSCRIPTS/postinstall
echo chmod $(VARFILEPERM) $(HACKDIR)/record >> PKGSCRIPTS/postinstall
echo chmod $(VARFILEPERM) $(HACKDIR)/logfile >> PKGSCRIPTS/postinstall
echo chmod $(VARFILEPERM) $(HACKDIR)/xlogfile >> PKGSCRIPTS/postinstall
echo chmod $(VARFILEPERM) $(HACKDIR)/sysconf >> PKGSCRIPTS/postinstall
echo chmod $(GAMEPERM) $(SHELLDIR)/nethack >> PKGSCRIPTS/postinstall
echo chmod $(EXEPERM) $(SHELLDIR)/recover >> PKGSCRIPTS/postinstall
chmod 0775 PKGSCRIPTS/postinstall
endif # end of build_tty_pkg
endif # WANT_WIN_TTY for packaging
ifdef WANT_WIN_QT
# XXX untested and incomplete (see below)
build_qt_pkg:
ifneq (,$(WANT_WIN_X11)$(WANT_WIN_TTY))
-echo build_qt_pkg only works for a qt-only build
exit 1
else
$(MAKE) build_package_root
rm -rf NetHackQt
mkdir -p NetHackQt/NetHackQt.app/nethackdir/save
mkdir NetHackQt/Documentation
cp doc/Guidebook.txt doc/nethack.txt doc/recover.txt NetHackQt/Documentation
osacompile -o NetHackQt/NetHackQt.app/nethackdir/NetHackRecover.app \
win/macosx/NetHackRecover.applescript
cp win/macosx/recover.pl NetHackQt/NetHackQt.app/nethackdir
mkdir -p NetHackQt/NetHackQt.app/Contents/Frameworks
cp $(QTDIR)/libqt-mt.3.dylib NetHackQt/NetHackQt.app/Contents/Frameworks
mkdir NetHackQt/NetHackQt.app/Contents/MacOS
mv PKGROOT/nethack NetHackQt/NetHackQt.app/Contents/MacOS
mv PKGROOT/lib/nethackdir NetHackQt/NetHackQt.app/nethackdir
# XXX still missing:
#NetHackQt/NetHackQt.app
# /Contents
# Info.plist
# Resources/nethack.icns
#NetHackQt/Documentation
#NetHackQtRecover.txt
#NetHack Defaults.txt
#changes.patch XXX is this still needed? why isn't it part of the tree?
# doesn't go here
hdiutil create -verbose -srcfolder NetHackQt NetHack-$(SVS)-macosx-qt.dmg
endif # end of build_qt_pkg
endif # WANT_WIN_QT for packaging
endif # MAKEFILE_TOP

View File

@@ -0,0 +1,306 @@
#
# NetHack 3.7 macosx10.5 $NHDT-Date: 1596498424 2020/08/03 23:47:04 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.34 $
# Copyright (c) Kenneth Lorber, Kensington, Maryland, 2009.
# NetHack may be freely redistributed. See license for details.
#
#-PRE
# Mac OS X (Darwin) hints file
# This is for Mac OS X 10.5 (Darwin 9.3) and also 10.6.
# If this doesn't work for some
# other version of either Darwin or Mac OS X, make a new file for that OS,
# don't change this one. And let us know about it.
# Useful info: http://www.opensource.apple.com/darwinsource/index.html
# This hints file can build several different types of installations.
# Edit the next section to match the type of build you need.
# 1. Which window system(s) should be included in this binary?
WANT_WIN_TTY=1
#WANT_WIN_X11=1
#WANT_WIN_QT=1
# 1a. What is the default window system?
WANT_DEFAULT=tty
#WANT_DEFAULT=x11
#WANT_DEFAULT=qt
# 1b. If you set WANT_WIN_QT, you need to
# A) set QTDIR either here or in the environment to point to the Qt2 or Qt3
# library installation root. (Qt4 will not work; Qt3 does not presently
# compile under Leopard (MacOSX 10.5) out-of-the-box.)
# B) set XPMLIB to point to the Xpm library
ifdef WANT_WIN_QT
QTDIR=/Developer/Qt
LIBXPM= -L/Developer/SDKs/MacOSX10.3.9.sdk/usr/X11R6/lib -lXpm
endif # WANT_WIN_QT
# 2. Is this a build for a binary that will be shared among different users
# or will it be private to you?
# If it is shared:
# - it will be owned by the user and group listed
# - if the user does not exist, you MUST create it before installing
# NetHack
# - if the group does not exist, it will be created.
# NB: if the group already exists and is being used for something
# besides games, you probably want to specify a new group instead
# NB: the group will be created locally; if your computer is centrally
# administered this may not be what you (or your admin) want.
# Consider a non-shared install (WANT_SHARE_INSTALL=0) instead.
# - 'make install' must be run as "sudo make install"
#WANT_SHARE_INSTALL=1
GAMEUID = $(USER)
GAMEGRP = games
# build to run in the source tree - primarily for development. Build with "make all"
#WANT_SOURCE_INSTALL=1
#CC=gcc -W -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -DGCC_WARN
CC=gcc -Wall -Wextra -Wno-missing-field-initializers -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wwrite-strings -DGCC_WARN -ansi -pedantic -Wno-long-long
#
# You shouldn't need to change anything below here.
#
# XXX -g vs -O should go here, -I../include goes in the makefile
CFLAGS=-g -I../include
CFLAGS+=-DNOCLIPPING -DNOMAIL -DNOTPARMDECL -DHACKDIR=\"$(HACKDIR)\"
CFLAGS+= -DDEFAULT_WINDOW_SYS=\"$(WANT_DEFAULT)\" -DDLB
CFLAGS+= -DGREPPATH=\"/usr/bin/grep\"
ifdef WANT_WIN_TTY
WINSRC = $(WINTTYSRC)
WINOBJ = $(WINTTYOBJ)
WINLIB = $(WINTTYLIB)
WINTTYLIB=-lncurses
else # !WANT_WIN_TTY
CFLAGS += -DNOTTYGRAPHICS
endif # !WANT_WIN_TTY
ifdef WANT_WIN_X11
WINX11LIB = -lXaw -lXmu -lXext -lXt -lX11
VARDATND = x11tiles NetHack.ad pet_mark.xbm pilemark.xbm
POSTINSTALL+= bdftopcf win/X11/nh10.bdf > $(INSTDIR)/nh10.pcf; ( cd $(INSTDIR); mkfontdir -x .lev );
CFLAGS += -DX11_GRAPHICS
ifdef USE_XPM
CFLAGS += -DUSE_XPM
WINX11LIB += -lXpm
VARDATND += rip.xpm
endif
WINSRC += $(WINX11SRC)
WINOBJ += $(WINX11OBJ)
WINLIB += $(WINX11LIB)
LFLAGS=-L/usr/X11R6/lib
endif # WANT_WIN_X11
ifdef WANT_WIN_QT
CFLAGS += -DQT_GRAPHICS -DNOUSER_SOUNDS
CFLAGS += -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4
LINK=g++
WINSRC += $(WINQTSRC)
WINLIB += $(WINQTLIB) $(LIBXPM)
WINLIB += -framework Carbon -framework QuickTime -lz -framework OpenGL
WINLIB += -framework AGL
ifdef WANT_WIN_X11
# prevent duplicate tile.o in WINOBJ
WINOBJ = $(sort $(WINQTOBJ) $(WINX11OBJ))
ifdef WANT_WIN_TTY
WINOBJ += $(WINTTYOBJ)
endif # WANT_WIN_TTY
else # !WANT_WIN_X11
WINOBJ += $(WINQTOBJ)
endif # !WANT_WIN_X11
# XXX if /Developer/qt exists and QTDIR not set, use that
ifndef QTDIR
$(error QTDIR not defined in the environment or Makefile)
endif # QTDIR
# XXX make sure QTDIR points to something reasonable
else # !WANT_WIN_QT
LINK=$(CC)
endif # !WANT_WIN_QT
ifdef WANT_SHARE_INSTALL
# if $GAMEUID is root, we install into roughly proper Mac locations, otherwise
# we install into ~/nethackdir
ifeq ($(GAMEUID),root)
PREFIX:=/Library/NetHack
SHELLDIR=/usr/local/bin
HACKDIR=$(PREFIX)/nethackdir
INSTDIR=$(HACKDIR)
VARDIR=$(HACKDIR)
CHOWN=chown
CHGRP=chgrp
# We run sgid so the game has access to both HACKDIR and user preferences.
GAMEPERM = 02755
else # ! root
PREFIX:=/Users/$(GAMEUID)
SHELLDIR=$(PREFIX)/bin
HACKDIR=$(PREFIX)/nethackdir
INSTDIR=$(HACKDIR)
VARDIR=$(HACKDIR)
CHOWN=touch
CHGRP=touch
GAMEPERM = 0500
endif # ! root
VARFILEPERM = 0664
VARDIRPERM = 0775
ROOTCHECK= [[ `id -u` == 0 ]] || ( echo "Must run install with sudo."; exit 1)
# XXX it's nice we don't write over sysconf, but we've already erased it
# make sure we have group GAMEUID and group GAMEGRP
PREINSTALL= . sys/unix/hints/macosx.sh user2 $(GAMEUID); . sys/unix/hints/macosx.sh group2 $(GAMEGRP); mkdir $(SHELLDIR); chown $(GAMEUID) $(SHELLDIR)
POSTINSTALL+= sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(INSTDIR)/sysconf; $(CHOWN) $(GAMEUID) $(INSTDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(INSTDIR)/sysconf; chmod $(VARFILEPERM) $(INSTDIR)/sysconf;
CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE
else ifdef WANT_SOURCE_INSTALL
PREFIX=$(abspath $(NHSROOT))
# suppress nethack.sh"
#SHELLDIR=
HACKDIR=$(PREFIX)/playground
INSTDIR=$(HACKDIR)
VARDIR=$(HACKDIR)
CHOWN=touch
CHGRP=touch
GAMEPERM = 0700
VARFILEPERM = 0600
VARDIRPERM = 0700
# We can use "make all" to build the whole thing - but it misses some things:
MOREALL=$(MAKE) install
else # !WANT_SOURCE_INSTALL
PREFIX:=$(wildcard ~)
SHELLDIR=$(PREFIX)/bin
HACKDIR=$(PREFIX)/nethackdir
INSTDIR=$(HACKDIR)
VARDIR=$(HACKDIR)
CHOWN=true
CHGRP=true
GAMEPERM = 0700
VARFILEPERM = 0600
VARDIRPERM = 0700
ifdef WANT_WIN_X11
# install nethack.rc as ~/.nethackrc if no ~/.nethackrc exists
PREINSTALL= cp -n win/X11/nethack.rc ~/.nethackrc || true
endif # WANT_WIN_X11
POSTINSTALL+= sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(INSTDIR)/sysconf; $(CHOWN) $(GAMEUID) $(INSTDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(INSTDIR)/sysconf; chmod $(VARFILEPERM) $(INSTDIR)/sysconf;
CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE
endif # !WANT_SOURCE_INSTALL
# ~/Library/Preferences/NetHack Defaults
# OPTIONS=name:player,number_pad,menustyle:partial,!time,showexp
# OPTIONS=hilite_pet,toptenwin,msghistory:200,windowtype:Qt
#
# Install.Qt mentions a patch for macos - it's not there (it seems to be in the Qt binary
# package under the docs directory).
#-POST
ifdef MAKEFILE_TOP
###
### Packaging
###
# Notes:
# 1) The Apple developer utilities must be installed in the default location.
# 2) Do a normal build before trying to package the game.
# 3) This matches the 3.4.3 Term package, but there are some things that should
# be changed.
ifdef WANT_WIN_TTY
DEVUTIL=/Developer/Applications/Utilities
PKGR=$(DEVUTIL)/PackageMaker.app/Contents/MacOS/PackageMaker
SVS=$(shell $(NHSROOT)/util/makedefs --svs)
SVSDOT=$(shell $(NHSROOT)/util/makedefs --svs .)
PKGROOT_UG = PKGROOT/usr/games
PKGROOT_UGLN = PKGROOT/usr/games/lib/nethackdir
build_tty_pkg:
ifneq (,$(WANT_WIN_X11)$(WANT_WIN_QT))
-echo build_tty_pkg only works for a tty-only build
exit 1
else
rm -rf NetHack-$(SVS)-mac-Term.pkg NetHack-$(SVS)-mac-Term.dmg
$(MAKE) build_package_root
rm -rf RESOURCES
mkdir RESOURCES
#enscript --language=rtf -o - < dat/license >RESOURCES/License.rtf
sys/unix/hints/macosx.sh descplist > RESOURCES/Description.plist
sys/unix/hints/macosx.sh infoplist > Info.plist
mkdir PKGROOT/Applications
#osacompile -o NetHackQt/NetHackQt.app/nethackdir/NetHackRecover.app \
# win/macosx/NetHackRecover.applescript
#cp win/macosx/recover.pl NetHackQt/NetHackQt.app/nethackdir
osacompile -o PKGROOT/Applications/NetHackRecover.app \
win/macosx/NetHackRecover.applescript
cp win/macosx/recover.pl $(PKGROOT_UGLN)
osacompile -o PKGROOT/Applications/NetHackTerm.app \
win/macosx/NetHackTerm.applescript
# XXX integrate into Makefile.doc
(cd doc; cat Guidebook.mn | ../util/makedefs --grep --input - --output - \
| tbl tmac.n - | groff |ps2pdf - > Guidebook.pdf)
cp doc/Guidebook.pdf $(PKGROOT_UG)/doc/NetHackGuidebook.pdf
osacompile -o PKGROOT/Applications/NetHackGuidebook.app \
win/macosx/NetHackGuidebook.applescript
$(PKGR) --root PKGROOT --info Info.plist -e RESOURCES -v -o NetHack-$(SVS)-mac-Term.pkg
hdiutil create -verbose -srcfolder NetHack-$(SVS)-mac-Term.pkg NetHack-$(SVS)-mac-Term.dmg
build_package_root:
cd src/.. # make sure we are at TOP
rm -rf PKGROOT
mkdir -p $(PKGROOT_UG)/lib $(PKGROOT_UG)/bin $(PKGROOT_UG)/man/man6 $(PKGROOT_UG)/doc $(PKGROOT_UGLN)
install -p src/nethack $(PKGROOT_UG)/bin
# XXX should this be called nethackrecover?
install -p util/recover $(PKGROOT_UG)/bin
install -p doc/nethack.6 $(PKGROOT_UG)/man/man6
install -p doc/recover.6 $(PKGROOT_UG)/man/man6
install -p doc/Guidebook $(PKGROOT_UG)/doc
install -p dat/nhdat $(PKGROOT_UGLN)
cd dat; install -p $(DATNODLB) ../$(PKGROOT_UGLN)
# XXX these files should be somewhere else for good Mac form
touch $(PKGROOT_UGLN)/perm $(PKGROOT_UGLN)/record $(PKGROOT_UGLN)/logfile
# XXX may need postinstall script to get perms right for sgid, etc.
mkdir $(PKGROOT_UGLN)/save
# XXX what about a news file?
endif # end of build_tty_pkg
endif # WANT_WIN_TTY for packaging
ifdef WANT_WIN_QT
# XXX untested and incomplete (see below)
build_qt_pkg:
ifneq (,$(WANT_WIN_X11)$(WANT_WIN_TTY))
-echo build_qt_pkg only works for a qt-only build
exit 1
else
$(MAKE) build_package_root
rm -rf NetHackQt
mkdir -p NetHackQt/NetHackQt.app/nethackdir/save
mkdir NetHackQt/Documentation
cp doc/Guidebook.txt doc/nethack.txt doc/recover.txt NetHackQt/Documentation
osacompile -o NetHackQt/NetHackQt.app/nethackdir/NetHackRecover.app \
win/macosx/NetHackRecover.applescript
cp win/macosx/recover.pl NetHackQt/NetHackQt.app/nethackdir
mkdir -p NetHackQt/NetHackQt.app/Contents/Frameworks
cp $(QTDIR)/libqt-mt.3.dylib NetHackQt/NetHackQt.app/Contents/Frameworks
mkdir NetHackQt/NetHackQt.app/Contents/MacOS
mv PKGROOT/nethack NetHackQt/NetHackQt.app/Contents/MacOS
mv PKGROOT/lib/nethackdir NetHackQt/NetHackQt.app/nethackdir
# XXX still missing:
#NetHackQt/NetHackQt.app
# /Contents
# Info.plist
# Resources/nethack.icns
#NetHackQt/Documentation
#NetHackQtRecover.txt
#NetHack Defaults.txt
#changes.patch XXX is this still needed? why isn't it part of the tree?
# doesn't go here
hdiutil create -verbose -srcfolder NetHackQt NetHack-$(SVS)-macosx-qt.dmg
endif # end of build_qt_pkg
endif # WANT_WIN_QT for packaging
endif # MAKEFILE_TOP

View File

@@ -0,0 +1,324 @@
#
# NetHack 3.7 macosx10.7 $NHDT-Date: 1596498424 2020/08/03 23:47:04 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.38 $
# Copyright (c) Kenneth Lorber, Kensington, Maryland, 2009.
# NetHack may be freely redistributed. See license for details.
#
#-PRE
# Mac OS X (Darwin) hints file
# This is for Mac OS X 10.7.
# If this doesn't work for some other version
# of Mac OS X, make a new file for that OS, don't change this one. And
# let us know about it.
# Useful info: http://www.opensource.apple.com/darwinsource/index.html
# This hints file can build several different types of installations.
# Edit the next section to match the type of build you need.
# 1. Which window system(s) should be included in this binary?
WANT_WIN_TTY=1
#WANT_WIN_X11=1
#WANT_WIN_QT=1
# 1a. What is the default window system?
WANT_DEFAULT=tty
#WANT_DEFAULT=x11
#WANT_DEFAULT=qt
# 1b. If you set WANT_WIN_QT, you need to
# A) set QTDIR either here or in the environment to point to the Qt2 or Qt3
# library installation root. (Qt4 will not work; Qt3 does not presently
# compile under Leopard (MacOSX 10.5) out-of-the-box.)
# B) set XPMLIB to point to the Xpm library
ifdef WANT_WIN_QT
QTDIR=/Developer/Qt
LIBXPM= -L/Developer/SDKs/MacOSX10.3.9.sdk/usr/X11R6/lib -lXpm
endif # WANT_WIN_QT
# 2. Is this a build for a binary that will be shared among different users
# or will it be private to you?
# If it is shared:
# - it will be owned by the user and group listed
# - if the user does not exist, you MUST create it before installing
# NetHack
# - if the group does not exist, it will be created.
# NB: if the group already exists and is being used for something
# besides games, you probably want to specify a new group instead
# NB: the group will be created locally; if your computer is centrally
# administered this may not be what you (or your admin) want.
# Consider a non-shared install (WANT_SHARE_INSTALL=0) instead.
# - 'make install' must be run as "sudo make install"
#WANT_SHARE_INSTALL=1
GAMEUID = $(USER)
GAMEGRP = games
# build to run in the source tree - primarily for development. Build with "make all"
#WANT_SOURCE_INSTALL=1
CC=gcc
# At the moment this is just for debugging, but in the future it could be
# useful for other things. Requires SYSCF and an ANSI compiler.
#WANT_WIN_CHAIN=1
#
# You shouldn't need to change anything below here.
#
#CFLAGS+=-W -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -DGCC_WARN
CFLAGS+=-Wall -Wextra -Wno-missing-field-initializers -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wwrite-strings -DGCC_WARN -ansi -pedantic -Wno-long-long
# As of LLVM build 2336.1.00, this gives dozens of spurious messages, so
# leave it out by default.
#CFLAGS+=-Wunreachable-code
# XXX -g vs -O should go here, -I../include goes in the makefile
CFLAGS+=-g -I../include
# older binaries use NOCLIPPING, but that disables SIGWINCH
#CFLAGS+=-DNOCLIPPING
CFLAGS+= -DNOMAIL -DNOTPARMDECL -DHACKDIR=\"$(HACKDIR)\"
CFLAGS+= -DDEFAULT_WINDOW_SYS=\"$(WANT_DEFAULT)\" -DDLB
CFLAGS+= -DGREPPATH=\"/usr/bin/grep\"
ifdef WANT_WIN_CHAIN
CFLAGS+= -DWINCHAIN
HINTSRC=$(CHAINSRC)
HINTOBJ=$(CHAINOBJ)
endif
ifdef WANT_WIN_TTY
WINSRC = $(WINTTYSRC)
WINOBJ = $(WINTTYOBJ)
WINLIB = $(WINTTYLIB)
WINTTYLIB=-lncurses
else # !WANT_WIN_TTY
CFLAGS += -DNOTTYGRAPHICS
endif # !WANT_WIN_TTY
ifdef WANT_WIN_X11
WINX11LIB = -lXaw -lXmu -lXext -lXt -lX11
VARDATND = x11tiles NetHack.ad pet_mark.xbm pilemark.xbm
POSTINSTALL+= bdftopcf win/X11/nh10.bdf > $(INSTDIR)/nh10.pcf; ( cd $(INSTDIR); mkfontdir -x .lev );
CFLAGS += -DX11_GRAPHICS
ifdef USE_XPM
CFLAGS += -DUSE_XPM
WINX11LIB += -lXpm
VARDATND += rip.xpm
endif
WINSRC += $(WINX11SRC)
WINOBJ += $(WINX11OBJ)
WINLIB += $(WINX11LIB)
LFLAGS=-L/usr/X11R6/lib
endif # WANT_WIN_X11
ifdef WANT_WIN_QT
CFLAGS += -DQT_GRAPHICS -DNOUSER_SOUNDS
CFLAGS += -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4
LINK=g++
WINSRC += $(WINQTSRC)
WINLIB += $(WINQTLIB) $(LIBXPM)
WINLIB += -framework Carbon -framework QuickTime -lz -framework OpenGL
WINLIB += -framework AGL
ifdef WANT_WIN_X11
# prevent duplicate tile.o in WINOBJ
WINOBJ = $(sort $(WINQTOBJ) $(WINX11OBJ))
ifdef WANT_WIN_TTY
WINOBJ += $(WINTTYOBJ)
endif # WANT_WIN_TTY
else # !WANT_WIN_X11
WINOBJ += $(WINQTOBJ)
endif # !WANT_WIN_X11
# XXX if /Developer/qt exists and QTDIR not set, use that
ifndef QTDIR
$(error QTDIR not defined in the environment or Makefile)
endif # QTDIR
# XXX make sure QTDIR points to something reasonable
else # !WANT_WIN_QT
LINK=$(CC)
endif # !WANT_WIN_QT
ifdef WANT_SHARE_INSTALL
# if $GAMEUID is root, we install into roughly proper Mac locations, otherwise
# we install into ~/nethackdir
ifeq ($(GAMEUID),root)
PREFIX:=/Library/NetHack
SHELLDIR=/usr/local/bin
HACKDIR=$(PREFIX)/nethackdir
INSTDIR=$(HACKDIR)
VARDIR=$(HACKDIR)
CHOWN=chown
CHGRP=chgrp
# We run sgid so the game has access to both HACKDIR and user preferences.
GAMEPERM = 02755
else # ! root
PREFIX:=/Users/$(GAMEUID)
SHELLDIR=$(PREFIX)/bin
HACKDIR=$(PREFIX)/nethackdir
INSTDIR=$(HACKDIR)
VARDIR=$(HACKDIR)
CHOWN=/usr/bin/true
CHGRP=/usr/bin/true
GAMEPERM = 0500
endif # ! root
VARFILEPERM = 0664
VARDIRPERM = 0775
ROOTCHECK= [[ `id -u` == 0 ]] || ( echo "Must run install with sudo."; exit 1)
# XXX it's nice we don't write over sysconf, but we've already erased it
# make sure we have group GAMEUID and group GAMEGRP
PREINSTALL= . sys/unix/hints/macosx.sh user2 $(GAMEUID); . sys/unix/hints/macosx.sh group2 $(GAMEGRP); mkdir $(SHELLDIR); chown $(GAMEUID) $(SHELLDIR)
POSTINSTALL+= sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(INSTDIR)/sysconf; $(CHOWN) $(GAMEUID) $(INSTDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(INSTDIR)/sysconf; chmod $(VARFILEPERM) $(INSTDIR)/sysconf;
CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE
else ifdef WANT_SOURCE_INSTALL
PREFIX=$(abspath $(NHSROOT))
# suppress nethack.sh
#SHELLDIR=
HACKDIR=$(PREFIX)/playground
INSTDIR=$(HACKDIR)
VARDIR=$(HACKDIR)
CHOWN=/usr/bin/true
CHGRP=/usr/bin/true
GAMEPERM = 0700
VARFILEPERM = 0600
VARDIRPERM = 0700
# We can use "make all" to build the whole thing - but it misses some things:
MOREALL=$(MAKE) install
CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE
else # !WANT_SOURCE_INSTALL
PREFIX:=$(wildcard ~)
SHELLDIR=$(PREFIX)/bin
HACKDIR=$(PREFIX)/nethackdir
INSTDIR=$(HACKDIR)
VARDIR=$(HACKDIR)
CHOWN=/usr/bin/true
CHGRP=/usr/bin/true
GAMEPERM = 0700
VARFILEPERM = 0600
VARDIRPERM = 0700
ifdef WANT_WIN_X11
# install nethack.rc as ~/.nethackrc if no ~/.nethackrc exists
PREINSTALL= cp -n win/X11/nethack.rc ~/.nethackrc || true
endif # WANT_WIN_X11
POSTINSTALL+= sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(INSTDIR)/sysconf; $(CHOWN) $(GAMEUID) $(INSTDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(INSTDIR)/sysconf; chmod $(VARFILEPERM) $(INSTDIR)/sysconf;
CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE
endif # !WANT_SOURCE_INSTALL
# ~/Library/Preferences/NetHack Defaults
# OPTIONS=name:player,number_pad,menustyle:partial,!time,showexp
# OPTIONS=hilite_pet,toptenwin,msghistory:200,windowtype:Qt
#
# Install.Qt mentions a patch for macos - it's not there (it seems to be in the Qt binary
# package under the docs directory).
#-POST
ifdef MAKEFILE_TOP
###
### Packaging
###
# Notes:
# 1) The Apple developer utilities must be installed in the default location.
# 2) Do a normal build before trying to package the game.
# 3) This matches the 3.4.3 Term package, but there are some things that should
# be changed.
ifdef WANT_WIN_TTY
DEVUTIL=/Developer/Applications/Utilities
PKGR=$(DEVUTIL)/PackageMaker.app/Contents/MacOS/PackageMaker
SVS=$(shell $(NHSROOT)/util/makedefs --svs)
SVSDOT=$(shell $(NHSROOT)/util/makedefs --svs .)
PKGROOT_UG = PKGROOT/usr/games
PKGROOT_UGLN = PKGROOT/usr/games/lib/nethackdir
build_tty_pkg:
ifneq (,$(WANT_WIN_X11)$(WANT_WIN_QT))
-echo build_tty_pkg only works for a tty-only build
exit 1
else
rm -rf NetHack-$(SVS)-mac-Term.pkg NetHack-$(SVS)-mac-Term.dmg
$(MAKE) build_package_root
rm -rf RESOURCES
mkdir RESOURCES
#enscript --language=rtf -o - < dat/license >RESOURCES/License.rtf
sys/unix/hints/macosx.sh descplist > RESOURCES/Description.plist
sys/unix/hints/macosx.sh infoplist > Info.plist
mkdir PKGROOT/Applications
#osacompile -o NetHackQt/NetHackQt.app/nethackdir/NetHackRecover.app \
# win/macosx/NetHackRecover.applescript
#cp win/macosx/recover.pl NetHackQt/NetHackQt.app/nethackdir
osacompile -o PKGROOT/Applications/NetHackRecover.app \
win/macosx/NetHackRecover.applescript
cp win/macosx/recover.pl $(PKGROOT_UGLN)
osacompile -o PKGROOT/Applications/NetHackTerm.app \
win/macosx/NetHackTerm.applescript
# XXX integrate into Makefile.doc
(cd doc; cat Guidebook.mn | ../util/makedefs --grep --input - --output - \
| tbl tmac.n - | groff |ps2pdf - > Guidebook.pdf)
cp doc/Guidebook.pdf $(PKGROOT_UG)/doc/NetHackGuidebook.pdf
osacompile -o PKGROOT/Applications/NetHackGuidebook.app \
win/macosx/NetHackGuidebook.applescript
$(PKGR) --root PKGROOT --info Info.plist -e RESOURCES -v -o NetHack-$(SVS)-mac-Term.pkg
hdiutil create -verbose -srcfolder NetHack-$(SVS)-mac-Term.pkg NetHack-$(SVS)-mac-Term.dmg
build_package_root:
cd src/.. # make sure we are at TOP
rm -rf PKGROOT
mkdir -p $(PKGROOT_UG)/lib $(PKGROOT_UG)/bin $(PKGROOT_UG)/man/man6 $(PKGROOT_UG)/doc $(PKGROOT_UGLN)
install -p src/nethack $(PKGROOT_UG)/bin
# XXX should this be called nethackrecover?
install -p util/recover $(PKGROOT_UG)/bin
install -p doc/nethack.6 $(PKGROOT_UG)/man/man6
install -p doc/recover.6 $(PKGROOT_UG)/man/man6
install -p doc/Guidebook $(PKGROOT_UG)/doc
install -p dat/nhdat $(PKGROOT_UGLN)
cd dat; install -p $(DATNODLB) ../$(PKGROOT_UGLN)
# XXX these files should be somewhere else for good Mac form
touch $(PKGROOT_UGLN)/perm $(PKGROOT_UGLN)/record $(PKGROOT_UGLN)/logfile
# XXX may need postinstall script to get perms right for sgid, etc.
mkdir $(PKGROOT_UGLN)/save
# XXX what about a news file?
endif # end of build_tty_pkg
endif # WANT_WIN_TTY for packaging
ifdef WANT_WIN_QT
# XXX untested and incomplete (see below)
build_qt_pkg:
ifneq (,$(WANT_WIN_X11)$(WANT_WIN_TTY))
-echo build_qt_pkg only works for a qt-only build
exit 1
else
$(MAKE) build_package_root
rm -rf NetHackQt
mkdir -p NetHackQt/NetHackQt.app/nethackdir/save
mkdir NetHackQt/Documentation
cp doc/Guidebook.txt doc/nethack.txt doc/recover.txt NetHackQt/Documentation
osacompile -o NetHackQt/NetHackQt.app/nethackdir/NetHackRecover.app \
win/macosx/NetHackRecover.applescript
cp win/macosx/recover.pl NetHackQt/NetHackQt.app/nethackdir
mkdir -p NetHackQt/NetHackQt.app/Contents/Frameworks
cp $(QTDIR)/libqt-mt.3.dylib NetHackQt/NetHackQt.app/Contents/Frameworks
mkdir NetHackQt/NetHackQt.app/Contents/MacOS
mv PKGROOT/nethack NetHackQt/NetHackQt.app/Contents/MacOS
mv PKGROOT/lib/nethackdir NetHackQt/NetHackQt.app/nethackdir
# XXX still missing:
#NetHackQt/NetHackQt.app
# /Contents
# Info.plist
# Resources/nethack.icns
#NetHackQt/Documentation
#NetHackQtRecover.txt
#NetHack Defaults.txt
#changes.patch XXX is this still needed? why isn't it part of the tree?
# doesn't go here
hdiutil create -verbose -srcfolder NetHackQt NetHack-$(SVS)-macosx-qt.dmg
endif # end of build_qt_pkg
endif # WANT_WIN_QT for packaging
endif # MAKEFILE_TOP

View File

@@ -0,0 +1,335 @@
#
# NetHack 3.7 macosx10.8 $NHDT-Date: 1596498425 2020/08/03 23:47:05 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.40 $
# Copyright (c) Kenneth Lorber, Kensington, Maryland, 2009.
# NetHack may be freely redistributed. See license for details.
#
#-PRE
# Mac OS X (Darwin) hints file
# This is for Mac OS X 10.8, Mountain Lion, and also 10.9.
#
# X11 is no longer included with OSX.
# To regain X11, download and install XQuartz. (Attempting to run X11.app
# will describe how.) Xcode (not related to X11) has also changed since
# earlier versions and some tools are no longer in their previous locations.
#
# If this doesn't work for some other version
# of Mac OS X, make a new file for that OS, don't change this one. And
# let us know about it.
# Useful info: http://www.opensource.apple.com/darwinsource/index.html
# This hints file can build several different types of installations.
# Edit the next section to match the type of build you need.
# 1. Which window system(s) should be included in this binary?
WANT_WIN_TTY=1
#WANT_WIN_X11=1
#WANT_WIN_QT=1
# 1a. What is the default window system?
WANT_DEFAULT=tty
#WANT_DEFAULT=x11
#WANT_DEFAULT=qt
# 1b. If you set WANT_WIN_QT, you need to
# A) set QTDIR either here or in the environment to point to the Qt2 or Qt3
# library installation root. (Qt4 will not work; Qt3 does not presently
# compile under Leopard (MacOSX 10.5) out-of-the-box.)
# B) set XPMLIB to point to the Xpm library
ifdef WANT_WIN_QT
QTDIR=/Developer/Qt
LIBXPM= -L/opt/X11/lib -lXpm
endif # WANT_WIN_QT
# 2. Is this a build for a binary that will be shared among different users
# or will it be private to you?
# If it is shared:
# - it will be owned by the user and group listed
# - if the user does not exist, you MUST create it before installing
# NetHack
# - if the group does not exist, it will be created.
# NB: if the group already exists and is being used for something
# besides games, you probably want to specify a new group instead
# NB: the group will be created locally; if your computer is centrally
# administered this may not be what you (or your admin) want.
# Consider a non-shared install (WANT_SHARE_INSTALL=0) instead.
# - 'make install' must be run as "sudo make install"
#WANT_SHARE_INSTALL=1
GAMEUID = $(USER)
GAMEGRP = games
# build to run in the source tree - primarily for development. Build with "make all"
#WANT_SOURCE_INSTALL=1
CC=gcc
# At the moment this is just for debugging, but in the future it could be
# useful for other things. Requires SYSCF and an ANSI compiler.
#WANT_WIN_CHAIN=1
#
# You shouldn't need to change anything below here.
#
#CFLAGS+=-W -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -DGCC_WARN
CFLAGS+=-Wall -Wextra -Wno-missing-field-initializers -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wwrite-strings -DGCC_WARN -ansi -pedantic -Wno-long-long
# As of LLVM build 2336.1.00, this gives dozens of spurious messages, so
# leave it out by default.
#CFLAGS+=-Wunreachable-code
# XXX -g vs -O should go here, -I../include goes in the makefile
CFLAGS+=-g -I../include
# older binaries use NOCLIPPING, but that disables SIGWINCH
#CFLAGS+=-DNOCLIPPING
CFLAGS+= -DNOMAIL -DNOTPARMDECL -DHACKDIR=\"$(HACKDIR)\"
CFLAGS+= -DDEFAULT_WINDOW_SYS=\"$(WANT_DEFAULT)\" -DDLB
CFLAGS+= -DGREPPATH=\"/usr/bin/grep\"
CFLAGS+= -DGDBPATH=\"/Developer/usr/bin/gdb\"
ifdef WANT_WIN_CHAIN
CFLAGS+= -DWINCHAIN
HINTSRC=$(CHAINSRC)
HINTOBJ=$(CHAINOBJ)
endif
ifdef WANT_WIN_TTY
WINSRC = $(WINTTYSRC)
WINOBJ = $(WINTTYOBJ)
WINLIB = $(WINTTYLIB)
WINTTYLIB=-lncurses
else # !WANT_WIN_TTY
CFLAGS += -DNOTTYGRAPHICS
endif # !WANT_WIN_TTY
ifdef WANT_WIN_X11
WINX11LIB = -lXaw -lXmu -lXext -lXt -lX11
VARDATND = x11tiles NetHack.ad pet_mark.xbm pilemark.xbm
POSTINSTALL+= bdftopcf win/X11/nh10.bdf > $(INSTDIR)/nh10.pcf; ( cd $(INSTDIR); mkfontdir -x .lev );
# separate from CFLAGS so that we don't pass it to every file
X11CFLAGS = -I/opt/X11/include
CFLAGS += -DX11_GRAPHICS
# avoid repeated complaints about _X_NONNULL(args...) in <X11/Xfuncproto.h>
X11CFLAGS += -Wno-variadic-macros
ifdef USE_XPM
CFLAGS += -DUSE_XPM
WINX11LIB += -lXpm
VARDATND += rip.xpm
endif
WINSRC += $(WINX11SRC)
WINOBJ += $(WINX11OBJ)
WINLIB += $(WINX11LIB)
LFLAGS=-L/opt/X11/lib
endif # WANT_WIN_X11
ifdef WANT_WIN_QT
CFLAGS += -DQT_GRAPHICS -DNOUSER_SOUNDS
CFLAGS += -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4
LINK=g++
WINSRC += $(WINQTSRC)
WINLIB += $(WINQTLIB) $(LIBXPM)
WINLIB += -framework Carbon -framework QuickTime -lz -framework OpenGL
WINLIB += -framework AGL
ifdef WANT_WIN_X11
# prevent duplicate tile.o in WINOBJ
WINOBJ = $(sort $(WINQTOBJ) $(WINX11OBJ))
ifdef WANT_WIN_TTY
WINOBJ += $(WINTTYOBJ)
endif # WANT_WIN_TTY
else # !WANT_WIN_X11
WINOBJ += $(WINQTOBJ)
endif # !WANT_WIN_X11
# XXX if /Developer/qt exists and QTDIR not set, use that
ifndef QTDIR
$(error QTDIR not defined in the environment or Makefile)
endif # QTDIR
# XXX make sure QTDIR points to something reasonable
else # !WANT_WIN_QT
LINK=$(CC)
endif # !WANT_WIN_QT
ifdef WANT_SHARE_INSTALL
# if $GAMEUID is root, we install into roughly proper Mac locations, otherwise
# we install into ~/nethackdir
ifeq ($(GAMEUID),root)
PREFIX:=/Library/NetHack
SHELLDIR=/usr/local/bin
HACKDIR=$(PREFIX)/nethackdir
INSTDIR=$(HACKDIR)
VARDIR=$(HACKDIR)
CHOWN=chown
CHGRP=chgrp
# We run sgid so the game has access to both HACKDIR and user preferences.
GAMEPERM = 02755
else # ! root
PREFIX:=/Users/$(GAMEUID)
SHELLDIR=$(PREFIX)/bin
HACKDIR=$(PREFIX)/nethackdir
INSTDIR=$(HACKDIR)
VARDIR=$(HACKDIR)
CHOWN=/usr/bin/true
CHGRP=/usr/bin/true
GAMEPERM = 0500
endif # ! root
VARFILEPERM = 0664
VARDIRPERM = 0775
ROOTCHECK= [[ `id -u` == 0 ]] || ( echo "Must run install with sudo."; exit 1)
# XXX it's nice we don't write over sysconf, but we've already erased it
# make sure we have group GAMEUID and group GAMEGRP
PREINSTALL= . sys/unix/hints/macosx.sh user2 $(GAMEUID); . sys/unix/hints/macosx.sh group2 $(GAMEGRP); mkdir $(SHELLDIR); chown $(GAMEUID) $(SHELLDIR)
POSTINSTALL+= sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(INSTDIR)/sysconf; $(CHOWN) $(GAMEUID) $(INSTDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(INSTDIR)/sysconf; chmod $(VARFILEPERM) $(INSTDIR)/sysconf;
CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE
else ifdef WANT_SOURCE_INSTALL
PREFIX=$(abspath $(NHSROOT))
# suppress nethack.sh
#SHELLDIR=
HACKDIR=$(PREFIX)/playground
INSTDIR=$(HACKDIR)
VARDIR=$(HACKDIR)
CHOWN=/usr/bin/true
CHGRP=/usr/bin/true
GAMEPERM = 0700
VARFILEPERM = 0600
VARDIRPERM = 0700
# We can use "make all" to build the whole thing - but it misses some things:
MOREALL=$(MAKE) install
CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE
else # !WANT_SOURCE_INSTALL
PREFIX:=$(wildcard ~)
SHELLDIR=$(PREFIX)/bin
HACKDIR=$(PREFIX)/nethackdir
INSTDIR=$(HACKDIR)
VARDIR=$(HACKDIR)
CHOWN=/usr/bin/true
CHGRP=/usr/bin/true
GAMEPERM = 0700
VARFILEPERM = 0600
VARDIRPERM = 0700
ifdef WANT_WIN_X11
# install nethack.rc as ~/.nethackrc if no ~/.nethackrc exists
PREINSTALL= cp -n win/X11/nethack.rc ~/.nethackrc || true
endif # WANT_WIN_X11
POSTINSTALL+= sys/unix/hints/macosx.sh editsysconf sys/unix/sysconf $(INSTDIR)/sysconf; $(CHOWN) $(GAMEUID) $(INSTDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(INSTDIR)/sysconf; chmod $(VARFILEPERM) $(INSTDIR)/sysconf;
CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE
endif # !WANT_SOURCE_INSTALL
# ~/Library/Preferences/NetHack Defaults
# OPTIONS=name:player,number_pad,menustyle:partial,!time,showexp
# OPTIONS=hilite_pet,toptenwin,msghistory:200,windowtype:Qt
#
# Install.Qt mentions a patch for macos - it's not there (it seems to be in the Qt binary
# package under the docs directory).
#-POST
ifdef MAKEFILE_TOP
###
### Packaging
###
# Notes:
# 1) The Apple developer utilities must be installed in the default location.
# 2) Do a normal build before trying to package the game.
# 3) This matches the 3.4.3 Term package, but there are some things that should
# be changed.
ifdef WANT_WIN_TTY
DEVUTIL=/Developer/Applications/Utilities
PKGR=$(DEVUTIL)/PackageMaker.app/Contents/MacOS/PackageMaker
SVS=$(shell $(NHSROOT)/util/makedefs --svs)
SVSDOT=$(shell $(NHSROOT)/util/makedefs --svs .)
PKGROOT_UG = PKGROOT/usr/games
PKGROOT_UGLN = PKGROOT/usr/games/lib/nethackdir
build_tty_pkg:
ifneq (,$(WANT_WIN_X11)$(WANT_WIN_QT))
-echo build_tty_pkg only works for a tty-only build
exit 1
else
rm -rf NetHack-$(SVS)-mac-Term.pkg NetHack-$(SVS)-mac-Term.dmg
$(MAKE) build_package_root
rm -rf RESOURCES
mkdir RESOURCES
#enscript --language=rtf -o - < dat/license >RESOURCES/License.rtf
sys/unix/hints/macosx.sh descplist > RESOURCES/Description.plist
sys/unix/hints/macosx.sh infoplist > Info.plist
mkdir PKGROOT/Applications
#osacompile -o NetHackQt/NetHackQt.app/nethackdir/NetHackRecover.app \
# win/macosx/NetHackRecover.applescript
#cp win/macosx/recover.pl NetHackQt/NetHackQt.app/nethackdir
osacompile -o PKGROOT/Applications/NetHackRecover.app \
win/macosx/NetHackRecover.applescript
cp win/macosx/recover.pl $(PKGROOT_UGLN)
osacompile -o PKGROOT/Applications/NetHackTerm.app \
win/macosx/NetHackTerm.applescript
# XXX integrate into Makefile.doc
(cd doc; cat Guidebook.mn | ../util/makedefs --grep --input - --output - \
| tbl tmac.n - | groff |ps2pdf - > Guidebook.pdf)
cp doc/Guidebook.pdf $(PKGROOT_UG)/doc/NetHackGuidebook.pdf
osacompile -o PKGROOT/Applications/NetHackGuidebook.app \
win/macosx/NetHackGuidebook.applescript
$(PKGR) --root PKGROOT --info Info.plist -e RESOURCES -v -o NetHack-$(SVS)-mac-Term.pkg
hdiutil create -verbose -srcfolder NetHack-$(SVS)-mac-Term.pkg NetHack-$(SVS)-mac-Term.dmg
build_package_root:
cd src/.. # make sure we are at TOP
rm -rf PKGROOT
mkdir -p $(PKGROOT_UG)/lib $(PKGROOT_UG)/bin $(PKGROOT_UG)/man/man6 $(PKGROOT_UG)/doc $(PKGROOT_UGLN)
install -p src/nethack $(PKGROOT_UG)/bin
# XXX should this be called nethackrecover?
install -p util/recover $(PKGROOT_UG)/bin
install -p doc/nethack.6 $(PKGROOT_UG)/man/man6
install -p doc/recover.6 $(PKGROOT_UG)/man/man6
install -p doc/Guidebook $(PKGROOT_UG)/doc
install -p dat/nhdat $(PKGROOT_UGLN)
cd dat; install -p $(DATNODLB) ../$(PKGROOT_UGLN)
# XXX these files should be somewhere else for good Mac form
touch $(PKGROOT_UGLN)/perm $(PKGROOT_UGLN)/record $(PKGROOT_UGLN)/logfile
# XXX may need postinstall script to get perms right for sgid, etc.
mkdir $(PKGROOT_UGLN)/save
# XXX what about a news file?
endif # end of build_tty_pkg
endif # WANT_WIN_TTY for packaging
ifdef WANT_WIN_QT
# XXX untested and incomplete (see below)
build_qt_pkg:
ifneq (,$(WANT_WIN_X11)$(WANT_WIN_TTY))
-echo build_qt_pkg only works for a qt-only build
exit 1
else
$(MAKE) build_package_root
rm -rf NetHackQt
mkdir -p NetHackQt/NetHackQt.app/nethackdir/save
mkdir NetHackQt/Documentation
cp doc/Guidebook.txt doc/nethack.txt doc/recover.txt NetHackQt/Documentation
osacompile -o NetHackQt/NetHackQt.app/nethackdir/NetHackRecover.app \
win/macosx/NetHackRecover.applescript
cp win/macosx/recover.pl NetHackQt/NetHackQt.app/nethackdir
mkdir -p NetHackQt/NetHackQt.app/Contents/Frameworks
cp $(QTDIR)/libqt-mt.3.dylib NetHackQt/NetHackQt.app/Contents/Frameworks
mkdir NetHackQt/NetHackQt.app/Contents/MacOS
mv PKGROOT/nethack NetHackQt/NetHackQt.app/Contents/MacOS
mv PKGROOT/lib/nethackdir NetHackQt/NetHackQt.app/nethackdir
# XXX still missing:
#NetHackQt/NetHackQt.app
# /Contents
# Info.plist
# Resources/nethack.icns
#NetHackQt/Documentation
#NetHackQtRecover.txt
#NetHack Defaults.txt
#changes.patch XXX is this still needed? why isn't it part of the tree?
# doesn't go here
hdiutil create -verbose -srcfolder NetHackQt NetHack-$(SVS)-macosx-qt.dmg
endif # end of build_qt_pkg
endif # WANT_WIN_QT for packaging
endif # MAKEFILE_TOP