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

Contents of /eclass/kde4-base.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.13 - (hide annotations) (download)
Thu Oct 2 06:49:02 2008 UTC (5 years, 11 months ago) by jmbsvicetto
Branch: MAIN
Changes since 1.12: +205 -77 lines
Bumped kde4 eclasses.
Add kde-4.1.2 into the tree from the kde-testing overlay.

1 ingmar 1.1 # Copyright 2007-2008 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 jmbsvicetto 1.13 # $Header: $
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     x11-libs/libXt
105     x11-proto/xf86vidmodeproto"
106     RDEPEND="${RDEPEND} ${COMMONDEPEND}"
107    
108 jmbsvicetto 1.13 # Add the kdeprefix use flag
109     case "${EAPI}" in
110     2 | 2_pre3 | 2_pre2 | 2_pre1)
111     IUSE="${IUSE} kdeprefix"
112     ;;
113     esac
114    
115 philantrop 1.7 # @ECLASS-VARIABLE: OPENGL_REQUIRED
116     # @DESCRIPTION:
117     # Is qt-opengl required? Possible values are 'always', 'optional' and 'never'.
118     # This variable must be set before inheriting any eclasses. Defaults to 'never'.
119     OPENGL_REQUIRED="${OPENGL_REQUIRED:-never}"
120    
121 zlin 1.4 # @ECLASS-VARIABLE: CPPUNIT_REQUIRED
122     # @DESCRIPTION:
123     # Is cppunit required for tests? Possible values are 'always', 'optional' and 'never'.
124     # This variable must be set before inheriting any eclasses. Defaults to 'never'.
125     CPPUNIT_REQUIRED="${CPPUNIT_REQUIRED:-never}"
126    
127     case "${CPPUNIT_REQUIRED}" in
128     always)
129     DEPEND="${DEPEND} dev-util/cppunit"
130     ;;
131     optional)
132     IUSE="${IUSE} test"
133 ingmar 1.1 DEPEND="${DEPEND}
134     test? ( dev-util/cppunit )"
135 zlin 1.4 ;;
136     *)
137     CPPUNIT_REQUIRED="never"
138     ;;
139     esac
140 ingmar 1.1
141     # @ECLASS-VARIABLE: NEED_KDE
142     # @DESCRIPTION:
143     # This variable sets the version of KDE4 which will be used by the eclass.
144     # This variable must be set by the ebuild, for all categories except for "kde-base".
145     # For kde-base packages, if it is not set by the ebuild,
146     # it's assumed that the required KDE4 version is the latest, non-live, available.
147     #
148     # @CODE
149     # Acceptable values are:
150     # - latest - Use latest version in the portage tree
151     # Default for kde-base ebuilds. Banned for ebuilds not part of kde or koffice.
152     # - svn - Use svn release (live ebuilds)
153     # - :SLOT - Use any version in the SLOT specified in the NEED_KDE value.
154     # - VERSION_NUMBER - Use the minimum KDE4 version specified in the NEED_KDE value.
155     # - VERSION_NUMBER:SLOT - Use the minimum KDE4 version and the SLOT specified in the NEED_KDE value.
156     # - none - Let the ebuild handle SLOT, kde dependencies, KDEDIR, ...
157     # @CODE
158     #
159     # Note: There is no default NEED_KDE for ebuilds not in kde-base or part of
160     # koffice, so you must set it explicitly in the ebuild, in all other cases.
161     if [[ -z ${NEED_KDE} ]]; then
162     if [[ -n ${KDEBASE} ]]; then
163     NEED_KDE="latest"
164     else
165     die "kde4-base.eclass inherited but NEED_KDE not defined - broken ebuild"
166     fi
167     fi
168     export NEED_KDE
169    
170     case ${NEED_KDE} in
171     latest)
172     # Should only be used by 'kde-base'-ebuilds
173     if [[ "${KDEBASE}" == "kde-base" ]]; then
174     case ${PV} in
175 jmbsvicetto 1.13 4.1*| 4.0.9* | 4.0.8*)
176     _kdedir="4.1"
177     _pv="-${PV}:4.1" ;;
178     4.0*)
179     _kdedir="4.0"
180     _pv="-${PV}:kde-4" ;;
181     3.9*)
182     _kdedir="3.9"
183     _pv="-${PV}:kde-4" ;;
184     *)
185     die "NEED_KDE=latest not supported for PV=${PV}" ;;
186 ingmar 1.1 esac
187     _operator=">="
188     else
189 jmbsvicetto 1.13 case ${PV} in
190     4.1 | 4.0.9* | 4.0.8*) _kdedir="4.1" ;;
191     4.0*) _kdedir="4.0" ;;
192     3.9*) _kdedir="3.9" ;;
193     *) die "NEED_KDE=latest not supported for PV=${PV}" ;;
194     esac
195 ingmar 1.1 fi
196     ;;
197 jmbsvicetto 1.13
198     # NEED_KDE=":${SLOT}"
199     :kde-svn)
200 ingmar 1.1 _kdedir="svn"
201 jmbsvicetto 1.13 _pv="-${NEED_KDE}"
202 ingmar 1.1 export NEED_KDE="svn"
203     ;;
204 jmbsvicetto 1.13 :4.1)
205     _kdedir="4.1"
206     _pv="${NEED_KDE}"
207     ;;
208     :kde-4)
209     _kdedir="4.0"
210     _pv="${NEED_KDE}"
211     ;;
212    
213     # NEED_KDE="${PV}:${SLOT}"
214 ingmar 1.1 *:kde-svn)
215     _kdedir="svn"
216     _operator=">="
217     _pv="-${NEED_KDE}"
218     export NEED_KDE="svn"
219     ;;
220 jmbsvicetto 1.13 *:4.1)
221     _kdedir="4.1"
222     _operator=">="
223     _pv="-${NEED_KDE}"
224 ingmar 1.1 ;;
225 jmbsvicetto 1.13 *:kde-4)
226 ingmar 1.1 _kdedir="4.0"
227 jmbsvicetto 1.13 _operator=">="
228     _pv="-${NEED_KDE}"
229     ;;
230    
231     # NEED_KDE="${PV}"
232     scm|svn|9999*)
233     _kdedir="svn"
234     _operator=">="
235     _pv="-${NEED_KDE}:kde-svn"
236     export NEED_KDE="svn"
237     ;;
238     4.1 | 4.0.9* | 4.0.8*)
239     _kdedir="4.1"
240     _operator=">="
241     _pv="-${NEED_KDE}:4.1"
242 ingmar 1.1 ;;
243 jmbsvicetto 1.13 4.0* | 4)
244 ingmar 1.1 _kdedir="4.0"
245     _operator=">="
246 jmbsvicetto 1.13 _pv="-${NEED_KDE}:kde-4"
247 ingmar 1.1 ;;
248     3.9*)
249     _kdedir="3.9"
250     _operator=">="
251     _pv="-${NEED_KDE}:kde-4"
252     ;;
253 jmbsvicetto 1.13
254     # The ebuild handles dependencies, KDEDIR, SLOT.
255     none)
256     :
257 ingmar 1.1 ;;
258 jmbsvicetto 1.13
259     *)
260     die "NEED_KDE=${NEED_KDE} currently not supported."
261 ingmar 1.1 ;;
262     esac
263    
264     if [[ ${NEED_KDE} != none ]]; then
265    
266 jmbsvicetto 1.13 #Set the SLOT
267 ingmar 1.1 if [[ -n ${KDEBASE} ]]; then
268     if [[ ${NEED_KDE} = svn ]]; then
269     SLOT="kde-svn"
270     else
271 jmbsvicetto 1.13 case ${PV} in
272     4.1* | 4.0.9* | 4.0.8*) SLOT="4.1" ;;
273     *) SLOT="kde-4" ;;
274     esac
275 ingmar 1.1 fi
276     fi
277    
278 jmbsvicetto 1.13 # Block install of other SLOTS unless kdeprefix
279     case "${EAPI}" in
280     2 | 2_pre3 | 2_pre2 | 2_pre1)
281     for KDE_SLOT in ${KDE_SLOTS[@]}; do
282     # block non kdeprefix ${PN} on other slots
283     if [[ ${SLOT} != ${KDE_SLOT} ]]; then
284     DEPEND="${DEPEND}
285     !kdeprefix? ( !kde-base/${PN}:${KDE_SLOT}[-kdeprefix] )"
286     RDEPEND="${RDEPEND}
287     !kdeprefix? ( !kde-base/${PN}:${KDE_SLOT}[-kdeprefix] )"
288     fi
289     done
290     ;;
291     esac
292    
293 ingmar 1.1 # We only need to add the dependencies if ${PN} is not "kdelibs" or "kdepimlibs"
294     if [[ ${PN} != "kdelibs" ]]; then
295 jmbsvicetto 1.13 case "${EAPI}" in
296     2 | 2_pre3 | 2_pre2 | 2_pre1)
297     DEPEND="${DEPEND} ${_operator}kde-base/kdelibs${_pv}[kdeprefix=]"
298     RDEPEND="${RDEPEND} ${_operator}kde-base/kdelibs${_pv}[kdeprefix=]"
299     ;;
300     *)
301     DEPEND="${DEPEND} ${_operator}kde-base/kdelibs${_pv}"
302     RDEPEND="${RDEPEND} ${_operator}kde-base/kdelibs${_pv}"
303     ;;
304     esac
305 ingmar 1.1 if [[ ${PN} != "kdepimlibs" ]]; then
306 jmbsvicetto 1.13 case "${EAPI}" in
307     2 | 2_pre3 | 2_pre2 | 2_pre1)
308     DEPEND="${DEPEND} ${_operator}kde-base/kdepimlibs${_pv}[kdeprefix=]"
309     RDEPEND="${RDEPEND} ${_operator}kde-base/kdepimlibs${_pv}[kdeprefix=]"
310     ;;
311     *)
312     DEPEND="${DEPEND} ${_operator}kde-base/kdepimlibs${_pv}"
313     RDEPEND="${RDEPEND} ${_operator}kde-base/kdepimlibs${_pv}"
314     esac
315 ingmar 1.1 fi
316     fi
317    
318 jmbsvicetto 1.13 unset _operator _pv
319 ingmar 1.1 fi
320    
321     # Fetch section - If the ebuild's category is not 'kde-base' and if it is not a
322     # koffice ebuild, the URI should be set in the ebuild itself
323     if [[ -n ${KDEBASE} ]]; then
324     if [[ -n ${KMNAME} ]]; then
325     _kmname=${KMNAME}
326     else
327     _kmname=${PN}
328     fi
329     _kmname_pv="${_kmname}-${PV}"
330     if [[ ${NEED_KDE} != "svn" ]]; then
331     case ${KDEBASE} in
332     kde-base)
333     case ${PV} in
334 jmbsvicetto 1.13 4.0.9* | 4.0.8*)
335     SRC_URI="mirror://kde/unstable/${PV}/src/${_kmname_pv}.tar.bz2" ;;
336     *) SRC_URI="mirror://kde/stable/${PV}/src/${_kmname_pv}.tar.bz2";;
337 ingmar 1.1 esac
338     ;;
339     koffice)
340     SRC_URI="mirror://kde/unstable/${_kmname_pv}/src/${_kmname_pv}.tar.bz2"
341     ;;
342     esac
343     fi
344     unset _kmname _kmname_pv
345     fi
346    
347     debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: SRC_URI is ${SRC_URI}"
348    
349     # @ECLASS-VARIABLE: PREFIX
350     # @DESCRIPTION:
351     # Set the installation PREFIX. All kde-base ebuilds go into the KDE4 installation directory.
352     # Applications installed by the other ebuilds go into /usr/ by default, this value
353     # can be superseded by defining PREFIX before inheriting kde4-base.
354 jmbsvicetto 1.13 # This value is set on pkg_setup
355     PREFIX=""
356 ingmar 1.1
357 jmbsvicetto 1.13 debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: SLOT ${SLOT} - NEED_KDE ${NEED_KDE}"
358 ingmar 1.1
359     # @FUNCTION: kde4-base_pkg_setup
360     # @DESCRIPTION:
361     # Adds flags needed by all of KDE 4 to $QT4_BUILT_WITH_USE_CHECK. Uses
362     # kde4-functions_check_use from kde4-functions.eclass to print appropriate
363     # errors and die if any required flags listed in $QT4_BUILT_WITH_USE_CHECK or
364     # $KDE4_BUILT_WITH_USE_CHECK are missing.
365     kde4-base_pkg_setup() {
366     debug-print-function $FUNCNAME "$@"
367    
368 jmbsvicetto 1.13 # Don't set KDEHOME during compile, it will cause access violations
369     unset KDEHOME
370    
371     if [[ ${NEED_KDE} != none ]]; then
372    
373     # Set PREFIX
374     case "${EAPI}" in
375     2 | 2_pre3 | 2_pre2 | 2_pre1)
376     if use kdeprefix; then
377     KDEDIR="/usr/kde/${_kdedir}"
378     KDEDIRS="/usr:/usr/local:${KDEDIR}"
379     else
380     KDEDIR="/usr"
381     KDEDIRS="/usr:/usr/local"
382     fi
383     ;;
384     *)
385     KDEDIR="/usr"
386     KDEDIRS="/usr:/usr/local"
387     ;;
388     esac
389     fi
390    
391     if [[ -n ${KDEBASE} ]]; then
392     PREFIX=${KDEDIR}
393     else
394     # if PREFIX is not defined we set it to the default value of /usr
395     PREFIX="${PREFIX:-/usr}"
396     fi
397    
398     unset _kdedir
399    
400 philantrop 1.7 case "${EAPI}" in
401 jmbsvicetto 1.13 2 | 2_pre3 | 2_pre2 | 2_pre1)
402 ingmar 1.11 [[ -n ${QT4_BUILT_WITH_USE_CHECK} || -n ${KDE4_BUILT_WITH_USE_CHECK[@]} ]] && \
403 philantrop 1.7 die "built_with_use illegal in this EAPI!"
404     ;;
405     *)
406 ingmar 1.11 # Make KDE4_BUILT_WITH_USE_CHECK an array if it isn't already
407     local line kde4_built_with_use_check=()
408     if [[ -n ${KDE4_BUILT_WITH_USE_CHECK[@]} && $(declare -p KDE4_BUILT_WITH_USE_CHECK) != 'declare -a '* ]]; then
409     while read line; do
410     [[ -z ${line} ]] && continue
411     kde4_built_with_use_check+=("${line}")
412     done <<< "${KDE4_BUILT_WITH_USE_CHECK}"
413 zlin 1.12 KDE4_BUILT_WITH_USE_CHECK=("${kde4_built_with_use_check[@]}")
414 ingmar 1.11 fi
415    
416 philantrop 1.7 # KDE4 applications require qt4 compiled with USE="accessibility dbus gif jpeg png qt3support ssl zlib".
417     if has_version '<x11-libs/qt-4.4_alpha:4'; then
418     QT4_BUILT_WITH_USE_CHECK="${QT4_BUILT_WITH_USE_CHECK} accessibility dbus gif jpeg png qt3support ssl zlib"
419 zlin 1.4 else
420 ingmar 1.11 KDE4_BUILT_WITH_USE_CHECK=("${KDE4_BUILT_WITH_USE_CHECK[@]}"
421     "x11-libs/qt-core qt3support ssl"
422     "x11-libs/qt-gui accessibility dbus"
423     "x11-libs/qt-qt3support accessibility")
424 zlin 1.4 fi
425 ingmar 1.1
426 philantrop 1.7 if has opengl ${IUSE//+} && use opengl || [[ ${OPENGL_REQUIRED} == always ]]; then
427     if has_version '<x11-libs/qt-4.4.0_alpha:4'; then
428     QT4_BUILT_WITH_USE_CHECK="${QT4_BUILT_WITH_USE_CHECK} opengl"
429     fi
430 zlin 1.4 fi
431 philantrop 1.7 kde4-functions_check_use
432     ;;
433     esac
434 ingmar 1.1 }
435    
436 zlin 1.4 # @FUNCTION: kde4-base_apply_patches
437 ingmar 1.1 # @DESCRIPTION:
438 zlin 1.4 # This function applies patches.
439 ingmar 1.1 #
440     # If the directory ${WORKDIR}/patches/ exists, we apply all patches in that
441     # directory, provided they follow this format:
442     # @CODE
443     # - Monolithic ebuilds, (from kde-base)
444     # - $CATEGORY=kde-base:
445     # Apply ${CHILD_EBUILD_NAME}-${SLOT}-*{diff,patch}
446     # - $CATEGORY=!kde-base:
447     # Apply ${CHILD_EBUILD_NAME}-${PV}-*{diff,patch}
448     # - Split ebuilds:
449     # - $CATEGORY=kde-base:
450     # Apply ${PN}-${SLOT}-*{diff,patch}
451     # - $CATEGORY!=kde-base:
452     # Apply ${PN}-${PV}-*{diff,patch}
453     # @CODE
454     #
455 zlin 1.8 # If ${PATCHES} is non-zero all patches in it get applied. If there is more
456     # than one patch please make ${PATCHES} an array for proper quoting.
457 zlin 1.4 kde4-base_apply_patches() {
458 zlin 1.10 local _patchdir _packages _p _f
459 zlin 1.4 _patchdir="${WORKDIR}/patches/"
460     if [[ -d "${_patchdir}" ]]; then
461     if is-parent-package ${CATEGORY}/${PN} ; then
462     _packages="$(get-child-packages ${CATEGORY}/${PN})"
463     _packages="${_packages//${CATEGORY}\//} ${PN}"
464     else
465     _packages="${PN}"
466     fi
467 zlin 1.10 if [[ $(declare -p PATCHES) != 'declare -a '* ]]; then
468 jmbsvicetto 1.13 die "PATCHES needs to be an array!"
469 zlin 1.10 fi
470     for _p in ${_packages}; do
471     for _f in "${_patchdir}"/${_p}-${PV}-*{diff,patch}; do
472     [[ -e ${_f} ]] && PATCHES+=("${_f}")
473 zlin 1.8 done
474 zlin 1.10 if [[ -n "${KDEBASE}" ]]; then
475     for _f in "${_patchdir}"/${_p}-${SLOT}-*{diff,patch}; do
476     [[ -e ${_f} ]] && PATCHES+=("${_f}")
477     done
478     fi
479     done
480 zlin 1.4 fi
481 zlin 1.8 [[ -n ${PATCHES[@]} ]] && base_src_unpack autopatch
482 zlin 1.4 }
483    
484     # @FUNCTION: kde4-base_src_unpack
485     # @DESCRIPTION:
486     # This function unpacks the source tarballs for KDE4 applications.
487     #
488     # If no argument is passed to this function, then standard src_unpack is
489     # executed. Otherwise options are passed to base_src_unpack.
490     #
491     # In addition it calls kde4-base_apply_patches when no arguments are passed to
492     # this function.
493 zlin 1.8 #
494     # It also handles translations if KDE_LINGUAS is defined. See KDE_LINGUAS and
495     # enable_selected_linguas() in kde4-functions.eclass(5) for further details.
496 ingmar 1.1 kde4-base_src_unpack() {
497     debug-print-function $FUNCNAME "$@"
498    
499     [[ -z "${KDE_S}" ]] && KDE_S="${S}"
500    
501     if [[ -z $* ]]; then
502     # Unpack first and deal with KDE patches after examing possible patch sets.
503     # To be picked up, patches need to conform to the guidelines stated before.
504     # Monolithic ebuilds will use the split ebuild patches.
505     [[ -d "${KDE_S}" ]] || unpack ${A}
506 zlin 1.4 kde4-base_apply_patches
507 ingmar 1.1 else
508     # Call base_src_unpack, which unpacks and patches
509     # step by step transparently as defined in the ebuild.
510     base_src_unpack $*
511     fi
512    
513     # Updated cmake dir
514     if [[ -d "${WORKDIR}/cmake" ]] && [[ -d "${KDE_S}/cmake" ]]; then
515     ebegin "Updating cmake/ directory..."
516     rm -rf "${KDE_S}/cmake" || die "Unable to remove old cmake/ directory"
517     ln -s "${WORKDIR}/cmake" "${KDE_S}/cmake" || die "Unable to symlink the new cmake/ directory"
518 philantrop 1.7 eend 0
519 ingmar 1.1 fi
520 zlin 1.8
521     # Only enable selected languages, used for KDE extragear apps.
522     if [[ -n ${KDE_LINGUAS} ]]; then
523     enable_selected_linguas
524     fi
525 ingmar 1.1 }
526    
527     # @FUNCTION: kde4-base_src_compile
528     # @DESCRIPTION:
529     # General function for compiling KDE4 applications.
530     kde4-base_src_compile() {
531     debug-print-function ${FUNCNAME} "$@"
532 jmbsvicetto 1.13 case "${EAPI}" in
533     2)
534     ;;
535     *)
536     kde4-base_src_configure
537     ;;
538     esac
539     if [[ -d ${WORKDIR}/${PN}_build ]]; then
540     pushd "${WORKDIR}"/${PN}_build > /dev/null
541     fi
542     [ -e [Mm]akefile ] && kde4-base_src_make
543 ingmar 1.1 }
544    
545     # @FUNCTION: kde4-base_src_configure
546     # @DESCRIPTION:
547     # Function for configuring the build of KDE4 applications.
548     kde4-base_src_configure() {
549     debug-print-function ${FUNCNAME} "$@"
550    
551     # Final flag handling
552     if has kdeenablefinal ${IUSE//+} && use kdeenablefinal; then
553 ingmar 1.5 echo "Activating enable-final flag"
554 ingmar 1.1 mycmakeargs="${mycmakeargs} -DKDE4_ENABLE_FINAL=ON"
555     fi
556    
557     # Enable generation of HTML handbook
558     if has htmlhandbook ${IUSE//+} && use htmlhandbook; then
559 ingmar 1.5 echo "Enabling building of HTML handbook"
560 ingmar 1.1 mycmakeargs="${mycmakeargs} -DKDE4_ENABLE_HTMLHANDBOOK=ON"
561     fi
562    
563     # Build tests in src_test only, where we override this value
564     mycmakeargs="${mycmakeargs} -DKDE4_BUILD_TESTS=OFF"
565    
566     # Set distribution name
567     [[ ${PN} == "kdelibs" ]] && mycmakeargs="${mycmakeargs} -DKDE_DISTRIBUTION_TEXT=Gentoo"
568    
569     # runpath linking
570     mycmakeargs="${mycmakeargs} -DKDE4_USE_ALWAYS_FULL_RPATH=ON"
571    
572     # Here we set the install prefix
573     mycmakeargs="${mycmakeargs} -DCMAKE_INSTALL_PREFIX=${PREFIX}"
574    
575 jmbsvicetto 1.13 # If prefix is /usr, sysconf needs to be /etc, not /usr/etc
576     [[ "${PREFIX}" == "/usr" ]] && mycmakeargs="${mycmakeargs} -DSYSCONF_INSTALL_DIR=/etc"
577    
578 ingmar 1.1 # Set environment
579     QTEST_COLORED=1
580     QT_PLUGIN_PATH=${KDEDIR}/$(get_libdir)/kde4/plugins/
581    
582 jmbsvicetto 1.13 # hardcode path to *.cmake KDE files
583     PKG_CONFIG_PATH="${PKG_CONFIG_PATH:+${PKG_CONFIG_PATH}:}${KDEDIR}/$(get_libdir)/pkgconfig"
584    
585     [ -e CMakeLists.txt ] && cmake-utils_src_configureout
586 ingmar 1.1 }
587    
588     # @FUNCTION: kde4-base_src_make
589     # @DESCRIPTION:
590     # Function for building KDE4 applications.
591     # Options are passed to cmake-utils_src_make.
592     kde4-base_src_make() {
593     debug-print-function ${FUNCNAME} "$@"
594    
595     cmake-utils_src_make "$@"
596     }
597    
598     # @FUNCTION: kde4-base_src_test
599     # @DESCRIPTION:
600     # Function for testing KDE4 applications.
601     kde4-base_src_test() {
602     debug-print-function ${FUNCNAME} "$@"
603    
604     # Override this value, set in kde4-base_src_configure()
605     mycmakeargs="${mycmakeargs} -DKDE4_BUILD_TESTS=ON"
606     cmake-utils_src_compile
607    
608     cmake-utils_src_test
609     }
610    
611     # @FUNCTION: kde4-base_src_install
612     # @DESCRIPTION:
613     # Function for installing KDE4 applications.
614     kde4-base_src_install() {
615     debug-print-function ${FUNCNAME} "$@"
616    
617     kde4-base_src_make_doc
618 jmbsvicetto 1.13 if [[ -d ${WORKDIR}/${PN}_build ]]; then
619     pushd "${WORKDIR}"/${PN}_build > /dev/null
620     fi
621     [ -e [Mm]akefile ] && cmake-utils_src_install
622 ingmar 1.1 }
623    
624     # @FUNCTION: kde4-base_src_make_doc
625     # @DESCRIPTION:
626     # Function for installing the documentation of KDE4 applications.
627     kde4-base_src_make_doc() {
628     debug-print-function ${FUNCNAME} "$@"
629    
630     local doc
631     for doc in AUTHORS ChangeLog* README* NEWS TODO; do
632     [[ -s $doc ]] && dodoc ${doc}
633     done
634    
635     if [[ -z ${KMNAME} ]]; then
636     for doc in {apps,runtime,workspace,.}/*/{AUTHORS,README*}; do
637     if [[ -s $doc ]]; then
638     local doc_complete=${doc}
639     doc="${doc#*/}"
640     newdoc "$doc_complete" "${doc%/*}.${doc##*/}"
641     fi
642     done
643     fi
644    
645     if [[ -n ${KDEBASE} && -d "${D}"/usr/share/doc/${PF} ]]; then
646     # work around bug #97196
647     dodir /usr/share/doc/kde && \
648     mv "${D}"/usr/share/doc/${PF} "${D}"/usr/share/doc/kde/ || \
649     die "Failed to move docs to kde/ failed."
650     fi
651     }
652    
653     # @FUNCTION: kde4-base_pkg_postinst
654     # @DESCRIPTION:
655     # Function to rebuild the KDE System Configuration Cache after an application has been installed.
656     kde4-base_pkg_postinst() {
657     buildsycoca
658     }
659    
660     # @FUNCTION: kde4-base_pkg_postrm
661     # @DESCRIPTION:
662     # Function to rebuild the KDE System Configuration Cache after an application has been removed.
663     kde4-base_pkg_postrm() {
664     buildsycoca
665     }

  ViewVC Help
Powered by ViewVC 1.1.20