1 |
commit: 569e97daacd0f990661927f2141717984979512d |
2 |
Author: Bernard Cafarelli <voyageur <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Aug 26 10:38:48 2019 +0000 |
4 |
Commit: Bernard Cafarelli <voyageur <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Aug 26 10:39:13 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=569e97da |
7 |
|
8 |
app-text/tesseract: add multilib support |
9 |
|
10 |
This can be used to add tesseract support in media-video/ffmpeg |
11 |
|
12 |
Bug: https://bugs.gentoo.org/622900 |
13 |
Package-Manager: Portage-2.3.73, Repoman-2.3.17 |
14 |
Signed-off-by: Bernard Cafarelli <voyageur <AT> gentoo.org> |
15 |
|
16 |
app-text/tesseract/tesseract-4.1.0-r1.ebuild | 91 ++++++++++++++++++++++++++++ |
17 |
1 file changed, 91 insertions(+) |
18 |
|
19 |
diff --git a/app-text/tesseract/tesseract-4.1.0-r1.ebuild b/app-text/tesseract/tesseract-4.1.0-r1.ebuild |
20 |
new file mode 100644 |
21 |
index 00000000000..7313d345c7a |
22 |
--- /dev/null |
23 |
+++ b/app-text/tesseract/tesseract-4.1.0-r1.ebuild |
24 |
@@ -0,0 +1,91 @@ |
25 |
+# Copyright 1999-2019 Gentoo Authors |
26 |
+# Distributed under the terms of the GNU General Public License v2 |
27 |
+ |
28 |
+EAPI=7 |
29 |
+ |
30 |
+inherit autotools multilib-minimal toolchain-funcs |
31 |
+ |
32 |
+DESCRIPTION="An OCR Engine, orginally developed at HP, now open source." |
33 |
+HOMEPAGE="https://github.com/tesseract-ocr" |
34 |
+SRC_URI="https://github.com/tesseract-ocr/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz" |
35 |
+ |
36 |
+LICENSE="Apache-2.0" |
37 |
+SLOT="0" |
38 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~mips ~ppc ~ppc64 ~sparc ~x86" |
39 |
+IUSE="doc jpeg opencl openmp png static-libs tiff training webp" |
40 |
+ |
41 |
+COMMON_DEPEND=">=media-libs/leptonica-1.74:=[${MULTILIB_USEDEP},zlib,tiff?,jpeg?,png?,webp?] |
42 |
+ opencl? ( |
43 |
+ virtual/opencl[${MULTILIB_USEDEP}] |
44 |
+ media-libs/tiff:0=[${MULTILIB_USEDEP}] |
45 |
+ media-libs/leptonica:=[tiff] |
46 |
+ ) |
47 |
+ training? ( |
48 |
+ dev-libs/icu:= |
49 |
+ x11-libs/pango:= |
50 |
+ x11-libs/cairo:= |
51 |
+ )" |
52 |
+RDEPEND="${COMMON_DEPEND} |
53 |
+ || ( |
54 |
+ >=app-text/tessdata_fast-4.0.0 |
55 |
+ >=app-text/tessdata_best-4.0.0 |
56 |
+ >=app-text/tessdata_legacy-4.0.0 |
57 |
+ )" |
58 |
+DEPEND="${COMMON_DEPEND} |
59 |
+ app-text/asciidoc |
60 |
+ app-text/docbook-xsl-stylesheets |
61 |
+ dev-libs/libxslt |
62 |
+ doc? ( app-doc/doxygen )" |
63 |
+ |
64 |
+pkg_pretend() { |
65 |
+ [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp |
66 |
+} |
67 |
+ |
68 |
+pkg_setup() { |
69 |
+ [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp |
70 |
+} |
71 |
+ |
72 |
+src_prepare() { |
73 |
+ default |
74 |
+ eautoreconf |
75 |
+} |
76 |
+ |
77 |
+multilib_src_configure() { |
78 |
+ # scrollview disabled for now, see bug #686944 |
79 |
+ local myeconfargs=( |
80 |
+ --enable-shared |
81 |
+ --disable-graphics |
82 |
+ $(use_enable opencl) |
83 |
+ $(use_enable openmp) |
84 |
+ $(use_enable static-libs static) |
85 |
+ ) |
86 |
+ |
87 |
+ ECONF_SOURCE="${S}" econf "${myeconfargs[@]}" |
88 |
+} |
89 |
+ |
90 |
+multilib_src_compile() { |
91 |
+ default |
92 |
+ if multilib_is_native_abi; then |
93 |
+ use doc && emake doc |
94 |
+ use training && emake training |
95 |
+ fi |
96 |
+} |
97 |
+ |
98 |
+multilib_src_install() { |
99 |
+ if multilib_is_native_abi; then |
100 |
+ DOCS=( "${S}"/AUTHORS "${S}"/ChangeLog "${S}"/README.md ) |
101 |
+ if use doc; then |
102 |
+ HTML_DOCS=( doc/html/. ) |
103 |
+ fi |
104 |
+ einstalldocs |
105 |
+ |
106 |
+ if use training; then |
107 |
+ emake DESTDIR="${D}" training-install |
108 |
+ fi |
109 |
+ fi |
110 |
+ emake DESTDIR="${D}" install |
111 |
+} |
112 |
+ |
113 |
+multilib_src_install_all() { |
114 |
+ find "${D}" -name '*.la' -type f -delete || die |
115 |
+} |