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

Contents of /eclass/kde4-base.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.15 - (hide annotations) (download)
Sat Oct 11 03:05:37 2008 UTC (5 years, 11 months ago) by jmbsvicetto
Branch: MAIN
Changes since 1.14: +5 -8 lines
As we moved KDEDIR setting to pkg_setup, we can't set PREFIX to it in global scope.
Furthermore, now that we have kdeprefix, set PREFIX to KDEDIR in pkg_setup and so make
the install location dependent on kdeprefix for all packages that inherit kde4-base.

1 ingmar 1.1 # Copyright 2007-2008 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 jmbsvicetto 1.15 # $Header: /var/cvsroot/gentoo-x86/eclass/kde4-base.eclass,v 1.14 2008/10/04 14:51:02 jmbsvicetto 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     # The kde4-base.eclass provides support for building KDE4 monolithic ebuilds
11     # and KDE4 applications.
12     #
13     # NOTE: This eclass uses the SLOT dependencies from EAPI="1" or compatible,
14 jmbsvicetto 1.13 # and use deps from EAPI="2", hence you must define EAPI="2" in the ebuild,
15     # before inheriting any eclasses.
16 ingmar 1.1
17 jmbsvicetto 1.13 inherit base cmake-utils eutils kde4-functions multilib
18 ingmar 1.1
19 jmbsvicetto 1.13 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     *)
24     EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_test src_install pkg_postinst pkg_postrm
25     ;;
26     esac
27 ingmar 1.1
28 jmbsvicetto 1.13 # Set the qt dependencies
29 philantrop 1.7 kde4-base_set_qt_dependencies() {
30 ingmar 1.11 local qt qtcore qtgui qt3support qtdepend qtopengldepend
31 zlin 1.4
32 philantrop 1.7 # use dependencies
33     case "${EAPI}" in
34 jmbsvicetto 1.13 2 | 2_pre3 | 2_pre2 | 2_pre1)
35    
36     qt="["
37 philantrop 1.7 case "${OPENGL_REQUIRED}" in
38     always)
39 jmbsvicetto 1.13 qt="${qt}opengl,"
40 philantrop 1.7 ;;
41     optional)
42 jmbsvicetto 1.13 qt="${qt}opengl?,"
43 philantrop 1.7 ;;
44     esac
45 jmbsvicetto 1.13 qt="${qt}accessibility,dbus,gif,jpeg,png,qt3support,ssl,zlib]"
46     qtcore="[qt3support,ssl]"
47     qtgui="[accessibility,dbus]"
48     qt3support="[accessibility]"
49 philantrop 1.7 ;;
50     esac
51    
52     # split qt
53     qtdepend="
54     x11-libs/qt-core:4${qtcore}
55     x11-libs/qt-gui:4${qtgui}
56     x11-libs/qt-qt3support:4${qt3support}
57 ingmar 1.11 x11-libs/qt-script:4
58     x11-libs/qt-svg:4
59     x11-libs/qt-test:4"
60     qtopengldepend="x11-libs/qt-opengl:4"
61 philantrop 1.7
62     # allow monolithic qt for PV < 4.1
63     case "${PV}" in
64 jmbsvicetto 1.13 scm|9999*|4.1*|4.0.9*|4.0.8*) : ;;
65 philantrop 1.7 *)
66     qtdepend="|| ( ( ${qtdepend} ) >=x11-libs/qt-4.3.3:4${qt} )"
67     qtopengldepend="|| ( ${qtopengldepend} >=x11-libs/qt-4.3.3:4 )"
68     ;;
69     esac
70    
71     # opengl dependencies
72     case "${OPENGL_REQUIRED}" in
73     always)
74     qtdepend="${qtdepend}
75     ${qtopengldepend}"
76     ;;
77     optional)
78     IUSE="${IUSE} opengl"
79     qtdepend="${qtdepend}
80     opengl? ( ${qtopengldepend} )"
81     ;;
82     *)
83     OPENGL_REQUIRED="never"
84     ;;
85     esac
86 zlin 1.4
87 philantrop 1.7 COMMONDEPEND="${COMMONDEPEND} ${qtdepend}"
88     }
89     kde4-base_set_qt_dependencies
90 zlin 1.4
91 jmbsvicetto 1.13 # 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
102     DEPEND="${DEPEND} ${COMMONDEPEND} ${CMAKEDEPEND}
103 ingmar 1.1 dev-util/pkgconfig
104 jmbsvicetto 1.14 kde-base/automoc
105 ingmar 1.1 x11-libs/libXt
106     x11-proto/xf86vidmodeproto"
107     RDEPEND="${RDEPEND} ${COMMONDEPEND}"
108    
109 jmbsvicetto 1.13 # Add the kdeprefix use flag
110     case "${EAPI}" in
111     2 | 2_pre3 | 2_pre2 | 2_pre1)
112     IUSE="${IUSE} kdeprefix"
113     ;;
114     esac
115    
116 philantrop 1.7 # @ECLASS-VARIABLE: OPENGL_REQUIRED
117     # @DESCRIPTION:
118     # Is qt-opengl required? Possible values are 'always', 'optional' and 'never'.
119     # This variable must be set before inheriting any eclasses. Defaults to 'never'.
120     OPENGL_REQUIRED="${OPENGL_REQUIRED:-never}"
121    
122 zlin 1.4 # @ECLASS-VARIABLE: CPPUNIT_REQUIRED
123     # @DESCRIPTION:
124     # Is cppunit required for tests? Possible values are 'always', 'optional' and 'never'.
125     # This variable must be set before inheriting any eclasses. Defaults to 'never'.
126     CPPUNIT_REQUIRED="${CPPUNIT_REQUIRED:-never}"
127    
128     case "${CPPUNIT_REQUIRED}" in
129     always)
130     DEPEND="${DEPEND} dev-util/cppunit"
131     ;;
132     optional)
133     IUSE="${IUSE} test"
134 ingmar 1.1 DEPEND="${DEPEND}
135     test? ( dev-util/cppunit )"
136 zlin 1.4 ;;
137     *)
138     CPPUNIT_REQUIRED="never"
139     ;;
140     esac
141 ingmar 1.1
142     # @ECLASS-VARIABLE: NEED_KDE
143     # @DESCRIPTION:
144     # This variable sets the version of KDE4 which will be used by the eclass.
145     # This variable must be set by the ebuild, for all categories except for "kde-base".
146     # For kde-base packages, if it is not set by the ebuild,
147     # it's assumed that the required KDE4 version is the latest, non-live, available.
148     #
149     # @CODE
150     # Acceptable values are:
151     # - latest - Use latest version in the portage tree
152     # Default for kde-base ebuilds. Banned for ebuilds not part of kde or koffice.
153     # - svn - Use svn release (live ebuilds)
154     # - :SLOT - Use any version in the SLOT specified in the NEED_KDE value.
155     # - VERSION_NUMBER - Use the minimum KDE4 version specified in the NEED_KDE value.
156     # - VERSION_NUMBER:SLOT - Use the minimum KDE4 version and the SLOT specified in the NEED_KDE value.
157     # - none - Let the ebuild handle SLOT, kde dependencies, KDEDIR, ...
158     # @CODE
159     #
160     # Note: There is no default NEED_KDE for ebuilds not in kde-base or part of
161     # koffice, so you must set it explicitly in the ebuild, in all other cases.
162     if [[ -z ${NEED_KDE} ]]; then
163     if [[ -n ${KDEBASE} ]]; then
164     NEED_KDE="latest"
165     else
166     die "kde4-base.eclass inherited but NEED_KDE not defined - broken ebuild"
167     fi
168     fi
169     export NEED_KDE
170    
171     case ${NEED_KDE} in
172     latest)
173     # Should only be used by 'kde-base'-ebuilds
174     if [[ "${KDEBASE}" == "kde-base" ]]; then
175     case ${PV} in
176 jmbsvicetto 1.13 4.1*| 4.0.9* | 4.0.8*)
177     _kdedir="4.1"
178     _pv="-${PV}:4.1" ;;
179     4.0*)
180     _kdedir="4.0"
181     _pv="-${PV}:kde-4" ;;
182     3.9*)
183     _kdedir="3.9"
184     _pv="-${PV}:kde-4" ;;
185     *)
186     die "NEED_KDE=latest not supported for PV=${PV}" ;;
187 ingmar 1.1 esac
188     _operator=">="
189     else
190 jmbsvicetto 1.13 case ${PV} in
191     4.1 | 4.0.9* | 4.0.8*) _kdedir="4.1" ;;
192     4.0*) _kdedir="4.0" ;;
193     3.9*) _kdedir="3.9" ;;
194     *) die "NEED_KDE=latest not supported for PV=${PV}" ;;
195     esac
196 ingmar 1.1 fi
197     ;;
198 jmbsvicetto 1.13
199     # NEED_KDE=":${SLOT}"
200     :kde-svn)
201 ingmar 1.1 _kdedir="svn"
202 jmbsvicetto 1.13 _pv="-${NEED_KDE}"
203 ingmar 1.1 export NEED_KDE="svn"
204     ;;
205 jmbsvicetto 1.13 :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}"
215 ingmar 1.1 *:kde-svn)
216     _kdedir="svn"
217     _operator=">="
218     _pv="-${NEED_KDE}"
219     export NEED_KDE="svn"
220     ;;
221 jmbsvicetto 1.13 *:4.1)
222     _kdedir="4.1"
223     _operator=">="
224     _pv="-${NEED_KDE}"
225 ingmar 1.1 ;;
226 jmbsvicetto 1.13 *:kde-4)
227 ingmar 1.1 _kdedir="4.0"
228 jmbsvicetto 1.13 _operator=">="
229     _pv="-${NEED_KDE}"
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 ingmar 1.1 ;;
244 jmbsvicetto 1.13 4.0* | 4)
245 ingmar 1.1 _kdedir="4.0"
246     _operator=">="
247 jmbsvicetto 1.13 _pv="-${NEED_KDE}:kde-4"
248 ingmar 1.1 ;;
249     3.9*)
250     _kdedir="3.9"
251     _operator=">="
252     _pv="-${NEED_KDE}:kde-4"
253     ;;
254 jmbsvicetto 1.13
255     # The ebuild handles dependencies, KDEDIR, SLOT.
256     none)
257     :
258 ingmar 1.1 ;;
259 jmbsvicetto 1.13
260     *)
261     die "NEED_KDE=${NEED_KDE} currently not supported."
262 ingmar 1.1 ;;
263     esac
264    
265     if [[ ${NEED_KDE} != none ]]; then
266    
267 jmbsvicetto 1.13 #Set the SLOT
268 ingmar 1.1 if [[ -n ${KDEBASE} ]]; then
269     if [[ ${NEED_KDE} = svn ]]; then
270     SLOT="kde-svn"
271     else
272 jmbsvicetto 1.13 case ${PV} in
273     4.1* | 4.0.9* | 4.0.8*) SLOT="4.1" ;;
274     *) SLOT="kde-4" ;;
275     esac
276 ingmar 1.1 fi
277     fi
278    
279 jmbsvicetto 1.13 # 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
293    
294 ingmar 1.1 # We only need to add the dependencies if ${PN} is not "kdelibs" or "kdepimlibs"
295     if [[ ${PN} != "kdelibs" ]]; then
296 jmbsvicetto 1.13 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     *)
302     DEPEND="${DEPEND} ${_operator}kde-base/kdelibs${_pv}"
303     RDEPEND="${RDEPEND} ${_operator}kde-base/kdelibs${_pv}"
304     ;;
305     esac
306 ingmar 1.1 if [[ ${PN} != "kdepimlibs" ]]; then
307 jmbsvicetto 1.13 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     *)
313     DEPEND="${DEPEND} ${_operator}kde-base/kdepimlibs${_pv}"
314     RDEPEND="${RDEPEND} ${_operator}kde-base/kdepimlibs${_pv}"
315     esac
316 ingmar 1.1 fi
317     fi
318    
319 jmbsvicetto 1.13 unset _operator _pv
320 ingmar 1.1 fi
321    
322     # Fetch section - If the ebuild's category is not 'kde-base' and if it is not a
323     # koffice ebuild, the URI should be set in the ebuild itself
324     if [[ -n ${KDEBASE} ]]; then
325     if [[ -n ${KMNAME} ]]; then
326     _kmname=${KMNAME}
327     else
328     _kmname=${PN}
329     fi
330     _kmname_pv="${_kmname}-${PV}"
331     if [[ ${NEED_KDE} != "svn" ]]; then
332     case ${KDEBASE} in
333     kde-base)
334     case ${PV} in
335 jmbsvicetto 1.13 4.0.9* | 4.0.8*)
336     SRC_URI="mirror://kde/unstable/${PV}/src/${_kmname_pv}.tar.bz2" ;;
337     *) SRC_URI="mirror://kde/stable/${PV}/src/${_kmname_pv}.tar.bz2";;
338 ingmar 1.1 esac
339     ;;
340     koffice)
341     SRC_URI="mirror://kde/unstable/${_kmname_pv}/src/${_kmname_pv}.tar.bz2"
342     ;;
343     esac
344     fi
345     unset _kmname _kmname_pv
346     fi
347    
348     debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: SRC_URI is ${SRC_URI}"
349    
350     # @ECLASS-VARIABLE: PREFIX
351     # @DESCRIPTION:
352     # Set the installation PREFIX. All kde-base ebuilds go into the KDE4 installation directory.
353     # Applications installed by the other ebuilds go into /usr/ by default, this value
354     # can be superseded by defining PREFIX before inheriting kde4-base.
355 jmbsvicetto 1.13 # This value is set on pkg_setup
356     PREFIX=""
357 ingmar 1.1
358 jmbsvicetto 1.13 debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: SLOT ${SLOT} - NEED_KDE ${NEED_KDE}"
359 ingmar 1.1
360     # @FUNCTION: kde4-base_pkg_setup
361     # @DESCRIPTION:
362     # Adds flags needed by all of KDE 4 to $QT4_BUILT_WITH_USE_CHECK. Uses
363     # kde4-functions_check_use from kde4-functions.eclass to print appropriate
364     # errors and die if any required flags listed in $QT4_BUILT_WITH_USE_CHECK or
365     # $KDE4_BUILT_WITH_USE_CHECK are missing.
366     kde4-base_pkg_setup() {
367     debug-print-function $FUNCNAME "$@"
368    
369 jmbsvicetto 1.13 # 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 jmbsvicetto 1.15
392     # Set the prefix based on KDEDIR
393     # Make it a consequence of kdeprefix
394     PREFIX=${KDEDIR}
395 jmbsvicetto 1.13
396     unset _kdedir
397    
398 philantrop 1.7 case "${EAPI}" in
399 jmbsvicetto 1.13 2 | 2_pre3 | 2_pre2 | 2_pre1)
400 ingmar 1.11 [[ -n ${QT4_BUILT_WITH_USE_CHECK} || -n ${KDE4_BUILT_WITH_USE_CHECK[@]} ]] && \
401 philantrop 1.7 die "built_with_use illegal in this EAPI!"
402     ;;
403     *)
404 ingmar 1.11 # 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 zlin 1.12 KDE4_BUILT_WITH_USE_CHECK=("${kde4_built_with_use_check[@]}")
412 ingmar 1.11 fi
413    
414 philantrop 1.7 # KDE4 applications require qt4 compiled with USE="accessibility dbus gif jpeg png qt3support ssl zlib".
415     if has_version '<x11-libs/qt-4.4_alpha:4'; then
416     QT4_BUILT_WITH_USE_CHECK="${QT4_BUILT_WITH_USE_CHECK} accessibility dbus gif jpeg png qt3support ssl zlib"
417 zlin 1.4 else
418 ingmar 1.11 KDE4_BUILT_WITH_USE_CHECK=("${KDE4_BUILT_WITH_USE_CHECK[@]}"
419     "x11-libs/qt-core qt3support ssl"
420     "x11-libs/qt-gui accessibility dbus"
421     "x11-libs/qt-qt3support accessibility")
422 zlin 1.4 fi
423 ingmar 1.1
424 philantrop 1.7 if has opengl ${IUSE//+} && use opengl || [[ ${OPENGL_REQUIRED} == always ]]; then
425     if has_version '<x11-libs/qt-4.4.0_alpha:4'; then
426     QT4_BUILT_WITH_USE_CHECK="${QT4_BUILT_WITH_USE_CHECK} opengl"
427     fi
428 zlin 1.4 fi
429 philantrop 1.7 kde4-functions_check_use
430     ;;
431     esac
432 ingmar 1.1 }
433    
434 zlin 1.4 # @FUNCTION: kde4-base_apply_patches
435 ingmar 1.1 # @DESCRIPTION:
436 zlin 1.4 # This function applies patches.
437 ingmar 1.1 #
438     # If the directory ${WORKDIR}/patches/ exists, we apply all patches in that
439     # directory, provided they follow this format:
440     # @CODE
441     # - Monolithic ebuilds, (from kde-base)
442     # - $CATEGORY=kde-base:
443     # Apply ${CHILD_EBUILD_NAME}-${SLOT}-*{diff,patch}
444     # - $CATEGORY=!kde-base:
445     # Apply ${CHILD_EBUILD_NAME}-${PV}-*{diff,patch}
446     # - Split ebuilds:
447     # - $CATEGORY=kde-base:
448     # Apply ${PN}-${SLOT}-*{diff,patch}
449     # - $CATEGORY!=kde-base:
450     # Apply ${PN}-${PV}-*{diff,patch}
451     # @CODE
452     #
453 zlin 1.8 # 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.
455 zlin 1.4 kde4-base_apply_patches() {
456 zlin 1.10 local _patchdir _packages _p _f
457 zlin 1.4 _patchdir="${WORKDIR}/patches/"
458     if [[ -d "${_patchdir}" ]]; then
459     if is-parent-package ${CATEGORY}/${PN} ; then
460     _packages="$(get-child-packages ${CATEGORY}/${PN})"
461     _packages="${_packages//${CATEGORY}\//} ${PN}"
462     else
463     _packages="${PN}"
464     fi
465 zlin 1.10 if [[ $(declare -p PATCHES) != 'declare -a '* ]]; then
466 jmbsvicetto 1.13 die "PATCHES needs to be an array!"
467 zlin 1.10 fi
468     for _p in ${_packages}; do
469     for _f in "${_patchdir}"/${_p}-${PV}-*{diff,patch}; do
470     [[ -e ${_f} ]] && PATCHES+=("${_f}")
471 zlin 1.8 done
472 zlin 1.10 if [[ -n "${KDEBASE}" ]]; then
473     for _f in "${_patchdir}"/${_p}-${SLOT}-*{diff,patch}; do
474     [[ -e ${_f} ]] && PATCHES+=("${_f}")
475     done
476     fi
477     done
478 zlin 1.4 fi
479 zlin 1.8 [[ -n ${PATCHES[@]} ]] && base_src_unpack autopatch
480 zlin 1.4 }
481    
482     # @FUNCTION: kde4-base_src_unpack
483     # @DESCRIPTION:
484     # This function unpacks the source tarballs for KDE4 applications.
485     #
486     # If no argument is passed to this function, then standard src_unpack is
487     # executed. Otherwise options are passed to base_src_unpack.
488     #
489     # In addition it calls kde4-base_apply_patches when no arguments are passed to
490     # this function.
491 zlin 1.8 #
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.
494 ingmar 1.1 kde4-base_src_unpack() {
495     debug-print-function $FUNCNAME "$@"
496    
497     [[ -z "${KDE_S}" ]] && KDE_S="${S}"
498    
499     if [[ -z $* ]]; then
500     # Unpack first and deal with KDE patches after examing possible patch sets.
501     # To be picked up, patches need to conform to the guidelines stated before.
502     # Monolithic ebuilds will use the split ebuild patches.
503     [[ -d "${KDE_S}" ]] || unpack ${A}
504 zlin 1.4 kde4-base_apply_patches
505 ingmar 1.1 else
506     # Call base_src_unpack, which unpacks and patches
507     # step by step transparently as defined in the ebuild.
508     base_src_unpack $*
509     fi
510    
511     # Updated cmake dir
512     if [[ -d "${WORKDIR}/cmake" ]] && [[ -d "${KDE_S}/cmake" ]]; then
513     ebegin "Updating cmake/ directory..."
514     rm -rf "${KDE_S}/cmake" || die "Unable to remove old cmake/ directory"
515     ln -s "${WORKDIR}/cmake" "${KDE_S}/cmake" || die "Unable to symlink the new cmake/ directory"
516 philantrop 1.7 eend 0
517 ingmar 1.1 fi
518 zlin 1.8
519     # Only enable selected languages, used for KDE extragear apps.
520     if [[ -n ${KDE_LINGUAS} ]]; then
521     enable_selected_linguas
522     fi
523 ingmar 1.1 }
524    
525     # @FUNCTION: kde4-base_src_compile
526     # @DESCRIPTION:
527     # General function for compiling KDE4 applications.
528     kde4-base_src_compile() {
529     debug-print-function ${FUNCNAME} "$@"
530 jmbsvicetto 1.13 case "${EAPI}" in
531     2)
532     ;;
533     *)
534     kde4-base_src_configure
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
541 ingmar 1.1 }
542    
543     # @FUNCTION: kde4-base_src_configure
544     # @DESCRIPTION:
545     # Function for configuring the build of KDE4 applications.
546     kde4-base_src_configure() {
547     debug-print-function ${FUNCNAME} "$@"
548    
549     # Final flag handling
550     if has kdeenablefinal ${IUSE//+} && use kdeenablefinal; then
551 ingmar 1.5 echo "Activating enable-final flag"
552 ingmar 1.1 mycmakeargs="${mycmakeargs} -DKDE4_ENABLE_FINAL=ON"
553     fi
554    
555     # Enable generation of HTML handbook
556     if has htmlhandbook ${IUSE//+} && use htmlhandbook; then
557 ingmar 1.5 echo "Enabling building of HTML handbook"
558 ingmar 1.1 mycmakeargs="${mycmakeargs} -DKDE4_ENABLE_HTMLHANDBOOK=ON"
559     fi
560    
561     # Build tests in src_test only, where we override this value
562     mycmakeargs="${mycmakeargs} -DKDE4_BUILD_TESTS=OFF"
563    
564     # Set distribution name
565     [[ ${PN} == "kdelibs" ]] && mycmakeargs="${mycmakeargs} -DKDE_DISTRIBUTION_TEXT=Gentoo"
566    
567     # runpath linking
568     mycmakeargs="${mycmakeargs} -DKDE4_USE_ALWAYS_FULL_RPATH=ON"
569    
570     # Here we set the install prefix
571     mycmakeargs="${mycmakeargs} -DCMAKE_INSTALL_PREFIX=${PREFIX}"
572    
573 jmbsvicetto 1.13 # If prefix is /usr, sysconf needs to be /etc, not /usr/etc
574     [[ "${PREFIX}" == "/usr" ]] && mycmakeargs="${mycmakeargs} -DSYSCONF_INSTALL_DIR=/etc"
575    
576 ingmar 1.1 # Set environment
577     QTEST_COLORED=1
578     QT_PLUGIN_PATH=${KDEDIR}/$(get_libdir)/kde4/plugins/
579    
580 jmbsvicetto 1.13 # 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
584 ingmar 1.1 }
585    
586     # @FUNCTION: kde4-base_src_make
587     # @DESCRIPTION:
588     # Function for building KDE4 applications.
589     # Options are passed to cmake-utils_src_make.
590     kde4-base_src_make() {
591     debug-print-function ${FUNCNAME} "$@"
592    
593     cmake-utils_src_make "$@"
594     }
595    
596     # @FUNCTION: kde4-base_src_test
597     # @DESCRIPTION:
598     # Function for testing KDE4 applications.
599     kde4-base_src_test() {
600     debug-print-function ${FUNCNAME} "$@"
601    
602     # Override this value, set in kde4-base_src_configure()
603     mycmakeargs="${mycmakeargs} -DKDE4_BUILD_TESTS=ON"
604     cmake-utils_src_compile
605    
606     cmake-utils_src_test
607     }
608    
609     # @FUNCTION: kde4-base_src_install
610     # @DESCRIPTION:
611     # Function for installing KDE4 applications.
612     kde4-base_src_install() {
613     debug-print-function ${FUNCNAME} "$@"
614    
615     kde4-base_src_make_doc
616 jmbsvicetto 1.13 if [[ -d ${WORKDIR}/${PN}_build ]]; then
617     pushd "${WORKDIR}"/${PN}_build > /dev/null
618     fi
619     [ -e [Mm]akefile ] && cmake-utils_src_install
620 ingmar 1.1 }
621    
622     # @FUNCTION: kde4-base_src_make_doc
623     # @DESCRIPTION:
624     # Function for installing the documentation of KDE4 applications.
625     kde4-base_src_make_doc() {
626     debug-print-function ${FUNCNAME} "$@"
627    
628     local doc
629     for doc in AUTHORS ChangeLog* README* NEWS TODO; do
630     [[ -s $doc ]] && dodoc ${doc}
631     done
632    
633     if [[ -z ${KMNAME} ]]; then
634     for doc in {apps,runtime,workspace,.}/*/{AUTHORS,README*}; do
635     if [[ -s $doc ]]; then
636     local doc_complete=${doc}
637     doc="${doc#*/}"
638     newdoc "$doc_complete" "${doc%/*}.${doc##*/}"
639     fi
640     done
641     fi
642    
643     if [[ -n ${KDEBASE} && -d "${D}"/usr/share/doc/${PF} ]]; then
644     # work around bug #97196
645     dodir /usr/share/doc/kde && \
646     mv "${D}"/usr/share/doc/${PF} "${D}"/usr/share/doc/kde/ || \
647     die "Failed to move docs to kde/ failed."
648     fi
649     }
650    
651     # @FUNCTION: kde4-base_pkg_postinst
652     # @DESCRIPTION:
653     # Function to rebuild the KDE System Configuration Cache after an application has been installed.
654     kde4-base_pkg_postinst() {
655     buildsycoca
656     }
657    
658     # @FUNCTION: kde4-base_pkg_postrm
659     # @DESCRIPTION:
660     # Function to rebuild the KDE System Configuration Cache after an application has been removed.
661     kde4-base_pkg_postrm() {
662     buildsycoca
663     }

  ViewVC Help
Powered by ViewVC 1.1.20