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

Contents of /eclass/kde4-base.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.38 - (hide annotations) (download)
Thu May 28 09:47:52 2009 UTC (5 years, 4 months ago) by scarabeus
Branch: MAIN
Changes since 1.37: +28 -14 lines
Update kde4 eclasses from kde-testing. Mostly minor sinc. Introduce support for stable koffice2

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

  ViewVC Help
Powered by ViewVC 1.1.20