# Maintainer: Natanael Copa pkgname=poppler pkgver=0.81.0 pkgrel=0 pkgdesc="PDF rendering library based on xpdf 3.0" url="https://poppler.freedesktop.org/" arch="all" options="!check" # No test suite. license="GPL-2.0-or-later" depends_dev="cairo-dev glib-dev" makedepends="$depends_dev cmake fontconfig-dev gobject-introspection-dev lcms2-dev libjpeg-turbo-dev libpng-dev libxml2-dev openjpeg-dev openjpeg-tools tiff-dev zlib-dev" subpackages="$pkgname-dev $pkgname-doc $pkgname-glib $pkgname-utils" source="https://poppler.freedesktop.org/poppler-$pkgver.tar.xz" builddir="$srcdir/$pkgname-$pkgver/build" # secfixes: # 0.80.0-r0: # - CVE-2019-9959 prepare() { local _linked_pkg=poppler-qt5 local _linked_apkbuild="$startdir"/../../community/$_linked_pkg/APKBUILD mkdir -p "$builddir" cd "$builddir" if [ -f "$_linked_apkbuild" ]; then local _linked_ver=$( . "$_linked_apkbuild"; echo "$pkgver") if [ "$_linked_ver" != "$pkgver" ]; then error "pkgver needs to be identical with $_linked_pkg ($_linked_ver)" return 1 fi fi } build() { cd "$builddir" cmake .. \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_INSTALL_LIBDIR=lib \ -DENABLE_UNSTABLE_API_ABI_HEADERS=ON \ -DBUILD_QT5_TESTS=OFF \ -DENABLE_QT5=OFF make } package() { cd "$builddir" make DESTDIR="$pkgdir" install } utils() { pkgdesc="Poppler's xpdf-workalike command line utilities" install -d "$subpkgdir"/usr mv "$pkgdir"/usr/bin "$subpkgdir"/usr/ } glib() { pkgdesc="Glib wrapper for poppler" replaces="poppler-gtk" mkdir -p "$subpkgdir"/usr/lib mv "$pkgdir"/usr/lib/libpoppler-glib.so.* \ "$pkgdir"/usr/lib/girepository* \ "$subpkgdir"/usr/lib/ } _cpp() { pkgdesc="Pure C++ wrapper for poppler" mkdir -p "$subpkgdir"/usr/lib mv "$pkgdir"/usr/lib/libpoppler-cpp.so.* \ "$subpkgdir"/usr/lib/ } sha512sums="774d650c63afe2a0d6669daad4b286c2412a0c02581d7ea2cc37d71936f77dff92dc22217367561b7e4285c9c27dcfdca4c76c187d9c3c482db2f3549919b25b poppler-0.81.0.tar.xz"