Add packages/cboard
authorFredrik Fornwall <fredrik@fornwall.net>
Sat, 11 Jul 2015 11:56:20 +0000 (07:56 -0400)
committerFredrik Fornwall <fredrik@fornwall.net>
Sat, 11 Jul 2015 11:56:20 +0000 (07:56 -0400)
packages/cboard/build.sh [new file with mode: 0644]
packages/cboard/configure.patch [new file with mode: 0644]
packages/cboard/libchess-pgn.c.patch [new file with mode: 0644]

diff --git a/packages/cboard/build.sh b/packages/cboard/build.sh
new file mode 100644 (file)
index 0000000..b80ec7a
--- /dev/null
@@ -0,0 +1,9 @@
+TERMUX_PKG_HOMEPAGE=https://benkibbey.wordpress.com/cboard/
+TERMUX_PKG_DESCRIPTION="PGN browser, editor and chess engine frontend"
+TERMUX_PKG_VERSION=0.7.3
+TERMUX_PKG_SRCURL=http://downloads.sourceforge.net/project/c-board/${TERMUX_PKG_VERSION}/cboard-${TERMUX_PKG_VERSION}.tar.bz2
+TERMUX_PKG_DEPENDS="libandroid-support,libandroid-glob,gnuchess, ncurses, ncurses-ui-libs"
+TERMUX_PKG_EXTRA_CONFIGURE_ARGS="ac_cv_func_malloc_0_nonnull=yes ac_cv_func_realloc_0_nonnull=yes"
+
+CFLAGS+=" -DLINE_MAX=_POSIX2_LINE_MAX"
+LDFLAGS+=" -landroid-glob"
diff --git a/packages/cboard/configure.patch b/packages/cboard/configure.patch
new file mode 100644 (file)
index 0000000..63aefe9
--- /dev/null
@@ -0,0 +1,44 @@
+diff -u -r ../cboard-0.7.3/configure ./configure
+--- ../cboard-0.7.3/configure  2015-01-18 12:26:31.000000000 -0500
++++ ./configure        2015-07-11 06:51:31.092218872 -0400
+@@ -11484,40 +11484,7 @@
+ ac_compiler_gnu=$ac_cv_c_compiler_gnu
+     if test "$cross_compiling" = yes; then :
+-  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+-as_fn_error $? "cannot run test program while cross compiling
+-See \`config.log' for more details" "$LINENO" 5; }
+-else
+-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+-/* end confdefs.h.  */
+-\
+-                 #include <stdio.h>
+-                 #include <sys/types.h>
+-                 #include <sys/stat.h>
+-                 #include <fcntl.h>
+-
+-                 int main()
+-                 {
+-                     int fd;
+-
+-                     if ((fd = open("/dev/ptmx", O_RDWR)) == -1)
+-                         exit(1);
+-
+-                     if (ptsname(fd) == NULL)
+-                         exit(1);
+-
+-                     exit(0);
+-                 }
+-
+-_ACEOF
+-if ac_fn_c_try_run "$LINENO"; then :
+   ptmx_works=yes
+-else
+-  ptmx_works=no
+-fi
+-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+ fi
diff --git a/packages/cboard/libchess-pgn.c.patch b/packages/cboard/libchess-pgn.c.patch
new file mode 100644 (file)
index 0000000..d8e6cdf
--- /dev/null
@@ -0,0 +1,20 @@
+diff -u -r ../cboard-0.7.3/libchess/pgn.c ./libchess/pgn.c
+--- ../cboard-0.7.3/libchess/pgn.c     2015-01-14 21:18:45.000000000 -0500
++++ ./libchess/pgn.c   2015-07-11 06:55:57.087877710 -0400
+@@ -813,7 +813,6 @@
+     time_t now;
+     char tbuf[11] = {0};
+     struct tm *tp;
+-    struct passwd *pw = getpwuid(getuid());
+     char host[64] = { 0 };
+     time(&now);
+@@ -834,7 +833,7 @@
+     if (pgn_tag_add(&g->tag, "Round", "-") != E_PGN_OK)
+       warn("pgn_tag_add()");
+-    if (pgn_tag_add(&g->tag, "White", pw->pw_gecos) != E_PGN_OK)
++    if (pgn_tag_add(&g->tag, "White", "You") != E_PGN_OK)
+       warn("pgn_tag_add()");
+     if (pgn_tag_add(&g->tag, "Black", "?") != E_PGN_OK)