# Description: Highly customizable and functional document viewer
# URL: https://pwmt.org/projects/zathura
# Maintainer: Tim Biermann, tbier at posteo dot de
# Depends on: girara json-glib
# Optional: texlive

name=zathura
version=2026.05.20
release=1
source=(https://github.com/pwmt/zathura/archive/$version/$name-$version.tar.gz)

build() {
  prt-get isinst texlive && PKGMK_ZATHURA+=" -D synctex=enabled" || PKGMK_ZATHURA=" -D synctex=disabled"

  meson setup $name-$version build $PKGMK_ZATHURA \
    --prefix=/usr \
    --sysconfdir=/etc \
    --buildtype=plain \
    --wrap-mode nodownload \
    -D b_lto=true \
    -D b_pie=true
  meson compile -C build
  DESTDIR=$PKG meson install -C build

  rm -rf $PKG/usr/share/{locale,fish}
  find $PKG -perm /go+w -exec chmod go-w {} \;
}
