From 9a0afd7e9b7f3dd8309beb93b80538adeda8085e Mon Sep 17 00:00:00 2001 From: Henrik Grimler Date: Sat, 27 Nov 2021 12:12:04 +0100 Subject: [PATCH] nethack: build host-tools in termux_step_host_build And simplify the related Makefile patches --- packages/nethack/build.sh | 37 ++++--- packages/nethack/sys-unix-Makefile.src.patch | 21 ++-- packages/nethack/sys-unix-makefile.dat.patch | 106 ------------------- packages/nethack/sys-unix-makefile.doc.patch | 11 -- packages/nethack/sys-unix-makefile.top.patch | 11 -- packages/nethack/sys-unix-makefile.utl.patch | 17 --- 6 files changed, 34 insertions(+), 169 deletions(-) delete mode 100644 packages/nethack/sys-unix-makefile.dat.patch delete mode 100644 packages/nethack/sys-unix-makefile.doc.patch delete mode 100644 packages/nethack/sys-unix-makefile.top.patch delete mode 100644 packages/nethack/sys-unix-makefile.utl.patch diff --git a/packages/nethack/build.sh b/packages/nethack/build.sh index a8b4529d0..d8f9c1b17 100644 --- a/packages/nethack/build.sh +++ b/packages/nethack/build.sh @@ -3,40 +3,47 @@ TERMUX_PKG_DESCRIPTION="Dungeon crawl game" TERMUX_PKG_LICENSE="Nethack" TERMUX_PKG_MAINTAINER="Leonid Pliushch " TERMUX_PKG_VERSION=3.6.6 -TERMUX_PKG_REVISION=3 +TERMUX_PKG_REVISION=4 TERMUX_PKG_SRCURL=http://www.nethack.org/download/${TERMUX_PKG_VERSION}/nethack-${TERMUX_PKG_VERSION//./}-src.tgz TERMUX_PKG_SHA256=cfde0c3ab6dd7c22ae82e1e5a59ab80152304eb23fb06e3129439271e5643ed2 TERMUX_PKG_DEPENDS="gzip, ncurses" TERMUX_PKG_BUILD_IN_SRC=true +TERMUX_PKG_HOSTBUILD=true -termux_step_make() { - cd $TERMUX_PKG_SRCDIR/sys/unix +termux_step_host_build() { + cp -r $TERMUX_PKG_SRCDIR/* . + pushd sys/unix sh setup.sh hints/linux - CFLAGS="$CPPFLAGS $CFLAGS" - export LFLAGS="$LDFLAGS" - cd $TERMUX_PKG_SRCDIR - cd util + popd && cd util if [ $TERMUX_ARCH_BITS = 32 ]; then HOST_CC="gcc -m32" else HOST_CC="gcc" fi CFLAGS="" CC="$HOST_CC" LD="ld" make makedefs - cp makedefs makedefs.host CFLAGS="" CC="$HOST_CC" LD="ld" make lev_comp - cp lev_comp lev_comp.host CFLAGS="" CC="$HOST_CC" LD="ld" make dgn_comp dlb recover - cp dgn_comp dgn_comp.host - cp dlb dlb.host - cd ../ - make clean - make WINTTYLIB="$LDFLAGS -lcurses" -j $TERMUX_MAKE_PROCESSES +} + +termux_step_pre_configure() { + WINTTYLIB="$LDFLAGS -lcurses" + export LFLAGS="$LDFLAGS" + export CFLAGS="$CPPFLAGS $CFLAGS" + cd sys/unix + sh setup.sh hints/linux +} + +termux_step_post_configure() { + # cp hostbuilt tools from hostbuild dir + cp $TERMUX_PKG_HOSTBUILD_DIR/util/{makedefs,lev_comp,dgn_comp,dlb} \ + util/ + touch -d "next hour" util/* } termux_step_post_make_install() { cd doc mkdir -p $TERMUX_PREFIX/share/man/man6 - cp nethack.6 $TERMUX_PREFIX/share/man/man6/ + install -m600 nethack.6 $TERMUX_PREFIX/share/man/man6/ ln -sf $TERMUX_PREFIX/games/nethack $TERMUX_PREFIX/bin/ } diff --git a/packages/nethack/sys-unix-Makefile.src.patch b/packages/nethack/sys-unix-Makefile.src.patch index 230cdea93..8c8d18eec 100644 --- a/packages/nethack/sys-unix-Makefile.src.patch +++ b/packages/nethack/sys-unix-Makefile.src.patch @@ -1,11 +1,14 @@ ---- ./sys/unix/Makefile.src.orig 2020-03-08 18:29:31.000000000 +0100 -+++ ./sys/unix/Makefile.src 2020-10-11 13:27:02.142596777 +0200 -@@ -670,7 +670,7 @@ - # up to date before being executed - ../include/date.h: $(VERSOURCES) $(HACK_H) - -$(SHELL) ../sys/unix/gitinfo.sh $(GITINFO) #before 'makedefs -v' -- ../util/makedefs -v -+ ../util/makedefs.host -v +--- ../unix-Makefile.src.orig 2021-11-27 11:02:18.000794086 +0000 ++++ ./sys/unix/Makefile.src 2021-11-27 11:03:29.084386408 +0000 +@@ -589,11 +589,9 @@ + # below in the 'make depend' output. + monst.o: + $(CC) $(CFLAGS) -c monst.c +- @rm -f $(MAKEDEFS) + objects.o: + $(CC) $(CFLAGS) -c objects.c +- @rm -f $(MAKEDEFS) - lint: + # Qt 3 windowport meta-object-compiler output + qt_kde0.moc: ../include/qt_kde0.h diff --git a/packages/nethack/sys-unix-makefile.dat.patch b/packages/nethack/sys-unix-makefile.dat.patch deleted file mode 100644 index 70b97e16e..000000000 --- a/packages/nethack/sys-unix-makefile.dat.patch +++ /dev/null @@ -1,106 +0,0 @@ ---- ../cache/nethack-3.6.1/sys/unix/Makefile.dat 2018-04-27 12:07:22.000000000 +0000 -+++ ./sys/unix/Makefile.dat 2018-07-13 00:08:30.165089686 +0000 -@@ -101,69 +101,69 @@ - - - data: data.base ../util/makedefs -- ../util/makedefs -d -+ ../util/makedefs.host -d - - rumors: rumors.tru rumors.fal ../util/makedefs -- ../util/makedefs -r -+ ../util/makedefs.host -r - - quest.dat: quest.txt ../util/makedefs -- ../util/makedefs -q -+ ../util/makedefs.host -q - - oracles: oracles.txt ../util/makedefs -- ../util/makedefs -h -+ ../util/makedefs.host -h - - engrave: engrave.txt ../util/makedefs -- ../util/makedefs -s -+ ../util/makedefs.host -s - - epitaph: epitaph.txt ../util/makedefs -- ../util/makedefs -s -+ ../util/makedefs.host -s - - bogusmon: bogusmon.txt ../util/makedefs -- ../util/makedefs -s -+ ../util/makedefs.host -s - - # note: 'options' should have already been made when include/date.h was created - options: ../util/makedefs -- ../util/makedefs -v -+ ../util/makedefs.host -v - - - spec_levs: ../util/lev_comp \ - bigroom.des castle.des endgame.des gehennom.des knox.des medusa.des \ - mines.des oracle.des sokoban.des tower.des yendor.des -- ../util/lev_comp bigroom.des -- ../util/lev_comp castle.des -- ../util/lev_comp endgame.des -- ../util/lev_comp gehennom.des -- ../util/lev_comp knox.des -- ../util/lev_comp medusa.des -- ../util/lev_comp mines.des -- ../util/lev_comp oracle.des -- ../util/lev_comp sokoban.des -- ../util/lev_comp tower.des -- ../util/lev_comp yendor.des -+ ../util/lev_comp.host bigroom.des -+ ../util/lev_comp.host castle.des -+ ../util/lev_comp.host endgame.des -+ ../util/lev_comp.host gehennom.des -+ ../util/lev_comp.host knox.des -+ ../util/lev_comp.host medusa.des -+ ../util/lev_comp.host mines.des -+ ../util/lev_comp.host oracle.des -+ ../util/lev_comp.host sokoban.des -+ ../util/lev_comp.host tower.des -+ ../util/lev_comp.host yendor.des - touch spec_levs - - quest_levs: ../util/lev_comp \ - Arch.des Barb.des Caveman.des Healer.des Knight.des Monk.des \ - Priest.des Ranger.des Rogue.des Samurai.des Tourist.des Valkyrie.des \ - Wizard.des -- ../util/lev_comp Arch.des -- ../util/lev_comp Barb.des -- ../util/lev_comp Caveman.des -- ../util/lev_comp Healer.des -- ../util/lev_comp Knight.des -- ../util/lev_comp Monk.des -- ../util/lev_comp Priest.des -- ../util/lev_comp Ranger.des -- ../util/lev_comp Rogue.des -- ../util/lev_comp Samurai.des -- ../util/lev_comp Tourist.des -- ../util/lev_comp Valkyrie.des -- ../util/lev_comp Wizard.des -+ ../util/lev_comp.host Arch.des -+ ../util/lev_comp.host Barb.des -+ ../util/lev_comp.host Caveman.des -+ ../util/lev_comp.host Healer.des -+ ../util/lev_comp.host Knight.des -+ ../util/lev_comp.host Monk.des -+ ../util/lev_comp.host Priest.des -+ ../util/lev_comp.host Ranger.des -+ ../util/lev_comp.host Rogue.des -+ ../util/lev_comp.host Samurai.des -+ ../util/lev_comp.host Tourist.des -+ ../util/lev_comp.host Valkyrie.des -+ ../util/lev_comp.host Wizard.des - touch quest_levs - - dungeon: dungeon.def ../util/makedefs ../util/dgn_comp -- ../util/makedefs -e -- ../util/dgn_comp dungeon.pdf -+ ../util/makedefs.host -e -+ ../util/dgn_comp.host dungeon.pdf - - spotless: - -rm -f spec_levs quest_levs *.lev $(VARDAT) dungeon dungeon.pdf diff --git a/packages/nethack/sys-unix-makefile.doc.patch b/packages/nethack/sys-unix-makefile.doc.patch deleted file mode 100644 index e5adfd01b..000000000 --- a/packages/nethack/sys-unix-makefile.doc.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../cache/nethack-3.6.1/sys/unix/Makefile.doc 2018-04-27 12:07:22.000000000 +0000 -+++ ./sys/unix/Makefile.doc 2018-07-13 00:54:14.687704597 +0000 -@@ -9,7 +9,7 @@ - # for Atari - # SHELL=E:/GEMINI2/MUPFEL.TTP - --MAKEDEFS = ../util/makedefs -+MAKEDEFS = ../util/makedefs.host - - # Which version do we want to build? (XXX These are not used anywhere.) - GUIDEBOOK = Guidebook # regular ASCII file diff --git a/packages/nethack/sys-unix-makefile.top.patch b/packages/nethack/sys-unix-makefile.top.patch deleted file mode 100644 index 8651f6027..000000000 --- a/packages/nethack/sys-unix-makefile.top.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ../cache/nethack-3.6.1/sys/unix/Makefile.top 2018-04-27 12:07:22.000000000 +0000 -+++ ./sys/unix/Makefile.top 2018-07-13 00:33:08.389609949 +0000 -@@ -188,7 +188,7 @@ - - dlb: - ( cd util ; $(MAKE) dlb ) -- ( cd dat ; LC_ALL=C ; ../util/dlb cf nhdat $(DATDLB) ) -+ ( cd dat ; LC_ALL=C ; ../util/dlb.host cf nhdat $(DATDLB) ) - - # recover can be used when INSURANCE is defined in include/config.h - # and the checkpoint option is true diff --git a/packages/nethack/sys-unix-makefile.utl.patch b/packages/nethack/sys-unix-makefile.utl.patch deleted file mode 100644 index e360b735b..000000000 --- a/packages/nethack/sys-unix-makefile.utl.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- ../Makefile.utl.orig 2019-08-11 17:36:35.716609211 +0200 -+++ ./sys/unix/Makefile.utl 2019-08-11 17:37:38.569874628 +0200 -@@ -239,11 +239,11 @@ - perl mdgrep.pl - - ../include/onames.h: makedefs -- ./makedefs -o -+ ./makedefs.host -o - ../include/pm.h: makedefs -- ./makedefs -p -+ ./makedefs.host -p - ../include/vis_tab.h: makedefs -- ./makedefs -z -+ ./makedefs.host -z - # makedefs -z makes both vis_tab.h and vis_tab.c, but writes the .h first - ../src/vis_tab.c: ../include/vis_tab.h -