# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI="4" ESVN_REPO_URI="http://tesseract-ocr.googlecode.com/svn/trunk" inherit eutils autotools subversion DESCRIPTION="An OCR Engine that was developed at HP and now at Google" HOMEPAGE="http://code.google.com/p/tesseract-ocr/" LICENSE="Apache-2.0" SLOT="0" KEYWORDS="~alpha ~amd64 ~mips ~ppc ~ppc64 ~sparc ~x86" IUSE_LINGUAS=( "linguas_ar ara" "linguas_bg bul" "linguas_ca cat" "linguas_cs ces" "linguas_da dan" "linguas_de deu" "linguas_el ell" "linguas_es spa" "linguas_fi fin" "linguas_fr fra" "linguas_he heb" "linguas_hi hin" "linguas_id ind" "linguas_it ita" "linguas_hu hun" "linguas_ja jpn" "linguas_ko kor" "linguas_lt lit" "linguas_lv lav" "linguas_nl nld" "linguas_nb nor" "linguas_pl pol" "linguas_pt por" "linguas_ro ron" "linguas_ru rus" "linguas_sl slv" "linguas_sk slk" "linguas_sr srp" "linguas_sv swe" "linguas_th tha" "linguas_tl tgl" "linguas_tr tur" "linguas_uk ukr" "linguas_vi vie" "linguas_zh_CN chi_sim" "linguas_zh_TW chi_tra" ) IUSE="examples jpeg png static-libs tiff -webp +scrollview ${IUSE_LINGUAS[@]% *}" DEPEND="media-libs/leptonica[zlib,tiff?,jpeg?,png?,webp?]" RDEPEND="${DEPEND}" # NOTES: # english language files are always installed because they are used by default # that is a tesseract bug and if possible this workaround should be avoided # see bug 287373 S="${WORKDIR}/tesseract-${PV}" src_prepare() { mkdir m4 || die eautoreconf } src_configure() { # https://code.google.com/p/tesseract-ocr/issues/detail?id=707 econf $(use_enable static-libs static) $(use_enable scrollview graphics) } src_install() { local LANGS="eng" IL for IL in "${IUSE_LINGUAS[@]}"; do use "${IL% *}" && LANGS="${LANGS} ${IL#* }" done emake install DESTDIR="${D}" LANGS="${LANGS}" dodoc AUTHORS ChangeLog NEWS README ReleaseNotes insinto /usr/share/tessdata if use examples; then insinto /usr/share/doc/${PF}/examples doins eurotext.tif phototest.tif fi prune_libtool_files }