diff options
author | James Le Cuirot <chewi@gentoo.org> | 2016-01-30 11:17:29 +0000 |
---|---|---|
committer | James Le Cuirot <chewi@gentoo.org> | 2016-02-01 17:12:19 +0000 |
commit | 7a46316823a825080fa731bbffe9dec801feaa6f (patch) | |
tree | f75c3c093bedbbfcc74ad49132e2b9f09accd46d /app-text/tesseract | |
parent | profiles: Mask tesseract[scrollview] on arches not supporting Java/SWT (diff) | |
download | gentoo-7a46316823a825080fa731bbffe9dec801feaa6f.tar.gz gentoo-7a46316823a825080fa731bbffe9dec801feaa6f.tar.bz2 gentoo-7a46316823a825080fa731bbffe9dec801feaa6f.zip |
app-text/tesseract: Fix ScrollViewer
Use the system piccolo2d to build the ScrollViewer server. Stage it
manually instead of using install-jars so we don't have to sed through
the files and copy the bundled piccolo2d.
Many thanks to Olivier Diotte for the initial work on this. See
https://github.com/gentoo/gentoo/pull/719 for the details.
Package-Manager: portage-2.2.27
Diffstat (limited to 'app-text/tesseract')
-rw-r--r-- | app-text/tesseract/files/tesseract-3.04.00-use-system-piccolo2d.patch | 39 | ||||
-rw-r--r-- | app-text/tesseract/tesseract-3.04.00-r4.ebuild | 23 |
2 files changed, 57 insertions, 5 deletions
diff --git a/app-text/tesseract/files/tesseract-3.04.00-use-system-piccolo2d.patch b/app-text/tesseract/files/tesseract-3.04.00-use-system-piccolo2d.patch new file mode 100644 index 000000000000..decee3a52f40 --- /dev/null +++ b/app-text/tesseract/files/tesseract-3.04.00-use-system-piccolo2d.patch @@ -0,0 +1,39 @@ +--- a/java/Makefile.am 2015-07-11 03:53:12.000000000 -0400 ++++ b/java/Makefile.am 2016-01-20 22:20:37.505713349 -0500 +@@ -36,10 +36,9 @@ + com/google/scrollview/ScrollView.class + + SCROLLVIEW_LIBS = \ +- $(srcdir)/piccolo2d-core-3.0.jar \ +- $(srcdir)/piccolo2d-extras-3.0.jar ++ /usr/share/piccolo2d/lib/piccolo2d.jar + +-CLASSPATH = $(srcdir)/piccolo2d-core-3.0.jar:$(srcdir)/piccolo2d-extras-3.0.jar ++CLASSPATH = /usr/share/piccolo2d/lib/piccolo2d.jar + + ScrollView.jar : $(SCROLLVIEW_CLASSES) + $(JAR) cf $@ com/google/scrollview/*.class \ +--- a/viewer/svutil.cpp 2015-07-11 03:53:12.000000000 -0400 ++++ b/viewer/svutil.cpp 2016-01-21 01:46:30.203461826 -0500 +@@ -302,7 +302,7 @@ + #else + const char* cmd_template = "-c \"trap 'kill %%1' 0 1 2 ; java " + "-Xms1024m -Xmx2048m -Djava.library.path=%s -cp %s/ScrollView.jar:" +- "%s/piccolo2d-core-3.0.jar:%s/piccolo2d-extras-3.0.jar" ++ "/usr/share/piccolo2d/lib/piccolo2d.jar" + " com.google.scrollview.ScrollView" + " & wait\""; + #endif +--- a/viewer/Makefile.am 2015-07-11 03:53:12.000000000 -0400 ++++ b/viewer/Makefile.am 2016-01-21 03:37:04.355789682 -0500 +@@ -5,6 +5,10 @@ + -fvisibility=hidden -fvisibility-inlines-hidden + endif + ++if !GRAPHICS_DISABLED ++AM_CPPFLAGS += -DSCROLLVIEW_PATH=/usr/share/tessdata/ ++endif ++ + noinst_HEADERS = \ + scrollview.h svmnode.h svutil.h + diff --git a/app-text/tesseract/tesseract-3.04.00-r4.ebuild b/app-text/tesseract/tesseract-3.04.00-r4.ebuild index 42e7f1b72ec9..8fce6ae0baa5 100644 --- a/app-text/tesseract/tesseract-3.04.00-r4.ebuild +++ b/app-text/tesseract/tesseract-3.04.00-r4.ebuild @@ -6,8 +6,9 @@ EAPI=5 MY_PN="tesseract-ocr" URI_PREFIX="https://github.com/${MY_PN}/tessdata/raw/${PV}/" +JAVA_PKG_OPT_USE="scrollview" -inherit eutils autotools +inherit eutils autotools java-pkg-opt-2 DESCRIPTION="An OCR Engine, orginally developed at HP, now open source." HOMEPAGE="https://github.com/tesseract-ocr" @@ -65,25 +66,34 @@ KEYWORDS="~alpha ~amd64 ~arm ~ppc ~ppc64 ~sparc ~x86" IUSE="doc examples jpeg math opencl osd png +scrollview static-libs tiff training -webp linguas_ar linguas_bg linguas_ca linguas_chr linguas_cs linguas_de linguas_da linguas_el linguas_es linguas_fi linguas_fr linguas_he linguas_hi linguas_hu linguas_id linguas_it linguas_jp linguas_ko linguas_lt linguas_lv linguas_nl linguas_no linguas_pl linguas_pt linguas_ro linguas_ru linguas_sk linguas_sl linguas_sr linguas_sv linguas_th linguas_tl linguas_tr linguas_uk linguas_vi linguas_zh_CN linguas_zh_TW" # With opencl USE=tiff is necessary in leptonica -DEPEND=">=media-libs/leptonica-1.71:=[zlib,tiff?,jpeg?,png?,webp?] +CDEPEND=">=media-libs/leptonica-1.71:=[zlib,tiff?,jpeg?,png?,webp?] opencl? ( virtual/opencl media-libs/tiff:0= media-libs/leptonica:=[tiff] ) + scrollview? ( + >=dev-java/piccolo2d-3.0:0 + ) training? ( dev-libs/icu:= x11-libs/pango:= x11-libs/cairo:= ) " -RDEPEND="${DEPEND}" + +DEPEND="${CDEPEND} + scrollview? ( >=virtual/jdk-1.7 )" + +RDEPEND="${CDEPEND} + scrollview? ( >=virtual/jre-1.7 )" DOCS=(AUTHORS ChangeLog NEWS README ReleaseNotes ) PATCHES=( "${FILESDIR}/tesseract-2.04-gcc47.patch" "${FILESDIR}/${P}-fix-scrollview-disabled.patch" + "${FILESDIR}/${P}-use-system-piccolo2d.patch" ) src_unpack() { @@ -96,6 +106,8 @@ src_unpack() { src_prepare() { epatch "${PATCHES[@]}" eautoreconf + + java-pkg-opt-2_src_prepare } src_configure() { @@ -111,6 +123,7 @@ src_configure() { src_compile() { default + use scrollview && emake ScrollView.jar JAVAC="javac $(java-pkg_javac-args)" use training && emake training } @@ -131,7 +144,7 @@ src_install() { dohtml -r "${WORKDIR}/${MY_PN}"/doc/html/* fi - # install language files insinto /usr/share/tessdata - doins tessdata/*traineddata* + doins tessdata/*traineddata* # language files + use scrollview && doins java/ScrollView.jar # scrollview } |