blob: b618f28c5fe825f45b4354b191faa4757eb8fbeb [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001SUMMARY = "Poppler is a PDF rendering library based on the xpdf-3.0 code base"
2LICENSE = "GPLv2"
3LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
4
5SRC_URI = "http://poppler.freedesktop.org/${BP}.tar.xz \
6 file://0001-Do-not-overwrite-all-our-build-flags.patch \
7 file://0002-CairoOutputDev.cc-fix-build-error-when-using-fixedpo.patch \
8 file://0001-glib-CMakeLists.txt-Add-libpoppler-to-link-along-wit.patch \
9 file://basename-include.patch \
10 "
11SRC_URI[md5sum] = "fdb0699e9aa20e81acd1a50701374c8b"
12SRC_URI[sha256sum] = "66972047d9ef8162cc8c389d7e7698291dfc9f2b3e4ea9a9f08ae604107451bd"
13
14DEPENDS = "fontconfig zlib cairo lcms glib-2.0"
15
16inherit cmake pkgconfig gobject-introspection
17
18PACKAGECONFIG ??= "jpeg openjpeg png tiff nss ${@bb.utils.contains('BBFILE_COLLECTIONS', 'qt5-layer', 'qt5', '', d)}"
19PACKAGECONFIG[jpeg] = "-DWITH_JPEG=ON -DENABLE_DCTDECODER=libjpeg,-DWITH_JPEG=OFF -DENABLE_DCTDECODER=none,jpeg"
20PACKAGECONFIG[png] = "-DWITH_PNG=ON,-DWITH_PNG=OFF,libpng"
21PACKAGECONFIG[tiff] = "-DWITH_TIFF=ON,-DWITH_TIFF=OFF,tiff"
22PACKAGECONFIG[curl] = "-DENABLE_LIBCURL=ON,-DENABLE_LIBCURL=OFF,curl"
23PACKAGECONFIG[openjpeg] = "-DENABLE_LIBOPENJPEG=openjpeg2,-DENABLE_LIBOPENJPEG=none,openjpeg"
24PACKAGECONFIG[qt5] = "-DENABLE_QT5=ON,-DENABLE_QT5=OFF,qtbase qttools-native"
25PACKAGECONFIG[nss] = "-DWITH_NSS3=ON,-DWITH_NSS3=OFF,nss"
26
27# surprise - did not expect this to work :)
28inherit ${@bb.utils.contains('PACKAGECONFIG', 'qt5', 'cmake_qt5', '', d)}
29
30SECURITY_CFLAGS = "${SECURITY_NO_PIE_CFLAGS}"
31
32EXTRA_OECMAKE += " \
33 -DENABLE_CMS=lcms2 \
34 -DENABLE_XPDF_HEADERS=ON \
35 -DBUILD_GTK_TESTS=OFF \
36 -DENABLE_ZLIB=ON \
37 -DCMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES:PATH='${STAGING_INCDIR}' \
38"
39
40do_configure_append() {
41 # poppler macro uses pkg-config to check for g-ir runtimes. Something
42 # makes them point to /usr/bin. Align them to sysroot - that's where the
43 # git-wrappers are:
44 sed -i 's: ${bindir}/g-ir: ${STAGING_BINDIR}/g-ir:' ${B}/build.ninja
45}
46
47# check for TARGET_FPU=soft and inform configure of the result so it can disable some floating points
48def get_poppler_fpu_setting(bb, d):
49 if d.getVar('TARGET_FPU') in [ 'soft' ]:
50 return "-DUSE_FIXEDPOINT=ON"
51 return ""
52
53EXTRA_OECMAKE += "${@get_poppler_fpu_setting(bb, d)}"
54
55PACKAGES =+ "libpoppler libpoppler-glib"
56FILES_libpoppler = "${libdir}/libpoppler.so.*"
57FILES_libpoppler-glib = "${libdir}/libpoppler-glib.so.*"
58
59RDEPENDS_libpoppler = "poppler-data"