makedepends=(caja dconf djvulibre libsecret libspectre mate-desktop mate-icon-theme poppler-glib webkitgtk
             libsynctex libgxps mathjax2 itstool gtk-doc gobject-introspection python-setuptools)

description="Simply a pdf document viewer"
url="https://mate-desktop.org/"

packager="Great-OS Team"
maintainer="Great-OS Team"

name=atril
version=1.28.1
release=2

source=(http://pub.mate-desktop.org/releases/${version%.*}/$name-$version.tar.xz)

build() {

  cd $name-$version

  sed -i 's|/usr/share/javascript/mathjax|/usr/share/mathjax|' backend/epub/epub-document.c

  ./configure --prefix=/usr \
              --disable-static \
              --libexecdir=/usr/lib/${name} \
              --enable-gtk-doc \
              --enable-djvu \
              --enable-dvi \
              --enable-epub \
              --enable-t1lib \
              --enable-pixbuf \
              --enable-comics \
              --enable-xps \
              --enable-introspection

  make

  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool

  make DESTDIR=$PKG install
}
