mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-08-31 19:31:10 +02:00
66 lines
2.0 KiB
Plaintext
66 lines
2.0 KiB
Plaintext
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
|
|
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
|
|
pkgname=tesseract-ocr
|
|
pkgver=4.0.0
|
|
_tdver=4.0.0
|
|
pkgrel=1
|
|
pkgdesc="open source OCR engine"
|
|
url="https://github.com/tesseract-ocr/tesseract/releases"
|
|
arch="all"
|
|
license="Apache"
|
|
makedepends="automake autoconf libtool leptonica-dev pango-dev icu-dev
|
|
cairo-dev"
|
|
subpackages="$pkgname-dev"
|
|
source="$pkgname-$pkgver.tar.gz::https://github.com/tesseract-ocr/tesseract/archive/$pkgver.tar.gz
|
|
https://github.com/tesseract-ocr/tessdata/archive/${_tdver}/tessdata-${_tdver}.tar.gz
|
|
"
|
|
|
|
_langs="afr ara aze bel ben bul cat ces chi_sim chi_tra chr dan deu ell
|
|
enm epo 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"
|
|
|
|
for _lang in $_langs; do
|
|
subpackages="$subpackages $pkgname-data-$_lang:_lang_data:noarch"
|
|
done
|
|
|
|
builddir="$srcdir"/${pkgname/-*}-$pkgver
|
|
|
|
build() {
|
|
cd "$builddir"
|
|
./autogen.sh
|
|
./configure \
|
|
--build=$CBUILD \
|
|
--host=$CHOST \
|
|
--prefix=/usr \
|
|
--sysconfdir=/etc \
|
|
--mandir=/usr/share/man \
|
|
--infodir=/usr/share/info \
|
|
--localstatedir=/var \
|
|
--disable-static
|
|
make
|
|
make training
|
|
}
|
|
|
|
package() {
|
|
cd "$builddir"
|
|
make DESTDIR="$pkgdir" install
|
|
make DESTDIR="$pkgdir" training-install
|
|
install -D "$srcdir"/tessdata-$_tdver/eng.* \
|
|
"$srcdir"/tessdata-$_tdver/osd.* \
|
|
"$srcdir"/tessdata-$_tdver/equ.* \
|
|
"$pkgdir"/usr/share/tessdata/
|
|
}
|
|
|
|
_lang_data() {
|
|
local lang="${subpkgname#$pkgname-data-}"
|
|
pkgdesc="Tesseract language data for $lang"
|
|
depends="$pkgname"
|
|
mkdir -p "$subpkgdir"/usr/share/tessdata
|
|
mv "$srcdir"/tessdata-$_tdver/$lang.* \
|
|
"$subpkgdir"/usr/share/tessdata/
|
|
}
|
|
|
|
sha512sums="69e57d4ba1fc43d212fd0fff69a2b5d48a3b37cfee7054fdc083cbb7e04d92317609a32e457229661d70ce8d9b16c9d25e81bfc3861db660dd2c8f292202d447 tesseract-ocr-4.0.0.tar.gz
|
|
cd71bb99d44eefb53b359ba64b472c509fff773b2737a8d51e10d5d52d9a3a7ff870d470b1c72a7c78be3263b5ecfbb58a6eab13cf7128d8599681676cdcef6b tessdata-4.0.0.tar.gz"
|