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

Contents of /eclass/kde4-meta.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.29 - (show annotations) (download)
Wed Dec 2 17:07:05 2009 UTC (6 years, 9 months ago) by abcd
Branch: MAIN
Changes since 1.28: +6 -1 lines
Update kde4 eclasses from overlay

1 # Copyright 1999-2009 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/eclass/kde4-meta.eclass,v 1.18 2009/05/09 13:23:15 scarabeus Exp $
4 #
5 # @ECLASS: kde4-meta.eclass
6 # @MAINTAINER:
7 # kde@gentoo.org
8 # @BLURB: Eclass for writing "split" KDE packages.
9 # @DESCRIPTION:
10 # This eclass provides all necessary functions for writing split KDE ebuilds.
11 #
12 # You must define KMNAME to use this eclass, and do so before inheriting it. All other variables are optional.
13 # Do not include the same item in more than one of KMMODULE, KMMEXTRA, KMCOMPILEONLY, KMEXTRACTONLY.
14
15 inherit kde4-base versionator
16
17 EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare src_configure src_compile src_test src_install pkg_postinst pkg_postrm
18
19 if [[ -z ${KMNAME} ]]; then
20 die "kde4-meta.eclass inherited but KMNAME not defined - broken ebuild"
21 fi
22
23 # Add khelpcenter dependency when installing handbooks
24 if [[ ${PN} != khelpcenter ]] && has handbook ${IUSE//+}; then
25 RDEPEND+=" handbook? ( $(add_kdebase_dep khelpcenter) )"
26 fi
27
28 # Add dependencies that all packages in a certain module share.
29 case ${KMNAME} in
30 kdebase|kdebase-apps|kdebase-workspace|kdebase-runtime|kdegraphics)
31 COMMONDEPEND+=" >=kde-base/qimageblitz-0.0.4"
32 ;;
33 kdepim|kdepim-runtime)
34 COMMONDEPEND+=" $(add_kdebase_dep kdepimlibs)"
35 case ${PN} in
36 akregator|kaddressbook|kjots|kmail|knode|knotes|korganizer|ktimetracker)
37 IUSE+=" +kontact"
38 if ! slot_is_at_least 4.4 ${SLOT} || [[ ${SLOT} == 4.4 && ${PV} < 4.3.68 ]]; then
39 RDEPEND+=" kontact? ( $(add_kdebase_dep kontactinterfaces) )"
40 fi
41 ;;
42 esac
43 ;;
44 kdegames)
45 if [[ ${PN} != libkdegames ]]; then
46 COMMONDEPEND+=" $(add_kdebase_dep libkdegames)"
47 fi
48 ;;
49 koffice)
50 [[ ${PN} != koffice-data ]] && IUSE+=" debug"
51 RDEPEND+="
52 !app-office/${PN}:0
53 !app-office/koffice:0
54 !app-office/koffice-meta:0
55 "
56 if has openexr ${IUSE//+}; then
57 COMMONDEPEND+=" media-gfx/imagemagick[openexr?]"
58 else
59 COMMONDEPEND+=" media-gfx/imagemagick"
60 fi
61
62 COMMONDEPEND+="
63 dev-cpp/eigen:2
64 media-libs/fontconfig
65 media-libs/freetype:2
66 "
67 if [[ ${PN} != koffice-libs && ${PN} != koffice-data ]]; then
68 COMMONDEPEND+=" >=app-office/koffice-libs-${PV}:${SLOT}"
69 fi
70 ;;
71 esac
72
73 DEPEND+=" ${COMMONDEPEND}"
74 RDEPEND+=" ${COMMONDEPEND}"
75 unset COMMONDEPEND
76
77 debug-print "line ${LINENO} ${ECLASS}: DEPEND ${DEPEND} - after metapackage-specific dependencies"
78 debug-print "line ${LINENO} ${ECLASS}: RDEPEND ${RDEPEND} - after metapackage-specific dependencies"
79
80 # Useful to build kde4-meta style stuff from extragear/playground (plasmoids etc)
81 case ${BUILD_TYPE} in
82 live)
83 case ${KMNAME} in
84 extragear*|playground*)
85 ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}"
86 ESVN_PROJECT="${KMNAME}${ESVN_PROJECT_SUFFIX}"
87 ;;
88 esac
89 ;;
90 esac
91
92 # @ECLASS-VARIABLE: KMNAME
93 # @DESCRIPTION:
94 # Name of the parent-module (e.g. kdebase, kdepim, ...). You _must_ set it
95 # _before_ inheriting this eclass, (unlike the other parameters), since it's
96 # used to set $SRC_URI.
97
98 # @ECLASS-VARIABLE: KMMODULE
99 # @DESCRIPTION:
100 # Specify exactly one subdirectory of $KMNAME here. Defaults to $PN.
101 # The subdirectory listed here is treated exactly like items in $KMEXTRA.
102 #
103 # Example: The ebuild name of "kdebase/l10n" is kde-base/kdebase-l10n, because
104 # just 'l10n' would be too confusing. Hence it sets KMMODULE="l10n".
105
106 # @ECLASS-VARIABLE: KMNOMODULE
107 # @DESCRIPTION:
108 # If set to "true", $KMMODULE doesn't have to be defined.
109 #
110 # Example usage: If you're installing subdirectories of a package, like plugins,
111 # you mark the top subdirectory (containing the package) as $KMEXTRACTONLY, and
112 # set KMNOMODULE="true".
113 if [[ -z ${KMMODULE} && ${KMNOMODULE} != true ]]; then
114 KMMODULE=${PN}
115 fi
116
117 # @ECLASS-VARIABLE: KMEXTRA
118 # @DESCRIPTION:
119 # All subdirectories listed here will be extracted, compiled & installed.
120 # $KMMODULE is always added to $KMEXTRA.
121 # If the handbook USE-flag is set, and if this directory exists,
122 # then "doc/$KMMODULE" is added to $KMEXTRA. In other cases, this should be
123 # handled in the ebuild.
124 # If the documentation is in a different subdirectory, you should add it to KMEXTRA.
125
126 # @ECLASS-VARIABLE: KMCOMPILEONLY
127 # @DESCRIPTION:
128 # All subdirectories listed here will be extracted & compiled, but not installed.
129
130 # TODO: better formulation may be needed
131 # @ECLASS-VARIABLE: KMEXTRACTONLY
132 # @DESCRIPTION:
133 # All subdirectories listed here will be extracted, but neither compiled nor installed.
134 # This can be used to avoid compilation in a subdirectory of a directory in $KMMODULE or $KMEXTRA
135
136 # @ECLASS-VARIABLE: KMTARPARAMS
137 # @DESCRIPTION:
138 # Specify extra parameters to pass to tar, in kde4-meta_src_extract.
139 # '-xpf -j' are passed to tar by default.
140
141 # @FUNCTION: kde4-meta_pkg_setup
142 # @DESCRIPTION:
143 # Currently just calls its equivalent in kde4-base.eclass(5). Use this one in
144 # split ebuilds.
145 kde4-meta_pkg_setup() {
146 debug-print-function ${FUNCNAME} "$@"
147
148 kde4-base_pkg_setup
149 }
150
151 # @FUNCTION: kde4-meta_src_unpack
152 # @DESCRIPTION:
153 # This function unpacks the source for split ebuilds. See also
154 # kde4-meta-src_extract.
155 kde4-meta_src_unpack() {
156 debug-print-function ${FUNCNAME} "$@"
157
158 if [[ ${BUILD_TYPE} = live ]]; then
159 migrate_store_dir
160 S="${WORKDIR}/${P}"
161 mkdir -p "${S}"
162 ESVN_RESTRICT="export" subversion_src_unpack
163 subversion_wc_info
164 subversion_bootstrap
165 kde4-meta_src_extract
166 else
167 kde4-meta_src_extract
168 fi
169 }
170
171 # FIXME: the difference between kde4-meta_src_extract and kde4-meta_src_unpack?
172
173 # @FUNCTION: kde4-meta_src_extract
174 # @DESCRIPTION:
175 # A function to unpack the source for a split KDE ebuild.
176 # Also see KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY, KMEXTRACTONLY and
177 # KMTARPARAMS.
178 kde4-meta_src_extract() {
179 debug-print-function ${FUNCNAME} "$@"
180
181 if [[ ${BUILD_TYPE} = live ]]; then
182 local rsync_options subdir kmnamedir targetdir
183 # Export working copy to ${S}
184 einfo "Exporting parts of working copy to ${S}"
185 kde4-meta_create_extractlists
186
187 rsync_options="--group --links --owner --perms --quiet --exclude=.svn/"
188
189 # Copy ${KMNAME} non-recursively (toplevel files)
190 rsync ${rsync_options} "${ESVN_WC_PATH}"/${kmnamedir}* "${S}" \
191 || die "${ESVN}: can't export toplevel files to '${S}'."
192 # Copy cmake directory
193 if [[ -d "${ESVN_WC_PATH}/${kmnamedir}cmake" ]]; then
194 rsync --recursive ${rsync_options} "${ESVN_WC_PATH}/${kmnamedir}cmake" "${S}" \
195 || die "${ESVN}: can't export cmake files to '${S}'."
196 fi
197 # Copy all subdirectories
198 for subdir in $(__list_needed_subdirectories); do
199 targetdir=""
200 if [[ $subdir = doc/* && ! -e "$ESVN_WC_PATH/$kmnamedir$subdir" ]]; then
201 continue
202 fi
203
204 [[ ${subdir%/} = */* ]] && targetdir=${subdir%/} && targetdir=${targetdir%/*} && mkdir -p "${S}/${targetdir}"
205 rsync --recursive ${rsync_options} "${ESVN_WC_PATH}/${kmnamedir}${subdir%/}" "${S}/${targetdir}" \
206 || die "${ESVN}: can't export subdirectory '${subdir}' to '${S}/${targetdir}'."
207 done
208
209 if [[ ${KMNAME} = kdebase-runtime && ${PN} != kdebase-data ]]; then
210 sed -i -e '/^install(PROGRAMS[[:space:]]*[^[:space:]]*\/kde4[[:space:]]/s/^/#DONOTINSTALL /' \
211 "${S}"/CMakeLists.txt || die "Sed to exclude bin/kde4 failed"
212 fi
213 else
214 local abort tarball tarfile f extractlist moduleprefix postfix
215 case ${PV} in
216 4.3.8[05] | 4.3.9[0568])
217 # block for normally packed upstream unstable snapshots
218 KMTARPARAMS+=" --bzip2" # bz2
219 postfix="bz2"
220 ;;
221 4.3.[6-9]*)
222 # Not passing --xz, as it doesn't work with stable tar
223 KMTARPARAMS+=" --use-compress-program=xz" # xz
224 postfix="xz"
225 ;;
226 *)
227 KMTARPARAMS+=" --bzip2" # bz2
228 postfix="bz2"
229 ;;
230 esac
231 case ${KMNAME} in
232 kdebase-apps)
233 # kdebase/apps -> kdebase-apps
234 tarball="kdebase-${PV}.tar.${postfix}"
235 # Go one level deeper for kdebase-apps in tarballs
236 moduleprefix=apps/
237 KMTARPARAMS+=" --transform=s|apps/||"
238 ;;
239 *)
240 # Create tarball name from module name (this is the default)
241 tarball="${KMNAME}-${PV}.tar.${postfix}"
242 ;;
243 esac
244
245 # Full path to source tarball
246 tarfile="${DISTDIR}/${tarball}"
247
248 # Detect real toplevel dir from tarball name - it will be used upon extraction
249 # and in __list_needed_subdirectories
250 topdir="${tarball%.tar.*}/"
251
252 ebegin "Unpacking parts of ${tarball} to ${WORKDIR}"
253
254 kde4-meta_create_extractlists
255
256 for f in cmake/ CMakeLists.txt ConfigureChecks.cmake config.h.cmake \
257 AUTHORS COPYING INSTALL README NEWS ChangeLog
258 do
259 extractlist+=" ${topdir}${moduleprefix}${f}"
260 done
261 extractlist+=" $(__list_needed_subdirectories)"
262
263 pushd "${WORKDIR}" > /dev/null
264 [[ -n ${KDE4_STRICTER} ]] && echo tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} >&2
265 tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} 2> /dev/null
266
267 # Default $S is based on $P; rename the extracted directory to match $S if necessary
268 mv ${topdir} ${P} || die "Died while moving \"${topdir}\" to \"${P}\""
269
270 popd > /dev/null
271
272 eend $?
273
274 # We need to clear it here to make verification below work
275 unset moduleprefix
276
277 if [[ -n ${KDE4_STRICTER} ]]; then
278 for f in $(__list_needed_subdirectories fatal); do
279 if [[ ! -e "${S}/${f#*/}" ]]; then
280 eerror "'${f#*/}' is missing"
281 abort=true
282 fi
283 done
284 [[ -n ${abort} ]] && die "There were missing files."
285 fi
286
287 # We don't need it anymore
288 unset topdir
289 fi
290 }
291
292 # @FUNCTION: kde4-meta_create_extractlists
293 # @DESCRIPTION:
294 # Create lists of files and subdirectories to extract.
295 # Also see descriptions of KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY,
296 # KMEXTRACTONLY and KMTARPARAMS.
297 kde4-meta_create_extractlists() {
298 debug-print-function ${FUNCNAME} "$@"
299
300 # TODO change to KMEXTRA for more strict check
301 if has handbook ${IUSE//+} && use handbook && [[ -n ${KMMODULE} ]]; then
302 # We use the basename of $KMMODULE because $KMMODULE can contain
303 # the path to the module subdirectory.
304 KMEXTRA_NONFATAL+="
305 doc/${KMMODULE##*/}"
306 fi
307
308 # Add some CMake-files to KMEXTRACTONLY.
309 # Note that this actually doesn't include KMEXTRA handling.
310 # In those cases you should care to add the relevant files to KMEXTRACTONLY
311 case ${KMNAME} in
312 kdebase)
313 KMEXTRACTONLY+="
314 apps/config-apps.h.cmake
315 apps/ConfigureChecks.cmake"
316 ;;
317 kdebase-apps)
318 KMEXTRACTONLY+="
319 config-apps.h.cmake
320 ConfigureChecks.cmake"
321 ;;
322 kdebase-runtime)
323 KMEXTRACTONLY+="
324 config-runtime.h.cmake"
325 ;;
326 kdebase-workspace)
327 KMEXTRACTONLY+="
328 config-unix.h.cmake
329 ConfigureChecks.cmake
330 config-workspace.h.cmake
331 config-X11.h.cmake
332 startkde.cmake
333 KDE4WorkspaceConfig.cmake.in"
334 ;;
335 kdegames)
336 if [[ ${PN} != libkdegames ]]; then
337 KMEXTRACTONLY+="
338 libkdegames/"
339 fi
340 ;;
341 kdepim)
342 if [[ ${PN} != libkdepim ]]; then
343 KMEXTRACTONLY+="
344 libkdepim/"
345 fi
346 case ${SLOT} in
347 4.3|4.4|live)
348 KMEXTRACTONLY+="
349 kdepim-version.h
350 config-enterprise.h.cmake"
351 ;;
352 esac
353 KMEXTRACTONLY+="
354 kleopatra/ConfigureChecks.cmake"
355 if has kontact ${IUSE//+} && use kontact; then
356 KMEXTRA+="
357 kontact/plugins/${PLUGINNAME:-${PN}}/"
358 if ! slot_is_at_least 4.4 ${SLOT} || [[ ${SLOT} == 4.4 && ${PV} < 4.3.68 ]]; then
359 KMEXTRACTONLY+="
360 kontactinterfaces/"
361 fi
362 fi
363 ;;
364 kdeutils)
365 case ${SLOT} in
366 4.3|4.4|live)
367 KMEXTRACTONLY+="
368 kdeutils-version.h"
369 ;;
370 esac
371 ;;
372 koffice)
373 KMEXTRACTONLY+="
374 config-endian.h.cmake
375 filters/config-filters.h.cmake
376 config-openexr.h.cmake
377 config-opengl.h.cmake
378 config-prefix.h.cmake
379 "
380 case ${PV} in
381 2.0.*)
382 KMEXTRACTONLY+="
383 config-openctl.h.cmake"
384 ;;
385 esac
386 ;;
387 esac
388 # Don't install cmake modules for split ebuilds, to avoid collisions.
389 case ${KMNAME} in
390 kdepim)
391 # No need for unpack since 4.2.86
392 # Remove when 4.2 is wiped out from the tree
393 case ${PV} in
394 4.2.[0-4])
395 KMCOMPILEONLY+="
396 cmake/modules/"
397 ;;
398 esac
399 ;;
400 kdebase-runtime|kdebase-workspace|kdeedu|kdegames|kdegraphics)
401 case ${PN} in
402 libkdegames|libkdeedu|libkworkspace)
403 KMEXTRA+="
404 cmake/modules/"
405 ;;
406 *)
407 KMCOMPILEONLY+="
408 cmake/modules/"
409 ;;
410 esac
411 ;;
412 esac
413
414 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME}: KMEXTRACTONLY ${KMEXTRACTONLY}"
415 }
416
417 __list_needed_subdirectories() {
418 local i j kmextra kmextra_expanded kmmodule_expanded kmcompileonly_expanded extractlist
419
420 # We expand KMEXTRA by adding CMakeLists.txt files
421 kmextra="${KMEXTRA}"
422 [[ ${1} != fatal ]] && kmextra+=" ${KMEXTRA_NONFATAL}"
423 for i in ${kmextra}; do
424 kmextra_expanded+=" ${i}"
425 j=$(dirname ${i})
426 while [[ ${j} != "." ]]; do
427 kmextra_expanded+=" ${j}/CMakeLists.txt";
428 j=$(dirname ${j})
429 done
430 done
431
432 # Expand KMMODULE
433 if [[ -n ${KMMODULE} ]]; then
434 kmmodule_expanded="${KMMODULE}"
435 j=$(dirname ${KMMODULE})
436 while [[ ${j} != "." ]]; do
437 kmmodule_expanded+=" ${j}/CMakeLists.txt";
438 j=$(dirname ${j})
439 done
440 fi
441
442 # Expand KMCOMPILEONLY
443 for i in ${KMCOMPILEONLY}; do
444 kmcompileonly_expanded+=" ${i}"
445 j=$(dirname ${i})
446 while [[ ${j} != "." ]]; do
447 kmcompileonly_expanded+=" ${j}/CMakeLists.txt";
448 j=$(dirname ${j})
449 done
450 done
451
452 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmextra_expanded: ${kmextra_expanded}"
453 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmmodule_expanded: ${kmmodule_expanded}"
454 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmcompileonly_expanded: ${kmcompileonly_expanded}"
455
456 # Create final list of stuff to extract
457 # We append topdir only when specified (usually for tarballs)
458 for i in ${kmmodule_expanded} ${kmextra_expanded} ${kmcompileonly_expanded} \
459 ${KMEXTRACTONLY}
460 do
461 extractlist+=" ${topdir}${moduleprefix}${i}"
462 done
463
464 echo ${extractlist}
465 }
466
467 # @FUNCTION: kde4-meta_src_prepare
468 # @DESCRIPTION:
469 # Meta-package build system configuration handling - commenting out targets, etc..
470 kde4-meta_src_prepare() {
471 debug-print-function ${FUNCNAME} "$@"
472
473 kde4-meta_change_cmakelists
474 kde4-base_src_prepare
475 }
476
477 # FIXME: no comment here?
478 _change_cmakelists_parent_dirs() {
479 debug-print-function ${FUNCNAME} "$@"
480
481 local _olddir _dir
482 _dir="${S}"/${1}
483 until [[ ${_dir} == "${S}" ]]; do
484 _olddir=$(basename "${_dir}")
485 _dir=$(dirname "${_dir}")
486 debug-print "${LINENO}: processing ${_dir} CMakeLists.txt searching for ${_olddir}"
487 if [[ -f ${_dir}/CMakeLists.txt ]]; then
488 sed -e "/add_subdirectory[[:space:]]*([[:space:]]*${_olddir}[[:space:]]*)/s/#DONOTCOMPILE //g" \
489 -e "/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*${_olddir}[[:space:]]*)/s/#DONOTCOMPILE //g" \
490 -i ${_dir}/CMakeLists.txt || die "${LINENO}: died in ${FUNCNAME} while processing ${_dir}"
491 fi
492 done
493 }
494
495 # FIXME: add description
496 # @FUNCTION: kde4-meta_change_cmakelists
497 # @DESCRIPTION:
498 kde4-meta_change_cmakelists() {
499 debug-print-function ${FUNCNAME} "$@"
500
501 pushd "${S}" > /dev/null
502
503 comment_all_add_subdirectory ./
504
505 # Restore "add_subdirectory( cmake )" in ${S}/CMakeLists.txt
506 if [[ -f CMakeLists.txt ]]; then
507 sed -e '/add_subdirectory[[:space:]]*([[:space:]]*cmake[[:space:]]*)/s/^#DONOTCOMPILE //' \
508 -e '/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*cmake[[:space:]]*)/s/^#DONOTCOMPILE //' \
509 -i CMakeLists.txt || die "${LINENO}: cmake sed died"
510 fi
511
512 if [[ -z ${KMNOMODULE} ]]; then
513 # Restore "add_subdirectory" in $KMMODULE subdirectories
514 find "${S}"/${KMMODULE} -name CMakeLists.txt -print0 | \
515 xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \
516 die "${LINENO}: died in KMMODULE section"
517 _change_cmakelists_parent_dirs ${KMMODULE}
518 fi
519
520 local i
521
522 # KMEXTRACTONLY section - Some ebuilds need to comment out some subdirs in KMMODULE and they use KMEXTRACTONLY
523 for i in ${KMEXTRACTONLY}; do
524 if [[ -d ${i} && -f ${i}/../CMakeLists.txt ]]; then
525 sed -e "/([[:space:]]*$(basename $i)[[:space:]]*)/s/^/#DONOTCOMPILE /" \
526 -i ${i}/../CMakeLists.txt || \
527 die "${LINENO}: sed died while working in the KMEXTRACTONLY section while processing ${i}"
528 fi
529 done
530
531 # KMCOMPILEONLY
532 for i in ${KMCOMPILEONLY}; do
533 debug-print "${LINENO}: KMCOMPILEONLY, processing ${i}"
534 # Uncomment "add_subdirectory" instructions inside $KMCOMPILEONLY, then comment "install" instructions.
535 find "${S}"/${i} -name CMakeLists.txt -print0 | \
536 xargs -0 sed -i \
537 -e 's/^#DONOTCOMPILE //g' \
538 -e '/install(.*)/{s/^/#DONOTINSTALL /;}' \
539 -e '/^install(/,/)/{s/^/#DONOTINSTALL /;}' \
540 -e '/kde4_install_icons(.*)/{s/^/#DONOTINSTALL /;}' || \
541 die "${LINENO}: sed died in the KMCOMPILEONLY section while processing ${i}"
542 _change_cmakelists_parent_dirs ${i}
543 done
544
545 # KMEXTRA section
546 for i in ${KMEXTRA}; do
547 debug-print "${LINENO}: KMEXTRA section, processing ${i}"
548 find "${S}"/${i} -name CMakeLists.txt -print0 | \
549 xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \
550 die "${LINENO}: sed died uncommenting add_subdirectory instructions in KMEXTRA section while processing ${i}"
551 _change_cmakelists_parent_dirs ${i}
552 done
553 # KMEXTRA_NONFATAL section
554 for i in ${KMEXTRA_NONFATAL}; do
555 if [[ -d "${S}"/${i} ]]; then
556 find "${S}"/${i} -name CMakeLists.txt -print0 | \
557 xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \
558 die "${LINENO}: sed died uncommenting add_subdirectory instructions in KMEXTRA section while processing ${i}"
559 _change_cmakelists_parent_dirs ${i}
560 fi
561 done
562
563 case ${KMNAME} in
564 kdebase-workspace)
565 # COLLISION PROTECT section
566 # Install the startkde script just once, as a part of kde-base/kdebase-startkde,
567 # not as a part of every package.
568 if [[ ${PN} != kdebase-startkde && -f CMakeLists.txt ]]; then
569 # The startkde script moved to kdebase-workspace for KDE4 versions > 3.93.0.
570 sed -e '/startkde/s/^/#DONOTINSTALL /' \
571 -i CMakeLists.txt || die "${LINENO}: sed died in the kdebase-startkde collision prevention section"
572 fi
573 # Strip EXPORT feature section from workspace for KDE4 versions > 4.1.82
574 if [[ ${PN} != libkworkspace ]]; then
575 sed -e '/install(FILES ${CMAKE_CURRENT_BINARY_DIR}\/KDE4WorkspaceConfig.cmake/,/^[[:space:]]*FILE KDE4WorkspaceLibraryTargets.cmake )[[:space:]]*^/d' \
576 -i CMakeLists.txt || die "${LINENO}: sed died in kdebase-workspace strip config install and fix EXPORT section"
577 fi
578 ;;
579 kdebase-runtime)
580 # COLLISION PROTECT section
581 # Only install the kde4 script as part of kde-base/kdebase-data
582 if [[ ${PN} != kdebase-data && -f CMakeLists.txt ]]; then
583 sed -e '/^install(PROGRAMS[[:space:]]*[^[:space:]]*\/kde4[[:space:]]/s/^/#DONOTINSTALL /' \
584 -i CMakeLists.txt || die "Sed to exclude bin/kde4 failed"
585 fi
586 ;;
587 kdenetwork)
588 # Disable hardcoded kdepimlibs check
589 sed -e 's/find_package(KdepimLibs REQUIRED)/macro_optional_find_package(KdepimLibs)/' \
590 -i CMakeLists.txt || die "failed to disable hardcoded checks"
591 ;;
592 kdepim)
593 case ${PN} in
594 kaddressbook|kalarm|kmailcvt|kontact|korganizer|korn)
595 sed -n -e '/qt4_generate_dbus_interface(.*org\.kde\.kmail\.\(kmail\|mailcomposer\)\.xml/p' \
596 -e '/add_custom_target(kmail_xml /,/)/p' \
597 -i kmail/CMakeLists.txt || die "uncommenting xml failed"
598 _change_cmakelists_parent_dirs kmail
599 ;;
600 esac
601 ;;
602 kdewebdev)
603 # Disable hardcoded kdepimlibs check
604 sed -e 's/find_package(KdepimLibs REQUIRED)/macro_optional_find_package(KdepimLibs)/' \
605 -e 's/find_package(LibXml2 REQUIRED)/macro_optional_find_package(LibXml2)/' \
606 -e 's/find_package(LibXslt REQUIRED)/macro_optional_find_package(LibXslt)/' \
607 -e 's/find_package(Boost REQUIRED)/macro_optional_find_package(Boost)/' \
608 -i CMakeLists.txt || die "failed to disable hardcoded checks"
609 ;;
610 koffice)
611 # prevent collisions
612 if [[ ${PN} != koffice-data ]]; then
613 sed -e '/install(.*FindKOfficeLibs.cmake/,/)/ d' \
614 -i cmake/modules/CMakeLists.txt || die "${LINENO}: sed died in collision prevention section"
615 sed -e '/install(.\+config-openexr\.h.\+)/d' \
616 -i CMakeLists.txt || die "${LINENO}: sed died in collision prevention section"
617 fi
618 # koffice 2.0
619 case ${PV} in
620 2.0.[1-9])
621 sed -i -n -e '1h;1!H;${g;s/install(.\+config-openexr.h.\+)//;p}' \
622 "${S}"/CMakeLists.txt || \
623 die "${LINENO}: sed died in collision prevention section"
624 ;;
625 *) ;;
626 esac
627 esac
628
629 popd > /dev/null
630 }
631
632 # @FUNCTION: kde4-meta_src_configure
633 # @DESCRIPTION:
634 # Currently just calls its equivalent in kde4-base.eclass(5). Use this one in split
635 # ebuilds.
636 kde4-meta_src_configure() {
637 debug-print-function ${FUNCNAME} "$@"
638
639 # Set some cmake default values here (usually workarounds for automagic deps)
640 case ${KMNAME} in
641 kdewebdev)
642 mycmakeargs="
643 -DWITH_KdepimLibs=OFF
644 -DWITH_LibXml2=OFF
645 -DWITH_LibXslt=OFF
646 -DWITH_Boost=OFF
647 -DWITH_LibTidy=OFF
648 ${mycmakeargs}"
649 ;;
650 esac
651
652 kde4-base_src_configure
653 }
654
655 # @FUNCTION: kde4-meta_src_compile
656 # @DESCRIPTION:
657 # General function for compiling split KDE4 applications.
658 # Overrides kde4-base_src_compile.
659 kde4-meta_src_compile() {
660 debug-print-function ${FUNCNAME} "$@"
661
662 kde4-base_src_compile "$@"
663 }
664
665 # @FUNCTION: kde4-meta_src_test
666 # @DESCRIPTION:
667 # Currently just calls its equivalent in kde4-base.eclass(5). Use this in split
668 # ebuilds.
669 kde4-meta_src_test() {
670 debug-print-function $FUNCNAME "$@"
671
672 kde4-base_src_test
673 }
674
675 # @FUNCTION: kde4-meta_src_install
676 # @DESCRIPTION:
677 # Function for installing KDE4 split applications.
678 kde4-meta_src_install() {
679 debug-print-function $FUNCNAME "$@"
680
681 kde4-base_src_install
682 }
683
684 # @FUNCTION: kde4-meta_src_make_doc
685 # @DESCRIPTION:
686 # This function searches in ${S}/${KMMODULE},
687 # and tries to install "AUTHORS ChangeLog* README* NEWS TODO" if these files exist.
688 kde4-meta_src_make_doc() {
689 debug-print-function ${FUNCNAME} "$@"
690
691 local doc
692 for doc in AUTHORS ChangeLog* README* NEWS TODO; do
693 [[ -s ${KMMODULE}/${doc} ]] && newdoc "${KMMODULE}/${doc}" "${doc}.${KMMODULE##*/}"
694 done
695
696 kde4-base_src_make_doc
697 }
698
699 # @FUNCTION: kde4-meta_pkg_postinst
700 # @DESCRIPTION:
701 # Invoke kbuildsycoca4.
702 kde4-meta_pkg_postinst() {
703 debug-print-function ${FUNCNAME} "$@"
704
705 kde4-base_pkg_postinst
706 }
707
708 # @FUNCTION: kde4-meta_pkg_postrm
709 # @DESCRIPTION:
710 # Currently just calls its equivalent in kde4-base.eclass(5). Use this in split
711 # ebuilds.
712 kde4-meta_pkg_postrm() {
713 debug-print-function ${FUNCNAME} "$@"
714
715 kde4-base_pkg_postrm
716 }

  ViewVC Help
Powered by ViewVC 1.1.20