| 1 | # Copyright 2007-2008 Gentoo Foundation |
1 | # Copyright 2007-2008 Gentoo Foundation |
| 2 | # Distributed under the terms of the GNU General Public License v2 |
2 | # Distributed under the terms of the GNU General Public License v2 |
| 3 | # $Header: /var/cvsroot/gentoo-x86/eclass/kde4-base.eclass,v 1.7 2008/04/03 18:12:48 philantrop Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/kde4-base.eclass,v 1.18 2008/11/22 01:23:31 jmbsvicetto Exp $ |
| 4 | |
4 | |
| 5 | # @ECLASS: kde4-base.eclass |
5 | # @ECLASS: kde4-base.eclass |
| 6 | # @MAINTAINER: |
6 | # @MAINTAINER: |
| 7 | # kde@gentoo.org |
7 | # kde@gentoo.org |
| 8 | # @BLURB: This eclass provides functions for kde 4.0 ebuilds |
8 | # @BLURB: This eclass provides functions for kde 4.X ebuilds |
| 9 | # @DESCRIPTION: |
9 | # @DESCRIPTION: |
| 10 | # The kde4-base.eclass provides support for building KDE4 monolithic ebuilds |
10 | # The kde4-base.eclass provides support for building KDE4 monolithic ebuilds |
| 11 | # and KDE4 applications. |
11 | # and KDE4 applications. |
| 12 | # |
12 | # |
| 13 | # NOTE: This eclass uses the SLOT dependencies from EAPI="1" or compatible, |
13 | # NOTE: This eclass uses the SLOT dependencies from EAPI="1" or compatible, |
| 14 | # hence you must define EAPI="1" in the ebuild, before inheriting any eclasses. |
14 | # and use deps from EAPI="2", hence you must define EAPI="2" in the ebuild, |
|
|
15 | # before inheriting any eclasses. |
| 15 | |
16 | |
| 16 | inherit base eutils multilib cmake-utils kde4-functions |
17 | inherit base cmake-utils eutils kde4-functions multilib |
| 17 | |
18 | |
|
|
19 | case "${EAPI}" in |
|
|
20 | 2) |
|
|
21 | EXPORT_FUNCTIONS pkg_setup src_unpack src_configure src_compile src_test src_install pkg_postinst pkg_postrm |
|
|
22 | ;; |
|
|
23 | *) |
| 18 | EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_test src_install pkg_postinst pkg_postrm |
24 | EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_test src_install pkg_postinst pkg_postrm |
|
|
25 | ;; |
|
|
26 | esac |
| 19 | |
27 | |
|
|
28 | # Set the qt dependencies |
| 20 | kde4-base_set_qt_dependencies() { |
29 | kde4-base_set_qt_dependencies() { |
| 21 | local qt qtcore qtgui qt3support qtsvg qttest qtopengl qtdepend qtopengldepend |
30 | local qt qtcore qtgui qt3support qtdepend qtopengldepend |
| 22 | |
31 | |
| 23 | # use dependencies |
32 | # use dependencies |
| 24 | case "${EAPI}" in |
33 | case "${EAPI}" in |
| 25 | kdebuild-1) |
34 | 2 | 2_pre3 | 2_pre2 | 2_pre1) |
| 26 | qt="[accessibility][dbus][debug?][gif][jpeg][png][qt3support][ssl][zlib]" |
35 | |
| 27 | qtcore="[debug?][qt3support][ssl]" |
36 | qt="[" |
| 28 | qtgui="[accessibility][dbus][debug?]" |
|
|
| 29 | qt3support="[accessibility][debug?]" |
|
|
| 30 | qtsvg="[debug?]" |
|
|
| 31 | qttest="[debug?]" |
|
|
| 32 | qtopengl="[debug?]" |
|
|
| 33 | case "${OPENGL_REQUIRED}" in |
37 | case "${OPENGL_REQUIRED}" in |
| 34 | always) |
38 | always) |
| 35 | qt="${qt}[opengl]" |
39 | qt="${qt}opengl," |
| 36 | ;; |
40 | ;; |
| 37 | optional) |
41 | optional) |
| 38 | qt="${qt}[opengl?]" |
42 | qt="${qt}opengl?," |
| 39 | ;; |
43 | ;; |
| 40 | esac |
44 | esac |
|
|
45 | qt="${qt}accessibility,dbus,gif,jpeg,png,qt3support,ssl,zlib]" |
|
|
46 | qtcore="[qt3support,ssl]" |
|
|
47 | qtgui="[accessibility,dbus]" |
|
|
48 | qt3support="[accessibility]" |
| 41 | ;; |
49 | ;; |
| 42 | esac |
50 | esac |
| 43 | |
51 | |
| 44 | # split qt |
52 | # split qt |
| 45 | qtdepend=" |
53 | qtdepend=" |
| 46 | x11-libs/qt-core:4${qtcore} |
54 | x11-libs/qt-core:4${qtcore} |
| 47 | x11-libs/qt-gui:4${qtgui} |
55 | x11-libs/qt-gui:4${qtgui} |
| 48 | x11-libs/qt-qt3support:4${qt3support} |
56 | x11-libs/qt-qt3support:4${qt3support} |
|
|
57 | x11-libs/qt-script:4 |
| 49 | x11-libs/qt-svg:4${qtsvg} |
58 | x11-libs/qt-svg:4 |
| 50 | x11-libs/qt-test:4${qttest}" |
59 | x11-libs/qt-test:4" |
| 51 | qtopengldepend="x11-libs/qt-opengl:4${qtopengl}" |
60 | qtopengldepend="x11-libs/qt-opengl:4" |
| 52 | |
61 | |
| 53 | # allow monolithic qt for PV < 4.1 |
62 | # allow monolithic qt for PV < 4.1 |
| 54 | case "${PV}" in |
63 | case "${PV}" in |
| 55 | scm|9999.4|4.1*) : ;; |
64 | scm|9999*|4.1*|4.0.9*|4.0.8*) : ;; |
| 56 | *) |
65 | *) |
| 57 | qtdepend="|| ( ( ${qtdepend} ) >=x11-libs/qt-4.3.3:4${qt} )" |
66 | qtdepend="|| ( ( ${qtdepend} ) >=x11-libs/qt-4.3.3:4${qt} )" |
| 58 | qtopengldepend="|| ( ${qtopengldepend} >=x11-libs/qt-4.3.3:4 )" |
67 | qtopengldepend="|| ( ${qtopengldepend} >=x11-libs/qt-4.3.3:4 )" |
| 59 | ;; |
68 | ;; |
| 60 | esac |
69 | esac |
| … | |
… | |
| 73 | *) |
82 | *) |
| 74 | OPENGL_REQUIRED="never" |
83 | OPENGL_REQUIRED="never" |
| 75 | ;; |
84 | ;; |
| 76 | esac |
85 | esac |
| 77 | |
86 | |
| 78 | COMMONDEPEND="${COMMONDEPEND} ${qtdepend}" |
87 | COMMONDEPEND="${COMMONDEPEND} ${qtdepend} !x11-libs/qt-phonon" |
| 79 | } |
88 | } |
| 80 | kde4-base_set_qt_dependencies |
89 | kde4-base_set_qt_dependencies |
| 81 | |
90 | |
|
|
91 | # Set the cmake dependencies |
|
|
92 | case "${PV}" in |
|
|
93 | 9999*) |
|
|
94 | CMAKEDEPEND=">=dev-util/cmake-2.6" |
|
|
95 | ;; |
|
|
96 | *) |
|
|
97 | CMAKEDEPEND=">=dev-util/cmake-2.4.7-r1" |
|
|
98 | ;; |
|
|
99 | esac |
|
|
100 | |
|
|
101 | # Set the common dependencies |
| 82 | DEPEND="${DEPEND} ${COMMONDEPEND} |
102 | DEPEND="${DEPEND} ${COMMONDEPEND} ${CMAKEDEPEND} |
| 83 | >=dev-util/cmake-2.4.7-r1 |
|
|
| 84 | dev-util/pkgconfig |
103 | dev-util/pkgconfig |
|
|
104 | kde-base/automoc |
| 85 | x11-libs/libXt |
105 | x11-libs/libXt |
| 86 | x11-proto/xf86vidmodeproto" |
106 | x11-proto/xf86vidmodeproto" |
| 87 | RDEPEND="${RDEPEND} ${COMMONDEPEND}" |
107 | RDEPEND="${RDEPEND} ${COMMONDEPEND}" |
|
|
108 | |
|
|
109 | # Add the kdeprefix use flag |
|
|
110 | case "${EAPI}" in |
|
|
111 | 2 | 2_pre3 | 2_pre2 | 2_pre1) |
|
|
112 | IUSE="${IUSE} kdeprefix" |
|
|
113 | ;; |
|
|
114 | esac |
| 88 | |
115 | |
| 89 | # @ECLASS-VARIABLE: OPENGL_REQUIRED |
116 | # @ECLASS-VARIABLE: OPENGL_REQUIRED |
| 90 | # @DESCRIPTION: |
117 | # @DESCRIPTION: |
| 91 | # Is qt-opengl required? Possible values are 'always', 'optional' and 'never'. |
118 | # Is qt-opengl required? Possible values are 'always', 'optional' and 'never'. |
| 92 | # This variable must be set before inheriting any eclasses. Defaults to 'never'. |
119 | # This variable must be set before inheriting any eclasses. Defaults to 'never'. |
| … | |
… | |
| 144 | case ${NEED_KDE} in |
171 | case ${NEED_KDE} in |
| 145 | latest) |
172 | latest) |
| 146 | # Should only be used by 'kde-base'-ebuilds |
173 | # Should only be used by 'kde-base'-ebuilds |
| 147 | if [[ "${KDEBASE}" == "kde-base" ]]; then |
174 | if [[ "${KDEBASE}" == "kde-base" ]]; then |
| 148 | case ${PV} in |
175 | case ${PV} in |
| 149 | 3.9*) _kdedir="3.9" ;; |
176 | 4.1*| 4.0.9* | 4.0.8*) |
|
|
177 | _kdedir="4.1" |
|
|
178 | _pv="-${PV}:4.1" ;; |
|
|
179 | 4.0*) |
| 150 | 4*) _kdedir="4.0" ;; |
180 | _kdedir="4.0" |
|
|
181 | _pv="-${PV}:kde-4" ;; |
|
|
182 | 3.9*) |
|
|
183 | _kdedir="3.9" |
|
|
184 | _pv="-${PV}:kde-4" ;; |
|
|
185 | *) |
| 151 | *) die "NEED_KDE=latest not supported for PV=${PV}" ;; |
186 | die "NEED_KDE=latest not supported for PV=${PV}" ;; |
| 152 | esac |
187 | esac |
| 153 | _operator=">=" |
188 | _operator=">=" |
| 154 | _pv="-${PV}:kde-4" |
|
|
| 155 | else |
189 | else |
|
|
190 | case ${PV} in |
|
|
191 | 4.1 | 4.0.9* | 4.0.8*) _kdedir="4.1" ;; |
| 156 | _kdedir="4.0" |
192 | 4.0*) _kdedir="4.0" ;; |
| 157 | _pv=":kde-4" |
193 | 3.9*) _kdedir="3.9" ;; |
|
|
194 | *) die "NEED_KDE=latest not supported for PV=${PV}" ;; |
|
|
195 | esac |
| 158 | fi |
196 | fi |
| 159 | ;; |
197 | ;; |
| 160 | scm|svn|9999*|:kde-svn) |
198 | |
|
|
199 | # NEED_KDE=":${SLOT}" |
|
|
200 | :kde-svn) |
| 161 | _kdedir="svn" |
201 | _kdedir="svn" |
| 162 | _pv=":kde-svn" |
202 | _pv="-${NEED_KDE}" |
| 163 | export NEED_KDE="svn" |
203 | export NEED_KDE="svn" |
| 164 | ;; |
204 | ;; |
|
|
205 | :4.1) |
|
|
206 | _kdedir="4.1" |
|
|
207 | _pv="${NEED_KDE}" |
|
|
208 | ;; |
|
|
209 | :kde-4) |
|
|
210 | _kdedir="4.0" |
|
|
211 | _pv="${NEED_KDE}" |
|
|
212 | ;; |
|
|
213 | |
|
|
214 | # NEED_KDE="${PV}:${SLOT}" |
| 165 | *:kde-svn) |
215 | *:kde-svn) |
| 166 | _kdedir="svn" |
216 | _kdedir="svn" |
| 167 | _operator=">=" |
217 | _operator=">=" |
| 168 | _pv="-${NEED_KDE}" |
218 | _pv="-${NEED_KDE}" |
| 169 | export NEED_KDE="svn" |
219 | export NEED_KDE="svn" |
| 170 | ;; |
220 | ;; |
| 171 | # The ebuild handles dependencies, KDEDIR, SLOT. |
221 | *:4.1) |
| 172 | none) |
|
|
| 173 | : |
|
|
| 174 | ;; |
|
|
| 175 | # NEED_KDE=":${SLOT}" |
|
|
| 176 | :kde-4) |
|
|
| 177 | _kdedir="4.0" |
222 | _kdedir="4.1" |
|
|
223 | _operator=">=" |
| 178 | _pv="${NEED_KDE}" |
224 | _pv="-${NEED_KDE}" |
| 179 | ;; |
225 | ;; |
| 180 | # NEED_KDE="${PV}:${SLOT}" |
|
|
| 181 | *:kde-4) |
226 | *:kde-4) |
| 182 | _kdedir="4.0" |
227 | _kdedir="4.0" |
| 183 | _operator=">=" |
228 | _operator=">=" |
| 184 | _pv="-${NEED_KDE}" |
229 | _pv="-${NEED_KDE}" |
| 185 | ;; |
230 | ;; |
|
|
231 | |
|
|
232 | # NEED_KDE="${PV}" |
|
|
233 | scm|svn|9999*) |
|
|
234 | _kdedir="svn" |
|
|
235 | _operator=">=" |
|
|
236 | _pv="-${NEED_KDE}:kde-svn" |
|
|
237 | export NEED_KDE="svn" |
|
|
238 | ;; |
|
|
239 | 4.1 | 4.0.9* | 4.0.8*) |
|
|
240 | _kdedir="4.1" |
|
|
241 | _operator=">=" |
|
|
242 | _pv="-${NEED_KDE}:4.1" |
|
|
243 | ;; |
|
|
244 | 4.0* | 4) |
|
|
245 | _kdedir="4.0" |
|
|
246 | _operator=">=" |
|
|
247 | _pv="-${NEED_KDE}:kde-4" |
|
|
248 | ;; |
| 186 | 3.9*) |
249 | 3.9*) |
| 187 | _kdedir="3.9" |
250 | _kdedir="3.9" |
| 188 | _operator=">=" |
251 | _operator=">=" |
| 189 | _pv="-${NEED_KDE}:kde-4" |
252 | _pv="-${NEED_KDE}:kde-4" |
| 190 | ;; |
253 | ;; |
|
|
254 | |
|
|
255 | # The ebuild handles dependencies, KDEDIR, SLOT. |
|
|
256 | none) |
|
|
257 | : |
|
|
258 | ;; |
|
|
259 | |
| 191 | 4*) |
260 | *) |
| 192 | _kdedir="4.0" |
|
|
| 193 | _operator=">=" |
|
|
| 194 | _pv="-${NEED_KDE}:kde-4" |
|
|
| 195 | ;; |
|
|
| 196 | *) die "NEED_KDE=${NEED_KDE} currently not supported." |
261 | die "NEED_KDE=${NEED_KDE} currently not supported." |
| 197 | ;; |
262 | ;; |
| 198 | esac |
263 | esac |
| 199 | |
264 | |
| 200 | if [[ ${NEED_KDE} != none ]]; then |
265 | if [[ ${NEED_KDE} != none ]]; then |
| 201 | KDEDIR="/usr/kde/${_kdedir}" |
|
|
| 202 | KDEDIRS="/usr:/usr/local:${KDEDIR}" |
|
|
| 203 | |
266 | |
|
|
267 | #Set the SLOT |
| 204 | if [[ -n ${KDEBASE} ]]; then |
268 | if [[ -n ${KDEBASE} ]]; then |
| 205 | if [[ ${NEED_KDE} = svn ]]; then |
269 | if [[ ${NEED_KDE} = svn ]]; then |
| 206 | SLOT="kde-svn" |
270 | SLOT="kde-svn" |
| 207 | else |
271 | else |
|
|
272 | case ${PV} in |
|
|
273 | 4.1* | 4.0.9* | 4.0.8*) SLOT="4.1" ;; |
| 208 | SLOT="kde-4" |
274 | *) SLOT="kde-4" ;; |
| 209 | fi |
275 | esac |
| 210 | fi |
276 | fi |
|
|
277 | fi |
|
|
278 | |
|
|
279 | # Block install of other SLOTS unless kdeprefix |
|
|
280 | case "${EAPI}" in |
|
|
281 | 2 | 2_pre3 | 2_pre2 | 2_pre1) |
|
|
282 | for KDE_SLOT in ${KDE_SLOTS[@]}; do |
|
|
283 | # block non kdeprefix ${PN} on other slots |
|
|
284 | if [[ ${SLOT} != ${KDE_SLOT} ]]; then |
|
|
285 | DEPEND="${DEPEND} |
|
|
286 | !kdeprefix? ( !kde-base/${PN}:${KDE_SLOT}[-kdeprefix] )" |
|
|
287 | RDEPEND="${RDEPEND} |
|
|
288 | !kdeprefix? ( !kde-base/${PN}:${KDE_SLOT}[-kdeprefix] )" |
|
|
289 | fi |
|
|
290 | done |
|
|
291 | ;; |
|
|
292 | esac |
| 211 | |
293 | |
| 212 | # We only need to add the dependencies if ${PN} is not "kdelibs" or "kdepimlibs" |
294 | # We only need to add the dependencies if ${PN} is not "kdelibs" or "kdepimlibs" |
| 213 | if [[ ${PN} != "kdelibs" ]]; then |
295 | if [[ ${PN} != "kdelibs" ]]; then |
| 214 | DEPEND="${DEPEND} |
296 | case "${EAPI}" in |
|
|
297 | 2 | 2_pre3 | 2_pre2 | 2_pre1) |
|
|
298 | DEPEND="${DEPEND} ${_operator}kde-base/kdelibs${_pv}[kdeprefix=]" |
|
|
299 | RDEPEND="${RDEPEND} ${_operator}kde-base/kdelibs${_pv}[kdeprefix=]" |
|
|
300 | ;; |
|
|
301 | *) |
| 215 | ${_operator}kde-base/kdelibs${_pv}" |
302 | DEPEND="${DEPEND} ${_operator}kde-base/kdelibs${_pv}" |
| 216 | RDEPEND="${RDEPEND} |
|
|
| 217 | ${_operator}kde-base/kdelibs${_pv}" |
303 | RDEPEND="${RDEPEND} ${_operator}kde-base/kdelibs${_pv}" |
|
|
304 | ;; |
|
|
305 | esac |
| 218 | if [[ ${PN} != "kdepimlibs" ]]; then |
306 | if [[ ${PN} != "kdepimlibs" ]]; then |
| 219 | DEPEND="${DEPEND} |
307 | case "${EAPI}" in |
|
|
308 | 2 | 2_pre3 | 2_pre2 | 2_pre1) |
|
|
309 | DEPEND="${DEPEND} ${_operator}kde-base/kdepimlibs${_pv}[kdeprefix=]" |
|
|
310 | RDEPEND="${RDEPEND} ${_operator}kde-base/kdepimlibs${_pv}[kdeprefix=]" |
|
|
311 | ;; |
|
|
312 | *) |
| 220 | ${_operator}kde-base/kdepimlibs${_pv}" |
313 | DEPEND="${DEPEND} ${_operator}kde-base/kdepimlibs${_pv}" |
| 221 | RDEPEND="${RDEPEND} |
|
|
| 222 | ${_operator}kde-base/kdepimlibs${_pv}" |
314 | RDEPEND="${RDEPEND} ${_operator}kde-base/kdepimlibs${_pv}" |
| 223 | fi |
315 | esac |
| 224 | fi |
316 | fi |
|
|
317 | fi |
| 225 | |
318 | |
| 226 | unset _operator _pv _kdedir |
319 | unset _operator _pv |
| 227 | fi |
320 | fi |
| 228 | |
321 | |
| 229 | # Fetch section - If the ebuild's category is not 'kde-base' and if it is not a |
322 | # Fetch section - If the ebuild's category is not 'kde-base' and if it is not a |
| 230 | # koffice ebuild, the URI should be set in the ebuild itself |
323 | # koffice ebuild, the URI should be set in the ebuild itself |
| 231 | if [[ -n ${KDEBASE} ]]; then |
324 | if [[ -n ${KDEBASE} ]]; then |
| … | |
… | |
| 237 | _kmname_pv="${_kmname}-${PV}" |
330 | _kmname_pv="${_kmname}-${PV}" |
| 238 | if [[ ${NEED_KDE} != "svn" ]]; then |
331 | if [[ ${NEED_KDE} != "svn" ]]; then |
| 239 | case ${KDEBASE} in |
332 | case ${KDEBASE} in |
| 240 | kde-base) |
333 | kde-base) |
| 241 | case ${PV} in |
334 | case ${PV} in |
|
|
335 | 4.0.9* | 4.0.8*) |
|
|
336 | SRC_URI="mirror://kde/unstable/${PV}/src/${_kmname_pv}.tar.bz2" ;; |
| 242 | *) SRC_URI="mirror://kde/stable/${PV}/src/${_kmname_pv}.tar.bz2";; |
337 | *) SRC_URI="mirror://kde/stable/${PV}/src/${_kmname_pv}.tar.bz2";; |
| 243 | esac |
338 | esac |
| 244 | ;; |
339 | ;; |
| 245 | koffice) |
340 | koffice) |
| 246 | SRC_URI="mirror://kde/unstable/${_kmname_pv}/src/${_kmname_pv}.tar.bz2" |
341 | SRC_URI="mirror://kde/unstable/${_kmname_pv}/src/${_kmname_pv}.tar.bz2" |
| 247 | ;; |
342 | ;; |
| … | |
… | |
| 249 | fi |
344 | fi |
| 250 | unset _kmname _kmname_pv |
345 | unset _kmname _kmname_pv |
| 251 | fi |
346 | fi |
| 252 | |
347 | |
| 253 | debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: SRC_URI is ${SRC_URI}" |
348 | debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: SRC_URI is ${SRC_URI}" |
| 254 | debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: DEPEND ${DEPEND} - before blockers" |
|
|
| 255 | |
|
|
| 256 | # Monolithic ebuilds should add blockers for split ebuilds in the same slot. |
|
|
| 257 | # If KMNAME is not set then this is not a split package |
|
|
| 258 | if [[ -n ${KDEBASE} && -z ${KMNAME} ]]; then |
|
|
| 259 | for _x in $(get-child-packages ${CATEGORY}/${PN}); do |
|
|
| 260 | DEPEND="${DEPEND} !${_x}:${SLOT}" |
|
|
| 261 | RDEPEND="${RDEPEND} !${_x}:${SLOT}" |
|
|
| 262 | done |
|
|
| 263 | unset _x |
|
|
| 264 | fi |
|
|
| 265 | |
|
|
| 266 | debug-print "${BASH_SOURCE} ${LINENO} ${ECLASS} ${FUNCNAME}: DEPEND ${DEPEND} - after blockers" |
|
|
| 267 | |
349 | |
| 268 | # @ECLASS-VARIABLE: PREFIX |
350 | # @ECLASS-VARIABLE: PREFIX |
| 269 | # @DESCRIPTION: |
351 | # @DESCRIPTION: |
| 270 | # Set the installation PREFIX. All kde-base ebuilds go into the KDE4 installation directory. |
352 | # Set the installation PREFIX. All kde-base ebuilds go into the KDE4 installation directory. |
| 271 | # Applications installed by the other ebuilds go into /usr/ by default, this value |
353 | # Applications installed by the other ebuilds go into /usr/ by default, this value |
| 272 | # can be superseded by defining PREFIX before inheriting kde4-base. |
354 | # can be superseded by defining PREFIX before inheriting kde4-base. |
| 273 | if [[ -n ${KDEBASE} ]]; then |
355 | # This value is set on pkg_setup |
| 274 | PREFIX=${KDEDIR} |
356 | PREFIX="" |
| 275 | else |
|
|
| 276 | # if PREFIX is not defined we set it to the default value of /usr |
|
|
| 277 | PREFIX="${PREFIX:-/usr}" |
|
|
| 278 | fi |
|
|
| 279 | |
357 | |
| 280 | debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: SLOT ${SLOT} - KDEDIR ${KDEDIR} - KDEDIRS ${KDEDIRS}- PREFIX ${PREFIX} - NEED_KDE ${NEED_KDE}" |
358 | debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: SLOT ${SLOT} - NEED_KDE ${NEED_KDE}" |
| 281 | |
359 | |
| 282 | # @FUNCTION: kde4-base_pkg_setup |
360 | # @FUNCTION: kde4-base_pkg_setup |
| 283 | # @DESCRIPTION: |
361 | # @DESCRIPTION: |
| 284 | # Adds flags needed by all of KDE 4 to $QT4_BUILT_WITH_USE_CHECK. Uses |
362 | # Adds flags needed by all of KDE 4 to $QT4_BUILT_WITH_USE_CHECK. Uses |
| 285 | # kde4-functions_check_use from kde4-functions.eclass to print appropriate |
363 | # kde4-functions_check_use from kde4-functions.eclass to print appropriate |
| 286 | # errors and die if any required flags listed in $QT4_BUILT_WITH_USE_CHECK or |
364 | # errors and die if any required flags listed in $QT4_BUILT_WITH_USE_CHECK or |
| 287 | # $KDE4_BUILT_WITH_USE_CHECK are missing. |
365 | # $KDE4_BUILT_WITH_USE_CHECK are missing. |
| 288 | kde4-base_pkg_setup() { |
366 | kde4-base_pkg_setup() { |
| 289 | debug-print-function $FUNCNAME "$@" |
367 | debug-print-function $FUNCNAME "$@" |
| 290 | |
368 | |
|
|
369 | # Don't set KDEHOME during compile, it will cause access violations |
|
|
370 | unset KDEHOME |
|
|
371 | |
|
|
372 | if [[ ${NEED_KDE} != none ]]; then |
|
|
373 | |
|
|
374 | # Set PREFIX |
|
|
375 | case "${EAPI}" in |
|
|
376 | 2 | 2_pre3 | 2_pre2 | 2_pre1) |
|
|
377 | if use kdeprefix; then |
|
|
378 | KDEDIR="/usr/kde/${_kdedir}" |
|
|
379 | KDEDIRS="/usr:/usr/local:${KDEDIR}" |
|
|
380 | else |
|
|
381 | KDEDIR="/usr" |
|
|
382 | KDEDIRS="/usr:/usr/local" |
|
|
383 | fi |
|
|
384 | ;; |
|
|
385 | *) |
|
|
386 | KDEDIR="/usr" |
|
|
387 | KDEDIRS="/usr:/usr/local" |
|
|
388 | ;; |
|
|
389 | esac |
|
|
390 | fi |
|
|
391 | |
|
|
392 | # Set the prefix based on KDEDIR |
|
|
393 | # Make it a consequence of kdeprefix |
|
|
394 | PREFIX=${KDEDIR} |
|
|
395 | |
|
|
396 | unset _kdedir |
|
|
397 | |
| 291 | case "${EAPI}" in |
398 | case "${EAPI}" in |
| 292 | kdebuild-1) |
399 | 2 | 2_pre3 | 2_pre2 | 2_pre1) |
| 293 | [[ -n ${QT4_BUILT_WITH_USE_CHECK} || -n ${KDE4_BUILT_WITH_USE_CHECK} ]] && \ |
400 | [[ -n ${QT4_BUILT_WITH_USE_CHECK} || -n ${KDE4_BUILT_WITH_USE_CHECK[@]} ]] && \ |
| 294 | die "built_with_use illegal in this EAPI!" |
401 | die "built_with_use illegal in this EAPI!" |
| 295 | ;; |
402 | ;; |
| 296 | *) |
403 | *) |
|
|
404 | # Make KDE4_BUILT_WITH_USE_CHECK an array if it isn't already |
|
|
405 | local line kde4_built_with_use_check=() |
|
|
406 | if [[ -n ${KDE4_BUILT_WITH_USE_CHECK[@]} && $(declare -p KDE4_BUILT_WITH_USE_CHECK) != 'declare -a '* ]]; then |
|
|
407 | while read line; do |
|
|
408 | [[ -z ${line} ]] && continue |
|
|
409 | kde4_built_with_use_check+=("${line}") |
|
|
410 | done <<< "${KDE4_BUILT_WITH_USE_CHECK}" |
|
|
411 | KDE4_BUILT_WITH_USE_CHECK=("${kde4_built_with_use_check[@]}") |
|
|
412 | fi |
|
|
413 | |
| 297 | # KDE4 applications require qt4 compiled with USE="accessibility dbus gif jpeg png qt3support ssl zlib". |
414 | # KDE4 applications require qt4 compiled with USE="accessibility dbus gif jpeg png qt3support ssl zlib". |
| 298 | if has_version '<x11-libs/qt-4.4_alpha:4'; then |
415 | if has_version '<x11-libs/qt-4.4_alpha:4'; then |
| 299 | QT4_BUILT_WITH_USE_CHECK="${QT4_BUILT_WITH_USE_CHECK} accessibility dbus gif jpeg png qt3support ssl zlib" |
416 | QT4_BUILT_WITH_USE_CHECK="${QT4_BUILT_WITH_USE_CHECK} accessibility dbus gif jpeg png qt3support ssl zlib" |
| 300 | else |
417 | else |
| 301 | KDE4_BUILT_WITH_USE_CHECK="${KDE4_BUILT_WITH_USE_CHECK} |
418 | KDE4_BUILT_WITH_USE_CHECK=("${KDE4_BUILT_WITH_USE_CHECK[@]}" |
| 302 | x11-libs/qt-core qt3support ssl |
419 | "x11-libs/qt-core qt3support ssl" |
| 303 | x11-libs/qt-gui accessibility dbus |
420 | "x11-libs/qt-gui accessibility dbus" |
| 304 | x11-libs/qt-qt3support accessibility" |
421 | "x11-libs/qt-qt3support accessibility") |
| 305 | fi |
|
|
| 306 | |
|
|
| 307 | if has debug ${IUSE//+} && use debug; then |
|
|
| 308 | if has_version '<x11-libs/qt-4.4.0_alpha:4'; then |
|
|
| 309 | QT4_BUILT_WITH_USE_CHECK="${QT4_BUILT_WITH_USE_CHECK} debug" |
|
|
| 310 | else |
|
|
| 311 | KDE4_BUILT_WITH_USE_CHECK="${KDE4_BUILT_WITH_USE_CHECK} |
|
|
| 312 | x11-libs/qt-core:4 debug |
|
|
| 313 | x11-libs/qt-gui:4 debug |
|
|
| 314 | x11-libs/qt-qt3support:4 debug |
|
|
| 315 | x11-libs/qt-svg:4 debug |
|
|
| 316 | x11-libs/qt-test:4 debug" |
|
|
| 317 | if has opengl ${IUSE//+} && use opengl || [[ ${OPENGL_REQUIRED} == always ]]; then |
|
|
| 318 | KDE4_BUILT_WITH_USE_CHECK="${KDE4_BUILT_WITH_USE_CHECK} |
|
|
| 319 | x11-libs/qt-opengl:4 debug" |
|
|
| 320 | fi |
|
|
| 321 | fi |
|
|
| 322 | fi |
422 | fi |
| 323 | |
423 | |
| 324 | if has opengl ${IUSE//+} && use opengl || [[ ${OPENGL_REQUIRED} == always ]]; then |
424 | if has opengl ${IUSE//+} && use opengl || [[ ${OPENGL_REQUIRED} == always ]]; then |
| 325 | if has_version '<x11-libs/qt-4.4.0_alpha:4'; then |
425 | if has_version '<x11-libs/qt-4.4.0_alpha:4'; then |
| 326 | QT4_BUILT_WITH_USE_CHECK="${QT4_BUILT_WITH_USE_CHECK} opengl" |
426 | QT4_BUILT_WITH_USE_CHECK="${QT4_BUILT_WITH_USE_CHECK} opengl" |
| … | |
… | |
| 348 | # Apply ${PN}-${SLOT}-*{diff,patch} |
448 | # Apply ${PN}-${SLOT}-*{diff,patch} |
| 349 | # - $CATEGORY!=kde-base: |
449 | # - $CATEGORY!=kde-base: |
| 350 | # Apply ${PN}-${PV}-*{diff,patch} |
450 | # Apply ${PN}-${PV}-*{diff,patch} |
| 351 | # @CODE |
451 | # @CODE |
| 352 | # |
452 | # |
| 353 | # If ${PATCHES} is non-zero all patches in it gets applied. |
453 | # If ${PATCHES} is non-zero all patches in it get applied. If there is more |
|
|
454 | # than one patch please make ${PATCHES} an array for proper quoting. |
| 354 | kde4-base_apply_patches() { |
455 | kde4-base_apply_patches() { |
| 355 | local _patchdir _packages _p |
456 | local _patchdir _packages _p _f |
| 356 | _patchdir="${WORKDIR}/patches/" |
457 | _patchdir="${WORKDIR}/patches/" |
| 357 | if [[ -d "${_patchdir}" ]]; then |
458 | if [[ -d "${_patchdir}" ]]; then |
| 358 | if is-parent-package ${CATEGORY}/${PN} ; then |
459 | if is-parent-package ${CATEGORY}/${PN} ; then |
| 359 | _packages="$(get-child-packages ${CATEGORY}/${PN})" |
460 | _packages="$(get-child-packages ${CATEGORY}/${PN})" |
| 360 | _packages="${_packages//${CATEGORY}\//} ${PN}" |
461 | _packages="${_packages//${CATEGORY}\//} ${PN}" |
| 361 | else |
462 | else |
| 362 | _packages="${PN}" |
463 | _packages="${PN}" |
| 363 | fi |
464 | fi |
|
|
465 | if [[ $(declare -p PATCHES) != 'declare -a '* ]]; then |
|
|
466 | die "PATCHES needs to be an array!" |
|
|
467 | fi |
| 364 | for _p in ${_packages}; do |
468 | for _p in ${_packages}; do |
| 365 | PATCHES="${PATCHES} $(ls ${_patchdir}/${_p}-${PV}-*{diff,patch} 2>/dev/null)" |
469 | for _f in "${_patchdir}"/${_p}-${PV}-*{diff,patch}; do |
|
|
470 | [[ -e ${_f} ]] && PATCHES+=("${_f}") |
|
|
471 | done |
| 366 | if [[ -n "${KDEBASE}" ]]; then |
472 | if [[ -n "${KDEBASE}" ]]; then |
| 367 | PATCHES="${PATCHES} $(ls ${_patchdir}/${_p}-${SLOT}-*{diff,patch} 2>/dev/null)" |
473 | for _f in "${_patchdir}"/${_p}-${SLOT}-*{diff,patch}; do |
|
|
474 | [[ -e ${_f} ]] && PATCHES+=("${_f}") |
|
|
475 | done |
| 368 | fi |
476 | fi |
| 369 | done |
477 | done |
| 370 | fi |
478 | fi |
| 371 | [[ -n ${PATCHES} ]] && base_src_unpack autopatch |
479 | [[ -n ${PATCHES[@]} ]] && base_src_unpack autopatch |
| 372 | } |
480 | } |
| 373 | |
481 | |
| 374 | # @FUNCTION: kde4-base_src_unpack |
482 | # @FUNCTION: kde4-base_src_unpack |
| 375 | # @DESCRIPTION: |
483 | # @DESCRIPTION: |
| 376 | # This function unpacks the source tarballs for KDE4 applications. |
484 | # This function unpacks the source tarballs for KDE4 applications. |
| … | |
… | |
| 378 | # If no argument is passed to this function, then standard src_unpack is |
486 | # If no argument is passed to this function, then standard src_unpack is |
| 379 | # executed. Otherwise options are passed to base_src_unpack. |
487 | # executed. Otherwise options are passed to base_src_unpack. |
| 380 | # |
488 | # |
| 381 | # In addition it calls kde4-base_apply_patches when no arguments are passed to |
489 | # In addition it calls kde4-base_apply_patches when no arguments are passed to |
| 382 | # this function. |
490 | # this function. |
|
|
491 | # |
|
|
492 | # It also handles translations if KDE_LINGUAS is defined. See KDE_LINGUAS and |
|
|
493 | # enable_selected_linguas() in kde4-functions.eclass(5) for further details. |
| 383 | kde4-base_src_unpack() { |
494 | kde4-base_src_unpack() { |
| 384 | debug-print-function $FUNCNAME "$@" |
495 | debug-print-function $FUNCNAME "$@" |
| 385 | |
496 | |
| 386 | [[ -z "${KDE_S}" ]] && KDE_S="${S}" |
497 | [[ -z "${KDE_S}" ]] && KDE_S="${S}" |
| 387 | |
498 | |
| 388 | if [[ -z $* ]]; then |
499 | if [[ -z $* ]]; then |
| 389 | # Unpack first and deal with KDE patches after examing possible patch sets. |
500 | # Unpack first and deal with KDE patches after examing possible patch sets. |
| 390 | # To be picked up, patches need to conform to the guidelines stated before. |
501 | # To be picked up, patches need to conform to the guidelines stated before. |
| 391 | # Monolithic ebuilds will use the split ebuild patches. |
502 | # Monolithic ebuilds will use the split ebuild patches. |
| 392 | [[ -d "${KDE_S}" ]] || unpack ${A} |
503 | [[ -d "${KDE_S}" ]] || unpack ${A} |
| 393 | kde4-base_apply_patches |
504 | base_src_unpack $* |
| 394 | else |
505 | else |
| 395 | # Call base_src_unpack, which unpacks and patches |
506 | # Call base_src_unpack, which unpacks and patches |
| 396 | # step by step transparently as defined in the ebuild. |
507 | # step by step transparently as defined in the ebuild. |
| 397 | base_src_unpack $* |
508 | base_src_unpack $* |
| 398 | fi |
509 | fi |
| … | |
… | |
| 402 | ebegin "Updating cmake/ directory..." |
513 | ebegin "Updating cmake/ directory..." |
| 403 | rm -rf "${KDE_S}/cmake" || die "Unable to remove old cmake/ directory" |
514 | rm -rf "${KDE_S}/cmake" || die "Unable to remove old cmake/ directory" |
| 404 | ln -s "${WORKDIR}/cmake" "${KDE_S}/cmake" || die "Unable to symlink the new cmake/ directory" |
515 | ln -s "${WORKDIR}/cmake" "${KDE_S}/cmake" || die "Unable to symlink the new cmake/ directory" |
| 405 | eend 0 |
516 | eend 0 |
| 406 | fi |
517 | fi |
|
|
518 | |
|
|
519 | # Only enable selected languages, used for KDE extragear apps. |
|
|
520 | if [[ -n ${KDE_LINGUAS} ]]; then |
|
|
521 | enable_selected_linguas |
|
|
522 | fi |
| 407 | } |
523 | } |
| 408 | |
524 | |
| 409 | # @FUNCTION: kde4-base_src_compile |
525 | # @FUNCTION: kde4-base_src_compile |
| 410 | # @DESCRIPTION: |
526 | # @DESCRIPTION: |
| 411 | # General function for compiling KDE4 applications. |
527 | # General function for compiling KDE4 applications. |
| 412 | kde4-base_src_compile() { |
528 | kde4-base_src_compile() { |
| 413 | debug-print-function ${FUNCNAME} "$@" |
529 | debug-print-function ${FUNCNAME} "$@" |
| 414 | |
530 | case "${EAPI}" in |
|
|
531 | 2) |
|
|
532 | ;; |
|
|
533 | *) |
| 415 | kde4-base_src_configure |
534 | kde4-base_src_configure |
| 416 | kde4-base_src_make |
535 | ;; |
|
|
536 | esac |
|
|
537 | if [[ -d ${WORKDIR}/${PN}_build ]]; then |
|
|
538 | pushd "${WORKDIR}"/${PN}_build > /dev/null |
|
|
539 | fi |
|
|
540 | [ -e [Mm]akefile ] && kde4-base_src_make |
| 417 | } |
541 | } |
| 418 | |
542 | |
| 419 | # @FUNCTION: kde4-base_src_configure |
543 | # @FUNCTION: kde4-base_src_configure |
| 420 | # @DESCRIPTION: |
544 | # @DESCRIPTION: |
| 421 | # Function for configuring the build of KDE4 applications. |
545 | # Function for configuring the build of KDE4 applications. |
| … | |
… | |
| 444 | mycmakeargs="${mycmakeargs} -DKDE4_USE_ALWAYS_FULL_RPATH=ON" |
568 | mycmakeargs="${mycmakeargs} -DKDE4_USE_ALWAYS_FULL_RPATH=ON" |
| 445 | |
569 | |
| 446 | # Here we set the install prefix |
570 | # Here we set the install prefix |
| 447 | mycmakeargs="${mycmakeargs} -DCMAKE_INSTALL_PREFIX=${PREFIX}" |
571 | mycmakeargs="${mycmakeargs} -DCMAKE_INSTALL_PREFIX=${PREFIX}" |
| 448 | |
572 | |
|
|
573 | # If prefix is /usr, sysconf needs to be /etc, not /usr/etc |
|
|
574 | [[ "${PREFIX}" == "/usr" ]] && mycmakeargs="${mycmakeargs} -DSYSCONF_INSTALL_DIR=/etc" |
|
|
575 | |
| 449 | # Set environment |
576 | # Set environment |
| 450 | QTEST_COLORED=1 |
577 | QTEST_COLORED=1 |
| 451 | QT_PLUGIN_PATH=${KDEDIR}/$(get_libdir)/kde4/plugins/ |
578 | QT_PLUGIN_PATH=${KDEDIR}/$(get_libdir)/kde4/plugins/ |
| 452 | |
579 | |
| 453 | cmake-utils_src_configureout |
580 | # hardcode path to *.cmake KDE files |
|
|
581 | PKG_CONFIG_PATH="${PKG_CONFIG_PATH:+${PKG_CONFIG_PATH}:}${KDEDIR}/$(get_libdir)/pkgconfig" |
|
|
582 | |
|
|
583 | [ -e CMakeLists.txt ] && cmake-utils_src_configureout |
| 454 | } |
584 | } |
| 455 | |
585 | |
| 456 | # @FUNCTION: kde4-base_src_make |
586 | # @FUNCTION: kde4-base_src_make |
| 457 | # @DESCRIPTION: |
587 | # @DESCRIPTION: |
| 458 | # Function for building KDE4 applications. |
588 | # Function for building KDE4 applications. |
| … | |
… | |
| 481 | # Function for installing KDE4 applications. |
611 | # Function for installing KDE4 applications. |
| 482 | kde4-base_src_install() { |
612 | kde4-base_src_install() { |
| 483 | debug-print-function ${FUNCNAME} "$@" |
613 | debug-print-function ${FUNCNAME} "$@" |
| 484 | |
614 | |
| 485 | kde4-base_src_make_doc |
615 | kde4-base_src_make_doc |
| 486 | cmake-utils_src_install |
616 | if [[ -d ${WORKDIR}/${PN}_build ]]; then |
|
|
617 | pushd "${WORKDIR}"/${PN}_build > /dev/null |
|
|
618 | fi |
|
|
619 | [ -e [Mm]akefile ] && cmake-utils_src_install |
| 487 | } |
620 | } |
| 488 | |
621 | |
| 489 | # @FUNCTION: kde4-base_src_make_doc |
622 | # @FUNCTION: kde4-base_src_make_doc |
| 490 | # @DESCRIPTION: |
623 | # @DESCRIPTION: |
| 491 | # Function for installing the documentation of KDE4 applications. |
624 | # Function for installing the documentation of KDE4 applications. |