Nethack 3.6.0: Added patches and recipe

This commit is contained in:
Mikołaj 'lich' Halber
2015-12-27 00:41:38 +01:00
parent d97532ab2d
commit 200425d078
3 changed files with 226 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
NETHACK GENERAL PUBLIC LICENSE
(Copyright 1989 M. Stephenson)
(Based on the BISON general public license, copyright 1988 Richard M. Stallman)
Everyone is permitted to copy and distribute verbatim copies of this license, but changing it is not allowed. You can also use this wording to make the terms for other programs.
The license agreements of most software companies keep you at the mercy of those companies. By contrast, our general public license is intended to give everyone the right to share NetHack. To make sure that you get the rights we want you to have, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. Hence this license agreement.
Specifically, we want to make sure that you have the right to give away copies of NetHack, that you receive source code or else can get it if you want it, that you can change NetHack or use pieces of it in new free programs, and that you know you can do these things.
To make sure that everyone has such rights, we have to forbid you to deprive anyone else of these rights. For example, if you distribute copies of NetHack, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights.
Also, for our own protection, we must make certain that everyone finds out that there is no warranty for NetHack. If NetHack is modified by someone else and passed on, we want its recipients to know that what they have is not what we distributed.
Therefore we (Mike Stephenson and other holders of NetHack copyrights) make the following terms which say what you must do to be allowed to distribute or change NetHack.
COPYING POLICIES
1.You may copy and distribute verbatim copies of NetHack source code as you receive it, in any medium, provided that you keep intact the notices on all files that refer to copyrights, to this License Agreement, and to the absence of any warranty; and give any other recipients of the NetHack program a copy of this License Agreement along with the program.
2.You may modify your copy or copies of NetHack or any portion of it, and copy and distribute such modifications under the terms of Paragraph 1 above (including distributing this License Agreement), provided that you also do the following:
a) cause the modified files to carry prominent notices stating that you changed the files and the date of any change; and
b) cause the whole of any work that you distribute or publish, that in whole or in part contains or is a derivative of NetHack or any part thereof, to be licensed at no charge to all third parties on terms identical to those contained in this License Agreement (except that you may choose to grant more extensive warranty protection to some or all third parties, at your option)
c) You may charge a distribution fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
3.You may copy and distribute NetHack (or a portion or derivative of it, under Paragraph 2) in object code or executable form under the terms of Paragraphs 1 and 2 above provided that you also do one of the following:
a) accompany it with the complete machine-readable source code, which must be distributed under the terms of Paragraphs 1 and 2 above; or,
b) accompany it with full information as to how to obtain the complete machine-readable source code from an appropriate archive site. (This alternative is allowed only for noncommercial distribution.)
For these purposes, complete source code means either the full source distribution as originally released over Usenet or updated copies of the files in this distribution used to create the object code or executable.
4.You may not copy, sublicense, distribute or transfer NetHack except as expressly provided under this License Agreement. Any attempt otherwise to copy, sublicense, distribute or transfer NetHack is void and your rights to use the program under this License agreement shall be automatically terminated. However, parties who have received computer software programs from you with this License Agreement will not have their licenses terminated so long as such parties remain in full compliance.
Stated plainly: You are permitted to modify NetHack, or otherwise use parts of NetHack, provided that you comply with the conditions specified above; in particular, your modified NetHack or program containing parts of NetHack must remain freely available as provided in this License Agreement. In other words, go ahead and share NetHack, but don't try to stop anyone else from sharing it farther.

View File

@@ -0,0 +1,87 @@
SUMMARY="The ultimate old-school single player dungeon exploration game"
HOMEPAGE="http://www.nethack.org/"
DESCRIPTION="NetHack is a single-player roguelike video game originally \
released in 1987 with ASCII graphics. It is a descendant of an earlier game \
called Hack (1985), which is a descendant of Rogue (1980)."
COPYRIGHT="1985-2015 Stichting Mathematisch Centrum and M. Stephenson"
REVISION="1"
LICENSE="nethack"
SOURCE_URI="http://sourceforge.net/projects/nethack/files/nethack/3.6.0/nethack-360-src.tgz"
CHECKSUM_SHA256="1ade698d8458b8d87a4721444cb73f178c74ed1b6fde537c12000f8edf2cb18a"
SOURCE_DIR="nethack-$portVersion"
PATCHES="nethack-$portVersion.patchset"
#the x86 is left is somebody wanted to edit it to work under gcc4
#(it compiles in gcc4, but what is the point if it compiles under gcc2)
ARCHITECTURES="x86_gcc2 ?x86 ?x86_64"
PROVIDES="
nethack = $portVersion
cmd:nethack
cmd:nethack_bin
"
REQUIRES="
haiku
lib:libncurses
"
BUILD_REQUIRES="
haiku_devel
devel:libncurses
"
BUILD_PREREQUIRES="
cmd:awk
cmd:bison
cmd:flex
cmd:gcc
cmd:install
cmd:groff
cmd:nroff
cmd:make
cmd:sed
cmd:tbl
"
GLOBAL_WRITABLE_FILES="
settings/nethack directory keep-old
"
BUILD()
{
./sys/unix/setup.sh ./sys/unix/hints/haiku
make PREFIX=$binDir $jobArgs
}
INSTALL()
{
mkdir -p $binDir
make install PREFIX=$binDir
#copy the main binary file to be in main directory
cp $binDir/nethack/nethack $binDir/nethack_bin
mkdir -p $settingsDir/nethack
#move configs to writable directory (license also belongs there)
cp -r $binDir/nethack/license \
$binDir/nethack/logfile \
$binDir/nethack/nhdat \
$binDir/nethack/perm \
$binDir/nethack/record \
$binDir/nethack/save \
$binDir/nethack/symbols \
$binDir/nethack/sysconf \
$binDir/nethack/xlogfile \
$settingsDir/nethack/
#remove first nethack dir to not make a name problems
rm -rf $binDir/nethack
#replace paths from installation to rights paths in system
sed "s/HACKDIR=.*/HACKDIR=\/boot\/system\/settings\/nethack/; \
s/HACK=.*/HACK=\/bin\/nethack_bin/" \
$binDir/nethacksh/nethack > $binDir/nethack
chmod +x $binDir/nethack
rm -rf $binDir/nethacksh
}

