From bf3b644f32ab4eba5a889cab19e0770ac65d42d0 Mon Sep 17 00:00:00 2001 From: Leonid Pliushch Date: Sun, 16 Jun 2019 14:58:52 +0300 Subject: [PATCH] new package: sc-im https://github.com/termux/unstable-packages/issues/34 --- packages/libzip/build.sh | 9 ++++++++ packages/sc-im/Makefile.patch | 34 +++++++++++++++++++++++++++++ packages/sc-im/build.sh | 15 +++++++++++++ packages/sc-im/cmds_command.c.patch | 34 +++++++++++++++++++++++++++++ packages/sc-im/cmds_normal.c.patch | 24 ++++++++++++++++++++ packages/sc-im/cmds_visual.c.patch | 23 +++++++++++++++++++ packages/sc-im/file.c.patch | 34 +++++++++++++++++++++++++++++ packages/sc-im/main.c.patch | 34 +++++++++++++++++++++++++++++ 8 files changed, 207 insertions(+) create mode 100644 packages/libzip/build.sh create mode 100644 packages/sc-im/Makefile.patch create mode 100644 packages/sc-im/build.sh create mode 100644 packages/sc-im/cmds_command.c.patch create mode 100644 packages/sc-im/cmds_normal.c.patch create mode 100644 packages/sc-im/cmds_visual.c.patch create mode 100644 packages/sc-im/file.c.patch create mode 100644 packages/sc-im/main.c.patch diff --git a/packages/libzip/build.sh b/packages/libzip/build.sh new file mode 100644 index 000000000..26c31a1eb --- /dev/null +++ b/packages/libzip/build.sh @@ -0,0 +1,9 @@ +TERMUX_PKG_HOMEPAGE=https://libzip.org/ +TERMUX_PKG_DESCRIPTION="Library for reading, creating, and modifying zip archives" +TERMUX_PKG_LICENSE="BSD" +TERMUX_PKG_MAINTAINER="Leonid Plyushch " +TERMUX_PKG_VERSION=1.5.2 +TERMUX_PKG_REVISION=2 +TERMUX_PKG_SRCURL=https://libzip.org/download/libzip-$TERMUX_PKG_VERSION.tar.gz +TERMUX_PKG_SHA256=be694a4abb2ffe5ec02074146757c8b56084dbcebf329123c84b205417435e15 +TERMUX_PKG_DEPENDS="libbz2, openssl, zlib" diff --git a/packages/sc-im/Makefile.patch b/packages/sc-im/Makefile.patch new file mode 100644 index 000000000..b5da711c5 --- /dev/null +++ b/packages/sc-im/Makefile.patch @@ -0,0 +1,34 @@ +--- src/Makefile 2018-02-23 06:49:41.666712787 +0000 ++++ src/src/Makefile 2018-02-23 06:49:53.650717771 +0000 +@@ -2,7 +2,7 @@ + name = scim + + # The base directory where everything should be installed. +-prefix = /usr/local ++prefix = @TERMUX_PREFIX@ + + EXDIR = $(prefix)/bin + HELPDIR = $(prefix)/share/$(name) +@@ -13,10 +13,11 @@ + + # Change these to your liking or use `make CC=gcc` etc + #CC = cc +-#YACC = bison -y ++YACC = bison -y + #SED = sed + + LDLIBS += -lm ++LDLIBS += -landroid-support + + CFLAGS += -Wall -g + CFLAGS += -DNCURSES +@@ -166,6 +167,9 @@ + gram.c : gram.y + $(YACC) -d $< + ++gram.y : ++ $(YACC) gram.y ++ + pvmtbl.o: sc.h pvmtbl.c + $(CC) ${CFLAGS} -c -DPSC pvmtbl.c + diff --git a/packages/sc-im/build.sh b/packages/sc-im/build.sh new file mode 100644 index 000000000..8049b77e2 --- /dev/null +++ b/packages/sc-im/build.sh @@ -0,0 +1,15 @@ +TERMUX_PKG_HOMEPAGE=https://github.com/andmarti1424/sc-im +TERMUX_PKG_DESCRIPTION="An improved version of sc, a spreadsheet calculator" +TERMUX_PKG_LICENSE="BSD" +TERMUX_PKG_MAINTAINER="Leonid Plyushch " +TERMUX_PKG_VERSION=0.7.0 +TERMUX_PKG_REVISION=4 +TERMUX_PKG_SRCURL=https://github.com/andmarti1424/sc-im/archive/v${TERMUX_PKG_VERSION}.tar.gz +TERMUX_PKG_SHA256=87225918cb6f52bbc068ee6b12eaf176c7c55ba9739b29ca08cb9b6699141cad +TERMUX_PKG_DEPENDS="libandroid-support, libzip, ncurses" +TERMUX_PKG_BUILD_IN_SRC=yes + +termux_step_post_configure() { + CFLAGS+=" $CPPFLAGS -I$TERMUX_PREFIX/include/libandroid-support" + cp -rf src/* . +} diff --git a/packages/sc-im/cmds_command.c.patch b/packages/sc-im/cmds_command.c.patch new file mode 100644 index 000000000..73bc64713 --- /dev/null +++ b/packages/sc-im/cmds_command.c.patch @@ -0,0 +1,34 @@ +--- cmds_command.c 2018-02-23 06:39:28.313538544 +0000 ++++ src/src/cmds_command.c 2018-02-23 06:39:49.702839355 +0000 +@@ -46,7 +46,6 @@ + #include + #include + #include // for isprint() +-#include + #include "sc.h" // for rescol + #include "conf.h" + #include "cmds_command.h" +@@ -73,6 +72,23 @@ + #include "undo.h" + #endif + ++#define WRDE_NOCMD 0 ++ ++typedef struct { ++ size_t we_wordc; ++ char **we_wordv; ++ size_t we_offs; ++} wordexp_t; ++ ++static inline int wordexp(const char *c, wordexp_t *w, int _i) ++{ ++ return -1; ++} ++ ++static inline void wordfree(wordexp_t *__wordexp) ++{ ++} ++ + extern char * rev; + extern struct dictionary * user_conf_d; + diff --git a/packages/sc-im/cmds_normal.c.patch b/packages/sc-im/cmds_normal.c.patch new file mode 100644 index 000000000..401d3df39 --- /dev/null +++ b/packages/sc-im/cmds_normal.c.patch @@ -0,0 +1,24 @@ +diff -uNr sc-im-0.7.0/src/cmds_normal.c sc-im-0.7.0.mod/src/cmds_normal.c +--- sc-im-0.7.0/src/cmds_normal.c 2017-12-13 19:48:59.000000000 +0200 ++++ sc-im-0.7.0.mod/src/cmds_normal.c 2019-01-30 21:58:28.431965657 +0200 +@@ -89,6 +89,11 @@ + * \return none + */ + ++#ifdef USELOCALE ++#include ++#include ++#endif ++ + void do_normalmode(struct block * buf) { + int bs = get_bufsize(buf); + struct ent * e; +@@ -227,8 +232,6 @@ + case ctl('d'): // set date format using current locate D_FMT format + { + #ifdef USELOCALE +- #include +- #include + char * loc = NULL; + char * f = NULL; + loc = setlocale(LC_TIME, ""); diff --git a/packages/sc-im/cmds_visual.c.patch b/packages/sc-im/cmds_visual.c.patch new file mode 100644 index 000000000..0efddb007 --- /dev/null +++ b/packages/sc-im/cmds_visual.c.patch @@ -0,0 +1,23 @@ +diff -uNr sc-im-0.7.0/src/cmds_visual.c sc-im-0.7.0.mod/src/cmds_visual.c +--- sc-im-0.7.0/src/cmds_visual.c 2017-12-13 19:48:59.000000000 +0200 ++++ sc-im-0.7.0.mod/src/cmds_visual.c 2019-01-30 22:00:04.705760754 +0200 +@@ -141,6 +141,10 @@ + * \return none + */ + ++#ifdef USELOCALE ++#include ++#include ++#endif + void do_visualmode(struct block * buf) { + // we are moving (previous to a 'C-o' keypress) + if (moving == TRUE) { +@@ -400,8 +404,6 @@ + // datefmt with locale D_FMT format + } else if (buf->value == ctl('d')) { + #ifdef USELOCALE +- #include +- #include + char * loc = NULL; + char * f = NULL; + loc = setlocale(LC_TIME, ""); diff --git a/packages/sc-im/file.c.patch b/packages/sc-im/file.c.patch new file mode 100644 index 000000000..877f6d1a1 --- /dev/null +++ b/packages/sc-im/file.c.patch @@ -0,0 +1,34 @@ +--- file.c 2018-02-23 06:39:56.329524606 +0000 ++++ src/src/file.c 2018-02-23 06:40:14.550410296 +0000 +@@ -53,7 +53,6 @@ + #include + #include + #include +-#include + + #include "conf.h" + #include "maps.h" +@@ -82,6 +81,23 @@ + extern int pthread_exists; + #endif + ++#define WRDE_NOCMD 0 ++ ++typedef struct { ++ size_t we_wordc; ++ char **we_wordv; ++ size_t we_offs; ++} wordexp_t; ++ ++static inline int wordexp(const char *c, wordexp_t *w, int _i) ++{ ++ return -1; ++} ++ ++static inline void wordfree(wordexp_t *__wordexp) ++{ ++} ++ + /** + * \brief Erase the database (tbl, etc.) + * diff --git a/packages/sc-im/main.c.patch b/packages/sc-im/main.c.patch new file mode 100644 index 000000000..91703ab46 --- /dev/null +++ b/packages/sc-im/main.c.patch @@ -0,0 +1,34 @@ +--- main.c 2018-02-23 06:41:58.248538336 +0000 ++++ src/src/main.c 2018-02-23 06:42:28.433438297 +0000 +@@ -60,7 +60,6 @@ + #include // for F_GETFL O_NONBLOCK F_SETFL + #include + #include +-#include + #include // for ioctl + + #include "main.h" +@@ -90,6 +89,23 @@ + #include "lua.h" + #endif + ++#define WRDE_NOCMD 0 ++ ++typedef struct { ++ size_t we_wordc; ++ char **we_wordv; ++ size_t we_offs; ++} wordexp_t; ++ ++static inline int wordexp(const char *c, wordexp_t *w, int _i) ++{ ++ return -1; ++} ++ ++static inline void wordfree(wordexp_t *__wordexp) ++{ ++} ++ + int currow = 0; /**< Current row of the selected cell. */ + int curcol = 0; /**< Current column of the selected cell. */ + int lastrow = 0;