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

Contents of /eclass/kde4-base.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.17 - (hide annotations) (download)
Fri Nov 21 17:06:03 2008 UTC (5 years, 8 months ago) by jmbsvicetto
Branch: MAIN
Changes since 1.16: +2 -1 lines
Added a block to x11-libs/qt-phonon.

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

  ViewVC Help
Powered by ViewVC 1.1.20