public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] dev/eva:master commit in: media-gfx/ocrfeeder/, media-gfx/ocrfeeder/files/
@ 2015-09-07  0:06 Gilles Dartiguelongue
  0 siblings, 0 replies; only message in thread
From: Gilles Dartiguelongue @ 2015-09-07  0:06 UTC (permalink / raw
  To: gentoo-commits

commit:     6985718be6fbc4b3dc4d8a8e1236285b8f50ca5b
Author:     Gilles Dartiguelongue <eva <AT> gentoo <DOT> org>
AuthorDate: Mon Sep  7 00:05:06 2015 +0000
Commit:     Gilles Dartiguelongue <eva <AT> gentoo <DOT> org>
CommitDate: Mon Sep  7 00:05:06 2015 +0000
URL:        https://gitweb.gentoo.org/dev/eva.git/commit/?id=6985718b

media-gfx/ocrfeeder: initial ebuild

A far from perfect first attempt at packaging OCRFeeder. Appears to work
ok with Tesseract. Probably needs some REQUIRED_USE for tiff handling.

 media-gfx/ocrfeeder/Manifest                       | 11 +++
 .../ocrfeeder/files/0001-Fix-PIL-imports.patch     | 95 ++++++++++++++++++++++
 .../files/0002-Drop-bundled-odfpy-usage.patch      | 60 ++++++++++++++
 media-gfx/ocrfeeder/metadata.xml                   |  8 ++
 media-gfx/ocrfeeder/ocrfeeder-0.8.1.ebuild         | 79 ++++++++++++++++++
 5 files changed, 253 insertions(+)

diff --git a/media-gfx/ocrfeeder/Manifest b/media-gfx/ocrfeeder/Manifest
new file mode 100644
index 0000000..89db5a9
--- /dev/null
+++ b/media-gfx/ocrfeeder/Manifest
@@ -0,0 +1,11 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA512
+
+DIST ocrfeeder-0.8.1.tar.xz 900692 SHA256 5816401c9b4bfce98fd9a7b649a3c7ecc3d6968a30f0e4d1b3677d172d55253b SHA512 77684cf752ea1f3b55a1373099d3be3cbfe812cead2b254bd0624f650ace5254d5f708c001f946c3e59fd34f6db52f39b94ff6865588370ed3a5ea6530be8113 WHIRLPOOL 182f7717c3b7638d1818b6172c660b2b00f232cc8ee43f4811ef417838aadbcce063281e241d176b19d353d6a654c1d7862cd4b9bda1fe1dec59a6e0493ca0b0
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v2
+
+iEYEAREKAAYFAlXs1LIACgkQ1fmVwcYIWAadcACgzIrGN/ilEAf+yKxCZ67Pzcwx
+orsAoKycsZ+4HZIGoUEB3Wq84k5uM/U4
+=Q0c+
+-----END PGP SIGNATURE-----

diff --git a/media-gfx/ocrfeeder/files/0001-Fix-PIL-imports.patch b/media-gfx/ocrfeeder/files/0001-Fix-PIL-imports.patch
new file mode 100644
index 0000000..64fb523
--- /dev/null
+++ b/media-gfx/ocrfeeder/files/0001-Fix-PIL-imports.patch
@@ -0,0 +1,95 @@
+From 871bd69b4f00347b3533f54c665b1179f5c33702 Mon Sep 17 00:00:00 2001
+From: Sander Sweers <sander.sweers@gmail.com>
+Date: Sat, 7 Sep 2013 13:02:00 +0200
+Subject: [PATCH 1/2] Fix PIL imports
+
+---
+ src/ocrfeeder/feeder/imageManipulation.py | 2 +-
+ src/ocrfeeder/feeder/layoutAnalysis.py    | 2 +-
+ src/ocrfeeder/studio/dataHolder.py        | 2 +-
+ src/ocrfeeder/studio/widgetPresenter.py   | 2 +-
+ src/ocrfeeder/util/graphics.py            | 2 +-
+ src/ocrfeeder/util/lib.py                 | 2 +-
+ 6 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/src/ocrfeeder/feeder/imageManipulation.py b/src/ocrfeeder/feeder/imageManipulation.py
+index c7f01ec..ad94cf1 100644
+--- a/src/ocrfeeder/feeder/imageManipulation.py
++++ b/src/ocrfeeder/feeder/imageManipulation.py
+@@ -21,7 +21,7 @@
+ from ocrfeeder.util.lib import debug
+ 
+ import gettext
+-import Image, ImageDraw
++from PIL import Image, ImageDraw
+ import os.path
+ from ocrfeeder.util import graphics
+ import sys
+diff --git a/src/ocrfeeder/feeder/layoutAnalysis.py b/src/ocrfeeder/feeder/layoutAnalysis.py
+index edf69c7..80770e2 100644
+--- a/src/ocrfeeder/feeder/layoutAnalysis.py
++++ b/src/ocrfeeder/feeder/layoutAnalysis.py
+@@ -23,7 +23,7 @@ from ocrfeeder.util import graphics
+ from ocrfeeder.util.constants import OCRFEEDER_DEBUG, DTP
+ from ocrfeeder.studio.dataHolder import DataBox
+ from imageManipulation import ImageProcessor
+-import Image
++from PIL import Image
+ import re
+ import math
+ 
+diff --git a/src/ocrfeeder/studio/dataHolder.py b/src/ocrfeeder/studio/dataHolder.py
+index 084a345..df65f7a 100644
+--- a/src/ocrfeeder/studio/dataHolder.py
++++ b/src/ocrfeeder/studio/dataHolder.py
+@@ -20,7 +20,7 @@
+ 
+ import os.path
+ from ocrfeeder.util import graphics
+-import Image
++from PIL import Image
+ import gobject
+ from ocrfeeder.util.graphics import getImagePrintSize, getImageResolution
+ from ocrfeeder.util import TEXT_TYPE, IMAGE_TYPE, ALIGN_LEFT, lib
+diff --git a/src/ocrfeeder/studio/widgetPresenter.py b/src/ocrfeeder/studio/widgetPresenter.py
+index 0c447ab..a12c56a 100644
+--- a/src/ocrfeeder/studio/widgetPresenter.py
++++ b/src/ocrfeeder/studio/widgetPresenter.py
+@@ -26,7 +26,7 @@ from ocrfeeder.util.asyncworker import AsyncWorker
+ from ocrfeeder.util.constants import *
+ from ocrfeeder.util.graphics import convertPixbufToImage
+ from enchant.checker import SpellChecker
+-import Image
++from PIL import Image
+ import gettext
+ import gobject
+ import goocanvas
+diff --git a/src/ocrfeeder/util/graphics.py b/src/ocrfeeder/util/graphics.py
+index fc2049a..b93fc5f 100644
+--- a/src/ocrfeeder/util/graphics.py
++++ b/src/ocrfeeder/util/graphics.py
+@@ -19,7 +19,7 @@
+ ###########################################################################
+ 
+ from lib import debug
+-import Image
++from PIL import Image
+ import gtk
+ import math
+ 
+diff --git a/src/ocrfeeder/util/lib.py b/src/ocrfeeder/util/lib.py
+index c95318d..8fed1f2 100644
+--- a/src/ocrfeeder/util/lib.py
++++ b/src/ocrfeeder/util/lib.py
+@@ -20,7 +20,7 @@
+ 
+ import os
+ import mimetypes
+-import Image
++from PIL import Image
+ import tempfile
+ import gtk
+ import math
+-- 
+1.8.3.2
+

diff --git a/media-gfx/ocrfeeder/files/0002-Drop-bundled-odfpy-usage.patch b/media-gfx/ocrfeeder/files/0002-Drop-bundled-odfpy-usage.patch
new file mode 100644
index 0000000..1e9d779
--- /dev/null
+++ b/media-gfx/ocrfeeder/files/0002-Drop-bundled-odfpy-usage.patch
@@ -0,0 +1,60 @@
+From 8b4aefa3a981de1855a29c5221465b178c9ba303 Mon Sep 17 00:00:00 2001
+From: Sander Sweers <sander.sweers@gmail.com>
+Date: Sat, 7 Sep 2013 13:07:41 +0200
+Subject: [PATCH 2/2] Drop bundled odfpy usage
+
+---
+ configure.ac                               | 1 -
+ src/ocrfeeder/Makefile.am                  | 2 +-
+ src/ocrfeeder/feeder/documentGeneration.py | 8 ++++----
+ 3 files changed, 5 insertions(+), 6 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index bb95aa7..29e69c3 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -46,7 +46,6 @@ bin/ocrfeeder-cli
+ src/Makefile
+ src/ocrfeeder/Makefile
+ src/ocrfeeder/feeder/Makefile
+-src/ocrfeeder/odf/Makefile
+ src/ocrfeeder/studio/Makefile
+ src/ocrfeeder/util/Makefile
+ src/ocrfeeder/util/constants.py
+diff --git a/src/ocrfeeder/Makefile.am b/src/ocrfeeder/Makefile.am
+index 3bf4845..14803ce 100644
+--- a/src/ocrfeeder/Makefile.am
++++ b/src/ocrfeeder/Makefile.am
+@@ -7,7 +7,7 @@ SUBDIRS = \
+ 	feeder/ \
+ 	studio/ \
+ 	util/ \
+-	odf/
++	$(NULL)
+ 
+ clean-local:
+ 	rm -rf *.pyc *.pyo
+\ No newline at end of file
+diff --git a/src/ocrfeeder/feeder/documentGeneration.py b/src/ocrfeeder/feeder/documentGeneration.py
+index 3c83796..f7ff955 100644
+--- a/src/ocrfeeder/feeder/documentGeneration.py
++++ b/src/ocrfeeder/feeder/documentGeneration.py
+@@ -18,11 +18,11 @@
+ #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ ###########################################################################
+ 
+-from ocrfeeder.odf.draw import Frame, TextBox, Image
+-from ocrfeeder.odf.opendocument import OpenDocumentText
+-from ocrfeeder.odf.style import Style, MasterPage, GraphicProperties, ParagraphProperties, \
++from odf.draw import Frame, TextBox, Image
++from odf.opendocument import OpenDocumentText
++from odf.style import Style, MasterPage, GraphicProperties, ParagraphProperties, \
+     TextProperties, PageLayout, PageLayoutProperties
+-from ocrfeeder.odf.text import P, Page, PageSequence
++from odf.text import P, Page, PageSequence
+ from pango import WEIGHT_BOLD, WEIGHT_NORMAL, STYLE_ITALIC, STYLE_NORMAL, \
+     STYLE_OBLIQUE
+ from ocrfeeder.util import TEXT_TYPE, IMAGE_TYPE, ALIGN_LEFT, ALIGN_RIGHT, ALIGN_CENTER, \
+-- 
+1.8.3.2
+

diff --git a/media-gfx/ocrfeeder/metadata.xml b/media-gfx/ocrfeeder/metadata.xml
new file mode 100644
index 0000000..0da281d
--- /dev/null
+++ b/media-gfx/ocrfeeder/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<maintainer>
+		<email>eva@gentoo.org</email>
+		<name>Gilles Dartiguelongue</name>
+	</maintainer>
+</pkgmetadata>

diff --git a/media-gfx/ocrfeeder/ocrfeeder-0.8.1.ebuild b/media-gfx/ocrfeeder/ocrfeeder-0.8.1.ebuild
new file mode 100644
index 0000000..8992c84
--- /dev/null
+++ b/media-gfx/ocrfeeder/ocrfeeder-0.8.1.ebuild
@@ -0,0 +1,79 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI="5"
+GCONF_DEBUG="no"
+PYTHON_COMPAT=( python2_7 )
+
+inherit autotools eutils gnome2 python-r1
+
+DESCRIPTION="Document layout analysis and optical character recognition system"
+HOMEPAGE="https://wiki.gnome.org/Apps/OCRFeeder"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+COMMON_DEPEND="
+	${PYTHON_DEPS}
+	app-text/gtkspell:3[introspection]
+	dev-libs/gobject-introspection
+	dev-python/lxml[${PYTHON_USEDEP}]
+	>=dev-python/odfpy-0.7[${PYTHON_USEDEP}]
+	dev-python/pyenchant[${PYTHON_USEDEP}]
+	dev-python/pygobject:3
+	dev-python/python-sane[${PYTHON_USEDEP}]
+	dev-python/reportlab[${PYTHON_USEDEP}]
+	virtual/python-imaging[${PYTHON_USEDEP}]
+	x11-libs/goocanvas:2.0[introspection]
+	x11-libs/gtk+:3[introspection]
+"
+RDEPEND="${COMMON_DEPEND}
+	media-gfx/sane-backends
+
+	app-text/unpaper
+	|| (
+		app-text/tesseract
+		app-text/ocrad
+		app-text/gocr
+		app-text/cuneiform
+	)
+"
+DEPEND="${COMMON_DEPEND}
+	app-text/gnome-doc-utils[${PYTHON_USEDEP}]
+	>=dev-util/intltool-0.35
+"
+
+pkg_setup() {
+	python_setup
+}
+
+src_prepare() {
+	# Unbundle odfpy
+	#epatch "${FILESDIR}"/0002-Drop-bundled-odfpy-usage.patch
+	#rm -rf src/ocrfeeder/odf/ || die
+
+	#eautoreconf
+	gnome2_src_prepare
+	python_copy_sources
+}
+
+src_configure() {
+	python_foreach_impl run_in_build_dir gnome2_src_configure
+}
+
+src_compile() {
+	python_foreach_impl run_in_build_dir emake
+}
+
+src_test() {
+	python_foreach_impl run_in_build_dir emake check
+}
+
+src_install() {
+	python_foreach_impl run_in_build_dir gnome2_src_install
+	python_fix_shebang "${D}"/usr/bin
+}


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-09-07  0:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-07  0:06 [gentoo-commits] dev/eva:master commit in: media-gfx/ocrfeeder/, media-gfx/ocrfeeder/files/ Gilles Dartiguelongue

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox