1 # Copyright 2005-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit cmake toolchain-funcs xdg-utils
8 if [[ ${PV} == *9999* ]] ; then
10 EGIT_REPO_URI="https://anongit.freedesktop.org/git/poppler/poppler.git"
13 SRC_URI="https://poppler.freedesktop.org/${P}.tar.xz"
14 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
15 SLOT="0/97" # CHECK THIS WHEN BUMPING!!! SUBSLOT IS libpoppler.so SOVERSION
18 DESCRIPTION="PDF rendering library based on the xpdf-3.0 code base"
19 HOMEPAGE="https://poppler.freedesktop.org/"
22 IUSE="cairo cjk curl +cxx debug doc +introspection +jpeg +jpeg2k +lcms nss png qt5 tiff +utils"
24 # No test data provided
38 introspection? ( dev-libs/gobject-introspection:= )
40 curl? ( net-misc/curl )
41 jpeg? ( virtual/jpeg:0 )
42 jpeg2k? ( >=media-libs/openjpeg-2.3.0-r1:2= )
43 lcms? ( media-libs/lcms:2 )
44 nss? ( >=dev-libs/nss-3.19:0 )
45 png? ( media-libs/libpng:0= )
51 tiff? ( media-libs/tiff:0 )
54 cjk? ( app-text/poppler-data )
57 DOCS=( AUTHORS NEWS README.md README-XPDF )
60 "${FILESDIR}/${PN}-0.60.1-qt5-dependencies.patch"
61 "${FILESDIR}/${PN}-0.28.1-fix-multilib-configuration.patch"
62 "${FILESDIR}/${PN}-0.82.0-respect-cflags.patch"
63 "${FILESDIR}/${PN}-0.61.0-respect-cflags.patch"
64 "${FILESDIR}/${PN}-0.57.0-disable-internal-jpx.patch"
70 # Clang doesn't grok this flag, the configure nicely tests that, but
71 # cmake just uses it, so remove it if we use clang
72 if [[ ${CC} == clang ]] ; then
73 sed -e 's/-fno-check-new//' -i cmake/modules/PopplerMacros.cmake || die
76 if ! grep -Fq 'cmake_policy(SET CMP0002 OLD)' CMakeLists.txt ; then
77 sed -e '/^cmake_minimum_required/acmake_policy(SET CMP0002 OLD)' \
78 -i CMakeLists.txt || die
80 einfo "policy(SET CMP0002 OLD) - workaround can be removed"
90 -DRUN_GPERF_IF_PRESENT=OFF
93 -DENABLE_ZLIB_UNCOMPRESS=OFF
94 -DENABLE_UNSTABLE_API_ABI_HEADERS=ON
96 -DWITH_Cairo=$(usex cairo)
97 -DENABLE_LIBCURL=$(usex curl)
98 -DENABLE_CPP=$(usex cxx)
99 -DWITH_JPEG=$(usex jpeg)
100 -DENABLE_DCTDECODER=$(usex jpeg libjpeg none)
101 -DENABLE_LIBOPENJPEG=$(usex jpeg2k openjpeg2 none)
102 -DENABLE_CMS=$(usex lcms lcms2 none)
103 -DWITH_NSS3=$(usex nss)
104 -DWITH_PNG=$(usex png)
105 $(cmake_use_find_package qt5 Qt5Core)
106 -DWITH_TIFF=$(usex tiff)
107 -DENABLE_UTILS=$(usex utils)
109 use cairo && mycmakeargs+=( -DWITH_GObjectIntrospection=$(usex introspection) )
117 # live version doesn't provide html documentation
118 if use cairo && use doc && [[ ${PV} != *9999* ]]; then
119 # For now install gtk-doc there
120 insinto /usr/share/gtk-doc/html/poppler
121 doins -r "${S}"/glib/reference/html/*