---- nfbtrans.c.orig 2004-09-21 19:52:34.341784094 -0500
-+++ nfbtrans.c 2004-09-21 19:54:07.005727168 -0500
+--- a/nfbtrans.c 2004-09-21 19:52:34.341784094 -0500
++++ b/nfbtrans.c 2004-09-21 19:54:07.005727168 -0500
@@ -6,7 +6,7 @@
#define LINT_ARGS
#define DOS
--- /dev/null
+--- a/Makefile 2017-06-13 11:08:23.428114301 -0500
++++ b/Makefile 2017-06-13 11:09:01.084376256 -0500
+@@ -28,10 +28,10 @@
+ djgppall: nfbtrans.exe\r
+ \r
+ nfbtrans: $(OBJFILES)\r
+- $(CC) $(CFLAGS) $(OBJFILES) $(LIBS) -o nfbtrans\r
++ $(CC) $(CFLAGS) $(LDFLAGS) $(OBJFILES) $(LIBS) -o nfbtrans\r
+ \r
+ nfbtrans.exe:$(OBJFILES)\r
+- $(CC) $(CFLAGS) $(OBJFILES) -o nfbtrans.exe\r
++ $(CC) $(CFLAGS) $(LDFLAGS) $(OBJFILES) -o nfbtrans.exe\r
+ \r
+ ultrix:\r
+ $(MAKE) CFLAGS=-O\r
+@@ -44,7 +44,7 @@
+ \r
+ insight:\r
+ insight -fno-builtin -fwritable-strings \\r
+- $(CFLAGS) $(OBJFILES) $(LIBS) -o nfbtrans\r
++ $(CFLAGS) $(LDFLAGS) $(OBJFILES) $(LIBS) -o nfbtrans\r
+ \r
+ aix:\r
+ $(MAKE) all CC=cc CFLAGS="-o -Dunix -Daix"\r
--- /dev/null
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils
+
+DESCRIPTION="braille translator from the National Federation of the Blind"
+HOMEPAGE="http://www.nfb.org/nfbtrans"
+SRC_URI="http://www.nfb.org/Images/nfb/Products_Technology/nfbtr774.zip"
+
+LICENSE="public-domain"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE=""
+
+DEPEND=" >=app-arch/unzip-5.50-r2"
+RDEPEND=""
+
+S=${WORKDIR}
+
+PATCHES=(
+"${FILESDIR}"/${P}-gentoo-fix.patch
+"${FILESDIR}"/${P}-getline-fix.patch
+"${FILESDIR}"/${P}-respect-ldflags.patch
+)
+
+src_prepare() {
+ mv MAKEFILE Makefile || die
+ mv SPANISH.ZIP spanish.zip || die
+ emake lowercase
+ default
+}
+
+src_compile() {
+ emake CC=$(tc-getCC) \
+ LIBS= \
+ CFLAGS="${CFLAGS} -DLINUX" LDFLAGS="${LDFLAGS}" all
+}
+
+src_install() {
+ dobin nfbtrans
+ dodoc *fmt readme.txt makedoc
+ insinto /etc/nfbtrans
+ doins *cnf *tab *dic spell.dat *zip
+}