summaryrefslogtreecommitdiff
path: root/app-editors/fte
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /app-editors/fte
reinit the tree, so we can have metadata
Diffstat (limited to 'app-editors/fte')
-rw-r--r--app-editors/fte/Manifest15
-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
-rw-r--r--app-editors/fte/fte-20051115-r3.ebuild124
-rw-r--r--app-editors/fte/fte-20110708-r1.ebuild119
-rw-r--r--app-editors/fte/metadata.xml9
10 files changed, 531 insertions, 0 deletions
diff --git a/app-editors/fte/Manifest b/app-editors/fte/Manifest
new file mode 100644
index 000000000000..fa37a0b22c26
--- /dev/null
+++ b/app-editors/fte/Manifest
@@ -0,0 +1,15 @@
+AUX fte 604 SHA256 ab2f22eb5fe1d1df82c0f976a457979f66b0c4f605fb69baba46d50204021f0c SHA512 5f93df643282016c352db88cddd37c1b9f86d94654a7eff0089b9d349ad3f56ba4266cb2431ac3a418bd4b5aebf6d7ad04c26099061942fd3e90fc9fb938322b WHIRLPOOL 8ba69515823d2f340559acc9b39b36952db41e66c49c652e200edf7d550f7c1ef6332264ec2806c91bab420a54fc202c109b37c594ee1aa36aead047fb6781cf
+AUX fte-cpp14.patch 531 SHA256 99e71c9a9c681cfc7b6744ed4399acf556984b8b415f09e306ebcd9e290d5fb1 SHA512 d6bfe5912f92e5d948d3de49085824d74ca51877b93cf8af7f2d4a6d162e6ea5ae11f96fc2b096875a9cd08476af88b07a7a1e352a97206876c15779e4bc36a5 WHIRLPOOL 2c915a7cbb6af0556eb3cfc362293b11c44ef9956af27dc2b4b3ae6b13f5dfe070502a8d9e391babe907fd47d801baadf63d552135f99ed2551017fd9de5041d
+AUX fte-gcc34 1092 SHA256 c3f452a0b72182c50a2f3057a10d749d8a304890b0844ad9ee572cf4ebf83811 SHA512 390da870507786d74d67847d644c07d9c24789913117c46fcd8739f5ceb58345ac100a7cd1e2ef1183d09e76f923b73cd94fa523f5eaa3d6113a952240fd4800 WHIRLPOOL 488e5e72a87a50be21da96ca04c4b743bb3f55cc709d59ebce2887140aff9afde03229b4264d0ef0624902e87872da3ffd9a652aaabe1456926b989611a5fc72
+AUX fte-interix.patch 1041 SHA256 e4289d383169cbafdadb4868a4ca64a43a6f70da8870b34c2228eda9ae6317b7 SHA512 6f43c682b577b838675fe93c9e2b4c225e3c853d2db95f81f84d64508e78c6f957f1c8842343df2d9a6e7d01e5103a6cc2a1cd0cf414cee641b6b11c0d551b78 WHIRLPOOL 9eb0bb3401695d5609a314495f4af91f756cf895b1649bc75a0b462cfa7fff0d56b6060832fe9b51b80c90d12414eba5c4e74d3f1bfb0c138b1864a66fd03631
+AUX fte-new_keyword.patch 340 SHA256 c30c5c216ee481a6e1fe964d12998b5b36e288d30883f9ced88fca60ab7253b8 SHA512 ab003f671919fb03429ab13adda5025554258e0799844b887cb786c2378e81025893998b0ef3b0b121d82422502d90f5dc8afa9855c1432c8d2f6597ea087c7a WHIRLPOOL cdfef784939b444dd7d83de66599955c7b927b93b1980fe070311cbac349767f66e481b67246b0512b6bc76017d56083416abb47bfc943a3d2051b69d1dffc46
+AUX fte-slang.patch 3567 SHA256 00b623d6c05f03243cbc7d6c3fa90f3b083f87b613cfa8110f4e1eaef9695a19 SHA512 3f9504d9b4d6de6e012f0aedf762dce51d1fbc79345f2f45f5303bc81194441396cbd7eadc9457e07814cb6d33b6db6ad1186de026b5b474f9419071e4b75d10 WHIRLPOOL 2cc082f80a33ae22a3a19a0eda86988e70d9f37480c7210f4b5902d8361b114789a692446a6ce092f1809ac9f2efaca34b362b5907ac9f056e83b3a7f6edcd5c
+DIST fte-20051115-common.zip 187849 SHA256 794031dd1d06156259d21ddcb3dec3196001818ea7116e9786b54314484dabf4 SHA512 18e1657a6fe1b48449dc97a357f00bfeb6626450520b48647e2751cc946d9d1bfc6d77d4b0fbdff0a980121502da870f739846b1db9569ff0b305530ee717323 WHIRLPOOL 5d515bdac01d5730a961b153df202e9ed6535ef536d1163166f9934dea002bb7fe7a6ac4b48d552e7c0ac1b1c96b3a44b6e0d4a7f32c25948f94691a910eb11b
+DIST fte-20051115-src.zip 549216 SHA256 bb4135e5c39223fa346d20613052e69090b14ed46855d5134bf2dbc4ba40d962 SHA512 320c2c4f27041ff5e7417288e5acc8c776013da4aa7cfc187e6207086851642a7ed961383ca19f6ae6c1717a59453c6a9ca40a1c7eb77dae6e5b9184cd7c346a WHIRLPOOL e8c3e84b7986a7900ea81dfc2b5285edb1f8d413769b400898a3b08083a7b954502d8e57f8a0d74d3d487ad7ea93227e334a89a6e178112cf1dfcf72c25357e4
+DIST fte-20110708-common.zip 200007 SHA256 58411578b31958765f42d2bf29b7aedd9f916955c2c19c96909a1c03e0246af7 SHA512 0bb59a5b6b4a5ef6c1234dadd8922cd50a13ad1f0c06d6046b74a95592ad55f720b43bbc78a42cab63dfc68c5e073d44d5179bd6ed72f346563f43f3c5c146f1 WHIRLPOOL 9d3ed7205b8daf8c4959b8683e979d47a3c842471f312fdcf03a6c6dc36f66bd7dede6a3bb9d4e91f7a91f554165b7360c755857d685dfe55478ae18672cbe55
+DIST fte-20110708-src.zip 504199 SHA256 d6311c542d3f0f2890a54a661c3b67228e27b894b4164e9faf29f014f254499e SHA512 2d59fadcdd988ee85b87425c343341e1b768a7e9ef838c5f8a1f22c4adc5bf2cc37d547f36354ca1740bce07b33d5ae93d14e24001b9dbd3b1b267986564a089 WHIRLPOOL 8a2c7a9053780092fe690b19dfb419bdb66c0617ac49c1fec312ce75fd480bbf691d24da34eeeb38ee267af0eafbc5fd6c6caf06c25ee809b917caa32a9dce51
+EBUILD fte-20051115-r3.ebuild 2780 SHA256 a0d895dba1b543a73aeaa985466236d8a238c31c7c9054c737e0a5fe070f857f SHA512 106f6eda464bb37d35d549e8c3a56c53a3571e259e748bf7f975d1e6fce4a4e1fa32ea85f8cc26f38ac5181cdd64af32012a8332594a74c09d4e064779a9778a WHIRLPOOL 9460aeadc6e925a6b947706638239594e6477b29bb680e8fc31987beceb46fc3b8b21e8e7126739c2aa42ee951b245f73764fe2f56c6b13896407ed0a02608ef
+EBUILD fte-20110708-r1.ebuild 2656 SHA256 e60cfd519210ff900890874f4d1cde7115ad8779b10ba539c9abfdc5e3b201ee SHA512 989ddf33022f0bd8b8d0e1d79bb1dcad111f8fbe3d7de329512feedbd4751a6790d5c08657ec83f110bf86547e05be5795fcfdbf2597ed172b11664a47bb38a0 WHIRLPOOL a3fc82ffc1a3dde64e3e5d122a1e4c0a5792dc7e618ba9f730a7dd0348ee01de24f6f44870950a0c4286da0905f29f8a59af037078323596cd030cc16b18cdde
+MISC ChangeLog 3346 SHA256 e965d42b0e02d5f43f1da0476375769888895b1f3dad172f8417302346e9ed7f SHA512 8954369ed575b8504b5360839e0c466e83dbbe3c3f49294f4ef495008b8d1122a1d56afed49414116c470b0ab1933986f41d6ce7aa62c8dcea8b37451a28b67c WHIRLPOOL 5f07a715944deb5752249de20fdf9d7e2502506064f9be6c00e31b4df12235f9fc32c84f8284e155abd7b00027a05bb0c4780a322a7545d5cc8d6a8683fbb9fc
+MISC ChangeLog-2015 9237 SHA256 9267816793bb7360d1adde12d08e3906f92a618017184b947fd0adc084f5a964 SHA512 1d7f0bd93b04099436e9bc141972e0cf0a33c305670f5466d252e92dd9c1ff2d6a916fd79c5c594dbaade63077b20995627afce355b484032dc036a6cfe0d6a0 WHIRLPOOL 765e58749f0ea8bf67c1ca95d951185802869ad53d60688684b63d2c03348a2a838771bed828e35087a303141404ee3be3672744b3cd226622472d1ca7a6ef14
+MISC metadata.xml 312 SHA256 41e084f55bc5c50a862824d7c1e3dc2153df5a8c22e7ca8a9e724ae927b5069d SHA512 3946924797105501c1388f172caf774488ebb480ff13664fffd75fb30ebdfba27d52c3e7d534e7dcad5204b6074ba28ee25a4724ed117748059fceeff9d23b60 WHIRLPOOL 2b4b53365baa68eb87f5c0216bfcba285a71816b287808ed17db1939cf6e2674beeb6c5b723c68c427b91972a6682295f058ab8850633a5e88cc66c7a5f75dac
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) | ' ';
+
diff --git a/app-editors/fte/fte-20051115-r3.ebuild b/app-editors/fte/fte-20051115-r3.ebuild
new file mode 100644
index 000000000000..ea155c1e9f64
--- /dev/null
+++ b/app-editors/fte/fte-20051115-r3.ebuild
@@ -0,0 +1,124 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Lightweight text-mode editor"
+HOMEPAGE="http://fte.sourceforge.net"
+SRC_URI="
+ mirror://sourceforge/fte/${P}-src.zip
+ mirror://sourceforge/fte/${P}-common.zip"
+
+LICENSE="|| ( GPL-2 Artistic )"
+SLOT="0"
+KEYWORDS="~alpha amd64 ppc -sparc x86 ~amd64-linux ~x86-linux ~ppc-macos"
+IUSE="gpm slang X"
+
+S="${WORKDIR}/${PN}"
+
+RDEPEND="
+ >=sys-libs/ncurses-5.2
+ X? (
+ x11-libs/libXdmcp
+ x11-libs/libXau
+ x11-libs/libX11
+ x11-libs/libXpm
+ )
+ gpm? ( >=sys-libs/gpm-1.20 )"
+DEPEND="${RDEPEND}
+ slang? ( >=sys-libs/slang-2.1.3 )
+ app-arch/unzip"
+
+set_targets() {
+ export TARGETS=""
+ use slang && TARGETS="${TARGETS} sfte"
+ use X && TARGETS="${TARGETS} xfte"
+
+ [[ ${CHOST} == *-linux-gnu* ]] \
+ && TARGETS="${TARGETS} vfte" \
+ || TARGETS="${TARGETS} nfte"
+}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/fte-gcc34 \
+ "${FILESDIR}"/${PN}-new_keyword.patch \
+ "${FILESDIR}"/${PN}-slang.patch \
+ "${FILESDIR}"/${PN}-interix.patch \
+ "${FILESDIR}"/${PN}-cpp14.patch # bug #595048
+
+ [[ -e /usr/include/linux/keyboard.h ]] && \
+ sed /usr/include/linux/keyboard.h -e '/wait.h/d' > src/hacked_keyboard.h
+
+ sed \
+ -e "s:<linux/keyboard.h>:\"hacked_keyboard.h\":" \
+ -i src/con_linux.cpp || die "sed keyboard"
+ sed \
+ -e 's:^OPTIMIZE:#&:g' \
+ -e '/^LDFLAGS/s:=:+=:g' \
+ -e 's:= g++:= $(CXX):g' \
+ -i src/fte-unix.mak || die "sed CFLAGS, LDFLAGS, CC"
+ ecvs_clean
+}
+
+src_configure() {
+ set_targets
+ sed \
+ -e "s:@targets@:${TARGETS}:" \
+ -e '/^XINCDIR =/c\XINCDIR =' \
+ -e '/^XLIBDIR =/c\XLIBDIR = -lstdc++' \
+ -e '/^SINCDIR =/c\SINCDIR = -I'"${EPREFIX}"'/usr/include/slang' \
+ -i src/fte-unix.mak || die "sed targets"
+
+ if ! use gpm; then
+ sed \
+ -e "s:#define USE_GPM://#define USE_GPM:" \
+ -i src/con_linux.cpp || die "sed USE_GPM"
+ sed \
+ -e "s:-lgpm::" \
+ -i src/fte-unix.mak || die "sed -lgpm"
+ fi
+}
+
+src_compile() {
+ local os="-DLINUX" # by now the default in makefile
+ [[ ${CHOST} == *-interix* ]] && os=
+
+ DEFFLAGS="PREFIX='${EPREFIX}'/usr CONFIGDIR='${EPREFIX}'/usr/share/fte \
+ DEFAULT_FTE_CONFIG=../config/main.fte UOS=${os}"
+
+ set_targets
+ emake CXX=$(tc-getCXX) OPTIMIZE="${CXXFLAGS}" ${DEFFLAGS} TARGETS="${TARGETS}" all
+}
+
+src_install() {
+ local files
+
+ keepdir /etc/fte
+
+ into /usr
+
+ set_targets
+ files="${TARGETS} cfte"
+
+ for i in ${files}; do
+ dobin src/$i
+ done
+
+ dobin "${FILESDIR}"/fte
+
+ dodoc CHANGES BUGS HISTORY README TODO
+ dohtml doc/*
+
+ insinto /usr/share/fte
+ doins -r config/*
+}
+
+pkg_postinst() {
+ ebegin "Compiling configuration"
+ cd "${EPREFIX}"/usr/share/fte || die "missing configuration dir"
+ "${EPREFIX}"/usr/bin/cfte main.fte "${EPREFIX}"/etc/fte/system.fterc
+ eend $?
+}
diff --git a/app-editors/fte/fte-20110708-r1.ebuild b/app-editors/fte/fte-20110708-r1.ebuild
new file mode 100644
index 000000000000..e32fb0fe8861
--- /dev/null
+++ b/app-editors/fte/fte-20110708-r1.ebuild
@@ -0,0 +1,119 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Lightweight text-mode editor"
+HOMEPAGE="http://fte.sourceforge.net"
+SRC_URI="
+ mirror://sourceforge/${PN}/${P}-src.zip
+ mirror://sourceforge/${PN}/${P}-common.zip"
+
+LICENSE="|| ( GPL-2 Artistic )"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~ppc -sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
+IUSE="gpm slang X"
+
+S="${WORKDIR}/${PN}"
+
+RDEPEND="
+ sys-libs/ncurses:0=
+ X? (
+ x11-libs/libXdmcp
+ x11-libs/libXau
+ x11-libs/libX11
+ x11-libs/libXpm
+ )
+ gpm? ( >=sys-libs/gpm-1.20 )"
+DEPEND="${RDEPEND}
+ slang? ( >=sys-libs/slang-2.1.3 )
+ app-arch/unzip"
+
+HTML_DOCS=( doc/. )
+
+set_targets() {
+ export TARGETS=""
+ use slang && TARGETS="${TARGETS} s${PN}"
+ use X && TARGETS="${TARGETS} x${PN}"
+
+ [[ ${CHOST} == *-linux-gnu* ]] \
+ && TARGETS="${TARGETS} v${PN}" \
+ || TARGETS="${TARGETS} n${PN}"
+}
+
+src_prepare() {
+ default
+
+ if [[ -e "${EPREFIX}"/usr/include/linux/keyboard.h ]]; then
+ sed "${EPREFIX}"/usr/include/linux/keyboard.h \
+ -e '/wait.h/d' > src/hacked_keyboard.h || die
+ fi
+
+ sed \
+ -e "s:<linux/keyboard.h>:\"hacked_keyboard.h\":" \
+ -i src/con_linux.cpp || die "sed keyboard"
+ sed \
+ -e 's:^OPTIMIZE:#&:g' \
+ -e '/^LDFLAGS/s:=:+=:g' \
+ -e 's:= g++:= $(CXX):g' \
+ -i src/${PN}-unix.mak || die "sed CFLAGS, LDFLAGS, CC"
+ ecvs_clean
+}
+
+src_configure() {
+ set_targets
+ sed \
+ -e "s:@targets@:${TARGETS}:" \
+ -e '/^XINCDIR =/c\XINCDIR =' \
+ -e '/^XLIBDIR =/c\XLIBDIR = -lstdc++' \
+ -e '/^SINCDIR =/c\SINCDIR = -I'"${EPREFIX}"'/usr/include/slang' \
+ -i src/${PN}-unix.mak || die "sed targets"
+
+ if ! use gpm; then
+ sed \
+ -e "s:#define USE_GPM://#define USE_GPM:" \
+ -i src/con_linux.cpp || die "sed USE_GPM"
+ sed \
+ -e "s:-lgpm::" \
+ -i src/fte-unix.mak || die "sed -lgpm"
+ fi
+}
+
+src_compile() {
+ local os="-DLINUX" # by now the default in makefile
+ [[ ${CHOST} == *-interix* ]] && os=
+
+ DEFFLAGS="PREFIX='${EPREFIX}'/usr CONFIGDIR='${EPREFIX}'/usr/share/${PN} \
+ DEFAULT_FTE_CONFIG=../config/main.${PN} UOS=${os}"
+
+ set_targets
+ emake CXX="$(tc-getCXX)" OPTIMIZE="${CXXFLAGS}" "${DEFFLAGS}" TARGETS="${TARGETS}" all
+}
+
+src_install() {
+ keepdir /etc/${PN}
+ into /usr
+
+ set_targets
+
+ local i files="${TARGETS} c${PN}"
+ for i in ${files}; do
+ dobin src/${i}
+ done
+
+ dobin "${FILESDIR}/${PN}"
+
+ einstalldocs
+
+ insinto /usr/share/${PN}
+ doins -r config/.
+}
+
+pkg_postinst() {
+ ebegin "Compiling configuration"
+ cd "${EPREFIX}"/usr/share/${PN} || die "missing configuration dir"
+ "${EPREFIX}"/usr/bin/c${PN} main.${PN} "${EPREFIX}"/etc/${PN}/system.${PN}rc || die
+ eend $?
+}
diff --git a/app-editors/fte/metadata.xml b/app-editors/fte/metadata.xml
new file mode 100644
index 000000000000..c209ef776339
--- /dev/null
+++ b/app-editors/fte/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <!-- maintainer-needed -->
+ <longdescription>Lightweight text-mode editor.</longdescription>
+ <upstream>
+ <remote-id type="sourceforge">fte</remote-id>
+ </upstream>
+</pkgmetadata>