# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=chafa
pkgver=1.18.1
pkgrel=1
pkgdesc="Image-to-text converter supporting a wide range of symbols and palettes, transparency, animations, etc."
arch=("x86_64" "aarch64")
url="https://hpjansson.org/chafa/"
license=("LGPL-3.0-or-later")
depends=('libavif' 'libheif' 'libjxl' 'librsvg' 'libwebp' 'libxslt')
makedepends=('git' 'gtk-doc')
provides=('libchafa.so')
source=(git+https://github.com/hpjansson/chafa.git#tag=$pkgver?signed)
sha512sums=('c121c46bf53a1ec8f881f0bb7fe0280a3acf6cefa11d16021238cbd1230f92b4aab9ea55526b76847f9003b5ebdd6b8cb696466e0482920237116c9b0c467bfe')
validpgpkeys=('C01EDE5BB0D91E26D003662EC76BB9FEEAD12EA7')  # Hans Petter Jansson

build() {
  cd $pkgname
  ./autogen.sh --prefix=/usr --enable-man --enable-gtk-doc
  make
}

package() {
  cd $pkgname
  make DESTDIR="$pkgdir" install
  make -C tools/completions PREFIX="$pkgdir"/usr/share install-zsh-completion install-fish-completion install-bash-completion
}
