From bd8903b490906f839c023971aa3a3951981d113f Mon Sep 17 00:00:00 2001 From: Sergei Reznikov Date: Tue, 31 Mar 2015 15:32:01 +0300 Subject: [PATCH] tesseract: added recipe for version 3.02.02 --- .../tesseract/patches/tesseract-3.02.02.patch | 40 ++++++ app-text/tesseract/tesseract-3.02.02.recipe | 115 ++++++++++++++++++ app-text/tesseract/tesseract-3.x_svn.recipe | 32 ----- 3 files changed, 155 insertions(+), 32 deletions(-) create mode 100644 app-text/tesseract/patches/tesseract-3.02.02.patch create mode 100644 app-text/tesseract/tesseract-3.02.02.recipe delete mode 100644 app-text/tesseract/tesseract-3.x_svn.recipe diff --git a/app-text/tesseract/patches/tesseract-3.02.02.patch b/app-text/tesseract/patches/tesseract-3.02.02.patch new file mode 100644 index 000000000..100e1f158 --- /dev/null +++ b/app-text/tesseract/patches/tesseract-3.02.02.patch @@ -0,0 +1,40 @@ +From 96fec6ffd95b10d352a8df7b57f3e8f36beb5320 Mon Sep 17 00:00:00 2001 +From: Sergei Reznikov +Date: Tue, 31 Mar 2015 14:43:55 +0300 +Subject: [PATCH] Backport 16aa99315a3d - make ocrclass.h public header + +--- + ccutil/Makefile.am | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/ccutil/Makefile.am b/ccutil/Makefile.am +index 5c08f6b..8737dda 100644 +--- a/ccutil/Makefile.am ++++ b/ccutil/Makefile.am +@@ -14,13 +14,13 @@ EXTRA_DIST = mfcpch.cpp + + include_HEADERS = \ + basedir.h errcode.h fileerr.h genericvector.h helpers.h host.h memry.h \ +- ndminx.h params.h platform.h serialis.h strngs.h tesscallback.h \ +- unichar.h unicharmap.h unicharset.h ++ ndminx.h params.h ocrclass.h platform.h serialis.h strngs.h \ ++ tesscallback.h unichar.h unicharmap.h unicharset.h + + noinst_HEADERS = \ + ambigs.h bits16.h bitvector.h ccutil.h clst.h elst2.h \ + elst.h globaloc.h hashfn.h hosthplb.h indexmapbidi.h lsterr.h \ +- mfcpch.h notdll.h nwmain.h ocrclass.h qrsequence.h secname.h \ ++ mfcpch.h notdll.h nwmain.h qrsequence.h secname.h \ + sorthelper.h stderr.h tessdatamanager.h tprintf.h unicity_table.h \ + unicodes.h + +@@ -51,4 +51,4 @@ if MINGW + AM_CPPFLAGS += -I$(top_srcdir)/vs2008/port -DWINDLLNAME=\"lib@GENERIC_LIBRARY_NAME@\" + noinst_HEADERS += ../vs2008/port/strtok_r.h + libtesseract_ccutil_la_SOURCES += ../vs2008/port/strtok_r.cpp +-endif +\ No newline at end of file ++endif +-- +2.2.2 + diff --git a/app-text/tesseract/tesseract-3.02.02.recipe b/app-text/tesseract/tesseract-3.02.02.recipe new file mode 100644 index 000000000..1f067bae9 --- /dev/null +++ b/app-text/tesseract/tesseract-3.02.02.recipe @@ -0,0 +1,115 @@ +SUMMARY="An OCR Engine that was developed at HP and now at Google" +DESCRIPTION=" +An OCR Engine that was developed at HP Labs between 1985 and 1995... and \ +now at Google. +Tesseract is probably the most accurate open source OCR engine available. \ +Combined with the Leptonica Image Processing Library it can read a wide \ +variety of image formats and convert them to text in over 60 languages. \ +It was one of the top 3 engines in the 1995 UNLV Accuracy test. Between \ +1995 and 2006 it had little work done on it, but since then it has been \ +improved extensively by Google. It is released under the Apache License \ +2.0." +HOMEPAGE="http://code.google.com/p/tesseract-ocr" +LICENSE="Apache v2" +COPYRIGHT="1985-1995 HP labs + 2012 Google Inc." +SRC_URI="https://tesseract-ocr.googlecode.com/files/tesseract-ocr-3.02.02.tar.gz" +CHECKSUM_SHA256="26cd39cb3f2a6f6f1bf4050d1cc0aae35edee49eb49a92df3cb7f9487caa013d" +REVISION="1" + +ARCHITECTURES="x86 x86_64" +if [ $effectiveTargetArchitecture != x86_gcc2 ]; then + # x86_gcc2 is fine as primary target architecture as long as we're building + # for a different secondary architecture. + ARCHITECTURES="$ARCHITECTURES x86_gcc2" +else + ARCHITECTURES="$ARCHITECTURES !x86_gcc2" +fi +SECONDARY_ARCHITECTURES="x86" + +PROVIDES=" + tesseract$secondaryArchSuffix = $portVersion + lib:libtesseract$secondaryArchSuffix = $portVersion + cmd:ambiguous_words$secondaryArchSuffix = $portVersion + cmd:classifier_tester$secondaryArchSuffix = $portVersion + cmd:cntraining$secondaryArchSuffix = $portVersion + cmd:combine_tessdata$secondaryArchSuffix = $portVersion + cmd:dawg2wordlist$secondaryArchSuffix = $portVersion + cmd:mftraining$secondaryArchSuffix = $portVersion + cmd:shapeclustering$secondaryArchSuffix = $portVersion + cmd:tesseract$secondaryArchSuffix = $portVersion + cmd:unicharset_extractor$secondaryArchSuffix = $portVersion + cmd:wordlist2dawg$secondaryArchSuffix = $portVersion + " +PROVIDES_devel=" + tesseract${secondaryArchSuffix}_devel = $portVersion + devel:libtesseract$secondaryArchSuffix = $portVersion + " + +REQUIRES_devel=" + tesseract$secondaryArchSuffix == $portVersion + " + +REQUIRES=" + haiku$secondaryArchSuffix + lib:libgcc_s$secondaryArchSuffix + lib:libstdc++$secondaryArchSuffix + lib:liblept$secondaryArchSuffix + lib:libgif$secondaryArchSuffix + lib:libjpeg$secondaryArchSuffix + lib:libpng$secondaryArchSuffix + lib:libwebp$secondaryArchSuffix + lib:libz$secondaryArchSuffix" + +BUILD_REQUIRES=" + devel:liblept$secondaryArchSuffix + devel:libgif$secondaryArchSuffix + devel:libjpeg$secondaryArchSuffix + devel:libpng$secondaryArchSuffix + devel:libwebp$secondaryArchSuffix + devel:libz$secondaryArchSuffix + " +BUILD_PREREQUIRES=" + haiku${secondaryArchSuffix}_devel + cmd:aclocal + cmd:autoconf + cmd:awk + cmd:find + cmd:gcc$secondaryArchSuffix + cmd:libtoolize + cmd:make + " +SOURCE_DIR="tesseract-ocr" + +PATCHES="tesseract-3.02.02.patch" + +PATCH() +{ + sed -i 's,AM_CONFIG_HEADER,AC_CONFIG_HEADERS,g' configure.ac +} + +BUILD() +{ + autogen.sh + export LIBLEPT_HEADERSDIR=$(finddir B_SYSTEM_HEADERS_DIRECTORY)${secondaryArchSubDir}/leptonica + export TESSDATA_PREFIX=$dataDir/tessdata + runConfigure configure + make +} + +INSTALL() +{ + make install + + prepareInstalledDevelLibs libtesseract + fixPkgconfig + + # devel package + packageEntries devel $developDir +} + +TEST() +{ + make test + make check +} diff --git a/app-text/tesseract/tesseract-3.x_svn.recipe b/app-text/tesseract/tesseract-3.x_svn.recipe deleted file mode 100644 index de89df11c..000000000 --- a/app-text/tesseract/tesseract-3.x_svn.recipe +++ /dev/null @@ -1,32 +0,0 @@ -DESCRIPTION="An OCR Engine that was developed at HP Labs between 1985 and 1995... now at Google." -HOMEPAGE="http://code.google.com/p/tesseract-ocr" -SRC_URI="svn+http://tesseract-ocr.googlecode.com/svn/trunk" -REVISION="1" -STATUS_HAIKU="broken" -DEPEND="" -#CHECKSUM_MD5="cc812a261088ea0c3d2da735be35d09f" -BUILD() -{ - cd tesseract-3.x-svn - ./runautoconf - ./configure --prefix=`finddir B_COMMON_DIRECTORY` - make -} - -INSTALL() -{ - cd tesseract-3.x-svn - make install -} - -TEST() -{ - cd tesseract-ocr-3.x -# make test -# make check -} - -LICENSE="Apache v2 - GNU GPL v1" -COPYRIGHT="1985-1995 HP labs - 2011 Google Inc."