/[gentoo-x86]/eclass/kde4-base.eclass
Gentoo

Contents of /eclass/kde4-base.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.43 - (hide annotations) (download)
Fri Aug 7 01:00:11 2009 UTC (5 years, 1 month ago) by wired
Branch: MAIN
Changes since 1.42: +11 -0 lines
moved license/homepage stuff from kde4-meta to kde4-base

1 scarabeus 1.30 # Copyright 2007-2009 Gentoo Foundation
2 ingmar 1.1 # Distributed under the terms of the GNU General Public License v2
3 scarabeus 1.38 # $Header: /var/cvsroot/gentoo-x86/eclass/kde4-base.eclass,v 1.37 2009/05/09 13:23:15 scarabeus Exp $
4 ingmar 1.1
5     # @ECLASS: kde4-base.eclass
6     # @MAINTAINER:
7     # kde@gentoo.org
8 jmbsvicetto 1.13 # @BLURB: This eclass provides functions for kde 4.X ebuilds
9 ingmar 1.1 # @DESCRIPTION:
10 scarabeus 1.22 # The kde4-base.eclass provides support for building KDE4 based ebuilds
11 ingmar 1.1 # and KDE4 applications.
12     #
13 scarabeus 1.22 # NOTE: KDE 4 ebuilds by default define EAPI="2", this can be redefined but
14     # eclass will fail with version older than 2.
15    
16 scarabeus 1.31 inherit base cmake-utils eutils kde4-functions
17 scarabeus 1.22
18     get_build_type
19 scarabeus 1.30 if [[ ${BUILD_TYPE} = live ]]; then
20 scarabeus 1.22 inherit subversion
21     fi
22    
23     EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare src_configure src_compile src_test src_install pkg_postinst pkg_postrm
24 ingmar 1.1
25 wired 1.43 case ${KDEBASE} in
26     kde-base)
27     HOMEPAGE="http://www.kde.org/"
28     LICENSE="GPL-2"
29     ;;
30     koffice)
31     HOMEPAGE="http://www.koffice.org/"
32     LICENSE="GPL-2"
33     ;;
34     esac
35    
36 philantrop 1.7 # @ECLASS-VARIABLE: OPENGL_REQUIRED
37     # @DESCRIPTION:
38     # Is qt-opengl required? Possible values are 'always', 'optional' and 'never'.
39     # This variable must be set before inheriting any eclasses. Defaults to 'never'.
40     OPENGL_REQUIRED="${OPENGL_REQUIRED:-never}"
41    
42 scarabeus 1.31 # @ECLASS-VARIABLE: WEBKIT_REQUIRED
43     # @DESCRIPTION:
44     # Is qt-webkit requred? Possible values are 'always', 'optional' and 'never'.
45     # This variable must be set before inheriting any eclasses. Defaults to 'never'.
46     WEBKIT_REQUIRED="${WEBKIT_REQUIRED:-never}"
47    
48 zlin 1.4 # @ECLASS-VARIABLE: CPPUNIT_REQUIRED
49     # @DESCRIPTION:
50     # Is cppunit required for tests? Possible values are 'always', 'optional' and 'never'.
51     # This variable must be set before inheriting any eclasses. Defaults to 'never'.
52     CPPUNIT_REQUIRED="${CPPUNIT_REQUIRED:-never}"
53    
54 scarabeus 1.34 # @ECLASS-VARIABLE: KDE_REQUIRED
55     # @DESCRIPTION:
56     # Is kde required? Possible values are 'always', 'optional' and 'never'.
57     # This variable must be set before inheriting any eclasses. Defaults to 'always'
58     # If set to always or optional, KDE_MINIMAL may be overriden as well.
59     # Note that for kde-base packages this variable is fixed to 'always'.
60     KDE_REQUIRED="${KDE_REQUIRED:-always}"
61    
62     # Verify KDE_MINIMAL (display QA notice in pkg_setup, still we need to fix it here)
63     if [[ -n ${KDE_MINIMAL} ]]; then
64     for slot in ${KDE_SLOTS[@]} ${KDE_LIVE_SLOTS[@]}; do
65     [[ ${KDE_MINIMAL} = ${slot} ]] && KDE_MINIMAL_VALID=1 && break
66     done
67 scarabeus 1.37 unset slot
68 scarabeus 1.34 [[ -z ${KDE_MINIMAL_VALID} ]] && unset KDE_MINIMAL
69     else
70     KDE_MINIMAL_VALID=1
71     fi
72    
73     # @ECLASS-VARIABLE: KDE_MINIMAL
74     # @DESCRIPTION:
75 wired 1.42 # This variable is used when KDE_REQUIRED is set, to specify required KDE minimal
76 scarabeus 1.34 # version for apps to work. Currently defaults to 4.2
77     # One may override this variable to raise version requirements.
78     # For possible values look at KDE_SLOTS and KDE_LIVE_SLOTS variables.
79 wired 1.42 # Note that it is fixed to ${SLOT} for kde-base packages.
80 scarabeus 1.34 KDE_MINIMAL="${KDE_MINIMAL:-4.2}"
81    
82     # Fallback behaviour (for now)
83     # TODO Remove when tree is clean
84     if [[ -n ${NEED_KDE} ]]; then
85     case ${NEED_KDE} in
86     none)
87     KDE_REQUIRED="never"
88     ;;
89     *)
90     KDE_REQUIRED="always"
91     KDE_MINIMAL="${NEED_KDE}"
92     ;;
93     esac
94     fi
95    
96 scarabeus 1.39 # @ECLASS-VARIABLE: QT_DEPEND
97     # @DESCRIPTION:
98     # Determine version of qt we enforce as minimal for the package. 4.4.0 4.5.1..
99     # Currently defaults to 4.5.1
100     QT_DEPEND="${QT_DEPEND:-4.5.1}"
101    
102 scarabeus 1.34 # OpenGL dependencies
103     qtopengldepend="
104 scarabeus 1.39 >=x11-libs/qt-opengl-${QT_DEPEND}:4
105 scarabeus 1.34 "
106     case ${OPENGL_REQUIRED} in
107     always)
108 wired 1.42 COMMONDEPEND+=" ${qtopengldepend}"
109 scarabeus 1.34 ;;
110     optional)
111 wired 1.42 IUSE+=" opengl"
112     COMMONDEPEND+=" opengl? ( ${qtopengldepend} )"
113 scarabeus 1.34 ;;
114     *) ;;
115     esac
116     unset qtopengldepend
117    
118     # WebKit dependencies
119     qtwebkitdepend="
120 scarabeus 1.39 >=x11-libs/qt-webkit-${QT_DEPEND}:4
121 scarabeus 1.34 "
122     case ${WEBKIT_REQUIRED} in
123     always)
124 wired 1.42 COMMONDEPEND+=" ${qtwebkitdepend}"
125 scarabeus 1.34 ;;
126     optional)
127 wired 1.42 IUSE+=" webkit"
128     COMMONDEPEND+=" webkit? ( ${qtwebkitdepend} )"
129 scarabeus 1.34 ;;
130     *) ;;
131     esac
132     unset qtwebkitdepend
133    
134     # CppUnit dependencies
135     cppuintdepend="
136     dev-util/cppunit
137     "
138 scarabeus 1.22 case ${CPPUNIT_REQUIRED} in
139 zlin 1.4 always)
140 wired 1.42 DEPEND+=" ${cppuintdepend}"
141 scarabeus 1.22 ;;
142 zlin 1.4 optional)
143 wired 1.42 IUSE+=" test"
144     DEPEND+=" test? ( ${cppuintdepend} )"
145 scarabeus 1.22 ;;
146 scarabeus 1.34 *) ;;
147 zlin 1.4 esac
148 scarabeus 1.34 unset cppuintdepend
149    
150     # Setup packages inheriting this eclass
151     case ${KDEBASE} in
152     kde-base)
153     if [[ $BUILD_TYPE = live ]]; then
154     # Disable tests for live ebuilds
155 wired 1.42 RESTRICT+=" test"
156 scarabeus 1.34 # Live ebuilds in kde-base default to kdeprefix by default
157 wired 1.42 IUSE+=" +kdeprefix"
158 ingmar 1.1 else
159 scarabeus 1.34 # All other ebuild types default to -kdeprefix as before
160 wired 1.42 IUSE+=" kdeprefix"
161 ingmar 1.1 fi
162 scarabeus 1.37 # Determine SLOT from PVs
163 scarabeus 1.34 case ${PV} in
164 scarabeus 1.37 *.9999*) SLOT="${PV/.9999*/}" ;; # stable live
165 wired 1.42 4.4* | 4.3.9* | 4.3.8* | 4.3.7* | 4.3.6*) SLOT="4.4" ;;
166 scarabeus 1.34 4.3* | 4.2.9* | 4.2.8* | 4.2.7* | 4.2.6*) SLOT="4.3" ;;
167     4.2* | 4.1.9* | 4.1.8* | 4.1.7* | 4.1.6*) SLOT="4.2" ;;
168 scarabeus 1.37 9999*) SLOT="live" ;; # regular live
169 scarabeus 1.34 *) die "Unsupported ${PV}" ;;
170     esac
171     _kdedir="${SLOT}"
172     _pv="-${PV}:${SLOT}"
173     _pvn="-${PV}"
174    
175     # Block installation of other SLOTS unless kdeprefix
176 wired 1.42 for slot in ${KDE_SLOTS[@]} ${KDE_LIVE_SLOTS[@]}; do
177 scarabeus 1.34 # Block non kdeprefix ${PN} on other slots
178     if [[ ${SLOT} != ${slot} ]]; then
179 wired 1.42 RDEPEND+=" !kdeprefix? ( !kde-base/${PN}:${slot}[-kdeprefix] )"
180 scarabeus 1.34 fi
181     done
182 scarabeus 1.37 unset slot
183 ingmar 1.1 ;;
184 scarabeus 1.34 koffice)
185     SLOT="2"
186     _pv="-${KDE_MINIMAL}"
187     _pvn="${_pv}"
188 ingmar 1.1 ;;
189 jmbsvicetto 1.13 *)
190 scarabeus 1.34 _pv="-${KDE_MINIMAL}"
191     _pvn="${_pv}"
192 ingmar 1.1 ;;
193 scarabeus 1.34
194 ingmar 1.1 esac
195    
196 scarabeus 1.34 # KDE dependencies
197     kdecommondepend="
198     dev-lang/perl
199 scarabeus 1.39 >=x11-libs/qt-core-${QT_DEPEND}:4[qt3support,ssl]
200     >=x11-libs/qt-gui-${QT_DEPEND}:4[accessibility,dbus]
201     >=x11-libs/qt-qt3support-${QT_DEPEND}:4[accessibility]
202     >=x11-libs/qt-script-${QT_DEPEND}:4
203     >=x11-libs/qt-sql-${QT_DEPEND}:4[qt3support]
204     >=x11-libs/qt-svg-${QT_DEPEND}:4
205     >=x11-libs/qt-test-${QT_DEPEND}:4
206 wired 1.42 !aqua? (
207     x11-libs/libXext
208     x11-libs/libXt
209     x11-libs/libXxf86vm
210     )
211 scarabeus 1.34 "
212     if [[ ${PN} != kdelibs ]]; then
213     if [[ ${KDEBASE} = kde-base ]]; then
214 wired 1.42 kdecommondepend+="
215 scarabeus 1.34 kdeprefix? ( >=kde-base/kdelibs${_pv}[kdeprefix] )
216     !kdeprefix? ( >=kde-base/kdelibs${_pvn}[-kdeprefix] )
217 scarabeus 1.31 "
218 scarabeus 1.34 else
219 wired 1.42 kdecommondepend+="
220 scarabeus 1.34 >=kde-base/kdelibs${_pv}
221 scarabeus 1.31 "
222 ingmar 1.1 fi
223     fi
224 scarabeus 1.34 unset _pv _pvn
225     kdedepend="
226     dev-util/pkgconfig
227     "
228     case ${KDE_REQUIRED} in
229     always)
230 wired 1.42 IUSE+=" aqua"
231     COMMONDEPEND+=" ${kdecommondepend}"
232     DEPEND+=" ${kdedepend}"
233 scarabeus 1.34 ;;
234     optional)
235 wired 1.42 IUSE+=" aqua kde"
236     COMMONDEPEND+=" kde? ( ${kdecommondepend} )"
237     DEPEND+=" kde? ( ${kdedepend} )"
238 scarabeus 1.34 ;;
239     *) ;;
240     esac
241     unset kdecommondepend kdedepend
242    
243     debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: COMMONDEPEND is ${COMMONDEPEND}"
244     debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: DEPEND (only) is ${DEPEND}"
245     debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: RDEPEND (only) is ${RDEPEND}"
246    
247     # Accumulate dependencies set by this eclass
248 wired 1.42 DEPEND+=" ${COMMONDEPEND}"
249     RDEPEND+=" ${COMMONDEPEND}"
250     unset COMMONDEPEND
251 ingmar 1.1
252     # Fetch section - If the ebuild's category is not 'kde-base' and if it is not a
253     # koffice ebuild, the URI should be set in the ebuild itself
254 scarabeus 1.30 case ${BUILD_TYPE} in
255 scarabeus 1.22 live)
256 scarabeus 1.37 # Determine branch URL based on live type
257     local branch_prefix
258     case ${PV} in
259     9999*)
260     # trunk
261     branch_prefix="trunk/KDE"
262     ;;
263     *)
264     # branch
265     branch_prefix="branches/KDE/${SLOT}"
266     # @ECLASS-VARIABLE: ESVN_PROJECT_SUFFIX
267     # @DESCRIPTION
268     # Suffix appended to ESVN_PROJECT depending on fetched branch.
269     # Defaults is empty (for -9999 = trunk), and "-${PV}" otherwise.
270     ESVN_PROJECT_SUFFIX="-${PV}"
271     ;;
272     esac
273 scarabeus 1.30 SRC_URI=""
274 scarabeus 1.35 # @ECLASS-VARIABLE: ESVN_MIRROR
275     # @DESCRIPTION:
276     # This variable allows easy overriding of default kde mirror service
277     # (anonsvn) with anything else you might want to use.
278 scarabeus 1.22 ESVN_MIRROR=${ESVN_MIRROR:=svn://anonsvn.kde.org/home/kde}
279     # Split ebuild, or extragear stuff
280 scarabeus 1.30 if [[ -n ${KMNAME} ]]; then
281 scarabeus 1.37 ESVN_PROJECT="${KMNAME}${ESVN_PROJECT_SUFFIX}"
282 scarabeus 1.34 if [[ -z ${KMNOMODULE} ]] && [[ -z ${KMMODULE} ]]; then
283 jmbsvicetto 1.25 KMMODULE="${PN}"
284 scarabeus 1.22 fi
285     # Split kde-base/ ebuilds: (they reside in trunk/KDE)
286     case ${KMNAME} in
287     kdebase-*)
288 scarabeus 1.37 ESVN_REPO_URI="${ESVN_MIRROR}/${branch_prefix}/kdebase/${KMNAME#kdebase-}"
289 scarabeus 1.22 ;;
290 wired 1.42 kdelibs-*)
291     ESVN_REPO_URI="${ESVN_MIRROR}/${branch_prefix}/kdelibs/${KMNAME#kdelibs-}"
292     ;;
293 scarabeus 1.22 kdereview)
294 scarabeus 1.30 ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}/${KMMODULE}"
295 scarabeus 1.22 ;;
296 scarabeus 1.34 kdesupport)
297     ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}/${KMMODULE}"
298 scarabeus 1.37 ESVN_PROJECT="${PN}${ESVN_PROJECT_SUFFIX}"
299 scarabeus 1.34 ;;
300 scarabeus 1.22 kde*)
301 scarabeus 1.37 ESVN_REPO_URI="${ESVN_MIRROR}/${branch_prefix}/${KMNAME}"
302 scarabeus 1.22 ;;
303     extragear*|playground*)
304 scarabeus 1.34 # Unpack them in toplevel dir, so that they won't conflict with kde4-meta
305     # build packages from same svn location.
306 scarabeus 1.30 ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}/${KMMODULE}"
307 scarabeus 1.37 ESVN_PROJECT="${PN}${ESVN_PROJECT_SUFFIX}"
308 scarabeus 1.30 ;;
309 scarabeus 1.22 koffice)
310     ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}"
311     ;;
312     *)
313 scarabeus 1.30 ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}/${KMMODULE}"
314 scarabeus 1.22 ;;
315     esac
316     else
317     # kdelibs, kdepimlibs
318 scarabeus 1.37 ESVN_REPO_URI="${ESVN_MIRROR}/${branch_prefix}/${PN}"
319     ESVN_PROJECT="${PN}${ESVN_PROJECT_SUFFIX}"
320 scarabeus 1.22 fi
321 scarabeus 1.38 # @ECLASS-VARIABLE: ESVN_UP_FREQ
322     # @DESCRIPTION:
323     # This variable is used for specifying the timeout between svn synces
324     # for kde-base and koffice modules. Does not affect misc apps.
325     # Default value is 1 hour.
326     [[ ${KDEBASE} = kde-base || ${KDEBASE} = koffice ]] && ESVN_UP_FREQ=${ESVN_UP_FREQ:-1}
327 scarabeus 1.22 ;;
328     *)
329 scarabeus 1.30 if [[ -n ${KDEBASE} ]]; then
330 scarabeus 1.22 if [[ -n ${KMNAME} ]]; then
331 scarabeus 1.30 case ${KMNAME} in
332     kdebase-apps)
333     _kmname="kdebase" ;;
334     *)
335 scarabeus 1.34 _kmname="${KMNAME}" ;;
336 scarabeus 1.30 esac
337 scarabeus 1.22 else
338     _kmname=${PN}
339     fi
340     _kmname_pv="${_kmname}-${PV}"
341     if [[ $NEED_KDE != live ]]; then
342     case ${KDEBASE} in
343     kde-base)
344     case ${PV} in
345 wired 1.42 4.3.85 | 4.3.90 | 4.3.95 | 4.3.96)
346     # block for normally packed unstable releases
347     SRC_URI="mirror://kde/unstable/${PV}/src/${_kmname_pv}.tar.bz2" ;;
348     4.3.9* | 4.3.8* | 4.3.7* | 4.3.6*)
349     SRC_URI="http://dev.gentooexperimental.org/~alexxy/kde/${PV}/${_kmname_pv}.tar.lzma" ;;
350     4.2.85 | 4.2.90 | 4.2.95 | 4.2.96 | 4.2.98)
351 scarabeus 1.37 # block for normally packed unstable releases
352     SRC_URI="mirror://kde/unstable/${PV}/src/${_kmname_pv}.tar.bz2" ;;
353 scarabeus 1.31 4.2.9* | 4.2.8* | 4.2.7* | 4.2.6*)
354     SRC_URI="http://dev.gentooexperimental.org/~alexxy/kde/${PV}/${_kmname_pv}.tar.lzma" ;;
355     4.1.9* | 4.1.8* | 4.1.7* | 4.1.6* | 4.0.9* | 4.0.8*)
356 scarabeus 1.22 SRC_URI="mirror://kde/unstable/${PV}/src/${_kmname_pv}.tar.bz2" ;;
357     *) SRC_URI="mirror://kde/stable/${PV}/src/${_kmname_pv}.tar.bz2" ;;
358     esac
359     ;;
360     koffice)
361 scarabeus 1.38 case ${PV} in
362     1.9*)
363     SRC_URI="mirror://kde/unstable/${_kmname_pv}/src/${_kmname_pv}.tar.bz2"
364     ;;
365     *) SRC_URI="mirror://kde/stable/${_kmname_pv}/src/${_kmname_pv}.tar.bz2" ;;
366     esac
367 scarabeus 1.22 ;;
368 ingmar 1.1 esac
369 scarabeus 1.22 fi
370 scarabeus 1.30 unset _kmname _kmname_pv
371     fi
372 scarabeus 1.22 ;;
373     esac
374 ingmar 1.1
375     debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: SRC_URI is ${SRC_URI}"
376    
377     # @ECLASS-VARIABLE: PREFIX
378     # @DESCRIPTION:
379 scarabeus 1.34 # Set the installation PREFIX for non kde-base applications. It defaults to /usr.
380     # kde-base packages go into KDE4 installation directory (KDEDIR) by default.
381 wired 1.42 # No matter the PREFIX, package will be built against KDE installed in KDEDIR.
382 ingmar 1.1
383     # @FUNCTION: kde4-base_pkg_setup
384     # @DESCRIPTION:
385 scarabeus 1.34 # Do the basic kdeprefix KDEDIR settings and determine with which kde should
386     # optional applications link
387 ingmar 1.1 kde4-base_pkg_setup() {
388 scarabeus 1.30 debug-print-function ${FUNCNAME} "$@"
389 ingmar 1.1
390 scarabeus 1.34 # QA ebuilds
391     case ${NEED_KDE} in
392     none) ewarn "QA Notice: using deprecated NEED_KDE variable, use KDE_REQUIRED=\"never\" or KDE_REQUIRED=\"optional\" instead. You may want to override KDE_MINIMAL as well (default is KDE_MINIMAL=\"${KDE_MINIMAL}\")." ;;
393     *) [[ -n ${NEED_KDE} ]] && ewarn "QA Notice: using deprecated NEED_KDE variable, use KDE_MINIMAL instead (default is KDE_MINIMAL=\"${KDE_MINIMAL}\")." ;;
394     esac
395     [[ -z ${KDE_MINIMAL_VALID} ]] && ewarn "QA Notice: ignoring invalid KDE_MINIMAL (defaulting to ${KDE_MINIMAL})."
396    
397     # Don't set KDEHOME during compilation, it will cause access violations
398 jmbsvicetto 1.13 unset KDEHOME
399    
400 scarabeus 1.34 if [[ ${KDEBASE} = kde-base ]]; then
401     if use kdeprefix; then
402 wired 1.42 KDEDIR="${EROOT}usr/kde/${_kdedir}"
403 scarabeus 1.34 else
404 wired 1.42 KDEDIR="${EROOT}usr"
405 scarabeus 1.34 fi
406     PREFIX="${PREFIX:-${KDEDIR}}"
407 scarabeus 1.29 else
408 scarabeus 1.34 # Determine KDEDIR by loooking for the closest match with KDE_MINIMAL
409     KDEDIR=
410     local kde_minimal_met
411     for slot in ${KDE_SLOTS[@]} ${KDE_LIVE_SLOTS[@]}; do
412     [[ -z ${kde_minimal_met} ]] && [[ ${slot} = ${KDE_MINIMAL} ]] && kde_minimal_met=1
413     if [[ -n ${kde_minimal_met} ]] && has_version "kde-base/kdelibs:${slot}"; then
414     if has_version "kde-base/kdelibs:${slot}[kdeprefix]"; then
415 wired 1.42 KDEDIR="${EROOT}usr/kde/${slot}"
416 scarabeus 1.34 else
417 wired 1.42 KDEDIR="${EROOT}usr"
418 scarabeus 1.34 fi
419     break;
420     fi
421     done
422 scarabeus 1.37 unset slot
423 scarabeus 1.41
424     # Bail out if kdelibs required but not found
425     if [[ ${KDE_REQUIRED} = always ]] || { [[ ${KDE_REQUIRED} = optional ]] && use kde; }; then
426     [[ -z ${KDEDIR} ]] && die "Failed to determine KDEDIR!"
427     else
428 wired 1.42 [[ -z ${KDEDIR} ]] && KDEDIR="${EROOT}usr"
429 scarabeus 1.41 fi
430    
431 wired 1.42 PREFIX="${PREFIX:-${EROOT}usr}"
432 jmbsvicetto 1.13 fi
433 wired 1.42 # Point pkg-config path to KDE *.pc files
434     export PKG_CONFIG_PATH="${KDEDIR}/$(get_libdir)/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}"
435     # Point to correct QT plugins path
436     QT_PLUGIN_PATH="${KDEDIR}/$(get_libdir)/kde4/plugins/"
437 jmbsvicetto 1.13
438 scarabeus 1.34 # Not needed anymore
439 jmbsvicetto 1.13 unset _kdedir
440 zlin 1.4 }
441    
442     # @FUNCTION: kde4-base_src_unpack
443     # @DESCRIPTION:
444     # This function unpacks the source tarballs for KDE4 applications.
445 ingmar 1.1 kde4-base_src_unpack() {
446 scarabeus 1.30 debug-print-function ${FUNCNAME} "$@"
447 ingmar 1.1
448 scarabeus 1.30 if [[ ${BUILD_TYPE} = live ]]; then
449 scarabeus 1.23 migrate_store_dir
450 scarabeus 1.22 subversion_src_unpack
451 ingmar 1.1 else
452 scarabeus 1.30 base_src_unpack
453 ingmar 1.1 fi
454 scarabeus 1.22 }
455 ingmar 1.1
456 scarabeus 1.22 # @FUNCTION: kde4-base_src_compile
457     # @DESCRIPTION:
458     # General pre-configure and pre-compile function for KDE4 applications.
459     # It also handles translations if KDE_LINGUAS is defined. See KDE_LINGUAS and
460 wired 1.42 # enable_selected_linguas() and enable_selected_doc_linguas()
461     # in kde4-functions.eclass(5) for further details.
462 scarabeus 1.22 kde4-base_src_prepare() {
463     debug-print-function ${FUNCNAME} "$@"
464 zlin 1.8
465     # Only enable selected languages, used for KDE extragear apps.
466 scarabeus 1.30 if [[ -n ${KDE_LINGUAS} ]]; then
467 zlin 1.8 enable_selected_linguas
468     fi
469 ingmar 1.1
470 wired 1.42 # Enable/disable handbooks for kde4-base packages
471     # kde-l10n inherits kde-base but is metpackage, so no check for doc
472     if ! has kde4-meta ${INHERITED}; then
473     has handbook ${IUSE//+} && [[ ${PN} != kde-l10n ]] && enable_selected_doc_linguas
474     fi
475    
476 scarabeus 1.38 [[ ${BUILD_TYPE} = live ]] && subversion_src_prepare
477 scarabeus 1.22 base_src_prepare
478 scarabeus 1.20
479 scarabeus 1.22 # Save library dependencies
480 scarabeus 1.30 if [[ -n ${KMSAVELIBS} ]] ; then
481 scarabeus 1.22 save_library_dependencies
482     fi
483 scarabeus 1.20
484 scarabeus 1.22 # Inject library dependencies
485 scarabeus 1.30 if [[ -n ${KMLOADLIBS} ]] ; then
486 scarabeus 1.22 load_library_dependencies
487 jmbsvicetto 1.13 fi
488 ingmar 1.1 }
489    
490     # @FUNCTION: kde4-base_src_configure
491     # @DESCRIPTION:
492     # Function for configuring the build of KDE4 applications.
493     kde4-base_src_configure() {
494     debug-print-function ${FUNCNAME} "$@"
495    
496 scarabeus 1.31 # Handle common release builds
497     if ! has debug ${IUSE//+} || ! use debug; then
498     append-cppflags -DQT_NO_DEBUG
499 ingmar 1.1 fi
500    
501     # Build tests in src_test only, where we override this value
502 scarabeus 1.34 local cmakeargs="-DKDE4_BUILD_TESTS=OFF"
503 ingmar 1.1
504 scarabeus 1.38 # set "real" debug mode
505     if has debug ${IUSE//+} && use debug; then
506     CMAKE_BUILD_TYPE="Debugfull"
507     fi
508    
509 ingmar 1.1 # Set distribution name
510 wired 1.42 [[ ${PN} = kdelibs ]] && cmakeargs+=" -DKDE_DISTRIBUTION_TEXT=Gentoo"
511 ingmar 1.1
512     # Here we set the install prefix
513 wired 1.42 cmakeargs+=" -DCMAKE_INSTALL_PREFIX=${PREFIX}"
514 jmbsvicetto 1.13
515 wired 1.42 # Use colors
516 ingmar 1.1 QTEST_COLORED=1
517 jmbsvicetto 1.13
518 scarabeus 1.34 # Shadow existing /usr installations
519     unset KDEDIRS
520    
521 wired 1.42 if [[ ${KDEDIR} != "${EROOT}usr" ]]; then
522 scarabeus 1.37 # Override some environment variables - only when kdeprefix is different,
523     # to not break ccache/distcc
524 scarabeus 1.34 PATH="${KDEDIR}/bin:${PATH}"
525     LDPATH="${KDEDIR}/$(get_libdir):${LDPATH}"
526 scarabeus 1.37
527     # Append full RPATH
528 wired 1.42 cmakeargs+=" -DCMAKE_SKIP_RPATH=OFF"
529 scarabeus 1.34 fi
530    
531     if has kdeprefix ${IUSE//+} && use kdeprefix; then
532     # Set cmake prefixes to allow buildsystem to localize valid KDE installation
533     # when more are present
534 wired 1.42 cmakeargs+=" -DCMAKE_SYSTEM_PREFIX_PATH=${KDEDIR}"
535 scarabeus 1.34 else
536     # If prefix is /usr, sysconf needs to be /etc, not /usr/etc
537 wired 1.42 cmakeargs+=" -DSYSCONF_INSTALL_DIR=${EROOT}etc"
538 scarabeus 1.22 fi
539    
540 scarabeus 1.34 mycmakeargs="${cmakeargs} ${mycmakeargs}"
541    
542     cmake-utils_src_configure
543 scarabeus 1.22 }
544    
545     # @FUNCTION: kde4-base_src_compile
546     # @DESCRIPTION:
547     # General function for compiling KDE4 applications.
548     kde4-base_src_compile() {
549     debug-print-function ${FUNCNAME} "$@"
550    
551 wired 1.42 cmake-utils_src_compile "$@"
552 ingmar 1.1 }
553    
554     # @FUNCTION: kde4-base_src_test
555     # @DESCRIPTION:
556     # Function for testing KDE4 applications.
557     kde4-base_src_test() {
558     debug-print-function ${FUNCNAME} "$@"
559    
560     # Override this value, set in kde4-base_src_configure()
561 wired 1.42 mycmakeargs+=" -DKDE4_BUILD_TESTS=ON"
562 scarabeus 1.30 cmake-utils_src_configure
563     kde4-base_src_compile
564 ingmar 1.1
565     cmake-utils_src_test
566     }
567    
568     # @FUNCTION: kde4-base_src_install
569     # @DESCRIPTION:
570     # Function for installing KDE4 applications.
571     kde4-base_src_install() {
572     debug-print-function ${FUNCNAME} "$@"
573    
574 scarabeus 1.30 if [[ -n ${KMSAVELIBS} ]] ; then
575 scarabeus 1.22 install_library_dependencies
576     fi
577    
578 ingmar 1.1 kde4-base_src_make_doc
579 scarabeus 1.32 cmake-utils_src_install
580 ingmar 1.1 }
581    
582     # @FUNCTION: kde4-base_src_make_doc
583     # @DESCRIPTION:
584     # Function for installing the documentation of KDE4 applications.
585     kde4-base_src_make_doc() {
586     debug-print-function ${FUNCNAME} "$@"
587    
588     local doc
589     for doc in AUTHORS ChangeLog* README* NEWS TODO; do
590 scarabeus 1.30 [[ -s ${doc} ]] && dodoc ${doc}
591 ingmar 1.1 done
592    
593 scarabeus 1.30 if [[ -z ${KMNAME} ]]; then
594 ingmar 1.1 for doc in {apps,runtime,workspace,.}/*/{AUTHORS,README*}; do
595 scarabeus 1.30 if [[ -s ${doc} ]]; then
596 ingmar 1.1 local doc_complete=${doc}
597     doc="${doc#*/}"
598     newdoc "$doc_complete" "${doc%/*}.${doc##*/}"
599     fi
600     done
601     fi
602    
603 wired 1.42 if [[ -n ${KDEBASE} ]] && [[ -d "${D}${EROOT}usr/share/doc/${PF}" ]]; then
604 ingmar 1.1 # work around bug #97196
605 scarabeus 1.34 dodir /usr/share/doc/KDE4 && \
606 wired 1.42 mv "${D}${EROOT}usr/share/doc/${PF}" "${D}${EROOT}usr/share/doc/KDE4/" || \
607 scarabeus 1.34 die "Failed to move docs to KDE4/."
608 ingmar 1.1 fi
609     }
610    
611     # @FUNCTION: kde4-base_pkg_postinst
612     # @DESCRIPTION:
613     # Function to rebuild the KDE System Configuration Cache after an application has been installed.
614     kde4-base_pkg_postinst() {
615 scarabeus 1.30 debug-print-function ${FUNCNAME} "$@"
616    
617 ingmar 1.1 buildsycoca
618 scarabeus 1.36
619     if [[ ${BUILD_TYPE} = live ]] && [[ -z ${I_KNOW_WHAT_I_AM_DOING} ]]; then
620     echo
621 wired 1.42 einfo "WARNING! This is an experimental live ebuild of ${CATEGORY}/${PN}"
622 scarabeus 1.36 einfo "Use it at your own risk."
623     einfo "Do _NOT_ file bugs at bugs.gentoo.org because of this ebuild!"
624     echo
625 scarabeus 1.39 elif [[ ${BUILD_TYPE} != live ]] && [[ -z ${I_KNOW_WHAT_I_AM_DOING} ]] && has kdeprefix ${IUSE//+} && use kdeprefix; then
626     # warning about kdeprefix for non-live users
627     echo
628 wired 1.42 ewarn "WARNING! You have the kdeprefix useflag enabled."
629     ewarn "This setting is strongly discouraged and might lead to potential trouble"
630 scarabeus 1.39 ewarn "with KDE update strategies."
631 wired 1.42 ewarn "You are using this setup at your own risk and the kde team does not"
632 scarabeus 1.39 ewarn "take responsibilities for dead kittens."
633     echo
634 scarabeus 1.36 fi
635 ingmar 1.1 }
636    
637     # @FUNCTION: kde4-base_pkg_postrm
638     # @DESCRIPTION:
639     # Function to rebuild the KDE System Configuration Cache after an application has been removed.
640     kde4-base_pkg_postrm() {
641 scarabeus 1.30 debug-print-function ${FUNCNAME} "$@"
642    
643 ingmar 1.1 buildsycoca
644     }

  ViewVC Help
Powered by ViewVC 1.1.20