Skip to content

Instantly share code, notes, and snippets.

@nofxx
Last active June 2, 2021 02:47
Show Gist options
  • Save nofxx/d87f70448a92e7a1be10 to your computer and use it in GitHub Desktop.
Save nofxx/d87f70448a92e7a1be10 to your computer and use it in GitHub Desktop.
Tesseract with training tools on archlinux
# Tesseract with training tools
#
# You must install one of tesseract-data-* packages or whole tesseract-data
#
# Based on ABS tree:
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Andreas Hauser <andy-aur@splashground.de>
_langs=(afr ara aze bel ben bul cat ces chi_sim chi_tra chr dan deu ell
eng enm epo epo_alt equ est eus fin fra frk frm glg grc heb hin hrv hun
ind isl ita ita_old jpn kan kor lav lit mal mkd mlt msa nld nor pol por
ron rus slk slv spa spa_old sqi srp swa swe tam tel tgl tha tur ukr vie)
pkgname=tesseract-full
_pkgname=tesseract
pkgver=3.03rc1
_pkgver=3.03
pkgrel=1
pkgdesc="An OCR program. With training tools."
arch=(i686 x86_64)
url="http://code.google.com/p/tesseract-ocr"
license=("APACHE")
depends=(libpng libtiff libjpeg zlib giflib gcc-libs leptonica icu pango cairo)
provides=('tesseract')
conflicts=('tesseract')
optdepends=($(for l in ${_langs[@]}; do echo tesseract-data-${l}; done))
source=("http://arch.p5n.pp.ru/~sergej/dl/2014/$_pkgname-$pkgver.tar.gz")
md5sums=('d69ceca9ae70e0b7020d0f92d60b8565')
build() {
cd $srcdir/$_pkgname-${_pkgver}
[ -f Makefile ] || ./configure --prefix=/usr
make
cd training/ # hack to clean training on rc0
make clean # "
cd .. # "
make training
}
package() {
cd $srcdir/$_pkgname-${_pkgver}
make DESTDIR=$pkgdir install
make DESTDIR=$pkgdir training-install
mkdir -p $pkgdir/usr/share/tessdata
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment