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

Contents of /eclass/kde4-meta.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.28 - (show annotations) (download)
Tue Dec 1 10:56:17 2009 UTC (4 years, 9 months ago) by scarabeus
Branch: MAIN
Changes since 1.27: +5 -19 lines
Update kde4 eclasses from overlay:
Changes:
kde-functions
	Update the block resolving case to make it simpler.
kde-meta
	Drop not required elogs.
	Drop redundant dependencies.
kde-base
	introduce kdeenablefinal useflag (masked).
	support unpacking of xz tarballs in eapi2.

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

  ViewVC Help
Powered by ViewVC 1.1.20