diff options
author | Dmitry Marakasov <amdmi3@FreeBSD.org> | 2009-06-17 22:33:19 +0000 |
---|---|---|
committer | Dmitry Marakasov <amdmi3@FreeBSD.org> | 2009-06-17 22:33:19 +0000 |
commit | 132ab536a33a33044350259cbeecca9fb6bbb968 (patch) | |
tree | 1f021bd3037ae5a8a01fee64a51f2eda1d36c23d /graphics/ocropus/files | |
parent | 611a2602d54fcc4dfb98c34a0388cc178bbd970a (diff) |
- Update to 0.4
PR: 135665
Submitted by: Hiroto Kagotani <hiroto.kagotani@gmail.com> (maintainer)
Notes
Notes:
svn path=/head/; revision=236171
Diffstat (limited to 'graphics/ocropus/files')
-rw-r--r-- | graphics/ocropus/files/patch-Makefile.am | 11 | ||||
-rw-r--r-- | graphics/ocropus/files/patch-configure.ac | 31 | ||||
-rw-r--r-- | graphics/ocropus/files/patch-genAM.py | 20 | ||||
-rw-r--r-- | graphics/ocropus/files/patch-ocr-utils__components.cc | 10 | ||||
-rw-r--r-- | graphics/ocropus/files/patch-ocr-utils__narray-io.h | 6 | ||||
-rw-r--r-- | graphics/ocropus/files/patch-ocroscript__scripts__rec-tess-complete.lua | 96 |
6 files changed, 59 insertions, 115 deletions
diff --git a/graphics/ocropus/files/patch-Makefile.am b/graphics/ocropus/files/patch-Makefile.am deleted file mode 100644 index 37b04f6fd88a..000000000000 --- a/graphics/ocropus/files/patch-Makefile.am +++ /dev/null @@ -1,11 +0,0 @@ ---- ./Makefile.am.orig 2008-10-16 05:40:47.000000000 +0900 -+++ ./Makefile.am 2009-05-26 21:25:34.000000000 +0900 -@@ -110,7 +110,7 @@ - - # run check-style everytime and give a hint about make check - all: -- $(srcdir)/utilities/check-style -f $(srcdir) -+# $(srcdir)/utilities/check-style -f $(srcdir) - @echo - @echo "Use 'make check' to run tests!" - @echo diff --git a/graphics/ocropus/files/patch-configure.ac b/graphics/ocropus/files/patch-configure.ac index 1995713ab60d..49821662f843 100644 --- a/graphics/ocropus/files/patch-configure.ac +++ b/graphics/ocropus/files/patch-configure.ac @@ -1,6 +1,6 @@ ---- ./configure.ac.orig 2008-10-16 05:40:35.000000000 +0900 -+++ ./configure.ac 2009-05-26 21:22:11.000000000 +0900 -@@ -116,6 +116,8 @@ +--- ./configure.ac.orig 2009-06-01 05:18:41.000000000 +0900 ++++ ./configure.ac 2009-06-17 19:47:20.000000000 +0900 +@@ -114,11 +114,19 @@ AC_MSG_ERROR([no TIFFOpen; please install libtiff4-dev or equivalent])) AC_LANG_CPLUSPLUS @@ -9,12 +9,33 @@ # --- iulib (required) --- # NB: we can only use functions with C linkage here -@@ -180,7 +182,7 @@ + AC_CHECK_LIB(iulib, exit,, +- AC_MSG_ERROR([no iulib; please install iulib first (see INSTALL)])) ++ AC_CHECK_LIB(avcodec, avcodec_open, , ++ AC_MSG_ERROR([no iulib; please install iulib first (see INSTALL)])) ++ AC_CHECK_LIB(avformat, url_fopen, , ++ AC_MSG_ERROR([no iulib; please install iulib first (see INSTALL)])) ++ AC_CHECK_LIB(iulib, sleep, , ++ AC_MSG_ERROR([no iulib; please install iulib first (see INSTALL)])) ++) + + # --- libpthread (needed by tesseract) --- + AC_CHECK_LIB(pthread, pthread_create,,) +@@ -176,14 +184,14 @@ LDFLAGS="$LDFLAGS -L$leptheaders/../../lib" AC_CHECK_LIB(lept,pixCreate,,AC_MSG_ERROR([leptonica not found! Choose --without-leptonica if you don't want to use it.])) fi -AM_CONDITIONAL([use_leptonica], [test x$use_leptonica == xyes]) +AM_CONDITIONAL([use_leptonica], [test x$use_leptonica = xyes]) + # --- GSL (optional for glinerec) --- +-AC_SUBST(use_gsl, "yes") ++AC_SUBST(use_gsl, "no") + AC_CHECK_LIB(gslcblas, abort,,AC_SUBST(use_gsl, "no")) + AC_CHECK_LIB(gsl, gsl_error,,AC_SUBST(use_gsl, "no")) + AC_CHECK_LIB(blas, exit,,AC_SUBST(use_gsl, "no")) +-AM_CONDITIONAL([use_gsl], [test x$use_gsl == xyes]) ++AM_CONDITIONAL([use_gsl], [test x$use_gsl = xyes]) + - # --- SDL (optional for graphical debugging in ocroscript) --- + # --- SDL (optional for graphical debugging) --- diff --git a/graphics/ocropus/files/patch-genAM.py b/graphics/ocropus/files/patch-genAM.py new file mode 100644 index 000000000000..b7bbdc0bcaad --- /dev/null +++ b/graphics/ocropus/files/patch-genAM.py @@ -0,0 +1,20 @@ +--- ./genAM.py.orig 2009-06-01 05:18:41.000000000 +0900 ++++ ./genAM.py 2009-06-17 19:44:58.000000000 +0900 +@@ -62,7 +62,7 @@ + ocropusincludedir=$(includedir)/ocropus + + AM_CPPFLAGS = -I$(srcdir)/include -I$(srcdir)/ocr-utils \ +--I@iulibheaders@ -I@tessheaders@ ++-I@iulibheaders@ + + AM_LDFLAGS = + +@@ -180,7 +180,7 @@ + print """ + # run check-style everytime and give a hint about make check + all: +- $(srcdir)/utilities/check-style -f $(srcdir) ++# $(srcdir)/utilities/check-style -f $(srcdir) + @echo + @echo "Use 'make check' to run tests!" + @echo diff --git a/graphics/ocropus/files/patch-ocr-utils__components.cc b/graphics/ocropus/files/patch-ocr-utils__components.cc new file mode 100644 index 000000000000..d4cb3ab43ca3 --- /dev/null +++ b/graphics/ocropus/files/patch-ocr-utils__components.cc @@ -0,0 +1,10 @@ +--- ./ocr-utils/components.cc.orig 2009-06-01 05:18:41.000000000 +0900 ++++ ./ocr-utils/components.cc 2009-06-17 19:44:58.000000000 +0900 +@@ -26,6 +26,7 @@ + #include "colib/colib.h" + #include "iulib/iulib.h" + #include "components.h" ++extern char **environ; + + using namespace colib; + diff --git a/graphics/ocropus/files/patch-ocr-utils__narray-io.h b/graphics/ocropus/files/patch-ocr-utils__narray-io.h index 91adc25b6442..74c65c051d60 100644 --- a/graphics/ocropus/files/patch-ocr-utils__narray-io.h +++ b/graphics/ocropus/files/patch-ocr-utils__narray-io.h @@ -1,10 +1,10 @@ ---- ./ocr-utils/narray-io.h.orig 2008-10-16 05:40:46.000000000 +0900 -+++ ./ocr-utils/narray-io.h 2009-05-26 21:22:11.000000000 +0900 +--- ./ocr-utils/narray-io.h.orig 2009-06-01 05:18:41.000000000 +0900 ++++ ./ocr-utils/narray-io.h 2009-06-17 19:44:58.000000000 +0900 @@ -31,6 +31,7 @@ #include <stdio.h> #include <stdlib.h> +#include <stdint.h> - #include "colib.h" + #include "ocropus.h" namespace ocropus { diff --git a/graphics/ocropus/files/patch-ocroscript__scripts__rec-tess-complete.lua b/graphics/ocropus/files/patch-ocroscript__scripts__rec-tess-complete.lua deleted file mode 100644 index d428d7d718cb..000000000000 --- a/graphics/ocropus/files/patch-ocroscript__scripts__rec-tess-complete.lua +++ /dev/null @@ -1,96 +0,0 @@ ---- ./ocroscript/scripts/rec-tess-complete.lua.orig 2008-10-16 05:40:35.000000000 +0900 -+++ ./ocroscript/scripts/rec-tess-complete.lua 2009-05-26 21:22:11.000000000 +0900 -@@ -20,11 +20,20 @@ - -- Reviewer: - -- Primary Repository: - -- Web Sites: www.iupr.org, www.dfki.de, www.ocropus.org -+-- -+-- Patch applied: -+-- http://code.google.com/p/ocropus/issues/detail?id=137 - - - require 'lib.util' - require 'lib.headings' - require 'lib.paragraphs' -+require 'lib.path' -+require 'lib.hocr' -+import_all(ocr) -+import_all(graphics) -+import_all(iulib) -+import_all(nustring) - - remove_hyphens = true - -@@ -74,7 +83,7 @@ - -- RecognizedPage is a transport object of tesseract_recognize_blockwise(). - -- This function will convert it to a DOM. - function convert_RecognizedPage_to_DOM(p, image_path, keep_char_boxes) -- page_DOM = get_page_DOM(p, image_path) -+ page_DOM = hocr.get_page_DOM(p, image_path) - for i = 0, p:linesCount() - 1 do - local bbox = p:bbox(i) - local text = nustring() -@@ -85,13 +94,12 @@ - bboxes = narray_to_table(r) - end - p:text(text, i) -- line_DOM = get_line_DOM(bbox, text, bboxes, p) -+ line_DOM = hocr.get_line_DOM(bbox, text, bboxes, p) - table.insert(page_DOM, line_DOM) - end - return page_DOM - end - -- - function get_images_DOM(tiseg_image, html_path, images_dir, page_image) - os.execute('mkdir -p "'..images_dir..'"') - local rects = rectarray() -@@ -102,12 +110,11 @@ - local dom = {{tag = 'hr', size = '0'}} - for i = 0, rects:length() - 1 do - local src = images_dir .. ('/%04d.png'):format(i + 1) -- local img_path = util.combine_paths(html_path, src) - img = bytearray() - r = rects:at(i) - extract_subimage(img, page_image, r.x0, r.y0, r.x1, r.y1) -- write_image_gray(img_path, img) -- local props = {bbox = bbox_to_string(page_image, r)} -+ iulib.write_image_gray(src, img) -+ local props = {bbox = hocr.bbox_to_string(page_image, r)} - local link = {tag = 'a', href=src} - local width = r.x1 - r.x0 - local height = r.y1 -r.y0 -@@ -119,7 +126,7 @@ - height = "200px" - end - local tag = {tag = 'img', src = src, width=width, height=height, -- class = 'ocr_image', title = hocr_properties_attribute(props)} -+ class = 'ocr_image', title = hocr.properties_attribute(props)} - table.insert(link, tag) - table.insert(dom, link) - table.insert(dom, '\n') -@@ -146,8 +153,8 @@ - get_nontext_mask(nontext_mask,tiseg_image) - remove_masked_region(text_image,nontext_mask,clean_image) - segmenter:segment(page_segmentation,text_image) -- local p = RecognizedPage() -- tesseract_recognize_blockwise(p, page_image, page_segmentation) -+ local p = tesseract.RecognizedPage() -+ tesseract.recognize_blockwise(p, page_image, page_segmentation) - page_DOM = convert_RecognizedPage_to_DOM(p, pages:getFileName(), - option("charboxes")) - page_DOM = detect_headings(page_DOM, page_image) -@@ -157,10 +164,10 @@ - table.insert(body_DOM, page_DOM) - end - --end --doc_DOM = get_html_tag() --table.insert(doc_DOM, get_head_tag()) -+doc_DOM = hocr.get_html_tag() -+table.insert(doc_DOM, hocr.get_head_tag()) - table.insert(doc_DOM, '\n') - table.insert(doc_DOM, body_DOM) - file = io.open(output_file, 'w') --dump_DOM(file, doc_DOM, html_preamble) -+hocr.dump(file, doc_DOM, html_preamble) - file:close() |