View File

@@ -0,0 +1,104 @@
From 0b71f7544bde04daa8c5ee349c3b2a685d170f4d Mon Sep 17 00:00:00 2001
From: Mikolaj 'lich' Halber <lich@opmbx.org>
Date: Sun, 20 Dec 2015 13:49:37 +0000
Subject: Added Haiku support
diff --git a/sys/unix/Makefile.doc b/sys/unix/Makefile.doc
index e2a8131..e9c838e 100644
--- a/sys/unix/Makefile.doc
+++ b/sys/unix/Makefile.doc
@@ -17,7 +17,6 @@ GUIDEBOOK = Guidebook # regular ASCII file
# Some versions of col need -x to keep them from converting spaces to tabs;
# some versions of col don't do the conversion by default and don't
# recognize the option. Sigh.
-COLCMD = col -bx
#COLCMD = col -b
# The command to use to generate a PostScript file
@@ -29,7 +28,7 @@ PSCMD = groff
# GUIDECMD = cat Guidebook.txt
# The following works better with groff-1.18, eg on Linux
# GUIDECMD = $(GUIDE_PREFORMAT) | nroff -c -Tascii | $(COLCMD)
-GUIDECMD = $(GUIDE_PREFORMAT) | nroff | $(COLCMD)
+GUIDECMD = $(GUIDE_PREFORMAT) | nroff
# Only generate output for the current configuration:
NHGREP = $(MAKEDEFS) --grep --input - --output -
@@ -93,7 +92,7 @@ distrib: $(DISTRIB)
Guidebook.txt : Guidebook.mn tmac.n
$(GUIDECMD) > Guidebook.txt
-MAN2TXT = $(NHGREP) | nroff -man - | $(COLCMD)
+MAN2TXT = $(NHGREP) | nroff -man -|awk {print $0}
nethack.txt : nethack.6
cat nethack.6 | $(MAN2TXT) > nethack.txt
lev_comp.txt : lev_comp.6
diff --git a/sys/unix/Makefile.utl b/sys/unix/Makefile.utl
index d5d3042..b5b0b57 100644
--- a/sys/unix/Makefile.utl
+++ b/sys/unix/Makefile.utl
@@ -104,8 +104,8 @@ OBJDIR = ../src
# yacc/lex programs to use to generate *_comp.h, *_lex.c, and *_yacc.c.
# if, instead of yacc/lex you have bison/flex, comment/uncomment the following.
-YACC = yacc
-LEX = lex
+# YACC = yacc
+# LEX = lex
# YACC = bison -y
# YACC = byacc
# LEX = flex
diff --git a/sys/unix/hints/haiku b/sys/unix/hints/haiku
new file mode 100644
index 0000000..83db3ae
--- /dev/null
+++ b/sys/unix/hints/haiku
@@ -0,0 +1,44 @@
+#
+# NetHack 3.6 linux $NHDT-Date: 1432512814 2015/05/25 00:13:34 $ $NHDT-Branch: master $:$NHDT-Revision: 1.12 $
+# Copyright (c) Kenneth Lorber, Kensington, Maryland, 2007.
+# NetHack may be freely redistributed. See license for details.
+#
+#-PRE
+# Haiku hints file
+# This hints file provides a build for haiku.
+
+
+
+#PREFIX=/usr
+PREFIX=/tmp
+HACKDIR=$(PREFIX)/nethack
+SHELLDIR=$(PREFIX)/nethacksh
+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 $(CFLAGS1) -DDLB
+CFLAGS1=-DCOMPRESS=\"/bin/gzip\" -DCOMPRESS_EXTENSION=\".gz\"
+CFLAGS+=-DSYSCF -DSYSCF_FILE=\"/boot/system/settings/nethack/sysconf\" -DSECURE
+CFLAGS+=-DHACKDIR=\"/boot/system/settings/nethack\"
+
+LINK=$(CC)
+
+YACC=bison -y
+LEX=flex
+
+WINSRC = $(WINTTYSRC)
+WINOBJ = $(WINTTYOBJ)
+WINLIB = $(WINTTYLIB)
+
+WINTTYLIB=-lncurses
+
+CHOWN=true
+CHGRP=true
+
+VARDIRPERM = 0755
+VARFILEPERM = 0600
+GAMEPERM = 0755
--
2.2.2