From d4b022a5ec18a4b4eb07f47c1f06330b330c9783 Mon Sep 17 00:00:00 2001 From: keni Date: Wed, 23 Dec 2009 20:02:29 +0000 Subject: [PATCH] hints system changes and more Mac packaging update file headers add "#-PRE" and "#-POST" keywords (no default) so hints file can wrap Makefile.* add make var with name of makefile (e.g. MAKEFILE_TOP) so hints file can be conditional on the file add skeletel Mac Qt packaging target add missing aux file generation for Mac Term packaging --- sys/unix/hints/linux | 5 +-- sys/unix/hints/linux-x11 | 5 +-- sys/unix/hints/macosx | 3 +- sys/unix/hints/macosx.sh | 69 ++++++++++++++++++++++++++++++++++++++- sys/unix/hints/macosx10.5 | 62 ++++++++++++++++++++++++++++++----- sys/unix/hints/unix | 5 +-- sys/unix/mkmkfile.sh | 47 ++++++++++++++++++-------- sys/unix/setup.sh | 11 +++---- 8 files changed, 170 insertions(+), 37 deletions(-) diff --git a/sys/unix/hints/linux b/sys/unix/hints/linux index bdd8169a5..3390a43f6 100644 --- a/sys/unix/hints/linux +++ b/sys/unix/hints/linux @@ -1,8 +1,9 @@ -# -# SCCS Id: @(#)linux 3.5 2007/12/15 +# +# NetHack 3.5 linux $Date$ $Revision$ # 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. diff --git a/sys/unix/hints/linux-x11 b/sys/unix/hints/linux-x11 index baa316e68..5bd20c9a4 100644 --- a/sys/unix/hints/linux-x11 +++ b/sys/unix/hints/linux-x11 @@ -1,8 +1,9 @@ -# -# SCCS Id: @(#)linux 3.5 2007/12/16 +# +# NetHack 3.5 linux-x11 $Date$ $Revision$ # 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. diff --git a/sys/unix/hints/macosx b/sys/unix/hints/macosx index de2594c00..0ef9c342c 100644 --- a/sys/unix/hints/macosx +++ b/sys/unix/hints/macosx @@ -1,8 +1,9 @@ # -# SCCS Id: @(#)macosx 3.5 2007/12/12 +# NetHack 3.5 macosx $Date$ $Revision$ # 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.10 (Darwin 8.10). If this doesn't work for some # other version of either Darwin or Mac OS X, make a new file for that OS, diff --git a/sys/unix/hints/macosx.sh b/sys/unix/hints/macosx.sh index 4eb9e20a9..712134dfb 100755 --- a/sys/unix/hints/macosx.sh +++ b/sys/unix/hints/macosx.sh @@ -1,5 +1,5 @@ #!/bin/sh -# SCCS Id: @(#)macosx.sh 3.5 2007/12/12 +# NetHack 3.5 macosx.sh $Date$ $Revision$ # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2007. # NetHack may be freely redistributed. See license for details. # @@ -105,6 +105,73 @@ xgroup2) # RecordType: dsRecTypeStandard:Groups # SMBSID: S-1-5-21-100 +xdescplist) SVSDOT=`util/makedefs --svs .` + cat < + + + + IFPkgDescriptionDeleteWarning + + IFPkgDescriptionDescription + NetHack $SVSDOT for the MacOS X Terminal + + IFPkgDescriptionTitle + NetHack + IFPkgDescriptionVersion + $SVSDOT + + +E_O_M + ;; + +xinfoplist) SVSDOT=`util/makedefs --svs .` + cat < + + + + CFBundleGetInfoString + NetHack $SVSDOT for the MacOS X Terminal + CFBundleIdentifier + org.nethack.term + CFBundleName + NetHack + CFBundleShortVersionString + $SVSDOT + IFMajorVersion + 3 + IFMinorVersion + 3 + IFPkgFlagAllowBackRev + + IFPkgFlagAuthorizationAction + RootAuthorization + IFPkgFlagDefaultLocation + /usr/games + IFPkgFlagInstallFat + + IFPkgFlagIsRequired + + IFPkgFlagOverwritePermissions + + IFPkgFlagRelocatable + + IFPkgFlagRestartAction + NoRestart + IFPkgFlagRootVolumeOnly + + IFPkgFlagUpdateInstalledLanguages + + IFPkgFlagUseUserMask + + IFPkgFormatVersion + 0.10000000149011612 + + +E_O_M + ;; + *) echo "Unknown command $cmd" exit 1 ;; diff --git a/sys/unix/hints/macosx10.5 b/sys/unix/hints/macosx10.5 index 9c278d665..0cbf9cc11 100644 --- a/sys/unix/hints/macosx10.5 +++ b/sys/unix/hints/macosx10.5 @@ -1,8 +1,9 @@ # -# SCCS Id: @(#)macosx 3.5 2007/12/12 -# Copyright (c) Kenneth Lorber, Kensington, Maryland, 2007. +# NetHack 3.5 macosx10.5 $Date$ $Revision$ +# 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.3 (Darwin 9.3). If this doesn't work for some # other version of either Darwin or Mac OS X, make a new file for that OS, @@ -173,6 +174,8 @@ endif # !WANT_SOURCE_INSTALL # 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 ### @@ -188,10 +191,11 @@ PKGR=$(DEVUTIL)/PackageMaker.app/Contents/MacOS/PackageMaker SVS=$(shell $(NHSROOT)/util/makedefs --svs) build_tty_pkg: -if defined(WANT_WIN_X11) || defined(WANT_WIN_QT) -$(error "build_tty_pkg only works for a tty-only build) +ifneq (,$(WANT_WIN_X11)$(WANT_WIN_QT)) + -echo build_tty_pkg only works for a tty-only build + exit 1 else - $(MAKE) build_package_root + $(MAKE) build_package_root rm -rf RESOURCES mkdir RESOURCES enscript --language=rtf -o - < dat/license >RESOURCES/License.rtf @@ -201,8 +205,8 @@ else $(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 -SVS:=$(shell util/makedefs -svs) -SVSDOT:=$(shell util/makedefs -svs .) +SVS=$(shell util/makedefs --svs) +SVSDOT=$(shell util/makedefs --svs .) build_package_root: cd src/.. # make sure we are at TOP @@ -219,6 +223,46 @@ build_package_root: touch PKGROOT/perm PKGROOT/record PKGROOT/logfile # XXX may need postinstall script to get perms right for sgid, etc. mkdir PKGROOT/save +# XXX what about a news file? +endif # end of build_tty_pkg +endif # WANT_WIN_TTY for packaging -endif -endif +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 diff --git a/sys/unix/hints/unix b/sys/unix/hints/unix index 4dc8c6c39..d6f230e44 100644 --- a/sys/unix/hints/unix +++ b/sys/unix/hints/unix @@ -1,8 +1,9 @@ -# -# SCCS Id: @(#)unix 3.5 2007/12/12 +# +# NetHack 3.5 unix $Date$ $Revision$ # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2007. # NetHack may be freely redistributed. See license for details. # +#-PRE # unix hints file # This hints file provides the legacy configuration that NetHack has shipped # with historically - this means you will most likely need to hand edit .h diff --git a/sys/unix/mkmkfile.sh b/sys/unix/mkmkfile.sh index 20f118cb9..be140aa80 100644 --- a/sys/unix/mkmkfile.sh +++ b/sys/unix/mkmkfile.sh @@ -1,23 +1,42 @@ #!/bin/sh # NetHack 3.5 mkmkfile.sh $Date$ $Revision$ -# SCCS Id: @(#)macosx 3.5 2007/12/12 # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2007. # NetHack may be freely redistributed. See license for details. # build one makefile # args are: # $1 basefile -# $2 install path -# $3 hints file +# $2 basefile tag +# $3 install path +# $4 hints file -echo "#" > $2 -echo "# This file is generated automatically. Do not edit." >> $2 -echo "# Your changes will be lost. See sys/unix/NewInstall.unx." >> $2 -echo "###" >> $2 -echo "### Start $3" >> $2 -echo "###" >> $2 -cat $3 >> $2 -echo "### end of file" >> $2 -echo "### Start $1" >> $2 -cat $1 >> $2 -echo "### end of file" >> $2 +echo "#" > $3 +echo "# This file is generated automatically. Do not edit." >> $3 +echo "# Your changes will be lost. See sys/unix/NewInstall.unx." >> $3 +echo "# Identify this file:" >> $3 +echo "MAKEFILE_$2=1" >> $3 +echo "" >> $3 + +echo "###" >> $3 +echo "### Start $4 PRE" >> $3 +echo "###" >> $3 +awk '/^#-PRE/,/^#-POST/{ \ + if(index($0, "#-PRE") == 1) print "# (new segment at source line",NR,")"; \ + if(index($0, "#-P") != 1) print}' $4 >> $3 +echo "### end $4 PRE" >> $3 +echo "" >> $3 + +echo "###" >> $3 +echo "### Start $1" >> $3 +echo "###" >> $3 +cat $1 >> $3 +echo "### end of file" >> $3 +echo "" >> $3 + +echo "###" >> $3 +echo "### Start $4 POST" >> $3 +echo "###" >> $3 +awk '/^#-POST/,/^#-PRE/{ \ + if(index($0, "#-POST") == 1) print "# (new segment at source line",NR,")"; \ + if(index($0, "#-P") != 1) print}' $4 >> $3 +echo "### end $4 POST" >> $3 diff --git a/sys/unix/setup.sh b/sys/unix/setup.sh index ccda05bff..31844cbe4 100644 --- a/sys/unix/setup.sh +++ b/sys/unix/setup.sh @@ -1,6 +1,5 @@ #!/bin/sh # NetHack 3.5 setup.sh $Date$ $Revision$ -# SCCS Id: @(#)setup.sh 3.5 2007/12/12 # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2007. # NetHack may be freely redistributed. See license for details. # @@ -18,8 +17,8 @@ x) hints=/dev/null ;; esac -/bin/sh ./mkmkfile.sh Makefile.top ../../Makefile $hints -/bin/sh ./mkmkfile.sh Makefile.dat ../../dat/Makefile $hints -/bin/sh ./mkmkfile.sh Makefile.doc ../../doc/Makefile $hints -/bin/sh ./mkmkfile.sh Makefile.src ../../src/Makefile $hints -/bin/sh ./mkmkfile.sh Makefile.utl ../../util/Makefile $hints +/bin/sh ./mkmkfile.sh Makefile.top TOP ../../Makefile $hints +/bin/sh ./mkmkfile.sh Makefile.dat DAT ../../dat/Makefile $hints +/bin/sh ./mkmkfile.sh Makefile.doc DOC ../../doc/Makefile $hints +/bin/sh ./mkmkfile.sh Makefile.src SRC ../../src/Makefile $hints +/bin/sh ./mkmkfile.sh Makefile.utl UTL ../../util/Makefile $hints