Magellan Linux

Contents of /branches/magellan-next/core/poppler/poppler-0.18.2-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 9517 - (show annotations) (download)
Mon Dec 5 11:00:46 2011 UTC (12 years, 4 months ago) by niro
File size: 4833 byte(s)
-include qt4
1 # $Id$
2
3 PNAME="poppler"
4 PVER="0.18.2"
5 PBUILD="r1"
6
7 SPLIT_PACKAGES="poppler poppler-glib poppler-qt4"
8
9 PCATEGORIE="app-text"
10 HOMEPAGE="http://poppler.freedesktop.org/"
11
12 POPPLER_DEPEND=">= media-libs/freetype-2.4
13 >= media-libs/fontconfig-2.8
14 >= media-libs/libjpeg-8
15 >= media-libs/lcms-1.19
16 >= sys-libs/zlib-1
17 >= x11-libs/cairo-1.10
18 >= app-text/poppler-data-0.4.5"
19
20 GLIB_DEPEND=">= dev-libs/glib2-2.28
21 >= x11-libs/gtk2+-2.24"
22
23 QT4_DEPEND=">= x11-libs/qt4-4.7"
24
25 SDEPEND="${POPPLER_DEPEND}
26 ${GLIB_DEPEND}
27 ${QT4_DEPEND}
28 >= dev-libs/gobject-introspection-0.10
29 >= dev-util/pkgconfig-0.25
30 >= sys-dev/automake-4
31 >= sys-dev/autoconf-5"
32
33 SRCFILE="${PNAME}-${PVER}.tar.gz"
34 SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
35
36 sminclude mtools multilib qt4
37
38 SRC_URI=(
39 http://poppler.freedesktop.org/${SRCFILE}
40 mirror://${PNAME}/${SRCFILE}
41 mirror://${PNAME}/${PNAME}-0.16.0-fix-includes.patch
42 )
43
44 UP2DATE="updatecmd -listonly ${HOMEPAGE}/releases.html | firsttarball gz"
45
46 split_info_poppler()
47 {
48 DESCRIPTION="Poppler is a PDF rendering library based on the xpdf-3.0 code base."
49 DEPEND="${POPPLER_DEPEND}"
50 }
51
52 split_info_poppler-glib()
53 {
54 DESCRIPTION="Poppler bindings for glib2 and gtk2+."
55 DEPEND="== app-text/poppler-${PVER}
56 ${GLIB_DEPEND}"
57 }
58
59 split_info_poppler-qt4()
60 {
61 DESCRIPTION="Poppler bindings for QT4."
62 DEPEND="== app-text/poppler-${PVER}
63 ${QT4_DEPEND}"
64 }
65
66 src_prepare()
67 {
68 # check for older versions
69 [[ -e /usr/$(mlibdir)/libpoppler.so ]] && die "Uninstall *all* old versions of ${PNAME} first ..."
70
71 munpack ${SRCFILE} || die
72
73 # fix missing includes
74 mpatch ${PNAME}-0.16.0-fix-includes.patch || die
75 }
76
77 src_compile()
78 {
79 mconfigure \
80 --enable-introspection \
81 --enable-xpdf-headers \
82 --enable-libjpeg \
83 --enable-zlib \
84 --enable-poppler-qt4 \
85 --enable-poppler-glib \
86 --enable-cairo-output \
87 --disable-gtk-test \
88 || die
89
90 # disable qt4-multilib build on multilib systems
91 if [[ $(mlibdir) != lib ]]
92 then
93 only-m32 'sed -i "s/^qt4_subdir =.*/qt4_subdir =/" ${SRCDIR}-${abi}/Makefile || die'
94 only-m32 'sed -i "s/^qt4_pc_file =.*/qt4_pc_file =/" ${SRCDIR}-${abi}/Makefile || die'
95 fi
96
97 mmake || die
98 }
99
100 src_install_poppler()
101 {
102 # do not install glib, qt4
103 mmake \
104 glib_subdir="" glib_pc_file="" \
105 qt4_subdir="" qt4_pc_file="" \
106 DESTDIR=${BINDIR} install || die
107 }
108
109 src_install_poppler-glib()
110 {
111 # libtool tries to relink libpoppler-glib.la and libtool will not find -lpoppler
112 # so we install the poppler libraries first and remove them after install of poppler-glib
113 mmake -C poppler DESTDIR=${BINDIR} install-libLTLIBRARIES || die
114
115 mmake -C glib DESTDIR=${BINDIR} install || die
116
117 # remove poppler libraries
118 mmake -C poppler DESTDIR=${BINDIR} uninstall-libLTLIBRARIES || die
119
120 # install missing pkgconfig file
121 all-abis 'minstalldir /usr/$(mlibdir)/pkgconfig || die'
122 all-abis 'minstallfile poppler-glib.pc /usr/$(mlibdir)/pkgconfig/ || die'
123 }
124
125 src_install_poppler-qt4()
126 {
127 # disable qt4-multilib build on multilib systems
128 if [[ $(mlibdir) != lib ]]
129 then
130 # libtool tries to relink libpoppler-qt4.la and libtool will not find -lpoppler
131 # so we install the poppler libraries first and remove them after install of poppler-qt4
132 only-m64 'mmake -C poppler DESTDIR=${BINDIR} install-libLTLIBRARIES || die'
133 only-m64 'mmake -C qt4 DESTDIR=${BINDIR} install || die'
134 # remove poppler libraries
135 only-m64 'mmake -C poppler DESTDIR=${BINDIR} uninstall-libLTLIBRARIES || die'
136 # install missing pkgconfig file
137 only-m64 'minstalldir /usr/$(mlibdir)/pkgconfig || die'
138 only-m64 'minstallfile poppler-qt4.pc /usr/$(mlibdir)/pkgconfig/ || die'
139 else
140 # libtool tries to relink libpoppler-qt4.la and libtool will not find -lpoppler
141 # so we install the poppler libraries first and remove them after install of poppler-qt4
142 mmake -C poppler DESTDIR=${BINDIR} install-libLTLIBRARIES || die
143 mmake -C qt4 DESTDIR=${BINDIR} install || die
144 # remove poppler libraries
145 mmake -C poppler DESTDIR=${BINDIR} uninstall-libLTLIBRARIES || die
146 # install missing pkgconfig file
147 all-abis 'minstalldir /usr/$(mlibdir)/pkgconfig || die'
148 all-abis 'minstallfile poppler-qt4.pc /usr/$(mlibdir)/pkgconfig/ || die'
149 fi
150 }
151
152 preinstall()
153 {
154 if [[ ! -z $(magequery -n poppler-cairo) ]]
155 then
156 echo -e ${COLRED}
157 echo -e "Error: app-text/poppler-cairo is installed!!"
158 echo -e "poppler-cairo is now provided by poppler and doesn't need an extra package anymore."
159 echo -e "Please uninstall app-text/poppler-cairo first!"
160 echo -e ${COLDEFAULT}
161 die "app-text/poppler-cairo found!"
162 fi
163
164 if [[ ! -z $(magequery -n poppler-qt3) ]]
165 then
166 echo -e ${COLRED}
167 echo -e "Error: app-text/poppler-qt3 is installed!!"
168 echo -e "poppler-qt3 is now obsolete and the package does not exist anymore."
169 echo -e "Please uninstall app-text/poppler-qt3 first!"
170 echo -e ${COLDEFAULT}
171 die "app-text/poppler-qt3 found!"
172 fi
173 }