summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 5c2293455d552696845ca6b3266a457cf9b8c5a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Maintainer: 
# Contributor: Mark Wagie <mark dot wagie at proton dot me>
# Contributor: Grey Christoforo <first name at last name dot net>
pkgname=python-tesserocr
_name=${pkgname#python-}
pkgver=2.10.0
pkgrel=1
pkgdesc="A simple, Pillow-friendly, Python wrapper around tesseract-ocr API using Cython"
arch=('x86_64')
url="https://github.com/sirfz/tesserocr"
license=('MIT')
depends=(
	'leptonica'
	'python'
	'tesseract'
	'python-cysignals'
)
makedepends=(
	'cython'
	'python-build'
	'python-installer'
	'python-setuptools'
	'python-wheel'
)
optdepends=('python-pillow')
source=("$_name-$pkgver.tar.gz::$url/archive/refs/tags/v$pkgver.tar.gz")
b2sums=('fc6dae77ae37ca5ac47e61c44726b175429e8c4494ce1d4d8ca7822008d739ff6b52d5971a1555e8b6b6f0bb99dbbdbaa71a91a22d454e3bd8f4f6a9e462112e')

prepare() {
	cd "$_name-$pkgver"
	sed -i 's/Cython>=3.0.0,<3.2.0/Cython>=3.0.0/' setup.py
}

build() {
	cd "$_name-$pkgver"
	python -m build --wheel --no-isolation
}

package() {
	cd "$_name-$pkgver"
	python -m installer --destdir="$pkgdir" dist/*.whl
	
	install -Dm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
}