Fix tesseract building on machines without leptonica
[slapos.git] / component / tesseract / buildout.cfg
1 [buildout]
2 extends =
3   ../libtool/buildout.cfg
4   ../leptonica/buildout.cfg
5
6 parts =
7   tesseract-eng-traineddata-unzip
8   tesseract
9
10 [tesseract-share]
11 # XXX: tesseract seems not easy configurable on runtime about where to find
12 # its trained data, so just move out its datadir to own controlled location
13 recipe = plone.recipe.command
14 location = ${buildout:parts-directory}/${:_buildout_section_name_}
15 command = mkdir -p ${:location} && mkdir -p ${:location}/tessdata
16 update-command = ${:command}
17 stop-on-error = yes
18
19
20 [tesseract-gcc-4.7-build-patch]
21 recipe = hexagonit.recipe.download
22 url = ${:_profile_base_location_}/${:filename}
23 download-only = true
24 filename = tesseract-3.00-gcc-4.7-build.patch
25 md5sum = ca80db3ec489c547b03f3ee48879c1b1
26
27 [tesseract]
28 recipe = hexagonit.recipe.cmmi
29 url = http://tesseract-ocr.googlecode.com/files/tesseract-3.01.tar.gz
30 md5sum = 1ba496e51a42358fb9d3ffe781b2d20a
31 patch-options =
32   -p1
33 patches =
34   ${tesseract-gcc-4.7-build-patch:location}/${tesseract-gcc-4.7-build-patch:filename}
35 configure-command =
36   ./autogen.sh
37   ./configure --prefix=${buildout:parts-directory}/${:_buildout_section_name_} --disable-static --datarootdir=${tesseract-share:location}
38
39 # tesseract has a non-standard way of testing for leptonica, hence the
40 # LIBLEPT_HEADERSDIR entry below:
41 environment =
42   ACLOCAL_ARGS=-I${libtool:location}/share/aclocal
43   LIBLEPT_HEADERSDIR=${leptonica:location}/include
44   CPPFLAGS=-I${leptonica:location}/include
45   LDFLAGS =-L${leptonica:location}/lib -Wl,-rpath=${leptonica:location}/lib
46
47 [tesseract-eng-traineddata]
48 recipe = hexagonit.recipe.download
49 download-only = true
50 url = http://tesseract-ocr.googlecode.com/files/eng.traineddata.gz
51 md5sum = d91041ad156cf2db36664e91ef799451
52
53 [tesseract-eng-traineddata-unzip]
54 location = ${buildout:parts-directory}/${:_buildout_section_name_}
55 recipe = plone.recipe.command
56 command = gunzip ${tesseract-eng-traineddata:location}/eng.traineddata.gz -c > ${tesseract-share:location}/tessdata/eng.traineddata
57 update-command = ${:command}
58 stop-on-error = yes