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.9 2008/04/06 21:36:53 zlin Exp $ |
4 |
|
5 |
# @ECLASS: kde4-base.eclass |
6 |
# @MAINTAINER: |
7 |
# kde@gentoo.org |
8 |
# @BLURB: This eclass provides functions for kde 4.0 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 |
# hence you must define EAPI="1" in the ebuild, before inheriting any eclasses. |
15 |
|
16 |
inherit base eutils multilib cmake-utils kde4-functions |
17 |
|
18 |
EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_test src_install pkg_postinst pkg_postrm |
19 |
|
20 |
kde4-base_set_qt_dependencies() { |
21 |
local qt qtcore qtgui qt3support qtsvg qttest qtopengl qtdepend qtopengldepend |
22 |
|
23 |
# use dependencies |
24 |
case "${EAPI}" in |
25 |
kdebuild-1) |
26 |
qt="[accessibility][dbus][debug?][gif][jpeg][png][qt3support][ssl][zlib]" |
27 |
qtcore="[debug?][qt3support][ssl]" |
28 |
qtgui="[accessibility][dbus][debug?]" |
29 |
qt3support="[accessibility][debug?]" |
30 |
qtsvg="[debug?]" |
31 |
qttest="[debug?]" |
32 |
qtopengl="[debug?]" |
33 |
case "${OPENGL_REQUIRED}" in |
34 |
always) |
35 |
qt="${qt}[opengl]" |
36 |
;; |
37 |
optional) |
38 |
qt="${qt}[opengl?]" |
39 |
;; |
40 |
esac |
41 |
;; |
42 |
esac |
43 |
|
44 |
# split qt |
45 |
qtdepend=" |
46 |
x11-libs/qt-core:4${qtcore} |
47 |
x11-libs/qt-gui:4${qtgui} |
48 |
x11-libs/qt-qt3support:4${qt3support} |
49 |
x11-libs/qt-svg:4${qtsvg} |
50 |
x11-libs/qt-test:4${qttest}" |
51 |
qtopengldepend="x11-libs/qt-opengl:4${qtopengl}" |
52 |
|
53 |
# allow monolithic qt for PV < 4.1 |
54 |
case "${PV}" in |
55 |
scm|9999.4|4.1*) : ;; |
56 |
*) |
57 |
qtdepend="|| ( ( ${qtdepend} ) >=x11-libs/qt-4.3.3:4${qt} )" |
58 |
qtopengldepend="|| ( ${qtopengldepend} >=x11-libs/qt-4.3.3:4 )" |
59 |
;; |
60 |
esac |
61 |
|
62 |
# opengl dependencies |
63 |
case "${OPENGL_REQUIRED}" in |
64 |
always) |
65 |
qtdepend="${qtdepend} |
66 |
${qtopengldepend}" |
67 |
;; |
68 |
optional) |
69 |
IUSE="${IUSE} opengl" |
70 |
qtdepend="${qtdepend} |
71 |
opengl? ( ${qtopengldepend} )" |
72 |
;; |
73 |
*) |
74 |
OPENGL_REQUIRED="never" |
75 |
;; |
76 |
esac |
77 |
|
78 |
COMMONDEPEND="${COMMONDEPEND} ${qtdepend}" |
79 |
} |
80 |
kde4-base_set_qt_dependencies |
81 |
|
82 |
DEPEND="${DEPEND} ${COMMONDEPEND} |
83 |
>=dev-util/cmake-2.4.7-r1 |
84 |
dev-util/pkgconfig |
85 |
x11-libs/libXt |
86 |
x11-proto/xf86vidmodeproto" |
87 |
RDEPEND="${RDEPEND} ${COMMONDEPEND}" |
88 |
|
89 |
# @ECLASS-VARIABLE: OPENGL_REQUIRED |
90 |
# @DESCRIPTION: |
91 |
# Is qt-opengl required? Possible values are 'always', 'optional' and 'never'. |
92 |
# This variable must be set before inheriting any eclasses. Defaults to 'never'. |
93 |
OPENGL_REQUIRED="${OPENGL_REQUIRED:-never}" |
94 |
|
95 |
# @ECLASS-VARIABLE: CPPUNIT_REQUIRED |
96 |
# @DESCRIPTION: |
97 |
# Is cppunit required for tests? Possible values are 'always', 'optional' and 'never'. |
98 |
# This variable must be set before inheriting any eclasses. Defaults to 'never'. |
99 |
CPPUNIT_REQUIRED="${CPPUNIT_REQUIRED:-never}" |
100 |
|
101 |
case "${CPPUNIT_REQUIRED}" in |
102 |
always) |
103 |
DEPEND="${DEPEND} dev-util/cppunit" |
104 |
;; |
105 |
optional) |
106 |
IUSE="${IUSE} test" |
107 |
DEPEND="${DEPEND} |
108 |
test? ( dev-util/cppunit )" |
109 |
;; |
110 |
*) |
111 |
CPPUNIT_REQUIRED="never" |
112 |
;; |
113 |
esac |
114 |
|
115 |
# @ECLASS-VARIABLE: NEED_KDE |
116 |
# @DESCRIPTION: |
117 |
# This variable sets the version of KDE4 which will be used by the eclass. |
118 |
# This variable must be set by the ebuild, for all categories except for "kde-base". |
119 |
# For kde-base packages, if it is not set by the ebuild, |
120 |
# it's assumed that the required KDE4 version is the latest, non-live, available. |
121 |
# |
122 |
# @CODE |
123 |
# Acceptable values are: |
124 |
# - latest - Use latest version in the portage tree |
125 |
# Default for kde-base ebuilds. Banned for ebuilds not part of kde or koffice. |
126 |
# - svn - Use svn release (live ebuilds) |
127 |
# - :SLOT - Use any version in the SLOT specified in the NEED_KDE value. |
128 |
# - VERSION_NUMBER - Use the minimum KDE4 version specified in the NEED_KDE value. |
129 |
# - VERSION_NUMBER:SLOT - Use the minimum KDE4 version and the SLOT specified in the NEED_KDE value. |
130 |
# - none - Let the ebuild handle SLOT, kde dependencies, KDEDIR, ... |
131 |
# @CODE |
132 |
# |
133 |
# Note: There is no default NEED_KDE for ebuilds not in kde-base or part of |
134 |
# koffice, so you must set it explicitly in the ebuild, in all other cases. |
135 |
if [[ -z ${NEED_KDE} ]]; then |
136 |
if [[ -n ${KDEBASE} ]]; then |
137 |
NEED_KDE="latest" |
138 |
else |
139 |
die "kde4-base.eclass inherited but NEED_KDE not defined - broken ebuild" |
140 |
fi |
141 |
fi |
142 |
export NEED_KDE |
143 |
|
144 |
case ${NEED_KDE} in |
145 |
latest) |
146 |
# Should only be used by 'kde-base'-ebuilds |
147 |
if [[ "${KDEBASE}" == "kde-base" ]]; then |
148 |
case ${PV} in |
149 |
3.9*) _kdedir="3.9" ;; |
150 |
4*) _kdedir="4.0" ;; |
151 |
*) die "NEED_KDE=latest not supported for PV=${PV}" ;; |
152 |
esac |
153 |
_operator=">=" |
154 |
_pv="-${PV}:kde-4" |
155 |
else |
156 |
_kdedir="4.0" |
157 |
_pv=":kde-4" |
158 |
fi |
159 |
;; |
160 |
scm|svn|9999*|:kde-svn) |
161 |
_kdedir="svn" |
162 |
_pv=":kde-svn" |
163 |
export NEED_KDE="svn" |
164 |
;; |
165 |
*:kde-svn) |
166 |
_kdedir="svn" |
167 |
_operator=">=" |
168 |
_pv="-${NEED_KDE}" |
169 |
export NEED_KDE="svn" |
170 |
;; |
171 |
# The ebuild handles dependencies, KDEDIR, SLOT. |
172 |
none) |
173 |
: |
174 |
;; |
175 |
# NEED_KDE=":${SLOT}" |
176 |
:kde-4) |
177 |
_kdedir="4.0" |
178 |
_pv="${NEED_KDE}" |
179 |
;; |
180 |
# NEED_KDE="${PV}:${SLOT}" |
181 |
*:kde-4) |
182 |
_kdedir="4.0" |
183 |
_operator=">=" |
184 |
_pv="-${NEED_KDE}" |
185 |
;; |
186 |
3.9*) |
187 |
_kdedir="3.9" |
188 |
_operator=">=" |
189 |
_pv="-${NEED_KDE}:kde-4" |
190 |
;; |
191 |
4*) |
192 |
_kdedir="4.0" |
193 |
_operator=">=" |
194 |
_pv="-${NEED_KDE}:kde-4" |
195 |
;; |
196 |
*) die "NEED_KDE=${NEED_KDE} currently not supported." |
197 |
;; |
198 |
esac |
199 |
|
200 |
if [[ ${NEED_KDE} != none ]]; then |
201 |
KDEDIR="/usr/kde/${_kdedir}" |
202 |
KDEDIRS="/usr:/usr/local:${KDEDIR}" |
203 |
|
204 |
if [[ -n ${KDEBASE} ]]; then |
205 |
if [[ ${NEED_KDE} = svn ]]; then |
206 |
SLOT="kde-svn" |
207 |
else |
208 |
SLOT="kde-4" |
209 |
fi |
210 |
fi |
211 |
|
212 |
# We only need to add the dependencies if ${PN} is not "kdelibs" or "kdepimlibs" |
213 |
if [[ ${PN} != "kdelibs" ]]; then |
214 |
DEPEND="${DEPEND} |
215 |
${_operator}kde-base/kdelibs${_pv}" |
216 |
RDEPEND="${RDEPEND} |
217 |
${_operator}kde-base/kdelibs${_pv}" |
218 |
if [[ ${PN} != "kdepimlibs" ]]; then |
219 |
DEPEND="${DEPEND} |
220 |
${_operator}kde-base/kdepimlibs${_pv}" |
221 |
RDEPEND="${RDEPEND} |
222 |
${_operator}kde-base/kdepimlibs${_pv}" |
223 |
fi |
224 |
fi |
225 |
|
226 |
unset _operator _pv _kdedir |
227 |
fi |
228 |
|
229 |
# Fetch section - If the ebuild's category is not 'kde-base' and if it is not a |
230 |
# koffice ebuild, the URI should be set in the ebuild itself |
231 |
if [[ -n ${KDEBASE} ]]; then |
232 |
if [[ -n ${KMNAME} ]]; then |
233 |
_kmname=${KMNAME} |
234 |
else |
235 |
_kmname=${PN} |
236 |
fi |
237 |
_kmname_pv="${_kmname}-${PV}" |
238 |
if [[ ${NEED_KDE} != "svn" ]]; then |
239 |
case ${KDEBASE} in |
240 |
kde-base) |
241 |
case ${PV} in |
242 |
*) SRC_URI="mirror://kde/stable/${PV}/src/${_kmname_pv}.tar.bz2";; |
243 |
esac |
244 |
;; |
245 |
koffice) |
246 |
SRC_URI="mirror://kde/unstable/${_kmname_pv}/src/${_kmname_pv}.tar.bz2" |
247 |
;; |
248 |
esac |
249 |
fi |
250 |
unset _kmname _kmname_pv |
251 |
fi |
252 |
|
253 |
debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: SRC_URI is ${SRC_URI}" |
254 |
debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: DEPEND ${DEPEND} - before blockers" |
255 |
|
256 |
# Monolithic ebuilds should add blockers for split ebuilds in the same slot. |
257 |
# If KMNAME is not set then this is not a split package |
258 |
if [[ -n ${KDEBASE} && -z ${KMNAME} ]]; then |
259 |
for _x in $(get-child-packages ${CATEGORY}/${PN}); do |
260 |
DEPEND="${DEPEND} !${_x}:${SLOT}" |
261 |
RDEPEND="${RDEPEND} !${_x}:${SLOT}" |
262 |
done |
263 |
unset _x |
264 |
fi |
265 |
|
266 |
debug-print "${BASH_SOURCE} ${LINENO} ${ECLASS} ${FUNCNAME}: DEPEND ${DEPEND} - after blockers" |
267 |
|
268 |
# @ECLASS-VARIABLE: PREFIX |
269 |
# @DESCRIPTION: |
270 |
# Set the installation PREFIX. All kde-base ebuilds go into the KDE4 installation directory. |
271 |
# Applications installed by the other ebuilds go into /usr/ by default, this value |
272 |
# can be superseded by defining PREFIX before inheriting kde4-base. |
273 |
if [[ -n ${KDEBASE} ]]; then |
274 |
PREFIX=${KDEDIR} |
275 |
else |
276 |
# if PREFIX is not defined we set it to the default value of /usr |
277 |
PREFIX="${PREFIX:-/usr}" |
278 |
fi |
279 |
|
280 |
debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: SLOT ${SLOT} - KDEDIR ${KDEDIR} - KDEDIRS ${KDEDIRS}- PREFIX ${PREFIX} - NEED_KDE ${NEED_KDE}" |
281 |
|
282 |
# @FUNCTION: kde4-base_pkg_setup |
283 |
# @DESCRIPTION: |
284 |
# Adds flags needed by all of KDE 4 to $QT4_BUILT_WITH_USE_CHECK. Uses |
285 |
# kde4-functions_check_use from kde4-functions.eclass to print appropriate |
286 |
# errors and die if any required flags listed in $QT4_BUILT_WITH_USE_CHECK or |
287 |
# $KDE4_BUILT_WITH_USE_CHECK are missing. |
288 |
kde4-base_pkg_setup() { |
289 |
debug-print-function $FUNCNAME "$@" |
290 |
|
291 |
case "${EAPI}" in |
292 |
kdebuild-1) |
293 |
[[ -n ${QT4_BUILT_WITH_USE_CHECK} || -n ${KDE4_BUILT_WITH_USE_CHECK} ]] && \ |
294 |
die "built_with_use illegal in this EAPI!" |
295 |
;; |
296 |
*) |
297 |
# KDE4 applications require qt4 compiled with USE="accessibility dbus gif jpeg png qt3support ssl zlib". |
298 |
if has_version '<x11-libs/qt-4.4_alpha:4'; then |
299 |
QT4_BUILT_WITH_USE_CHECK="${QT4_BUILT_WITH_USE_CHECK} accessibility dbus gif jpeg png qt3support ssl zlib" |
300 |
else |
301 |
KDE4_BUILT_WITH_USE_CHECK="${KDE4_BUILT_WITH_USE_CHECK} |
302 |
x11-libs/qt-core qt3support ssl |
303 |
x11-libs/qt-gui accessibility dbus |
304 |
x11-libs/qt-qt3support accessibility" |
305 |
fi |
306 |
|
307 |
if has debug ${IUSE//+} && use debug; then |
308 |
if has_version '<x11-libs/qt-4.4.0_alpha:4'; then |
309 |
QT4_BUILT_WITH_USE_CHECK="${QT4_BUILT_WITH_USE_CHECK} debug" |
310 |
else |
311 |
KDE4_BUILT_WITH_USE_CHECK="${KDE4_BUILT_WITH_USE_CHECK} |
312 |
x11-libs/qt-core:4 debug |
313 |
x11-libs/qt-gui:4 debug |
314 |
x11-libs/qt-qt3support:4 debug |
315 |
x11-libs/qt-svg:4 debug |
316 |
x11-libs/qt-test:4 debug" |
317 |
if has opengl ${IUSE//+} && use opengl || [[ ${OPENGL_REQUIRED} == always ]]; then |
318 |
KDE4_BUILT_WITH_USE_CHECK="${KDE4_BUILT_WITH_USE_CHECK} |
319 |
x11-libs/qt-opengl:4 debug" |
320 |
fi |
321 |
fi |
322 |
fi |
323 |
|
324 |
if has opengl ${IUSE//+} && use opengl || [[ ${OPENGL_REQUIRED} == always ]]; then |
325 |
if has_version '<x11-libs/qt-4.4.0_alpha:4'; then |
326 |
QT4_BUILT_WITH_USE_CHECK="${QT4_BUILT_WITH_USE_CHECK} opengl" |
327 |
fi |
328 |
fi |
329 |
kde4-functions_check_use |
330 |
;; |
331 |
esac |
332 |
} |
333 |
|
334 |
# @FUNCTION: kde4-base_apply_patches |
335 |
# @DESCRIPTION: |
336 |
# This function applies patches. |
337 |
# |
338 |
# If the directory ${WORKDIR}/patches/ exists, we apply all patches in that |
339 |
# directory, provided they follow this format: |
340 |
# @CODE |
341 |
# - Monolithic ebuilds, (from kde-base) |
342 |
# - $CATEGORY=kde-base: |
343 |
# Apply ${CHILD_EBUILD_NAME}-${SLOT}-*{diff,patch} |
344 |
# - $CATEGORY=!kde-base: |
345 |
# Apply ${CHILD_EBUILD_NAME}-${PV}-*{diff,patch} |
346 |
# - Split ebuilds: |
347 |
# - $CATEGORY=kde-base: |
348 |
# Apply ${PN}-${SLOT}-*{diff,patch} |
349 |
# - $CATEGORY!=kde-base: |
350 |
# Apply ${PN}-${PV}-*{diff,patch} |
351 |
# @CODE |
352 |
# |
353 |
# If ${PATCHES} is non-zero all patches in it get applied. If there is more |
354 |
# than one patch please make ${PATCHES} an array for proper quoting. |
355 |
kde4-base_apply_patches() { |
356 |
local _patchdir _packages _p _f |
357 |
_patchdir="${WORKDIR}/patches/" |
358 |
if [[ -d "${_patchdir}" ]]; then |
359 |
if is-parent-package ${CATEGORY}/${PN} ; then |
360 |
_packages="$(get-child-packages ${CATEGORY}/${PN})" |
361 |
_packages="${_packages//${CATEGORY}\//} ${PN}" |
362 |
else |
363 |
_packages="${PN}" |
364 |
fi |
365 |
if [[ $(declare -p PATCHES) != 'declare -a '* ]]; then |
366 |
PATCHES=(${PATCHES}) |
367 |
fi |
368 |
for _p in ${_packages}; do |
369 |
for _f in "${_patchdir}"/${_p}-${PV}-*{diff,patch}; do |
370 |
[[ -e ${_f} ]] && PATCHES+=("${_f}") |
371 |
done |
372 |
if [[ -n "${KDEBASE}" ]]; then |
373 |
for _f in "${_patchdir}"/${_p}-${SLOT}-*{diff,patch}; do |
374 |
[[ -e ${_f} ]] && PATCHES+=("${_f}") |
375 |
done |
376 |
fi |
377 |
done |
378 |
fi |
379 |
[[ -n ${PATCHES[@]} ]] && base_src_unpack autopatch |
380 |
} |
381 |
|
382 |
# @FUNCTION: kde4-base_src_unpack |
383 |
# @DESCRIPTION: |
384 |
# This function unpacks the source tarballs for KDE4 applications. |
385 |
# |
386 |
# If no argument is passed to this function, then standard src_unpack is |
387 |
# executed. Otherwise options are passed to base_src_unpack. |
388 |
# |
389 |
# In addition it calls kde4-base_apply_patches when no arguments are passed to |
390 |
# this function. |
391 |
# |
392 |
# It also handles translations if KDE_LINGUAS is defined. See KDE_LINGUAS and |
393 |
# enable_selected_linguas() in kde4-functions.eclass(5) for further details. |
394 |
kde4-base_src_unpack() { |
395 |
debug-print-function $FUNCNAME "$@" |
396 |
|
397 |
[[ -z "${KDE_S}" ]] && KDE_S="${S}" |
398 |
|
399 |
if [[ -z $* ]]; then |
400 |
# Unpack first and deal with KDE patches after examing possible patch sets. |
401 |
# To be picked up, patches need to conform to the guidelines stated before. |
402 |
# Monolithic ebuilds will use the split ebuild patches. |
403 |
[[ -d "${KDE_S}" ]] || unpack ${A} |
404 |
kde4-base_apply_patches |
405 |
else |
406 |
# Call base_src_unpack, which unpacks and patches |
407 |
# step by step transparently as defined in the ebuild. |
408 |
base_src_unpack $* |
409 |
fi |
410 |
|
411 |
# Updated cmake dir |
412 |
if [[ -d "${WORKDIR}/cmake" ]] && [[ -d "${KDE_S}/cmake" ]]; then |
413 |
ebegin "Updating cmake/ directory..." |
414 |
rm -rf "${KDE_S}/cmake" || die "Unable to remove old cmake/ directory" |
415 |
ln -s "${WORKDIR}/cmake" "${KDE_S}/cmake" || die "Unable to symlink the new cmake/ directory" |
416 |
eend 0 |
417 |
fi |
418 |
|
419 |
# Only enable selected languages, used for KDE extragear apps. |
420 |
if [[ -n ${KDE_LINGUAS} ]]; then |
421 |
enable_selected_linguas |
422 |
fi |
423 |
} |
424 |
|
425 |
# @FUNCTION: kde4-base_src_compile |
426 |
# @DESCRIPTION: |
427 |
# General function for compiling KDE4 applications. |
428 |
kde4-base_src_compile() { |
429 |
debug-print-function ${FUNCNAME} "$@" |
430 |
|
431 |
kde4-base_src_configure |
432 |
kde4-base_src_make |
433 |
} |
434 |
|
435 |
# @FUNCTION: kde4-base_src_configure |
436 |
# @DESCRIPTION: |
437 |
# Function for configuring the build of KDE4 applications. |
438 |
kde4-base_src_configure() { |
439 |
debug-print-function ${FUNCNAME} "$@" |
440 |
|
441 |
# Final flag handling |
442 |
if has kdeenablefinal ${IUSE//+} && use kdeenablefinal; then |
443 |
echo "Activating enable-final flag" |
444 |
mycmakeargs="${mycmakeargs} -DKDE4_ENABLE_FINAL=ON" |
445 |
fi |
446 |
|
447 |
# Enable generation of HTML handbook |
448 |
if has htmlhandbook ${IUSE//+} && use htmlhandbook; then |
449 |
echo "Enabling building of HTML handbook" |
450 |
mycmakeargs="${mycmakeargs} -DKDE4_ENABLE_HTMLHANDBOOK=ON" |
451 |
fi |
452 |
|
453 |
# Build tests in src_test only, where we override this value |
454 |
mycmakeargs="${mycmakeargs} -DKDE4_BUILD_TESTS=OFF" |
455 |
|
456 |
# Set distribution name |
457 |
[[ ${PN} == "kdelibs" ]] && mycmakeargs="${mycmakeargs} -DKDE_DISTRIBUTION_TEXT=Gentoo" |
458 |
|
459 |
# runpath linking |
460 |
mycmakeargs="${mycmakeargs} -DKDE4_USE_ALWAYS_FULL_RPATH=ON" |
461 |
|
462 |
# Here we set the install prefix |
463 |
mycmakeargs="${mycmakeargs} -DCMAKE_INSTALL_PREFIX=${PREFIX}" |
464 |
|
465 |
# Set environment |
466 |
QTEST_COLORED=1 |
467 |
QT_PLUGIN_PATH=${KDEDIR}/$(get_libdir)/kde4/plugins/ |
468 |
|
469 |
cmake-utils_src_configureout |
470 |
} |
471 |
|
472 |
# @FUNCTION: kde4-base_src_make |
473 |
# @DESCRIPTION: |
474 |
# Function for building KDE4 applications. |
475 |
# Options are passed to cmake-utils_src_make. |
476 |
kde4-base_src_make() { |
477 |
debug-print-function ${FUNCNAME} "$@" |
478 |
|
479 |
cmake-utils_src_make "$@" |
480 |
} |
481 |
|
482 |
# @FUNCTION: kde4-base_src_test |
483 |
# @DESCRIPTION: |
484 |
# Function for testing KDE4 applications. |
485 |
kde4-base_src_test() { |
486 |
debug-print-function ${FUNCNAME} "$@" |
487 |
|
488 |
# Override this value, set in kde4-base_src_configure() |
489 |
mycmakeargs="${mycmakeargs} -DKDE4_BUILD_TESTS=ON" |
490 |
cmake-utils_src_compile |
491 |
|
492 |
cmake-utils_src_test |
493 |
} |
494 |
|
495 |
# @FUNCTION: kde4-base_src_install |
496 |
# @DESCRIPTION: |
497 |
# Function for installing KDE4 applications. |
498 |
kde4-base_src_install() { |
499 |
debug-print-function ${FUNCNAME} "$@" |
500 |
|
501 |
kde4-base_src_make_doc |
502 |
cmake-utils_src_install |
503 |
} |
504 |
|
505 |
# @FUNCTION: kde4-base_src_make_doc |
506 |
# @DESCRIPTION: |
507 |
# Function for installing the documentation of KDE4 applications. |
508 |
kde4-base_src_make_doc() { |
509 |
debug-print-function ${FUNCNAME} "$@" |
510 |
|
511 |
local doc |
512 |
for doc in AUTHORS ChangeLog* README* NEWS TODO; do |
513 |
[[ -s $doc ]] && dodoc ${doc} |
514 |
done |
515 |
|
516 |
if [[ -z ${KMNAME} ]]; then |
517 |
for doc in {apps,runtime,workspace,.}/*/{AUTHORS,README*}; do |
518 |
if [[ -s $doc ]]; then |
519 |
local doc_complete=${doc} |
520 |
doc="${doc#*/}" |
521 |
newdoc "$doc_complete" "${doc%/*}.${doc##*/}" |
522 |
fi |
523 |
done |
524 |
fi |
525 |
|
526 |
if [[ -n ${KDEBASE} && -d "${D}"/usr/share/doc/${PF} ]]; then |
527 |
# work around bug #97196 |
528 |
dodir /usr/share/doc/kde && \ |
529 |
mv "${D}"/usr/share/doc/${PF} "${D}"/usr/share/doc/kde/ || \ |
530 |
die "Failed to move docs to kde/ failed." |
531 |
fi |
532 |
} |
533 |
|
534 |
# @FUNCTION: kde4-base_pkg_postinst |
535 |
# @DESCRIPTION: |
536 |
# Function to rebuild the KDE System Configuration Cache after an application has been installed. |
537 |
kde4-base_pkg_postinst() { |
538 |
buildsycoca |
539 |
} |
540 |
|
541 |
# @FUNCTION: kde4-base_pkg_postrm |
542 |
# @DESCRIPTION: |
543 |
# Function to rebuild the KDE System Configuration Cache after an application has been removed. |
544 |
kde4-base_pkg_postrm() { |
545 |
buildsycoca |
546 |
} |