From a831bf576b20d630040476bd2af94b0330d896d3 Mon Sep 17 00:00:00 2001 From: Michael Meyer Date: Sat, 18 Nov 2023 12:46:33 -0500 Subject: [PATCH] Add WANT_SOURCE_INSTALL to linux.370 hints file WANT_SOURCE_INSTALL=1 can be specified when compiling to build NetHack within the repo/source tree, rather than in the normal system install location. I find it useful for development on OSX, but it wasn't present in any other hints files, so I've been using a custom hints file on Linux for a while that adds the same option. The code is based on the macOS.370 hints file. --- sys/unix/hints/linux.370 | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/sys/unix/hints/linux.370 b/sys/unix/hints/linux.370 index 59923327b..7139e9175 100755 --- a/sys/unix/hints/linux.370 +++ b/sys/unix/hints/linux.370 @@ -295,10 +295,25 @@ override GAME= MOREALL += ( cd src ; $(MAKE) pregame ; $(MAKE) $(TARGETPFX)libnh.a ) endif # WANT_LIBNH +ifdef WANT_SOURCE_INSTALL +PREFIX=$(abspath $(NHSROOT)) +#SHELLDIR= +HACKDIR=$(PREFIX)/playground +GAMEPERM = 0700 +VARFILEPERM = 0600 +VARDIRPERM = 0700 +CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" -DSECURE +MOREALL=$(MAKE) install +else #!WANT_SOURCE_INTSALL #PREFIX=/usr PREFIX=$(wildcard ~)/nh/install HACKDIR=$(PREFIX)/games/lib/nethackdir SHELLDIR = $(PREFIX)/games +VARDIRPERM = 0755 +VARFILEPERM = 0600 +GAMEPERM = 0755 +endif #?WANT_SOURCE_INSTALL + INSTDIR=$(HACKDIR) VARDIR = $(HACKDIR) @@ -347,10 +362,6 @@ LFLAGS+=-rdynamic CHOWN=true CHGRP=true -VARDIRPERM = 0755 -VARFILEPERM = 0600 -GAMEPERM = 0755 -# # manpages directory MANDIR=/usr/share/man/man6 #