# Maintainer: Natanael Copa pkgname=poppler pkgver=0.87.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" # 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" 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() { if [ "$CBUILD" != "$CHOST" ]; then CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux" fi cmake -B build \ -DCMAKE_BUILD_TYPE=None \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_INSTALL_LIBDIR=lib \ -DENABLE_UNSTABLE_API_ABI_HEADERS=ON \ -DBUILD_QT5_TESTS=OFF \ -DENABLE_QT5=OFF \ -DCMAKE_CXX_FLAGS="$CXXFLAGS" \ -DCMAKE_C_FLAGS="$CFLAGS" \ $CMAKE_CROSSOPTS . make -C build } package() { make -C build 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="4bdc432c75106b3f37643bfd57c66aba659864fdc3c4d9ffa5089ceaa33ad3bd10d2c4abfb09a4f7b9d7d137e31eb559b440d7df53f35f60d70eaef05f987630 poppler-0.87.0.tar.xz"