diff options
-rw-r--r-- | app-text/clara/clara-20031214-r1.ebuild | 55 | ||||
-rw-r--r-- | app-text/clara/files/clara-20031214-debian-vararg.patch | 90 |
2 files changed, 145 insertions, 0 deletions
diff --git a/app-text/clara/clara-20031214-r1.ebuild b/app-text/clara/clara-20031214-r1.ebuild new file mode 100644 index 00000000000..2b564d91a1a --- /dev/null +++ b/app-text/clara/clara-20031214-r1.ebuild @@ -0,0 +1,55 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=5 + +inherit eutils toolchain-funcs + +DESCRIPTION="An OCR (Optical Character Recognition) program" +SRC_URI="mirror://gentoo/${P}.tar.gz" +HOMEPAGE="http://www.claraocr.org/" + +SLOT="0" +LICENSE="GPL-2" +KEYWORDS="~amd64 ~ppc ~x86 ~ppc-macos ~sparc-solaris" +IUSE="" + +RDEPEND="x11-libs/libX11" +DEPEND="${RDEPEND}" + +# The test provided by clara doesn't seem to make any sense. It just +# calls the binary with an unsupported option, which results in an +# error. +RESTRICT="test" + +src_prepare() { + sed -i -re "s/(C|LD)FLAGS =/\1FLAGS +=/" Makefile + epatch "${FILESDIR}/${PN}_open_mode.patch" + epatch "${FILESDIR}/${P}-debian-vararg.patch" +} + +src_compile() { + emake CC="$(tc-getCC)" || die + emake doc || die +} + +src_install() { + dobin ${PN} selthresh + doman doc/${PN}*.1 selthresh.1 + + dodoc ANNOUNCE CHANGELOG doc/FAQ + insinto /usr/share/doc/${P} + doins imre.pbm + + dohtml doc/*.html +} + +pkg_postinst() { + elog + elog "Please note that Clara OCR has to be trained to recognize text," + elog "without a training session it simply won't work. Have a look at" + elog "the docs in /usr/share/doc/${P}/html/ to get more " + elog "info about the training procedure." + elog +} diff --git a/app-text/clara/files/clara-20031214-debian-vararg.patch b/app-text/clara/files/clara-20031214-debian-vararg.patch new file mode 100644 index 00000000000..570bc401899 --- /dev/null +++ b/app-text/clara/files/clara-20031214-debian-vararg.patch @@ -0,0 +1,90 @@ +--- clara-20031214.orig/clara.c ++++ clara-20031214/clara.c +@@ -751,11 +751,12 @@ + s[128] = 0; + logmsg(s); + +- if (!trace) +- return; +- va_start(args,m); +- vfprintf(stderr,m,args); +- fprintf(stderr,"\n"); ++ if (trace) { ++ vfprintf(stderr,m,args); ++ fprintf(stderr,"\n"); ++ } ++ ++ va_end(args); + } + + /* +@@ -775,10 +776,12 @@ + logmsg(s); + + /* send to stderr if requested */ +- if (!debug) +- return; +- vfprintf(stderr,m,args); +- fprintf(stderr,"\n"); ++ if (debug) { ++ vfprintf(stderr,m,args); ++ fprintf(stderr,"\n"); ++ } ++ ++ va_end(args); + } + + /* +@@ -797,9 +800,10 @@ + s[128] = 0; + logmsg(s); + +- va_start(args,m); + vfprintf(stderr,m,args); + fprintf(stderr,"\n"); ++ ++ va_end(args); + } + + /* (devel) +--- clara-20031214.orig/event.c ++++ clara-20031214/event.c +@@ -638,6 +638,8 @@ + } + } + ++ va_end(args); ++ + /* + printf("request (priority %d, mclip=%d, redraw=%d) to draw the message \"%s\"\n",f,mclip,redraw_stline,s); + */ +--- clara-20031214.orig/html.c ++++ clara-20031214/html.c +@@ -1548,11 +1548,12 @@ + va_list args; + int n=0,f; + +- va_start(args, fmt); + for (f=0; f==0; ) { + + /* try to write */ ++ va_start(args, fmt); + n = vsnprintf(*t+*top+1,*sz-*top-1,fmt,args); ++ va_end(args); + + /* + Some implementations of vsnprintf return -1 when +@@ -1589,11 +1590,12 @@ + va_list args; + int n=0,f; + +- va_start(args, fmt); + for (f=0; f==0; ) { + + /* try to write */ ++ va_start(args, fmt); + n = vsnprintf(text+topt+1,textsz-topt-1,fmt,args); ++ va_end(args); + + /* + Some implementations of vsnprintf return -1 when |