diff --git a/package/blindcoder/nethack/nethack.conf b/package/blindcoder/nethack/nethack.conf index ec5b45c9e..07bb35873 100644 --- a/package/blindcoder/nethack/nethack.conf +++ b/package/blindcoder/nethack/nethack.conf @@ -21,37 +21,12 @@ # # --- ROCK-COPYRIGHT-NOTE-END --- -createpatch () { - cd sys/unix/ ; sh setup.sh ; cd ../.. - xx=$builddir/config.patch -# Creating common patch - cat >$xx<<-EEE ---- nethack-3.4.0/include/unixconf.h Thu Mar 21 00:42:56 2002 -+++ nethack-3.4.0_my/include/unixconf.h Tue Oct 29 10:59:21 2002 -@@ -36,7 +36,7 @@ - * including Solaris 2+ */ - #define NETWORK /* if running on a networked system */ - /* e.g. Suns sharing a playground through NFS */ - /* #define SUNOS4 */ /* SunOS 4.x */ --/* #define LINUX */ /* Another Unix clone */ -+#define LINUX /* Another Unix clone */ - /* #define CYGWIN32 */ /* Unix on Win32 -- use with case sensitive defines */ - /* #define GENIX */ /* Yet Another Unix Clone */ - EEE - +nethack_premake () { +# yes, we are linux + sed -e 's,^/\* #define LINUX \*/.*,#define LINUX,g' -i include/unixconf.h # Timed Delay if [ "$ROCKCFG_PKG_NETHACK_DEL" == "1" ] ; then - cat >>$xx<<-EEE -@@ -132,7 +132,7 @@ - * "extra output" method is used, but not all systems provide access to - * a fine-grained timer. - */ --/* #define TIMED_DELAY */ /* usleep() */ -+#define TIMED_DELAY /* usleep() */ - #endif - - /* - EEE + sed -e 's,^/\* #define TIMED_DELAY \*/.*,#define TIMED_DELAY,g' -i include/unixconf.h fi # Adding source files for UIs if [ "$ROCKCFG_PKG_NETHACK_TTY" == "0" ] ; then @@ -78,300 +53,134 @@ createpatch () { winobj="$winobj "'$(WINGNOMEOBJ)' winlib="$winlib "'$(WINGNOMELIB)' fi - cat >>$xx<<-EEE ---- nethack-3.4.0/src/Makefile Fri Nov 8 11:20:35 2002 -+++ nethack-3.4.0_my/src/Makefile Tue Oct 29 10:58:25 2002 -@@ -207,2 +207,2 @@ --WINSRC = \$(WINTTYSRC) --WINOBJ = \$(WINTTYOBJ) -+WINSRC = $winsrc -+WINOBJ = $winobj tile.o - EEE + sed -e "s,^WINSRC = \$(WINTTYSRC),WINSRC = $winsrc,g" \ + -e "s,^WINOBJ = \$(WINTTYOBJ),WINOBJ = $winobj tile.o,g" \ + -i src/Makefile # more common things - cat >>$xx<<-EEE -@@ -219,8 +219,8 @@ - # WINTTYLIB = -ltermcap - # WINTTYLIB = -lcurses - # WINTTYLIB = -lcurses16 --# WINTTYLIB = -lncurses --WINTTYLIB = -ltermlib -+WINTTYLIB = -lncurses -+#WINTTYLIB = -ltermlib - # - # libraries for X11 - # If USE_XPM is defined in config.h, you will also need -lXpm here. - EEE + sed -e 's,^# WINTTYLIB = -lncurses,WINTTYLIB = -lncurses,g' \ + -e 's,^WINTTYLIB = -ltermlib,#WINTTYLIB = -ltermlib,g' \ + -i src/Makefile # Use libXpm? if [ "$ROCKCFG_PKG_NETHACK_XPM" == "1" ] ; then - cat >>$xx<<-EEE -@@ -225,5 +225,5 @@ - # libraries for X11 - # If USE_XPM is defined in config.h, you will also need -lXpm here. --WINX11LIB = -lXaw -lXmu -lXext -lXt -lX11 -+WINX11LIB = -L/usr/X11R6/lib -lXaw -lXmu -lXext -lXt -lX11 -lXpm - # WINX11LIB = -lXaw -lXmu -lXt -lX11 - # WINX11LIB = -lXaw -lXmu -lXext -lXt -lXpm -lX11 -lm -@@ -248,1 +248,1 @@ --WINLIB = \$(WINTTYLIB) -+WINLIB = $winlib - EEE + sed -e 's,^WINX11LIB = -lXaw -lXmu -lXext -lXt -lX11,WINX11LIB = -L/usr/X11R6/lib -lXaw -lXmu -lXext -lXt -lX11 -lXpm,g' \ + -i src/Makefile fi # Tiles for Qt if [ "$ROCKCFG_PKG_NETHACK_QT" == "1" ] ; then - cat >>$xx<<-EEE ---- ./Makefile 2003-06-08 13:13:32.000000000 +0200 -+++ ./Makefile 2003-06-08 21:24:48.000000000 +0200 -@@ -40,7 +40,7 @@ VARDIR = \$(GAMEDIR) - SHELLDIR = \$(PREFIX)/games - - # per discussion in Install.X11 and Install.Qt --VARDATND = -+VARDATND = x11tiles rip.xpm nhsplash.xpm pet_mark.xbm - # VARDATND = x11tiles pet_mark.xbm - # VARDATND = x11tiles pet_mark.xbm rip.xpm - # for Atari/Gem - EEE + sed -e 's,^VARDATND =,VARDATND = x11tiles rip.xpm nhsplash.xpm pet_mark.xbm,g' \ + -i ./Makefile fi - cat >>$xx<<-EEE ---- nethack-3.4.0/include/config.h Fri Nov 8 11:20:35 2002 -+++ nethack-3.4.0/include/config.h Tue Oct 29 10:58:25 2002 - EEE -#more User Interfaces - if [ "$ROCKCFG_PKG_NETHACK_TTY" == "0" -o \ - "$ROCKCFG_PKG_NETHACK_X11" == "1" -o \ - "$ROCKCFG_PKG_NETHACK_QT" == "1" -o \ - "$ROCKCFG_PKG_NETHACK_GNO" == "1" ] ; then - cat >>$xx<<-EEE -@@ -43,7 +43,7 @@ - * Some combinations make no sense. See the installation document. - */ - EEE - if [ "$ROCKCFG_PKG_NETHACK_TTY" == "0" ] ; then - cat >>$xx<<-EEE --#define TTY_GRAPHICS /* good old tty based graphics */ -+/* #define TTY_GRAPHICS */ /* good old tty based graphics */ - EEE - else - cat >>$xx<<-EEE - #define TTY_GRAPHICS /* good old tty based graphics */ - EEE - fi - if [ "$ROCKCFG_PKG_NETHACK_X11" == "1" ] ; then - cat >>$xx<<-EEE --/* #define X11_GRAPHICS */ /* X11 interface */ -+#define X11_GRAPHICS /* X11 interface */ - EEE - else - cat >>$xx<<-EEE - /* #define X11_GRAPHICS */ /* X11 interface */ - EEE - fi - if [ "$ROCKCFG_PKG_NETHACK_QT" == "1" ] ; then - cat >>$xx<<-EEE --/* #define QT_GRAPHICS */ /* Qt interface */ -+#define QT_GRAPHICS /* Qt interface */ - EEE - else - cat >>$xx<<-EEE - /* #define QT_GRAPHICS */ /* Qt interface */ - EEE - fi - if [ "$ROCKCFG_PKG_NETHACK_GNO" == "1" ] ; then - cat >>$xx<<-EEE --/* #define GNOME_GRAPHICS */ /* Gnome interface */ -+#define GNOME_GRAPHICS /* Gnome interface */ - EEE - else - cat >>$xx<<-EEE - /* #define GNOME_GRAPHICS */ /* Gnome interface */ - EEE - fi - cat >>$xx<<-EEE - /* #define MSWIN_GRAPHICS */ /* Windows NT, CE, Graphics */ - EEE + +# more User Interfaces + if [ "$ROCKCFG_PKG_NETHACK_TTY" == "0" ] ; then + sed -e 's,^#define TTY_GRAPHICS,/* #define TTY_GRAPHICS */,g' \ + -i include/config.h fi -# Wizard name, logfile, news - if [ "$ROCKCFG_PKG_NETHACK_WIZ" != "wizard" ] ; then - cat >>$xx<<-EEE -@@ -139,8 +139,8 @@ - #ifndef WIZARD /* allow for compile-time or Makefile changes */ - # ifndef KR1ED --# define WIZARD "wizard" /* the person allowed to use the -D option */ -+# define WIZARD "$ROCKCFG_PKG_NETHACK_WIZ" /* the person allowed to use the -D option */ - # else - # define WIZARD --# define WIZARD_NAME "wizard" -+# define WIZARD_NAME "$ROCKCFG_PKG_NETHACK_WIZ" - # endif - #endif - EEE + if [ "$ROCKCFG_PKG_NETHACK_X11" == "1" ] ; then + sed -e 's,^/\* #define X11_GRAPHICS \*/.*,#define X11_GRAPHICS,g' \ + -i include/config.h fi - if [ "$ROCKCFG_PKG_NETHACK_LOG" != "logfile" ] ; then - cat >>$xx<<-EEE -@@ -151,1 +151,1 @@ --#define LOGFILE "logfile" /* larger file for debugging purposes */ -+#define LOGFILE "$ROCKCFG_PKG_NETHACK_LOG" /* larger file for debugging purposes */ - EEE + if [ "$ROCKCFG_PKG_NETHACK_QT" == "1" ] ; then + sed -e 's,^/\* #define QT_GRAPHICS \*/.*,#define QT_GRAPHICS,g' \ + -i include/config.h fi - if [ "$ROCKCFG_PKG_NETHACK_NEW" != "news" ] ; then - cat >>$xx<<-EEE -@@ -152,1 +152,1 @@ --#define NEWS "news" /* the file containing the latest hack news */ -+#define NEWS "$ROCKCFG_PKG_NETHACK_NEW" /* the file containing the latest hack news */ - EEE + if [ "$ROCKCFG_PKG_NETHACK_GNO" == "1" ] ; then + sed -e 's,^/\* #define GNOME_GRAPHICS \*/.*,#define GNOME_GRAPHICS,g' \ + -i include/config.h fi +# Wizard name, logfile, news + sed -e "s,define WIZARD_NAME \"wizard\",define WIZARD_NAME \"$ROCKCFG_PKG_NETHACK_WIZ\",g" \ + -e "s,define LOGFILE \"logfile\",define LOGFILE \"$ROCKCFG_PKG_NETHACK_LOG\",g" \ + -e "s,define NEWS \"news\", define NEWS \"$ROCKCFG_PKG_NETHACK_NEW\",g" \ + -i include/config.h + # Compression if [ "$ROCKCFG_PKG_NETHACK_USE_COM" == "1" ] ; then if [ "$ROCKCFG_PKG_NETHACK_COM" != "/usr/bin/compress" ] ; then - cat >>$xx<<-EEE -@@ -170,1 +170,1 @@ --#define COMPRESS "/usr/bin/compress" /* Lempel-Ziv compression */ -+#define COMPRESS "$ROCKCFG_PKG_NETHACK_COM" /* Lempel-Ziv compression */ - EEE + sed -e "s,define COMPRESS \"/usr/bin/compress\",define COMPRESS \"$ROCKCFG_PKG_NETHACK_COM\",g" \ + -i include/config.h fi if [ "$ROCKCFG_PKG_NETHACK_EXT" != ".Z" ] ; then - cat >>$xx<<-EEE -@@ -171,1 +171,1 @@ --#define COMPRESS_EXTENSION ".Z" /* compress's extension */ -+#define COMPRESS_EXTENSION "$ROCKCFG_PKG_NETHACK_COM_EXT" /* compress's extension */ - EEE + sed -e "s,define COMPRESS_EXTENSION \".Z\",define COMPRESS_EXTENSION \"$ROCKCFG_PKG_NETHACK_COM_EXT\",g" \ + -i include/config.h fi else - cat >>$xx<<-EEE -@@ -164,8 +164,8 @@ - #ifdef UNIX - /* path and file name extension for compression program */ --#define COMPRESS "/usr/bin/compress" /* Lempel-Ziv compression */ --#define COMPRESS_EXTENSION ".Z" /* compress's extension */ -+/* #define COMPRESS "/usr/bin/compress" */ /* Lempel-Ziv compression */ -+/* #define COMPRESS_EXTENSION ".Z" */ /* compress's extension */ - /* An example of one alternative you might want to use: */ - /* #define COMPRESS "/usr/local/bin/gzip" */ /* FSF gzip compression */ - /* #define COMPRESS_EXTENSION ".gz" */ /* normal gzip extension */ - #endif - EEE + sed -e 's,#define COMPRESS.*,// #define COMPRESS "/usr/bin/compress",g' \ + -e 's,#define COMPRESS_EXTENSION.*, // #define COMPRESS_EXTENSION ".Z",g' \ + -i include/config.h fi -#Hackdir + +# Hackdir if [ "$ROCKCFG_PKG_NETHACK_HACKDIR" != "/usr/games/lib/nethackdir" ] ; then - cat >>$xx<<-EEE -@@ -203,3 +203,3 @@ - # ifndef HACKDIR --# define HACKDIR "/usr/games/lib/nethackdir" -+# define HACKDIR "$ROCKCFG_PKG_NETHACK_HACKDIR" - # endif - EEE + sed -e "s,define HACKDIR \"/usr/games/lib/nethackdir\",define HACKDIR \"$ROCKCFG_PKG_NETHACK_HACKDIR\",g" \ + -i include/config.h fi -#Max number of players +# Max number of players if [ $ROCKCFG_PKG_NETHACK_MAX -gt 0 ] ; then - cat >>$xx<<-EEE -@@ -215,7 +215,7 @@ --/* #define SECURE */ /* do setuid(getuid()) after chdir() */ -+#define SECURE /* do setuid(getuid()) after chdir() */ - - /* - * If it is desirable to limit the number of people that can play Hack -- * simultaneously, define HACKDIR, SECURE and MAX_NR_OF_PLAYERS. -- * #define MAX_NR_OF_PLAYERS 6 -- */ -+ * simultaneously, define HACKDIR, SECURE and MAX_NR_OF_PLAYERS. */ -+ #define MAX_NR_OF_PLAYERS $ROCKCFG_PKG_NETHACK_MAX -+ /* */ - EEE + sed -e "s, \\* #define MAX_NR_OF_PLAYERS 6, * */\\n#define MAX_NR_OF_PLAYERS $ROCKCFG_PKG_NETHACK_MAX\\n/*,g" \ + -i include/config.h fi - # dungeon features + +# dungeon features if [ "$ROCKCFG_PKG_NETHACK_SINKS" == "0" ] ; then - cat >>$xx<<-EEE -@@ -317,1 +317,1 @@ --#define SINKS /* Kitchen sinks - Janet Walz */ -+/*#define SINKS */ /* Kitchen sinks - Janet Walz */ - EEE + sed -e 's,^#define SINKS,/* #define SINKS */,g' \ + -i include/config.h fi if [ "$ROCKCFG_PKG_NETHACK_MAZES" == "0" ] ; then - cat >>$xx<<-EEE -@@ -319,1 +319,1 @@ --#define WALLIFIED_MAZE /* Fancy mazes - Jean-Christophe Collet */ -+/* #define WALLIFIED_MAZE */ /* Fancy mazes - Jean-Christophe Collet */ - EEE + sed -e 's,^#define WALLIFIED_MAZE,/* #define WALLIFIED_MAZE */,g' \ + -i include/config.h fi if [ "$ROCKCFG_PKG_NETHACK_REINCARNATION" == "0" ] ; then - cat >>$xx<<-EEE -@@ -320,1 +320,1 @@ --#define REINCARNATION /* Special Rogue-like levels */ -+/* #define REINCARNATION */ /* Special Rogue-like levels */ - EEE + sed -e 's,^#define REINCARNATION,/* #define REINCARNATION */,g' \ + -i include/config.h fi if [ "$ROCKCFG_PKG_NETHACK_KOPS" == "0" ] ; then - cat >>$xx<<-EEE -@@ -322,1 +322,1 @@ --#define KOPS /* Keystone Kops by Scott R. Turner */ -+/* #define KOPS */ /* Keystone Kops by Scott R. Turner */ - EEE + sed -e 's,^#define KOPS,/* #define KOPS */,g' \ + -i include/config.h fi if [ "$ROCKCFG_PKG_NETHACK_SEDUCE" == "0" ] ; then - cat >>$xx<<-EEE -@@ -323,1 +323,1 @@ --#define SEDUCE /* Succubi/incubi seduction, by KAA, suggested by IM */ -+ /* #define SEDUCE */ /* Succubi/incubi seduction, by KAA, suggested by IM */ - EEE + sed -e 's,^#define SEDUCE,/* #define SEDUCE */,g' \ + -i include/config.h fi if [ "$ROCKCFG_PKG_NETHACK_STEED" == "0" ] ; then - cat >>$xx<<-EEE -@@ -324,1 +324,1 @@ --#define STEED /* Riding steeds */ -+/* #define STEED */ /* Riding steeds */ - EEE + sed -e 's,^#define STEED,/* #define STEED */,g' \ + -i include/config.h fi if [ "$ROCKCFG_PKG_NETHACK_TOURIST" == "0" ] ; then - cat >>$xx<<-EEE -@@ -325,1 +325,1 @@ --#define TOURIST /* Tourist players with cameras and Hawaiian shirts */ -+/* #define TOURIST */ /* Tourist players with cameras and Hawaiian shirts */ - EEE + sed -e 's,^#define TOURIST,/* #define TOURIST */,g' \ + -i include/config.h fi if [ "$ROCKCFG_PKG_NETHACK_ELBERETH" == "0" ] ; then - cat >>$xx<<-EEE -@@ -327,1 +327,1 @@ --#define ELBERETH /* Engraving the E-word repels monsters */ -+/* #define ELBERETH */ /* Engraving the E-word repels monsters */ - EEE + sed -e 's,^#define ELBERETH,/* #define ELBERETH */,g' \ + -i include/config.h fi if [ "$ROCKCFG_PKG_NETHACK_EXP" == "0" ] ; then - cat >>$xx<<-EEE -@@ -338,1 +338,1 @@ --#define EXP_ON_BOTL /* Show experience on bottom line */ -+/* #define EXP_ON_BOTL */ /* Show experience on bottom line */ - EEE + sed -e 's,^#define EXP_ON_BOTL,/* #define EXP_ON_BOTL */,g' \ + -i include/config.h fi if [ "$ROCKCFG_PKG_NETHACK_SCORE" == "1" ] ; then - cat >>$xx<<-EEE -@@ -339,1 +339,1 @@ --/* #define SCORE_ON_BOTL */ /* added by Gary Erickson (erickson@ucivax) */ -+#define SCORE_ON_BOTL /* added by Gary Erickson (erickson@ucivax) */ - EEE + sed -e 's,^#define SCORE_ON_BOTL,/* #define SCORE_ON_BOTL */,g' \ + -i include/config.h fi if [ "$ROCKCFG_PKG_NETHACK_GOLD" == "1" ] ; then - cat >>$xx<<-EEE -@@ -349,1 +349,1 @@ --/*#define GOLDOBJ */ /* Gold is kept on obj chains - Helge Hafting */ -+#define GOLDOBJ /* Gold is kept on obj chains - Helge Hafting */ - EEE + sed -e 's,^#define GOLDOBJ,/* #define GOLDOBJ */,g' \ + -i include/config.h fi } runconf='0' - -prepatch="createpatch" -patchfiles="$patchfiles $builddir/config.patch" +prepatch="cd sys/unix/ ; sh setup.sh ; cd ../.." +premake="nethack_premake"