app-text/poppler: Version bump
[gentoo.git] / app-text / poppler / poppler-0.37.0.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6
7 inherit cmake-utils toolchain-funcs
8
9 if [[ "${PV}" == "9999" ]] ; then
10         inherit git-r3
11         EGIT_REPO_URI="git://git.freedesktop.org/git/${PN}/${PN}"
12         SLOT="0/9999"
13 else
14         SRC_URI="http://poppler.freedesktop.org/${P}.tar.xz"
15         KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
16         SLOT="0/56"   # CHECK THIS WHEN BUMPING!!! SUBSLOT IS libpoppler.so SOVERSION
17 fi
18
19 DESCRIPTION="PDF rendering library based on the xpdf-3.0 code base"
20 HOMEPAGE="http://poppler.freedesktop.org/"
21
22 LICENSE="GPL-2"
23 IUSE="cairo cjk curl cxx debug doc +introspection +jpeg +jpeg2k +lcms png qt4 qt5 tiff +utils"
24
25 # No test data provided
26 RESTRICT="test"
27
28 COMMON_DEPEND="
29         >=media-libs/fontconfig-2.6.0
30         >=media-libs/freetype-2.3.9
31         sys-libs/zlib
32         cairo? (
33                 dev-libs/glib:2
34                 >=x11-libs/cairo-1.10.0
35                 introspection? ( >=dev-libs/gobject-introspection-1.32.1 )
36         )
37         curl? ( net-misc/curl )
38         jpeg? ( virtual/jpeg:0 )
39         jpeg2k? ( media-libs/openjpeg:2= )
40         lcms? ( media-libs/lcms:2 )
41         png? ( media-libs/libpng:0= )
42         qt4? (
43                 dev-qt/qtcore:4
44                 dev-qt/qtgui:4
45         )
46         qt5? (
47                 dev-qt/qtcore:5
48                 dev-qt/qtgui:5
49                 dev-qt/qtxml:5
50         )
51         tiff? ( media-libs/tiff:0 )
52 "
53 DEPEND="${COMMON_DEPEND}
54         virtual/pkgconfig
55 "
56 RDEPEND="${COMMON_DEPEND}
57         cjk? ( >=app-text/poppler-data-0.4.4 )
58 "
59
60 DOCS=(AUTHORS NEWS README README-XPDF TODO)
61
62 PATCHES=(
63         "${FILESDIR}/${PN}-0.26.0-qt5-dependencies.patch"
64         "${FILESDIR}/${PN}-0.28.1-fix-multilib-configuration.patch"
65         "${FILESDIR}/${PN}-0.28.1-respect-cflags.patch"
66         "${FILESDIR}/${PN}-0.33.0-openjpeg2.patch"
67 )
68
69 src_prepare() {
70         cmake-utils_src_prepare
71
72         # Clang doesn't grok this flag, the configure nicely tests that, but
73         # cmake just uses it, so remove it if we use clang
74         if [[ ${CC} == clang ]] ; then
75                 sed -i -e 's/-fno-check-new//' cmake/modules/PopplerMacros.cmake || die
76         fi
77 }
78
79 src_configure() {
80         local mycmakeargs=(
81                 -DBUILD_GTK_TESTS=OFF
82                 -DBUILD_QT4_TESTS=OFF
83                 -DBUILD_QT5_TESTS=OFF
84                 -DBUILD_CPP_TESTS=OFF
85                 -DENABLE_SPLASH=ON
86                 -DENABLE_ZLIB=ON
87                 -DENABLE_XPDF_HEADERS=ON
88                 $(cmake-utils_use_enable curl LIBCURL)
89                 $(cmake-utils_use_enable cxx CPP)
90                 $(cmake-utils_use_enable utils)
91                 $(cmake-utils_use_with cairo)
92                 $(cmake-utils_use_with introspection GObjectIntrospection)
93                 $(cmake-utils_use_with jpeg)
94                 $(cmake-utils_use_with png)
95                 $(cmake-utils_use_with qt4)
96                 $(cmake-utils_use_find_package qt5 Qt5Core)
97                 $(cmake-utils_use_with tiff)
98         )
99         if use jpeg2k; then
100                 mycmakeargs+=(-DENABLE_LIBOPENJPEG=openjpeg2)
101         else
102                 mycmakeargs+=(-DENABLE_LIBOPENJPEG=)
103         fi
104         if use lcms; then
105                 mycmakeargs+=(-DENABLE_CMS=lcms2)
106         else
107                 mycmakeargs+=(-DENABLE_CMS=)
108         fi
109
110         cmake-utils_src_configure
111 }
112
113 src_install() {
114         cmake-utils_src_install
115
116         # live version doesn't provide html documentation
117         if use cairo && use doc && [[ ${PV} != 9999 ]]; then
118                 # For now install gtk-doc there
119                 insinto /usr/share/gtk-doc/html/poppler
120                 doins -r "${S}"/glib/reference/html/*
121         fi
122 }