source: gs2-extensions/tesseract/trunk/src/devel.bash@ 34178

Last change on this file since 34178 was 34178, checked in by ak19, 4 years ago

CASCADE-MAKE for Tesseract, the OCR tool. I'm thinking of expanding the UnknownPlugin tutorial to include using it with Tika for processing docx and for using the Pluging with Tika and Tesseract to OCR image-only pdfs. I have tested the compiled tesseract and on a sample tif image, and it works. But I've still to test the Tika with Tesseract combination. The libz, libpng, (lib)jpeg, (lib)tif and jpeg2000 packages are from Imagemagick. Leptonica needs them (not sure about jpeg2000) and libgif. No libgif yet. Libtool and Leptonica are the dependencies for Tesseract itself. I'm including just the English language data in tessdata folder. Others are available from https://github.com/tesseract-ocr/tessdata . I've added a file called LinksAndNotesOnCompilingManually.txt documenting reading on TikaOCR, how to compile up Tesseract and my pre cascade-make attempts to compile tesseract on Ubuntu. But then I followed the existing use of Cascade-Make in GS2-extensions gnome-lib and imagemagick to get Tesseract compiled up. I don't know how to add in support for cross compilation.

  • Property svn:executable set to *
File size: 1.6 KB
Line 
1#!/bin/bash
2
3if [ -d cascade-make ] ; then
4 source cascade-make/lib/cascade-lib.bash GEXTTESS . $*
5fi
6
7if [ -z $GEXTTESS ] ; then
8 source ./setup.bash_old
9fi
10
11if [ -z $GEXTTESS_DEVEL ] ; then
12 # Set environment variable so we can tell devel.bash has been sourced
13 export GEXTTESS_DEVEL=$GEXTTESS
14
15 export PATH="$GEXTTESS_INSTALLED/bin:$PATH"
16 export CFLAGS="-I$GEXTTESS_INSTALLED/include -I$GEXTTESS_INSTALLED/include/libxml2 $CFLAGS"
17 export CPPFLAGS="-I$GEXTTESS_INSTALLED/include -I$GEXTTESS_INSTALLED/include/libxml2 $CPPFLAGS"
18 export CXXFLAGS="-I$GEXTTESS_INSTALLED/include -I$GEXTTESS_INSTALLED/include/libxml2 $CXXFLAGS"
19 export LDFLAGS="-L$GEXTTESS_INSTALLED/lib $LDFLAGS"
20 export PKG_CONFIG_PATH="$GEXTTESS_INSTALLED/lib/pkgconfig:$PKG_CONFIG_PATH"
21
22 echo "+Your environment is now setup to compile with the TESSeract Support Library"
23
24 if [ -d "$GEXTTESS_INSTALLED/lib/pkgconfig" ] ; then
25 echo ""
26 echo "+Testing that pkg-config is correctly configured..."
27
28 pushd $GEXTTESS_INSTALLED/lib/pkgconfig
29
30 if [ ! -e .fixed-prefix.awk ] ; then
31
32 echo "Configuring ..."
33
34 echo "/^prefix=/ { print \"prefix=$GEXTTESS_INSTALLED\" ; next }" > .fixed-prefix.awk
35 echo " { print \$0 }" >> .fixed-prefix.awk
36
37 for file in *.pc ; do
38 cat $file | awk -f .fixed-prefix.awk > $file.new && \
39 /bin/mv $file.new $file
40 done
41 echo "... done"
42 else
43 echo "No configuration needed"
44 fi
45
46 popd
47 fi
48else
49 echo "+Your environment is already setup to compile with the TESSeract Support Library"
50fi
Note: See TracBrowser for help on using the repository browser.