[Lunar-commits] <moonbase-other> nethack: fix build without X11

v4hn me at v4hn.de
Fri Mar 22 16:10:16 CET 2013


commit a554a06a63c36688f28082729914ae548f3dc130
Author: v4hn <me at v4hn.de>
Date: Fri, 22 Mar 2013 08:10:16 -0700
URL: https://github.com/lunar-linux/moonbase-other/commit/a554a06a63c36688f28082729914ae548f3dc130

nethack: fix build without X11

Why didn't nobody notice that before?
Essentially, I had to rewrite the entire build
to fix this (and by that time my xorg-server finished building
as well...
---
  games/nethack/BUILD   | +39/-60   
  games/nethack/DEPENDS | +6/-0     
  2 files changed, 45 insertions(+), 60 deletions(-)

--- a/games/nethack/BUILD
+++ b/games/nethack/BUILD
@@ -1,60 +1,39 @@
-(
-
- cp include/config.h include/config.h.orig
- cat include/config.h.orig \
- | sed -e 's:/\* #define X11_GRAPHICS \*/:#define X11_GRAPHICS:' \
-       -e 's:/\* #define USE_XPM \*/:#define USE_XPM:' \
-       -e 's:^#define COMPRESS .*$:#define COMPRESS "/bin/gzip":' \
-       -e 's:^#define COMPRESS_EXTENSION.*$:#define COMPRESS_EXTENSION ".gz":' \
-       -e 's:/\* #define DLB \*/:#define DLB:' \
-       -e 's:/\* #define AUTOPICKUP_EXTENSIONS \*/:#define AUTOPICKUP_EXTENSIONS:' \
- > include/config.h
- # cp include/config.h* /tmp
-
- cp include/unixconf.h include/unixconf.h.orig
- cat include/unixconf.h.orig \
- | sed -e 's:/\* #define LINUX \*/:#define LINUX:' \
-       -e 's:/\* #define TIMED_DELAY \*/:#define TIMED_DELAY:' \
- > include/unixconf.h
- # cp include/unixconf.h* /tmp
-
- cp sys/unix/Makefile.src sys/unix/Makefile.src.orig
- cat sys/unix/Makefile.src.orig \
- | sed -e 's:^# CC = gcc *$:CC = gcc:' \
-       -e 's:^# LFLAGS = -L/usr/X11R6/lib:LFLAGS = -L/usr/X11R6/lib:' \
-       -e 's:^WINSRC = $(WINTTYSRC):WINSRC = $(WINTTYSRC) $(WINX11SRC):' \
-       -e 's:^WINOBJ = $(WINTTYOBJ):WINOBJ = $(WINTTYOBJ) $(WINX11OBJ):' \
-       -e 's:^WINTTYLIB = -ltermlib:WINTTYLIB = -lncurses:' \
-       -e 's:^WINX11LIB = -lXaw -lXmu -lXext -lXt -lX11:WINX11LIB = -lXaw -lXmu -lXext -lXt -lXpm -lX11:' \
-       -e 's:^WINLIB = $(WINTTYLIB):WINLIB = $(WINTTYLIB) $(WINX11LIB):' \
- > sys/unix/Makefile.src
- # cp sys/unix/Makefile.src* /tmp
-
- cp sys/unix/Makefile.utl sys/unix/Makefile.utl.orig
- cat sys/unix/Makefile.utl.orig \
- | sed -e 's:^# CC = gcc *$:CC = gcc:' \
-       -e 's:^# LFLAGS = -L/usr/X11R6/lib:LFLAGS = -L/usr/X11R6/lib:' \
-       -e 's:^YACC *= yacc:YACC = bison -y:' \
-       -e 's:^LEX *= lex:LEX = flex:' \
- > sys/unix/Makefile.utl
- # cp sys/unix/Makefile.utl* /tmp
-
- cp sys/unix/Makefile.top sys/unix/Makefile.top.orig
- cat sys/unix/Makefile.top.orig \
- | sed -e 's:^GAMEGRP *= bin:GAMEGRP = games:' \
-       -e 's:^GAMEPERM = 04755:GAMEPERM = 02755:' \
-       -e 's:^FILEPERM = 0644:FILEPERM = 0664:' \
-       -e 's:^DIRPERM = 0755:DIRPERM = 0775:' \
-       -e 's:^VARDATND =.*$:VARDATND = x11tiles NetHack.ad pet_mark.xbm rip.xpm:' \
- > sys/unix/Makefile.top
- # cp sys/unix/Makefile.top* /tmp
-
- sh sys/unix/setup.sh
- make all
-
- prepare_install
- make install
- chmod 0775 /usr/games/lib/nethackdir
-
-) > $C_FIFO 2>&1
-
+if in_depends $MODULE libX11; then
+  sedit 's:/\* #define X11_GRAPHICS \*/:#define X11_GRAPHICS:' include/config.h &&
+  sedit 's:^WINX11LIB = -lXaw -lXmu -lXext -lXt -lX11:WINX11LIB = -lXaw -lXmu -lXext -lXt -lXpm -lX11:' sys/unix/Makefile.src &&
+  sedit 's:^# WINSRC = $(WINTTYSRC):WINSRC = $(WINTTYSRC) $(WINX11SRC):' sys/unix/Makefile.src &&
+  sedit 's:^WINOBJ = $(WINTTYOBJ):WINOBJ = $(WINTTYOBJ) $(WINX11OBJ):' sys/unix/Makefile.src &&
+  sedit 's:^# LFLAGS = -L/usr/X11R6/lib:LFLAGS = -L/usr/X11R6/lib:' sys/unix/Makefile.src &&
+  sedit 's:^WINLIB = $(WINTTYLIB):WINLIB = $(WINTTYLIB) $(WINX11LIB):' sys/unix/Makefile.src
+fi &&
+
+if in_depends $MODULE libXpm; then
+  sedit 's:/\* #define USE_XPM \*/:#define USE_XPM:' include/config.h
+fi &&
+
+sedit 's:/^#define COMPRESS.*$:#define COMPRESS "/bin/gzip":'               include/config.h &&
+sedit 's:/^#define COMPRESS_EXTENSION.*$:#define COMPRESS_EXTENSION ".gz":'  include/config.h &&
+sedit 's:/\* #define DLB \*/:#define DLB:'                                     include/config.h &&
+sedit 's:/\* #define AUTOPICKUP_EXTENSIONS \*/:#define AUTOPICKUP_EXTENSIONS:' include/config.h &&
+
+sedit 's:/\* #define LINUX \*/:#define LINUX:'             include/unixconf.h &&
+sedit 's:/\* #define TIMED_DELAY \*/:#define TIMED_DELAY:' include/unixconf.h &&
+
+sedit 's:^# CC = gcc *$:CC = gcc:'  sys/unix/Makefile.src &&
+sedit 's:^WINTTYLIB = -ltermlib:WINTTYLIB = -lncurses:' sys/unix/Makefile.src &&
+
+sedit 's:^# CC = gcc *$:CC = gcc:' sys/unix/Makefile.utl &&
+sedit 's:^# FLAGS = -L/sr/X11R6/lib:LFLAGS = -L/usr/X11R6/lib:' sys/unix/Makefile.utl &&
+sedit 's:^YACC *= yacc:YACC = bison -y:' sys/unix/Makefile.utl &&
+sedit 's:^LEX *= lex:LEX = flex:' sys/unix/Makefile.utl &&
+
+sedit 's:^GAMEGRP *= bin:GAMEGRP = games:' sys/unix/Makefile.top &&
+sedit 's:^GAMEPERM = 04755:GAMEPERM = 02755:' sys/unix/Makefile.top &&
+sedit 's:^FILEPERM = 0644:FILEPERM = 0664:' sys/unix/Makefile.top &&
+sedit 's:^DIRPERM = 0755:DIRPERM = 0775:' sys/unix/Makefile.top &&
+sedit 's:^VERDATND =.*$:VARDATND = x11tiles NetHack.ad pet_mark.xbm rip.xpm:' sys/unix/Makefile.top &&
+
+sh sys/unix/setup.sh &&
+
+default_make &&
+chmod 0775 /usr/games/lib/nethackdir
--- /dev/null
+++ b/games/nethack/DEPENDS
@@ -0,0 +1,6 @@
+depends flex
+depends bison
+depends gzip
+
+optional_depends libX11 "" " " "for X11 frontend"
+optional_depends libXpm "" " " "for XPM file support"




More information about the Lunar-commits mailing list