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

name=zathura
version=0.5.2
release=1
source=(https://git.pwmt.org/pwmt/$name/-/archive/$version/$name-$version.tar.bz2)

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 {} \;
}
