forked from msys2/MINGW-packages
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/Alexpux/MINGW-packages
- Loading branch information
Showing
1 changed file
with
37 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,51 @@ | ||
# Maintainer: Alexey Pavlov <alexpux@gmail.com> | ||
# Maintainer: Ray Donnelly <mingw.android@gmail.com> | ||
# The traineddata files from the source should be unpacked in tesseract ocr's tessdata directory | ||
|
||
# The traineddata and related files for all languages should be placed in tessdata directory | ||
# Creates separate traineddata packages for each language | ||
# osd.traineddata (Orientation and script detection) is included with tesseract-ocr | ||
|
||
_realname=tesseract-ocr-osd | ||
_langs=(afr amh ara asm aze aze_cyrl bel ben bod bos bul cat ceb ces | ||
chi_sim chi_tra chr cym dan dan_frak deu deu_frak dzo ell eng enm epo | ||
equ est eus fas fin fra frk frm gle glg grc guj hat heb hin hrv hun | ||
iku ind isl ita ita_old jav jpn kan kat kat_old kaz khm kir kor kur | ||
lao lat lav lit mal mar mkd mlt msa mya nep nld nor ori pan pol | ||
por pus ron rus san sin slk slk_frak slv spa spa_old sqi srp srp_latn | ||
swa swe syr tam tel tgk tgl tha tir tur uig ukr urd uzb uzb_cyrl vie yid) | ||
|
||
_langs_deva=(hin mar nep san) | ||
|
||
_realname=tesseract-data | ||
pkgbase=mingw-w64-${_realname} | ||
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" | ||
pkgver=3.04.rc1 | ||
pkgname=($(for l in ${_langs[@]}; do echo ${MINGW_PACKAGE_PREFIX}-${_realname}-${l}; done) ) | ||
pkgver=3.04.00 | ||
pkgrel=1 | ||
pkgdesc="Orientation & Script Detection Data data for Tesseract OCR engine" | ||
pkgdesc="Language tessdata for Tesseract OCR engine (mingw-w64)" | ||
arch=('any') | ||
url="https://github.com/tesseract-ocr/tessdata" | ||
license=("Apache License 2.0") | ||
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc" "${MINGW_PACKAGE_PREFIX}-pkg-config") | ||
depends=(${MINGW_PACKAGE_PREFIX}-gcc-libs | ||
${MINGW_PACKAGE_PREFIX}-tesseract-ocr | ||
${MINGW_PACKAGE_PREFIX}-zlib) | ||
options=('!libtool' 'strip') | ||
source=("https://github.com/tesseract-ocr/tessdata/blob/master/osd.traineddata") | ||
sha256sums=('SKIP') | ||
|
||
prepare() { | ||
cd "$srcdir/${_realname}-master" | ||
} | ||
|
||
build() { | ||
[[ -d "${srcdir}/build-${MINGW_CHOST}" ]] && rm -rf "${srcdir}/build-${MINGW_CHOST}" | ||
mkdir "${srcdir}/build-${MINGW_CHOST}" | ||
cd "${srcdir}/build-${MINGW_CHOST}" | ||
|
||
|
||
${srcdir}/${_realname}-master/configure \ | ||
--build=${MINGW_CHOST} \ | ||
--host=${MINGW_CHOST} \ | ||
--target=${MINGW_CHOST} \ | ||
--prefix=${MINGW_PREFIX} \ | ||
LIBLEPT_HEADERSDIR=${MINGW_PREFIX}/include \ | ||
depends=() | ||
source=(${_realname}-$pkgver.tar.gz::https://github.com/tesseract-ocr/tessdata/archive/$pkgver.tar.gz) | ||
sha256sums=('5dcb37198336b6953843b461ee535df1401b41008d550fc9e43d0edabca7adb1') | ||
|
||
make | ||
build() { | ||
true | ||
} | ||
|
||
|
||
package() { | ||
cd "${srcdir}/build-${MINGW_CHOST}" | ||
make DESTDIR="$pkgdir" install-lang | ||
# Declare the package functions for tessdata | ||
for l in ${_langs[@]}; do | ||
eval " | ||
package_${MINGW_PACKAGE_PREFIX}-${_realname}-${l}(){ | ||
pkgdesc=\"($l) Language tessdata for Tesseract OCR engine (mingw-w64)\" | ||
pkgver=3.04.00 | ||
pkgrel=1 | ||
depends=() | ||
groups=(${_realname}) | ||
mkdir -p \$pkgdir/${MINGW_PREFIX}/share/tessdata | ||
cp \$srcdir/tessdata-$pkgver/${l}.* \$pkgdir/${MINGW_PREFIX}/share/tessdata/ | ||
find \$pkgdir/${MINGW_PREFIX}/share/tessdata -type f -exec chmod 0644 {} \; | ||
} | ||
" | ||
done |