summaryrefslogtreecommitdiff
path: root/app-editors/fte/files
diff options
context:
space:
mode:
Diffstat (limited to 'app-editors/fte/files')
-rw-r--r--app-editors/fte/files/fte26
-rw-r--r--app-editors/fte/files/fte-cpp14.patch17
-rw-r--r--app-editors/fte/files/fte-gcc3438
-rw-r--r--app-editors/fte/files/fte-interix.patch38
-rw-r--r--app-editors/fte/files/fte-new_keyword.patch14
-rw-r--r--app-editors/fte/files/fte-slang.patch131
6 files changed, 264 insertions, 0 deletions
diff --git a/app-editors/fte/files/fte b/app-editors/fte/files/fte
new file mode 100644
index 000000000000..2e4621b92a62
--- /dev/null
+++ b/app-editors/fte/files/fte
@@ -0,0 +1,26 @@
+#!/bin/sh
+#
+# simple wrapper shell script which selects appropriate fte executable
+#
+
+if [ -n "$DISPLAY" ]; then
+ if which xfte >/dev/null; then
+ exec xfte "$@"
+ elif which sfte >/dev/null; then
+ exec sfte "$@"
+ elif which vfte >/dev/null; then
+ echo "Only Console version installed!"
+ fi
+else
+ if [ "$TERM" = linux ] && which vfte >/dev/null; then
+ exec vfte "$@"
+ elif which sfte >/dev/null; then
+ exec sfte "$@"
+ elif which xfte >/dev/null; then
+ echo "Only X-Window version installed!"
+ fi
+
+fi
+
+echo "No binary executable from the FTE family has been found!"
+echo "Please install one of them."
diff --git a/app-editors/fte/files/fte-cpp14.patch b/app-editors/fte/files/fte-cpp14.patch
new file mode 100644
index 000000000000..bea83b6a5ccd
--- /dev/null
+++ b/app-editors/fte/files/fte-cpp14.patch
@@ -0,0 +1,17 @@
+Fix C++14 compilation errors. Add casting int literals to char in config
+generator to avoid narrowing conversions.
+Gentoo bug: https://bugs.gentoo.org/show_bug.cgi?id=595048
+
+--- a/src/mkdefcfg.pl
++++ b/src/mkdefcfg.pl
+@@ -24,8 +24,8 @@
+
+ @c = split(//, $buf);
+ for ($i = 0; $i < $len; $i++) {
+- $out .= sprintf("0x%02X", ord($c[$i]));
+- if ($n++ % 10) {
++ $out .= sprintf("(char)0x%02X", ord($c[$i]));
++ if ($n++ % 5) {
+ $out .= ", ";
+ } else {
+ $out .= ",\n";
diff --git a/app-editors/fte/files/fte-gcc34 b/app-editors/fte/files/fte-gcc34
new file mode 100644
index 000000000000..51940e650657
--- /dev/null
+++ b/app-editors/fte/files/fte-gcc34
@@ -0,0 +1,38 @@
+--- fte/src/con_slang.cpp 2003-02-16 19:23:58.000000000 +0100
++++ fte-gcc34/src/con_slang.cpp 2005-01-12 16:57:38.050369064 +0100
+@@ -246,7 +246,7 @@
+ SLsmg_write_nchars(slang_dchs, sizeof(slang_dchs));
+
+ SLsmg_gotorc(0, 0);
+- SLsmg_read_raw(linebuf, sizeof(slang_dchs));
++ SLsmg_read_raw((SLsmg_Char_Type*)linebuf, sizeof(slang_dchs));
+ for (i = 0; i < sizeof(slang_dchs); i++)
+ raw_dchs[i] = (linebuf[i]) & 0xff;
+
+@@ -368,7 +368,7 @@
+ ConQueryCursorPos(&CurX, &CurY);
+ while (H > 0) {
+ SLsmg_gotorc(Y++, X);
+- SLsmg_write_raw(box, W);
++ SLsmg_write_raw((SLsmg_Char_Type*)box, W);
+ box += W;
+ H--;
+ }
+@@ -386,7 +386,7 @@
+ ConQueryCursorPos(&CurX, &CurY);
+ while (H > 0) {
+ SLsmg_gotorc(Y++, X);
+- SLsmg_read_raw(Cell, W);
++ SLsmg_read_raw((SLsmg_Char_Type*)Cell, W);
+ for (i = 0; i < W; i++)
+ if (Cell[i] & 0x8000) {
+ ch = Cell[i] & 0xff;
+@@ -409,7 +409,7 @@
+ ConQueryCursorPos(&CurX, &CurY);
+ while (H > 0) {
+ SLsmg_gotorc(Y++, X);
+- SLsmg_read_raw(box, W);
++ SLsmg_read_raw((SLsmg_Char_Type*)box, W);
+ box += W;
+ H--;
+ }
diff --git a/app-editors/fte/files/fte-interix.patch b/app-editors/fte/files/fte-interix.patch
new file mode 100644
index 000000000000..1df0a49f488a
--- /dev/null
+++ b/app-editors/fte/files/fte-interix.patch
@@ -0,0 +1,38 @@
+https://sourceforge.net/tracker/?func=detail&aid=3554646&group_id=943&atid=100943
+
+diff -ru fte.orig/src/g_unix_pipe.cpp fte/src/g_unix_pipe.cpp
+--- fte.orig/src/g_unix_pipe.cpp 2008-04-03 13:33:49 +0200
++++ fte/src/g_unix_pipe.cpp 2008-04-03 13:34:20 +0200
+@@ -4,6 +4,10 @@
+ #include <signal.h>
+ #include <sys/wait.h>
+
++#ifdef __INTERIX
++# include <sys/time.h>
++#endif
++
+ #include "sysdep.h"
+ #include "c_config.h"
+ #include "console.h"
+diff -ru fte.orig/src/sysdep.h fte/src/sysdep.h
+--- fte.orig/src/sysdep.h 2008-04-03 13:33:58 +0200
++++ fte/src/sysdep.h 2008-04-03 13:30:43 +0200
+@@ -15,7 +15,7 @@
+ #include <stdlib.h>
+ #include <stdarg.h>
+ #include <string.h>
+-#if defined(AIX) || defined(SCO) || defined(NCR)
++#if defined(AIX) || defined(SCO) || defined(NCR) || defined(__INTERIX)
+ #include <strings.h>
+ #endif
+ #include <stdio.h>
+@@ -38,7 +38,8 @@
+ !defined(IRIX) && \
+ !defined(SCO) && \
+ !defined(SUNOS) && \
+- !defined(NCR)
++ !defined(NCR) && \
++ !defined(__INTERIX)
+ # error Target not supported.
+ #endif
+
diff --git a/app-editors/fte/files/fte-new_keyword.patch b/app-editors/fte/files/fte-new_keyword.patch
new file mode 100644
index 000000000000..c7b2a2b64554
--- /dev/null
+++ b/app-editors/fte/files/fte-new_keyword.patch
@@ -0,0 +1,14 @@
+--- src/con_linux.cpp.orig 2005-01-30 22:46:54.170485296 +0300
++++ src/con_linux.cpp 2005-01-30 22:46:28.859333176 +0300
+@@ -50,7 +50,11 @@
+ #include <linux/major.h>
+ #include <linux/kdev_t.h>
+ #include <linux/kd.h>
++extern "C" {
++#define new xnew
+ #include <linux/keyboard.h>
++#undef new
++}
+ #ifdef USE_GPM
+ extern "C" {
+ #include <gpm.h>
diff --git a/app-editors/fte/files/fte-slang.patch b/app-editors/fte/files/fte-slang.patch
new file mode 100644
index 000000000000..50470bd6b7ef
--- /dev/null
+++ b/app-editors/fte/files/fte-slang.patch
@@ -0,0 +1,131 @@
+diff -Nru /tmp/wgHyQebD7F/fte-0.50.0/src/con_slang.cpp /tmp/PQJo4szkUb/fte-0.50.0/src/con_slang.cpp
+--- a/fte-0.50.0/src/con_slang.cpp 2005-12-28 16:53:24.000000000 +0100
++++ b/fte-0.50.0/src/con_slang.cpp 2006-06-05 06:02:37.000000000 +0200
+@@ -99,12 +99,14 @@
+ '+'
+ };
+
+-static char raw_dchs[sizeof(slang_dchs)];
++static SLsmg_Char_Type raw_dchs[sizeof(slang_dchs)];
+
+-static unsigned char ftesl_get_dch(char raw)
++static unsigned char ftesl_get_dch(SLsmg_Char_Type raw)
+ {
+ for (int i = 0; i < (int) sizeof(slang_dchs); i++)
+- if (raw_dchs[i] == raw)
++ if (raw_dchs[i].nchars == raw.nchars
++ && !memcmp(raw_dchs[i].wchars, raw.wchars,
++ raw.nchars * sizeof(*raw.wchars)))
+ return DCH_SLANG_C1 + i;
+ return DCH_SLANG_EOL;
+ }
+@@ -215,7 +217,6 @@
+ int ConInit(int /*XSize */ , int /*YSize */ )
+ {
+ unsigned i;
+- unsigned short linebuf[sizeof(slang_dchs)];
+
+ SLtt_get_terminfo();
+
+@@ -246,9 +247,7 @@
+ SLsmg_write_nchars(slang_dchs, sizeof(slang_dchs));
+
+ SLsmg_gotorc(0, 0);
+- SLsmg_read_raw((SLsmg_Char_Type*)linebuf, sizeof(slang_dchs));
+- for (i = 0; i < sizeof(slang_dchs); i++)
+- raw_dchs[i] = (linebuf[i]) & 0xff;
++ SLsmg_read_raw(raw_dchs, sizeof(slang_dchs));
+
+ SLsmg_set_char_set(0);
+
+@@ -361,14 +360,14 @@
+ return 0;
+ }
+
+-static int ConPutBoxRaw(int X, int Y, int W, int H, unsigned short *box)
++static int ConPutBoxRaw(int X, int Y, int W, int H, SLsmg_Char_Type *box)
+ {
+ int CurX, CurY;
+
+ ConQueryCursorPos(&CurX, &CurY);
+ while (H > 0) {
+ SLsmg_gotorc(Y++, X);
+- SLsmg_write_raw((SLsmg_Char_Type*)box, W);
++ SLsmg_write_raw(box, W);
+ box += W;
+ H--;
+ }
+@@ -381,35 +380,51 @@
+ int ConGetBox(int X, int Y, int W, int H, PCell Cell)
+ {
+ int CurX, CurY, i;
+- char ch;
++ SLsmg_Char_Type *linebuf;
++
++ linebuf = new SLsmg_Char_Type [W];
+
+ ConQueryCursorPos(&CurX, &CurY);
+ while (H > 0) {
+ SLsmg_gotorc(Y++, X);
+- SLsmg_read_raw((SLsmg_Char_Type*)Cell, W);
+- for (i = 0; i < W; i++)
+- if (Cell[i] & 0x8000) {
+- ch = Cell[i] & 0xff;
+- Cell[i] &= 0x7f00;
+- Cell[i] |= ftesl_get_dch(ch);
+- }
++ SLsmg_read_raw(linebuf, W);
++ for (i = 0; i < W; i++) {
++ if (linebuf[i].color & SLSMG_ACS_MASK)
++ Cell[i] = ftesl_get_dch(linebuf[i]);
++ else
++ /*
++ * FIXME: Handle UTF-8 -- way beyond a quick-and-dirty
++ * fix. --MV
++ */
++ Cell[i] = SLSMG_EXTRACT_CHAR(linebuf[i]);
++ /*
++ * FIXME: This preserves only 7 out of 15 bits of color.
++ * Fortunately, we're dealing with color handles rather than
++ * colors themselves -- S-Lang jumps through an extra hoop to
++ * map these to color data. As long as we use less than 127
++ * different colors, things should be OK. I think. --MV
++ */
++ Cell[i] |= (linebuf[i].color & 0x7f) << 8;
++ }
+ Cell += W;
+ H--;
+ }
+ ConSetCursorPos(CurX, CurY);
+
++ delete [] (linebuf);
++
+ return 0;
+
+ }
+
+-static int ConGetBoxRaw(int X, int Y, int W, int H, unsigned short *box)
++static int ConGetBoxRaw(int X, int Y, int W, int H, SLsmg_Char_Type *box)
+ {
+ int CurX, CurY;
+
+ ConQueryCursorPos(&CurX, &CurY);
+ while (H > 0) {
+ SLsmg_gotorc(Y++, X);
+- SLsmg_read_raw((SLsmg_Char_Type*)box, W);
++ SLsmg_read_raw(box, W);
+ box += W;
+ H--;
+ }
+@@ -451,9 +466,9 @@
+
+ int ConScroll(int Way, int X, int Y, int W, int H, TAttr Fill, int Count)
+ {
+- unsigned short *box;
++ SLsmg_Char_Type *box;
+
+- box = new unsigned short [W * H];
++ box = new SLsmg_Char_Type [W * H];
+
+ TCell fill = (((unsigned) Fill) << 8) | ' ';
+