# Maintainer: PktSurf <smlinux@pktsurf.in>
app=poppler
version=0.57.0
build=1sml
homepage="https://poppler.freedesktop.org/"
download="https://poppler.freedesktop.org/poppler-$version.tar.xz"
desc="PDF rendering library aimed at centralised code maintenance"
requires="pkgconf gcc-libs libjpeg-turbo python3 curl lcms2 openjpeg icu cairo gtk2 gobject-introspection gtk3"

prepbuilddir() {
  mkandenterbuilddir
  rm -rf $app-$version

  tar xf $srcdir/$app-$version.tar.?z*
  cd $app-$version
  fixbuilddirpermissions
}

build() {

  applypatch $srcdir/poppler-segfault.patch

  ./configure \
    --prefix="" \
    --sysconfdir=/etc \
    --enable-introspection=no \
    --disable-gtk-test \
    --disable-poppler-qt4 \
    --disable-poppler-qt5 \
    --enable-xpdf-headers \
    --enable-zlib \
    --disable-static

  make
  make install DESTDIR=$pkg

  cp COPYING $pkgdocs/

  mkfinalpkg
}

sha512sums="
0d8c0fffe97809f20bb34f2139b2a7e28a16b05ba4d73904a8dcc0d351b9acc087d695d29e73bfb3b166840ee004e5497140b1299aa722ba3d460930f0a9019a  poppler-0.57.0.tar.lz
1f42a769becbf4873efa27c970e57b44bb46efc1029e6deecf0a8bfba047f189ec65ae4346ea79ce15eebd10771c74ece408fe1956e4b3d27a578a045aa2451f  poppler-segfault.patch
"