summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: f9c42134707c699d2304a193d6fda5b06716033e (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
45
46
47
48
49
50
51
52
53
54
55
56
57
# Maintainer: sudacode <suda@sudacode.com>
pkgname=python-manga-ocr
_pkgname=manga_ocr
pkgver=0.1.14
pkgrel=2
pkgdesc="A tool for extracting text from manga images using OCR"
arch=('any')
url="https://github.com/kha-white/manga-ocr"
license=('Apache-2.0')
makedepends=('python-build' 'python-installer')
depends=(
	'python>=3.6'
	'python-fire'
	'python-fugashi'
	'python-jaconv'
	'python-loguru'
	'python-numpy'
	'python-pillow>=10.0.0'
	'python-pyperclip'
	'python-pytorch>=1.0'
	'python-transformers>=4.25.0'
	'python-unidic-lite'
)
optdepends=(
	'wl-clipboard: Read images from the clipboard in the command-line mode on Wayland'
	'xclip: Read images from the clipboard in the command-line mode on X11'
)
checkdepends=('python-pytest')

conflicts=('manga-ocr-git')

source=(
	"${pkgname}-${pkgver}.tar.gz::https://github.com/kha-white/manga_ocr/archive/refs/tags/v${pkgver}.tar.gz"
	"skip-example-run-on-boot.patch"
)
sha256sums=('f7d73bbf482cbefb6f91ff3c628a3131d6c7dc863612539fe5d03a4b7d640643'
	'd287a2fbfa71d9753cdfd921ce67bd7bf1fcf1e36dd08fc00c8d142305d4da88')

prepare() {
	cd "${_pkgname//_/-}-$pkgver"
	patch --forward --strip=0 --input=../skip-example-run-on-boot.patch
}

build() {
	cd "${_pkgname//_/-}-$pkgver"
	python -m build --wheel --no-isolation
}

check() {
	cd "${_pkgname//_/-}-$pkgver"
	pytest -o addopts=""
}

package() {
	cd "${_pkgname//_/-}-$pkgver"
	python -m installer --destdir="$pkgdir" dist/*.whl
}