diff --git a/packages/gnushogi/build.sh b/packages/gnushogi/build.sh index 1ffc287604b7aea..49335adf53fc69a 100644 --- a/packages/gnushogi/build.sh +++ b/packages/gnushogi/build.sh @@ -2,22 +2,39 @@ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/gnushogi/ TERMUX_PKG_DESCRIPTION="Program that plays the game of Shogi, also known as Japanese Chess" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_MAINTAINER="@termux" -TERMUX_PKG_VERSION=1.4.2 -TERMUX_PKG_REVISION=4 -TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/gnushogi/gnushogi-${TERMUX_PKG_VERSION}.tar.gz -TERMUX_PKG_SHA256=1ecc48a866303c63652552b325d685e7ef5e9893244080291a61d96505d52b29 +_COMMIT=5bb0b5b2f6953b3250e965c7ecaf108215751a74 +TERMUX_PKG_VERSION=2014.11.19 +TERMUX_PKG_SRCURL=git+https://git.savannah.gnu.org/git/gnushogi.git +TERMUX_PKG_GIT_BRANCH=master +TERMUX_PKG_SHA256=7743bef7ca9d412e2e2d2c111c24ff23c934b53134a3eb7f477c05139dba9299 TERMUX_PKG_EXTRA_CONFIGURE_ARGS="ac_cv_lib_curses_clrtoeol=yes --with-curses" TERMUX_PKG_RM_AFTER_INSTALL="info/gnushogi.info" TERMUX_PKG_DEPENDS="ncurses" TERMUX_PKG_HOSTBUILD=true TERMUX_PKG_GROUPS="games" -termux_step_pre_configure() { - CFLAGS+=" $CPPFLAGS -fcommon" +termux_step_post_get_source() { + git fetch --unshallow + git checkout $_COMMIT + + local version="$(git log -1 --format=%cs | sed 's/-/./g')" + if [ "$version" != "$TERMUX_PKG_VERSION" ]; then + echo -n "ERROR: The specified version \"$TERMUX_PKG_VERSION\"" + echo " is different from what is expected to be: \"$version\"" + return 1 + fi + + local s=$(find . -type f ! -path '*/.git/*' -print0 | xargs -0 sha256sum | LC_ALL=C sort | sha256sum) + if [[ "${s}" != "${TERMUX_PKG_SHA256} "* ]]; then + termux_error_exit "Checksum mismatch for source files." + fi } -termux_step_post_configure () { - cp $TERMUX_PKG_HOSTBUILD_DIR/gnushogi/pat2inc $TERMUX_PKG_BUILDDIR/gnushogi/pat2inc - # Update timestamps so that the binaries does not get rebuilt: - touch -d "next hour" $TERMUX_PKG_BUILDDIR/gnushogi/pat2inc +termux_step_host_build() { + cd "$TERMUX_PKG_SRCDIR" + ./autogen.sh +} + +termux_step_pre_configure() { + CFLAGS+=" $CPPFLAGS -fcommon" } diff --git a/packages/gnushogi/gnushogi-makefile-in.patch b/packages/gnushogi/gnushogi-makefile-in.patch deleted file mode 100644 index f8ffe1eea5cb171..000000000000000 --- a/packages/gnushogi/gnushogi-makefile-in.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -u -r ../gnushogi-1.4.2/gnushogi/Makefile.in ./gnushogi/Makefile.in ---- ../gnushogi-1.4.2/gnushogi/Makefile.in 2014-02-17 21:26:59.000000000 +0100 -+++ ./gnushogi/Makefile.in 2014-03-10 00:07:58.821997498 +0100 -@@ -54,7 +54,7 @@ - LIBDIR = $(prefix)/lib/$(PROGNAME) - - # Where the man page goes. --MANDIR = $(prefix)/man/man6 -+MANDIR = @mandir@/man6 - - # Where the info file goes. - INFODIR = $(prefix)/info -@@ -241,7 +241,7 @@ - # - - install: $(PROGNAME) -- strip $(PROGNAME) -+ $(STRIP) $(PROGNAME) - $(INSTALL_PROGRAM) -d $(BINDIR) - $(INSTALL_PROGRAM) -d $(LIBDIR) - $(INSTALL_PROGRAM) -d $(MANDIR) diff --git a/packages/gnushogi/use_libncurses.patch b/packages/gnushogi/use_libncurses.patch deleted file mode 100644 index baecc6121fdecf8..000000000000000 --- a/packages/gnushogi/use_libncurses.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -u -r ../gnushogi-1.4.2/configure ./configure ---- ../gnushogi-1.4.2/configure 2014-02-17 21:30:14.000000000 +0100 -+++ ./configure 2014-02-25 23:37:49.000000000 +0100 -@@ -3315,7 +3315,7 @@ - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_curses_clrtoeol" >&5 - $as_echo "$ac_cv_lib_curses_clrtoeol" >&6; } - if test "x$ac_cv_lib_curses_clrtoeol" = xyes; then : -- LIBCURSES=-lcurses -+ LIBCURSES=-lncurses - - CURSESDSP=cursesdsp.o -