Skip to content

Instantly share code, notes, and snippets.

@yogo1212
Created January 17, 2025 14:41
Show Gist options
  • Save yogo1212/cf81f8ba647eff55df5c3e0edbdfa5fd to your computer and use it in GitHub Desktop.
Save yogo1212/cf81f8ba647eff55df5c3e0edbdfa5fd to your computer and use it in GitHub Desktop.
ocrs PKGBUILD based on [email protected]'s AUR package (fixed build process by removing cruft)
pkgname=ocrs
pkgver=0.9.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)
_tag="$pkgname-cli-v$pkgver"
_archive="$pkgname-$_tag"
source=("$url/archive/$_tag/$_archive.tar.gz")
sha256sums=('d571f050736ca7393ce4234579b9040e07c34b001ba2223c83881195c1f3a1b6')
_srcenv() {
cd "$_archive"
export CARGO_TARGET_DIR=target
CFLAGS+=' -ffat-lto-objects'
}
build() {
_srcenv
cargo build --release
}
package() {
cd "$_archive"
install -Dm0755 -t "$pkgdir/usr/bin/" "target/release/$pkgname"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment