new package: sc-im

https://github.com/termux/unstable-packages/issues/34
This commit is contained in:
Leonid Pliushch 2019-06-16 14:58:52 +03:00
parent 0add10686e
commit bf3b644f32
8 changed files with 207 additions and 0 deletions

9
packages/libzip/build.sh Normal file
View File

@ -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 <leonid.plyushch@gmail.com>"
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"

View File

@ -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

15
packages/sc-im/build.sh Normal file
View File

@ -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 <leonid.plyushch@gmail.com>"
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/* .
}

View File

@ -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 <wchar.h>
#include <stdlib.h>
#include <ctype.h> // for isprint()
-#include <wordexp.h>
#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;

View File

@ -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 <locale.h>
+#include <langinfo.h>
+#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 <locale.h>
- #include <langinfo.h>
char * loc = NULL;
char * f = NULL;
loc = setlocale(LC_TIME, "");

View File

@ -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 <locale.h>
+#include <langinfo.h>
+#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 <locale.h>
- #include <langinfo.h>
char * loc = NULL;
char * f = NULL;
loc = setlocale(LC_TIME, "");

View File

@ -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 <unistd.h>
#include <wchar.h>
#include <sys/wait.h>
-#include <wordexp.h>
#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.)
*

View File

@ -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 <fcntl.h> // for F_GETFL O_NONBLOCK F_SETFL
#include <locale.h>
#include <wchar.h>
-#include <wordexp.h>
#include <sys/ioctl.h> // 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;