add new package: redir (#772)
authorElTopo <ElTopo@users.noreply.github.com>
Mon, 20 Feb 2017 21:14:52 +0000 (13:14 -0800)
committerFredrik Fornwall <fredrik@fornwall.net>
Mon, 20 Feb 2017 21:14:52 +0000 (22:14 +0100)
* add bvi package

* add new package: cgdb

* add gdb in cgdb's TERMUX_PKG_DEPENDS

* add new package: redir

* bvi package revision 1: fix column number issue with clang (gcc does not seem to have this issue)
bvi (compiled with clang) incorrectly displayed only 12 bytes for each line on a 80-column terminal (instead of 16 bytes normally). command :set cm=## also had similar problems.
I found the issue was caused by the following statements:
       sprintf(addr_form,  "%%0%dllX  ", AnzAdd);
       AnzAdd = sprintf(tmp, addr_form, block_begin);

   ('block_begin''s data type is off_t)
   gcc automatically typecasts 'block_begin' from off_t to loff_t,
   on the otherhand, clang takes address of 'block_begin' and uses
   it as loff_t thus writes some garbage value in 'tmp' string.

packages/bvi/Makefile.in.patch
packages/bvi/build.sh
packages/bvi/column_number_bugfix.patch [new file with mode: 0644]
packages/bvi/fix_errno.patch
packages/redir/Makefile.patch [new file with mode: 0644]
packages/redir/build.sh [new file with mode: 0644]

index 2865615..6156589 100644 (file)
@@ -1,6 +1,5 @@
-diff -u -r ../bvi-1.4.0/Makefile.in ./Makefile.in
---- ../bvi-1.4.0/Makefile.in   2014-10-01 20:59:36.000000000 +0200
-+++ ./Makefile.in      2017-01-25 01:40:36.938250670 +0100
+--- bvi-1.4.0/Makefile.in      2014-10-01 11:59:36.000000000 -0700
++++ src/Makefile.in    2017-02-19 00:34:01.662869384 -0800
 @@ -72,8 +72,8 @@
        @$(INSTALL_DATA) bmore.help $(helpdir)
        @if [ -f $(bindir)/bview ]; then rm $(bindir)/bview; fi
index 920800a..0daf04d 100644 (file)
@@ -2,6 +2,7 @@ TERMUX_PKG_HOMEPAGE=http://bvi.sourceforge.net/
 TERMUX_PKG_DESCRIPTION="Binary file editor based on vi"
 TERMUX_PKG_DEPENDS="ncurses"
 TERMUX_PKG_VERSION=1.4.0
+TERMUX_PKG_REVISION=1
 TERMUX_PKG_SRCURL=http://sourceforge.net/projects/bvi/files/bvi/${TERMUX_PKG_VERSION}/bvi-${TERMUX_PKG_VERSION}.src.tar.gz
 TERMUX_PKG_SHA256=015a3c2832c7c097d98a5527deef882119546287ba8f2a70c736227d764ef802
 TERMUX_PKG_FOLDERNAME=bvi-${TERMUX_PKG_VERSION}
diff --git a/packages/bvi/column_number_bugfix.patch b/packages/bvi/column_number_bugfix.patch
new file mode 100644 (file)
index 0000000..0df86e0
--- /dev/null
@@ -0,0 +1,30 @@
+--- bvi-1.4.0/bvi.c    2014-10-07 13:09:45.000000000 -0700
++++ src/bvi.c  2017-02-19 00:35:24.587363303 -0800
+@@ -276,7 +276,7 @@
+        if (AnzAdd > sizeof(block_begin) * 2)
+            AnzAdd = sizeof(block_begin) * 2;
+        sprintf(addr_form,  "%%0%dllX  ", AnzAdd);
+-       AnzAdd = sprintf(tmp, addr_form, block_begin);
++       AnzAdd = sprintf(tmp, addr_form, (long long unsigned)block_begin);
+       }
+       Anzahl = ((COLS - AnzAdd - 1) / 16) * 4;
+@@ -729,7 +729,6 @@
+       char    *arg;
+ {
+       off_t   val;
+-      extern int errno;
+       char    *poi;
+       errno = 0;
+--- bvi-1.4.0/set.c    2014-09-30 05:00:53.000000000 -0700
++++ src/set.c  2017-02-19 00:36:08.927600541 -0800
+@@ -135,7 +135,7 @@
+                                       if (((COLS - AnzAdd - 1) / 4) >= P(P_CM)) {
+                                               Anzahl = P(P_CM);
+                                       } else {
+-                                              Anzahl = P(P_CM) = ((COLS - AnzAdd - 1) / 4);
++                                              Anzahl = P(P_CM) = ((COLS - AnzAdd - 1) / 16) * 4;
+                                       }
+                                   maxx = Anzahl * 4 + AnzAdd + 1;
+                                   Anzahl3 = Anzahl * 3;
index ada8d49..021f53b 100644 (file)
@@ -1,5 +1,5 @@
---- src/bm_unix.c~     2013-08-25 11:59:33.000000000 -0700
-+++ src/bm_unix.c      2017-01-03 23:37:36.697875250 -0800
+--- bvi-1.4.0/bm_unix.c        2013-08-25 11:59:33.000000000 -0700
++++ src/bm_unix.c      2017-02-19 00:34:01.618869104 -0800
 @@ -260,7 +260,6 @@
  vgetc()
  {
@@ -8,18 +8,8 @@
  
      errno = 0;
      if (read(2, &cha, 1) <= 0) {
---- src/bvi.c~ 2014-10-07 13:09:45.000000000 -0700
-+++ src/bvi.c  2017-01-03 23:37:09.469794620 -0800
-@@ -729,7 +729,6 @@
-       char    *arg;
- {
-       off_t   val;
--      extern int errno;
-       char    *poi;
-       errno = 0;
---- src/comm.c~        2014-01-29 06:54:53.000000000 -0800
-+++ src/comm.c 2017-01-03 23:37:18.305820838 -0800
+--- bvi-1.4.0/comm.c   2014-01-29 06:54:53.000000000 -0800
++++ src/comm.c 2017-02-19 00:34:01.622869129 -0800
 @@ -84,7 +84,6 @@
  extern        char    *name;                  /* actual filename */
  extern        char    **files;                /* used for "next" and "rewind" */
diff --git a/packages/redir/Makefile.patch b/packages/redir/Makefile.patch
new file mode 100644 (file)
index 0000000..320611d
--- /dev/null
@@ -0,0 +1,31 @@
+--- redir-2.2.1/Makefile       1999-12-26 12:51:55.000000000 -0800
++++ src/Makefile       2017-02-15 13:07:10.577481896 -0800
+@@ -15,7 +15,8 @@
+ # if your system needs any additional libraries (solaris, for example, 
+ # needs the ones commented out below), edit this line.
+-EXTRA_LIBS = #-lnsl -lsocket
++#EXTRA_LIBS = #-lnsl -lsocket
++EXTRA_LIBS = -llog
+ # add additional compiler flags here.  Some useful ones are:
+ #
+@@ -27,7 +28,7 @@
+ ### end of user configuration section
+ # redir requires gcc.  if you're lucky, another compiler might work.
+-CC = gcc
++#CC = gcc
+ # if your system lacks getopt_long, remove the comment from this line
+ OBJS = redir.o $(GETOPT_OBJS)
+@@ -51,6 +52,9 @@
+ redir:                ${OBJS}
+       ${CC} ${LDFLAGS} -o redir ${OBJS} ${LIBS}
++install: all
++      install redir $(PREFIX)/bin
++      install redir.man $(PREFIX)/share/man/man1/redir.1
diff --git a/packages/redir/build.sh b/packages/redir/build.sh
new file mode 100644 (file)
index 0000000..fd8c8bd
--- /dev/null
@@ -0,0 +1,8 @@
+TERMUX_PKG_HOMEPAGE=http://sammy.net/~sammy/hacks/
+TERMUX_PKG_DESCRIPTION="Redirect TCP connections"
+TERMUX_PKG_VERSION=2.2.1
+TERMUX_PKG_SRCURL=http://sammy.net/~sammy/hacks/redir-2.2.1.tar.gz
+TERMUX_PKG_SHA256=7ea504f835338e448f674ca8637512f511bf74538418ad43ab39039017090e6c
+TERMUX_PKG_FOLDERNAME=redir-${TERMUX_PKG_VERSION}
+TERMUX_PKG_BUILD_IN_SRC="yes"
+TERMUX_PKG_RM_AFTER_INSTALL="share/applications share/pixmaps"