diff options
author | Will Sinatra <wpsinatra@gmail.com> | 2020-08-12 20:34:50 -0400 |
---|---|---|
committer | Leo <thinkabit.ukim@gmail.com> | 2020-08-13 09:40:06 +0000 |
commit | 194533749202a81aba8408023bfc3969db775f0d (patch) | |
tree | 2380aaf5b2e758b54942c7eca48610d09c1ab8d8 | |
parent | d2b71227908c49f224b4003625ef96cbb026685f (diff) |
testing/zangband: new aport
-rw-r--r-- | testing/zangband/APKBUILD | 51 | ||||
-rw-r--r-- | testing/zangband/fix-bad-configure.patch | 219 | ||||
-rw-r--r-- | testing/zangband/fix-bad-substitution.patch | 12 | ||||
-rw-r--r-- | testing/zangband/fix-explosive-rune-error.patch | 12 | ||||
-rw-r--r-- | testing/zangband/fix-random-num-gen.patch | 22 | ||||
-rw-r--r-- | testing/zangband/fix-spear-of-hagen-error.patch | 12 |
6 files changed, 328 insertions, 0 deletions
diff --git a/testing/zangband/APKBUILD b/testing/zangband/APKBUILD new file mode 100644 index 00000000000..4405a0879f4 --- /dev/null +++ b/testing/zangband/APKBUILD @@ -0,0 +1,51 @@ +# Contributor: Will Sinatra <wpsinatra@gmail.com> +# Maintainer: Will Sinatra <wpsinatra@gmail.com> +pkgname=zangband +pkgver=2.7.5.1 +_pkgver=2.7.5pre1 +pkgrel=0 +pkgdesc="Roguelike computer role playing game based on Angband" +url="http://www.zangband.org" +license="custom" +arch="all" +makedepends="automake autoconf util-linux ncurses-dev" +depends="ncurses" +source="http://downloads.sourceforge.net/zangband/zangband-$_pkgver.tar.gz + fix-bad-substitution.patch + fix-bad-configure.patch + fix-random-num-gen.patch + fix-explosive-rune-error.patch + fix-spear-of-hagen-error.patch" +builddir="$srcdir/zangband" +options="!check" + +prepare() { + default_prepare + sed -i 's@# define DEFAULT_PATH "./lib/"@# define DEFAULT_PATH "/usr/lib/zangband/"@' $builddir/src/z-config.h + sed -i 's@strcpy(path, "./lib/");@strcpy(path, "/usr/lib/zangband/");@' $builddir/src/main.c +} + +build() { + ./configure --prefix=/usr/lib --with-gtk=no + make +} + +package() { + install -d "$pkgdir"/usr/lib/zangband + install -D -m755 zangband "$pkgdir"/usr/bin/zangband + cp -R "$srcdir"/zangband/lib "$pkgdir"/usr/lib + rename "$pkgdir"/usr/lib/lib "$pkgdir"/usr/lib/zangband "$pkgdir"/usr/lib/lib + chmod -R 775 "$pkgdir"/usr/lib/zangband + chown -R root:users "$pkgdir"/usr/lib/zangband + + find "$pkgdir"/usr/lib/zangband -name makefile.zb -exec rm {} \; + find "$pkgdir"/usr/lib/zangband -type f -exec chmod a-x {} \; +} + + +sha512sums="3eb0dc460c98278cceb06fedaec9e844418a92d791baccafcd3c6591cfb7021dc15188a52b4a5d951c23f55444650ed1b7005b49c3ac1773a19657f4ea1ac512 zangband-2.7.5pre1.tar.gz +ad764771aecc5421a3f25f01b15fe72cf44b17f5a58915ef1f44d2f3d9d8c19f22efffcfc37513deb587f88f6c7ed3f3da82942a922d74ebb307213a3ad3e90b fix-bad-substitution.patch +e0551b511c8b6c716704e2799f695f6314246a7c083f1f2ee23761a1d3227d4073e97f4af47e75daef271798b4b65d717a65cb56bae19eb45913321fd906c829 fix-bad-configure.patch +937627adfe6897c6195e28015de2fe6b796f402147f45a76b39c1bb4c0ba5e4e6c65d9153bc500ec481f3b0a92c048043efd9fbfe1300dfb9f3e57974e0c3d06 fix-random-num-gen.patch +2313da3a678212771cb5f51918bf7f1966e941b346d02538c5f13fdb0b43f208028cd61f50bb161180df1b2f3b496045c712fc39f4945c8ee029258faf6c7310 fix-explosive-rune-error.patch +6e5193a15a5fbb3947cb07363b15761c89405e050bcc13196c5106177843351df2d1ed3c06b95de1c6ecde4f3f614ef102a944270b500c2494d875de0adca8c3 fix-spear-of-hagen-error.patch" diff --git a/testing/zangband/fix-bad-configure.patch b/testing/zangband/fix-bad-configure.patch new file mode 100644 index 00000000000..372a88ea3de --- /dev/null +++ b/testing/zangband/fix-bad-configure.patch @@ -0,0 +1,219 @@ +#The initially available configure file uses non-posix forms leading to bad substitution errors, this allows the first configure run to pass +--- a/configure ++++ b/configure +@@ -9296,7 +9296,7 @@ + fi + echo "$as_me:$LINENO: result: `eval echo '${'$FLAG'}'`" >&5 + echo "${ECHO_T}`eval echo '${'$FLAG'}'`" >&6 +-if test ${!FLAG} = yes ; then ++if test [ "$FLAG" != yes ] ; then + CFLAGS="-pedantic $CFLAGS" + fi + +@@ -9315,7 +9315,7 @@ + fi + echo "$as_me:$LINENO: result: `eval echo '${'$FLAG'}'`" >&5 + echo "${ECHO_T}`eval echo '${'$FLAG'}'`" >&6 +-if test ${!FLAG} = yes ; then ++if test [ "$FLAG" != yes ] ; then + CFLAGS="-W $CFLAGS" + fi + +@@ -9334,7 +9334,7 @@ + fi + echo "$as_me:$LINENO: result: `eval echo '${'$FLAG'}'`" >&5 + echo "${ECHO_T}`eval echo '${'$FLAG'}'`" >&6 +-if test ${!FLAG} = yes ; then ++if test [ "$FLAG" != yes ] ; then + CFLAGS="-Wall $CFLAGS" + fi + +@@ -9353,7 +9353,7 @@ + fi + echo "$as_me:$LINENO: result: `eval echo '${'$FLAG'}'`" >&5 + echo "${ECHO_T}`eval echo '${'$FLAG'}'`" >&6 +-if test ${!FLAG} = yes ; then ++if test [ "$FLAG" != yes ] ; then + CFLAGS="-Wmissing-prototypes $CFLAGS" + fi + +@@ -9372,7 +9372,7 @@ + fi + echo "$as_me:$LINENO: result: `eval echo '${'$FLAG'}'`" >&5 + echo "${ECHO_T}`eval echo '${'$FLAG'}'`" >&6 +-if test ${!FLAG} = yes ; then ++if test [ "$FLAG" != yes ] ; then + CFLAGS="-Wmissing-declarations $CFLAGS" + fi + +@@ -9391,7 +9391,7 @@ + fi + echo "$as_me:$LINENO: result: `eval echo '${'$FLAG'}'`" >&5 + echo "${ECHO_T}`eval echo '${'$FLAG'}'`" >&6 +-if test ${!FLAG} = yes ; then ++if test [ "$FLAG" != yes ] ; then + CFLAGS="-Wno-long-long $CFLAGS" + fi + +@@ -9410,7 +9410,7 @@ + fi + echo "$as_me:$LINENO: result: `eval echo '${'$FLAG'}'`" >&5 + echo "${ECHO_T}`eval echo '${'$FLAG'}'`" >&6 +-if test ${!FLAG} = yes ; then ++if test [ "$FLAG" != yes ] ; then + CFLAGS="-Wwrite-strings $CFLAGS" + fi + +@@ -9429,7 +9429,7 @@ + fi + echo "$as_me:$LINENO: result: `eval echo '${'$FLAG'}'`" >&5 + echo "${ECHO_T}`eval echo '${'$FLAG'}'`" >&6 +-if test ${!FLAG} = yes ; then ++if test [ "$FLAG" != yes ] ; then + CFLAGS="-Wpointer-arith $CFLAGS" + fi + +@@ -9448,7 +9448,7 @@ + fi + echo "$as_me:$LINENO: result: `eval echo '${'$FLAG'}'`" >&5 + echo "${ECHO_T}`eval echo '${'$FLAG'}'`" >&6 +-if test ${!FLAG} = yes ; then ++if test [ "$FLAG" != yes ] ; then + CFLAGS="-Wbad-function-cast $CFLAGS" + fi + +@@ -9467,7 +9467,7 @@ + fi + echo "$as_me:$LINENO: result: `eval echo '${'$FLAG'}'`" >&5 + echo "${ECHO_T}`eval echo '${'$FLAG'}'`" >&6 +-if test ${!FLAG} = yes ; then ++if test [ "$FLAG" != yes ] ; then + CFLAGS="-Waggregate-return $CFLAGS" + fi + +@@ -9486,7 +9486,7 @@ + fi + echo "$as_me:$LINENO: result: `eval echo '${'$FLAG'}'`" >&5 + echo "${ECHO_T}`eval echo '${'$FLAG'}'`" >&6 +-if test ${!FLAG} = yes ; then ++if test [ "$FLAG" != yes ] ; then + CFLAGS="-Wstrict-prototypes $CFLAGS" + fi + +@@ -9505,7 +9505,7 @@ + fi + echo "$as_me:$LINENO: result: `eval echo '${'$FLAG'}'`" >&5 + echo "${ECHO_T}`eval echo '${'$FLAG'}'`" >&6 +-if test ${!FLAG} = yes ; then ++if test [ "$FLAG" != yes ] ; then + CFLAGS="-Wredundant-decls $CFLAGS" + fi + +@@ -9524,7 +9524,7 @@ + fi + echo "$as_me:$LINENO: result: `eval echo '${'$FLAG'}'`" >&5 + echo "${ECHO_T}`eval echo '${'$FLAG'}'`" >&6 +-if test ${!FLAG} = yes ; then ++if test [ "$FLAG" != yes ] ; then + CFLAGS="-Wchar-subscripts $CFLAGS" + fi + +@@ -9543,7 +9543,7 @@ + fi + echo "$as_me:$LINENO: result: `eval echo '${'$FLAG'}'`" >&5 + echo "${ECHO_T}`eval echo '${'$FLAG'}'`" >&6 +-if test ${!FLAG} = yes ; then ++if test [ "$FLAG" != yes ] ; then + CFLAGS="-Wimplicit $CFLAGS" + fi + +@@ -9562,7 +9562,7 @@ + fi + echo "$as_me:$LINENO: result: `eval echo '${'$FLAG'}'`" >&5 + echo "${ECHO_T}`eval echo '${'$FLAG'}'`" >&6 +-if test ${!FLAG} = yes ; then ++if test [ "$FLAG" != yes ] ; then + CFLAGS="-Wparentheses $CFLAGS" + fi + +@@ -9581,7 +9581,7 @@ + fi + echo "$as_me:$LINENO: result: `eval echo '${'$FLAG'}'`" >&5 + echo "${ECHO_T}`eval echo '${'$FLAG'}'`" >&6 +-if test ${!FLAG} = yes ; then ++if test [ "$FLAG" != yes ] ; then + CFLAGS="-Wsequence-point $CFLAGS" + fi + +@@ -9600,7 +9600,7 @@ + fi + echo "$as_me:$LINENO: result: `eval echo '${'$FLAG'}'`" >&5 + echo "${ECHO_T}`eval echo '${'$FLAG'}'`" >&6 +-if test ${!FLAG} = yes ; then ++if test [ "$FLAG" != yes ] ; then + CFLAGS="-Wreturn-type $CFLAGS" + fi + +@@ -9619,7 +9619,7 @@ + fi + echo "$as_me:$LINENO: result: `eval echo '${'$FLAG'}'`" >&5 + echo "${ECHO_T}`eval echo '${'$FLAG'}'`" >&6 +-if test ${!FLAG} = yes ; then ++if test [ "$FLAG" != yes ] ; then + CFLAGS="-Wswitch $CFLAGS" + fi + +@@ -9638,7 +9638,7 @@ + fi + echo "$as_me:$LINENO: result: `eval echo '${'$FLAG'}'`" >&5 + echo "${ECHO_T}`eval echo '${'$FLAG'}'`" >&6 +-if test ${!FLAG} = yes ; then ++if test [ "$FLAG" != yes ] ; then + CFLAGS="-Wunused $CFLAGS" + fi + +@@ -9657,7 +9657,7 @@ + fi + echo "$as_me:$LINENO: result: `eval echo '${'$FLAG'}'`" >&5 + echo "${ECHO_T}`eval echo '${'$FLAG'}'`" >&6 +-if test ${!FLAG} = yes ; then ++if test [ "$FLAG" != yes ] ; then + CFLAGS="-Wuninitialized $CFLAGS" + fi + +@@ -9676,7 +9676,7 @@ + fi + echo "$as_me:$LINENO: result: `eval echo '${'$FLAG'}'`" >&5 + echo "${ECHO_T}`eval echo '${'$FLAG'}'`" >&6 +-if test ${!FLAG} = yes ; then ++if test [ "$FLAG" != yes ] ; then + CFLAGS="-Wundef $CFLAGS" + fi + +@@ -9695,7 +9695,7 @@ + fi + echo "$as_me:$LINENO: result: `eval echo '${'$FLAG'}'`" >&5 + echo "${ECHO_T}`eval echo '${'$FLAG'}'`" >&6 +-if test ${!FLAG} = yes ; then ++if test [ "$FLAG" != yes ] ; then + CFLAGS="-Wnested-externs $CFLAGS" + fi + +@@ -9714,7 +9714,7 @@ + fi + echo "$as_me:$LINENO: result: `eval echo '${'$FLAG'}'`" >&5 + echo "${ECHO_T}`eval echo '${'$FLAG'}'`" >&6 +-if test ${!FLAG} = yes ; then ++if test [ "$FLAG" != yes ] ; then + CFLAGS="-Wdeclaration-after-statement $CFLAGS" + fi + +@@ -9733,7 +9733,7 @@ + fi + echo "$as_me:$LINENO: result: `eval echo '${'$FLAG'}'`" >&5 + echo "${ECHO_T}`eval echo '${'$FLAG'}'`" >&6 +-if test ${!FLAG} = yes ; then ++if test [ "$FLAG" != yes ] ; then + CFLAGS="-Wsign-compare $CFLAGS" + fi + diff --git a/testing/zangband/fix-bad-substitution.patch b/testing/zangband/fix-bad-substitution.patch new file mode 100644 index 00000000000..b344940b34f --- /dev/null +++ b/testing/zangband/fix-bad-substitution.patch @@ -0,0 +1,12 @@ +#The form ${!FLAG} throws bad substitution errors, converting to a posix complient form fixs it, and allows second pass generation to work +--- a/configure.in ++++ b/configure.in +@@ -249,7 +249,7 @@ + else + eval $FLAG=no + fi]) +-if test ${!FLAG} = yes ; then ++if test [ "$FLAG" != yes ] ; then + CFLAGS="$1 $CFLAGS" + fi + ]) diff --git a/testing/zangband/fix-explosive-rune-error.patch b/testing/zangband/fix-explosive-rune-error.patch new file mode 100644 index 00000000000..8b32831baef --- /dev/null +++ b/testing/zangband/fix-explosive-rune-error.patch @@ -0,0 +1,12 @@ +# Typo error, without this rune's won't break, which could lead to game breaking errors +--- a/lib/edit/t_info.txt ++++ b/lib/edit/t_info.txt +@@ -92,7 +92,7 @@ + L:MENTT:if (do_move == TRUE) then + L:MENTT: if (bAnd(race.flags[0], RF0_NEVER_BLOW) ~= 0) and + L:MENTT: (randint1(BREAK_MINOR_GLYPH) < race.level) then +-L:MENTT: if (field.fx == player.px) and (field.fy = player.py) then ++L:MENTT: if (field.fx == player.px) and (field.fy == player.py) then + L:MENTT: msgf("The rune explodes!") + L:MENTT: fire_ball(GF_MANA, 0, 2 * ((player.lev / 2) + damroll(7, 7)), 2) + L:MENTT: else diff --git a/testing/zangband/fix-random-num-gen.patch b/testing/zangband/fix-random-num-gen.patch new file mode 100644 index 00000000000..21d8bdec03a --- /dev/null +++ b/testing/zangband/fix-random-num-gen.patch @@ -0,0 +1,22 @@ +#RNG is not implemented properly for 64bit systems, without this Zangband hangs on character generation +*** a/src/h-type.h 2005-06-05 01:54:21.000000000 +0900 +--- b/src/h-type.h 2017-08-30 21:46:23.723911618 +0900 +*************** +*** 103,108 **** +--- 103,118 ---- + typedef signed short s16b; + typedef unsigned short u16b; + ++ /* detect 64 bit GCC */ ++ #ifdef _LP64 ++ #ifndef L64 ++ #define L64 1 ++ #endif ++ #ifndef USE_64B ++ #define USE_64B 1 ++ #endif ++ #endif ++ + /* Signed/Unsigned 32 bit value */ + #ifdef L64 /* 64 bit longs */ + typedef signed int s32b;
\ No newline at end of file diff --git a/testing/zangband/fix-spear-of-hagen-error.patch b/testing/zangband/fix-spear-of-hagen-error.patch new file mode 100644 index 00000000000..3b0994922e6 --- /dev/null +++ b/testing/zangband/fix-spear-of-hagen-error.patch @@ -0,0 +1,12 @@ +#Typo causes artifact not to work, using it in game throws errors +--- a/lib/edit/a_info.txt ++++ b/lib/edit/a_info.txt +@@ -1491,7 +1491,7 @@ + F:STEALTH | RES_DARK | INFRA | + F:BRAND_COLD | SLAY_UNDEAD | RES_COLD | SEE_INVIS | SHOW_MODS | THROW + F:INSTA_ART +-L:BONUS: b.pspeed = (player.level + 4) / 5 ++L:BONUS: b.pspeed = (player.lev + 4) / 5 + L:SPOIL: return "+1 speed / 5 levels" + + # The Spear 'Soulsucker' |