blob: a69a50f6e3ecefd27d1a33d6e1410745ed4cb69d (
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: Caleb Maclennan <caleb@alerque.com>
pkgname=ocrs
pkgver=0.8.0
pkgrel=1
pkgdesc='a modern OCR engine written in Rust'
arch=(x86_64)
url="https://github.com/robertknight/$pkgname"
license=(MIT Apache-2.0)
depends=(gcc-libs
glibc)
makedepends=(cargo-nightly)
_tag="$pkgname-cli-v$pkgver"
_archive="$pkgname-$_tag"
source=("$url/archive/$_tag/$_archive.tar.gz")
sha256sums=('a5c9826917eea6ffea215969d448bf8409eff159dc2603bbaee37133d96c5f2a')
prepare() {
cd "$_archive"
rustup default nightly-2024-05-19
cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
}
_srcenv() {
cd "$_archive"
export RUSTUP_TOOLCHAIN=nightly
export CARGO_TARGET_DIR=target
CFLAGS+=' -ffat-lto-objects'
}
build() {
_srcenv
cargo build --frozen --release --all-features
}
check() {
_srcenv
cargo test --frozen --all-features
}
package() {
cd "$_archive"
install -Dm0755 -t "$pkgdir/usr/bin/" "target/release/$pkgname"
}
|