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

Contents of /eclass/kde4-base.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.14 - (show annotations) (download)
Sat Oct 4 14:51:02 2008 UTC (5 years, 6 months ago) by jmbsvicetto
Branch: MAIN
Changes since 1.13: +2 -1 lines
Added automoc to the kde4-base eclass DEPEND list.
Fixes bug #239526. Thanks to Andreas Eckstein for the reporting.

1 # Copyright 2007-2008 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/eclass/kde4-base.eclass,v 1.13 2008/10/02 06:49:02 jmbsvicetto Exp $
4
5 # @ECLASS: kde4-base.eclass
6 # @MAINTAINER:
7 # kde@gentoo.org
8 # @BLURB: This eclass provides functions for kde 4.X ebuilds
9 # @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 # and use deps from EAPI="2", hence you must define EAPI="2" in the ebuild,
15 # before inheriting any eclasses.
16
17 inherit base cmake-utils eutils kde4-functions multilib
18
19 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
28 # Set the qt dependencies
29 kde4-base_set_qt_dependencies() {
30 local qt qtcore qtgui qt3support qtdepend qtopengldepend
31
32 # use dependencies
33 case "${EAPI}" in
34 2 | 2_pre3 | 2_pre2 | 2_pre1)
35
36 qt="["
37 case "${OPENGL_REQUIRED}" in
38 always)
39 qt="${qt}opengl,"
40 ;;
41 optional)
42 qt="${qt}opengl?,"
43 ;;
44 esac
45 qt="${qt}accessibility,dbus,gif,jpeg,png,qt3support,ssl,zlib]"
46 qtcore="[qt3support,ssl]"
47 qtgui="[accessibility,dbus]"
48 qt3support="[accessibility]"
49 ;;
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 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
62 # allow monolithic qt for PV < 4.1
63 case "${PV}" in
64 scm|9999*|4.1*|4.0.9*|4.0.8*) : ;;
65 *)
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
87 COMMONDEPEND="${COMMONDEPEND} ${qtdepend}"
88 }
89 kde4-base_set_qt_dependencies
90
91 # 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 dev-util/pkgconfig
104 kde-base/automoc
105 x11-libs/libXt
106 x11-proto/xf86vidmodeproto"
107 RDEPEND="${RDEPEND} ${COMMONDEPEND}"
108
109 # 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 # @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 # @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 DEPEND="${DEPEND}
135 test? ( dev-util/cppunit )"
136 ;;
137 *)
138 CPPUNIT_REQUIRED="never"
139 ;;
140 esac
141
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 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 esac
188 _operator=">="
189 else
190 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 fi
197 ;;
198
199 # NEED_KDE=":${SLOT}"
200 :kde-svn)
201 _kdedir="svn"
202 _pv="-${NEED_KDE}"
203 export NEED_KDE="svn"
204 ;;
205 :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 *:kde-svn)
216 _kdedir="svn"
217 _operator=">="
218 _pv="-${NEED_KDE}"
219 export NEED_KDE="svn"
220 ;;
221 *:4.1)
222 _kdedir="4.1"
223 _operator=">="
224 _pv="-${NEED_KDE}"
225 ;;
226 *:kde-4)
227 _kdedir="4.0"
228 _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 ;;
244 4.0* | 4)
245 _kdedir="4.0"
246 _operator=">="
247 _pv="-${NEED_KDE}:kde-4"
248 ;;
249 3.9*)
250 _kdedir="3.9"
251 _operator=">="
252 _pv="-${NEED_KDE}:kde-4"
253 ;;
254
255 # The ebuild handles dependencies, KDEDIR, SLOT.
256 none)
257 :
258 ;;
259
260 *)
261 die "NEED_KDE=${NEED_KDE} currently not supported."
262 ;;
263 esac
264
265 if [[ ${NEED_KDE} != none ]]; then
266
267 #Set the SLOT
268 if [[ -n ${KDEBASE} ]]; then
269 if [[ ${NEED_KDE} = svn ]]; then
270 SLOT="kde-svn"
271 else
272 case ${PV} in
273 4.1* | 4.0.9* | 4.0.8*) SLOT="4.1" ;;
274 *) SLOT="kde-4" ;;
275 esac
276 fi
277 fi
278
279 # 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 # We only need to add the dependencies if ${PN} is not "kdelibs" or "kdepimlibs"
295 if [[ ${PN} != "kdelibs" ]]; then
296 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 if [[ ${PN} != "kdepimlibs" ]]; then
307 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 fi
317 fi
318
319 unset _operator _pv
320 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 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 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 # This value is set on pkg_setup
356 PREFIX=""
357
358 debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: SLOT ${SLOT} - NEED_KDE ${NEED_KDE}"
359
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 # 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
392 if [[ -n ${KDEBASE} ]]; then
393 PREFIX=${KDEDIR}
394 else
395 # if PREFIX is not defined we set it to the default value of /usr
396 PREFIX="${PREFIX:-/usr}"
397 fi
398
399 unset _kdedir
400
401 case "${EAPI}" in
402 2 | 2_pre3 | 2_pre2 | 2_pre1)
403 [[ -n ${QT4_BUILT_WITH_USE_CHECK} || -n ${KDE4_BUILT_WITH_USE_CHECK[@]} ]] && \
404 die "built_with_use illegal in this EAPI!"
405 ;;
406 *)
407 # Make KDE4_BUILT_WITH_USE_CHECK an array if it isn't already
408 local line kde4_built_with_use_check=()
409 if [[ -n ${KDE4_BUILT_WITH_USE_CHECK[@]} && $(declare -p KDE4_BUILT_WITH_USE_CHECK) != 'declare -a '* ]]; then
410 while read line; do
411 [[ -z ${line} ]] && continue
412 kde4_built_with_use_check+=("${line}")
413 done <<< "${KDE4_BUILT_WITH_USE_CHECK}"
414 KDE4_BUILT_WITH_USE_CHECK=("${kde4_built_with_use_check[@]}")
415 fi
416
417 # KDE4 applications require qt4 compiled with USE="accessibility dbus gif jpeg png qt3support ssl zlib".
418 if has_version '<x11-libs/qt-4.4_alpha:4'; then
419 QT4_BUILT_WITH_USE_CHECK="${QT4_BUILT_WITH_USE_CHECK} accessibility dbus gif jpeg png qt3support ssl zlib"
420 else
421 KDE4_BUILT_WITH_USE_CHECK=("${KDE4_BUILT_WITH_USE_CHECK[@]}"
422 "x11-libs/qt-core qt3support ssl"
423 "x11-libs/qt-gui accessibility dbus"
424 "x11-libs/qt-qt3support accessibility")
425 fi
426
427 if has opengl ${IUSE//+} && use opengl || [[ ${OPENGL_REQUIRED} == always ]]; then
428 if has_version '<x11-libs/qt-4.4.0_alpha:4'; then
429 QT4_BUILT_WITH_USE_CHECK="${QT4_BUILT_WITH_USE_CHECK} opengl"
430 fi
431 fi
432 kde4-functions_check_use
433 ;;
434 esac
435 }
436
437 # @FUNCTION: kde4-base_apply_patches
438 # @DESCRIPTION:
439 # This function applies patches.
440 #
441 # If the directory ${WORKDIR}/patches/ exists, we apply all patches in that
442 # directory, provided they follow this format:
443 # @CODE
444 # - Monolithic ebuilds, (from kde-base)
445 # - $CATEGORY=kde-base:
446 # Apply ${CHILD_EBUILD_NAME}-${SLOT}-*{diff,patch}
447 # - $CATEGORY=!kde-base:
448 # Apply ${CHILD_EBUILD_NAME}-${PV}-*{diff,patch}
449 # - Split ebuilds:
450 # - $CATEGORY=kde-base:
451 # Apply ${PN}-${SLOT}-*{diff,patch}
452 # - $CATEGORY!=kde-base:
453 # Apply ${PN}-${PV}-*{diff,patch}
454 # @CODE
455 #
456 # If ${PATCHES} is non-zero all patches in it get applied. If there is more
457 # than one patch please make ${PATCHES} an array for proper quoting.
458 kde4-base_apply_patches() {
459 local _patchdir _packages _p _f
460 _patchdir="${WORKDIR}/patches/"
461 if [[ -d "${_patchdir}" ]]; then
462 if is-parent-package ${CATEGORY}/${PN} ; then
463 _packages="$(get-child-packages ${CATEGORY}/${PN})"
464 _packages="${_packages//${CATEGORY}\//} ${PN}"
465 else
466 _packages="${PN}"
467 fi
468 if [[ $(declare -p PATCHES) != 'declare -a '* ]]; then
469 die "PATCHES needs to be an array!"
470 fi
471 for _p in ${_packages}; do
472 for _f in "${_patchdir}"/${_p}-${PV}-*{diff,patch}; do
473 [[ -e ${_f} ]] && PATCHES+=("${_f}")
474 done
475 if [[ -n "${KDEBASE}" ]]; then
476 for _f in "${_patchdir}"/${_p}-${SLOT}-*{diff,patch}; do
477 [[ -e ${_f} ]] && PATCHES+=("${_f}")
478 done
479 fi
480 done
481 fi
482 [[ -n ${PATCHES[@]} ]] && base_src_unpack autopatch
483 }
484
485 # @FUNCTION: kde4-base_src_unpack
486 # @DESCRIPTION:
487 # This function unpacks the source tarballs for KDE4 applications.
488 #
489 # If no argument is passed to this function, then standard src_unpack is
490 # executed. Otherwise options are passed to base_src_unpack.
491 #
492 # In addition it calls kde4-base_apply_patches when no arguments are passed to
493 # this function.
494 #
495 # It also handles translations if KDE_LINGUAS is defined. See KDE_LINGUAS and
496 # enable_selected_linguas() in kde4-functions.eclass(5) for further details.
497 kde4-base_src_unpack() {
498 debug-print-function $FUNCNAME "$@"
499
500 [[ -z "${KDE_S}" ]] && KDE_S="${S}"
501
502 if [[ -z $* ]]; then
503 # Unpack first and deal with KDE patches after examing possible patch sets.
504 # To be picked up, patches need to conform to the guidelines stated before.
505 # Monolithic ebuilds will use the split ebuild patches.
506 [[ -d "${KDE_S}" ]] || unpack ${A}
507 kde4-base_apply_patches
508 else
509 # Call base_src_unpack, which unpacks and patches
510 # step by step transparently as defined in the ebuild.
511 base_src_unpack $*
512 fi
513
514 # Updated cmake dir
515 if [[ -d "${WORKDIR}/cmake" ]] && [[ -d "${KDE_S}/cmake" ]]; then
516 ebegin "Updating cmake/ directory..."
517 rm -rf "${KDE_S}/cmake" || die "Unable to remove old cmake/ directory"
518 ln -s "${WORKDIR}/cmake" "${KDE_S}/cmake" || die "Unable to symlink the new cmake/ directory"
519 eend 0
520 fi
521
522 # Only enable selected languages, used for KDE extragear apps.
523 if [[ -n ${KDE_LINGUAS} ]]; then
524 enable_selected_linguas
525 fi
526 }
527
528 # @FUNCTION: kde4-base_src_compile
529 # @DESCRIPTION:
530 # General function for compiling KDE4 applications.
531 kde4-base_src_compile() {
532 debug-print-function ${FUNCNAME} "$@"
533 case "${EAPI}" in
534 2)
535 ;;
536 *)
537 kde4-base_src_configure
538 ;;
539 esac
540 if [[ -d ${WORKDIR}/${PN}_build ]]; then
541 pushd "${WORKDIR}"/${PN}_build > /dev/null
542 fi
543 [ -e [Mm]akefile ] && kde4-base_src_make
544 }
545
546 # @FUNCTION: kde4-base_src_configure
547 # @DESCRIPTION:
548 # Function for configuring the build of KDE4 applications.
549 kde4-base_src_configure() {
550 debug-print-function ${FUNCNAME} "$@"
551
552 # Final flag handling
553 if has kdeenablefinal ${IUSE//+} && use kdeenablefinal; then
554 echo "Activating enable-final flag"
555 mycmakeargs="${mycmakeargs} -DKDE4_ENABLE_FINAL=ON"
556 fi
557
558 # Enable generation of HTML handbook
559 if has htmlhandbook ${IUSE//+} && use htmlhandbook; then
560 echo "Enabling building of HTML handbook"
561 mycmakeargs="${mycmakeargs} -DKDE4_ENABLE_HTMLHANDBOOK=ON"
562 fi
563
564 # Build tests in src_test only, where we override this value
565 mycmakeargs="${mycmakeargs} -DKDE4_BUILD_TESTS=OFF"
566
567 # Set distribution name
568 [[ ${PN} == "kdelibs" ]] && mycmakeargs="${mycmakeargs} -DKDE_DISTRIBUTION_TEXT=Gentoo"
569
570 # runpath linking
571 mycmakeargs="${mycmakeargs} -DKDE4_USE_ALWAYS_FULL_RPATH=ON"
572
573 # Here we set the install prefix
574 mycmakeargs="${mycmakeargs} -DCMAKE_INSTALL_PREFIX=${PREFIX}"
575
576 # If prefix is /usr, sysconf needs to be /etc, not /usr/etc
577 [[ "${PREFIX}" == "/usr" ]] && mycmakeargs="${mycmakeargs} -DSYSCONF_INSTALL_DIR=/etc"
578
579 # Set environment
580 QTEST_COLORED=1
581 QT_PLUGIN_PATH=${KDEDIR}/$(get_libdir)/kde4/plugins/
582
583 # hardcode path to *.cmake KDE files
584 PKG_CONFIG_PATH="${PKG_CONFIG_PATH:+${PKG_CONFIG_PATH}:}${KDEDIR}/$(get_libdir)/pkgconfig"
585
586 [ -e CMakeLists.txt ] && cmake-utils_src_configureout
587 }
588
589 # @FUNCTION: kde4-base_src_make
590 # @DESCRIPTION:
591 # Function for building KDE4 applications.
592 # Options are passed to cmake-utils_src_make.
593 kde4-base_src_make() {
594 debug-print-function ${FUNCNAME} "$@"
595
596 cmake-utils_src_make "$@"
597 }
598
599 # @FUNCTION: kde4-base_src_test
600 # @DESCRIPTION:
601 # Function for testing KDE4 applications.
602 kde4-base_src_test() {
603 debug-print-function ${FUNCNAME} "$@"
604
605 # Override this value, set in kde4-base_src_configure()
606 mycmakeargs="${mycmakeargs} -DKDE4_BUILD_TESTS=ON"
607 cmake-utils_src_compile
608
609 cmake-utils_src_test
610 }
611
612 # @FUNCTION: kde4-base_src_install
613 # @DESCRIPTION:
614 # Function for installing KDE4 applications.
615 kde4-base_src_install() {
616 debug-print-function ${FUNCNAME} "$@"
617
618 kde4-base_src_make_doc
619 if [[ -d ${WORKDIR}/${PN}_build ]]; then
620 pushd "${WORKDIR}"/${PN}_build > /dev/null
621 fi
622 [ -e [Mm]akefile ] && cmake-utils_src_install
623 }
624
625 # @FUNCTION: kde4-base_src_make_doc
626 # @DESCRIPTION:
627 # Function for installing the documentation of KDE4 applications.
628 kde4-base_src_make_doc() {
629 debug-print-function ${FUNCNAME} "$@"
630
631 local doc
632 for doc in AUTHORS ChangeLog* README* NEWS TODO; do
633 [[ -s $doc ]] && dodoc ${doc}
634 done
635
636 if [[ -z ${KMNAME} ]]; then
637 for doc in {apps,runtime,workspace,.}/*/{AUTHORS,README*}; do
638 if [[ -s $doc ]]; then
639 local doc_complete=${doc}
640 doc="${doc#*/}"
641 newdoc "$doc_complete" "${doc%/*}.${doc##*/}"
642 fi
643 done
644 fi
645
646 if [[ -n ${KDEBASE} && -d "${D}"/usr/share/doc/${PF} ]]; then
647 # work around bug #97196
648 dodir /usr/share/doc/kde && \
649 mv "${D}"/usr/share/doc/${PF} "${D}"/usr/share/doc/kde/ || \
650 die "Failed to move docs to kde/ failed."
651 fi
652 }
653
654 # @FUNCTION: kde4-base_pkg_postinst
655 # @DESCRIPTION:
656 # Function to rebuild the KDE System Configuration Cache after an application has been installed.
657 kde4-base_pkg_postinst() {
658 buildsycoca
659 }
660
661 # @FUNCTION: kde4-base_pkg_postrm
662 # @DESCRIPTION:
663 # Function to rebuild the KDE System Configuration Cache after an application has been removed.
664 kde4-base_pkg_postrm() {
665 buildsycoca
666 }

  ViewVC Help
Powered by ViewVC 1.1.20