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

Contents of /eclass/kde4-meta.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.72 - (show annotations) (download)
Thu Aug 15 15:29:58 2013 UTC (16 months, 1 week ago) by kensington
Branch: MAIN
Changes since 1.71: +2 -32 lines
Remove dependencies and actions that are now handled in individual ebuilds.

1 # Copyright 1999-2013 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.71 2013/08/15 15:10:05 kensington 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 if [[ ${___ECLASS_ONCE_KDE4_META} != "recur -_+^+_- spank" ]] ; then
16 ___ECLASS_ONCE_KDE4_META="recur -_+^+_- spank"
17
18 [[ -z ${KMNAME} ]] && die "kde4-meta.eclass inherited but KMNAME not defined - broken ebuild"
19
20 inherit kde4-base versionator
21
22 KDEMETA_EXPF="pkg_setup src_unpack src_prepare src_configure src_compile src_test src_install pkg_preinst pkg_postinst pkg_postrm"
23 EXPORT_FUNCTIONS ${KDEMETA_EXPF}
24
25 # Add dependencies that all packages in a certain module share.
26 case ${KMNAME} in
27 kdepim|kdepim-runtime)
28 case ${PN} in
29 akregator|kaddressbook|kjots|kmail|knode|knotes|korganizer|ktimetracker)
30 IUSE+=" +kontact"
31 RDEPEND+=" kontact? ( $(add_kdebase_dep kontact) )"
32 ;;
33 esac
34 ;;
35 esac
36
37 DEPEND+=" ${COMMONDEPEND}"
38 RDEPEND+=" ${COMMONDEPEND}"
39 unset COMMONDEPEND
40
41 debug-print "line ${LINENO} ${ECLASS}: DEPEND ${DEPEND} - after metapackage-specific dependencies"
42 debug-print "line ${LINENO} ${ECLASS}: RDEPEND ${RDEPEND} - after metapackage-specific dependencies"
43
44 # Useful to build kde4-meta style stuff from extragear/playground (plasmoids etc)
45 case ${KDE_BUILD_TYPE} in
46 live)
47 if [[ ${KDE_SCM} == svn ]]; then
48 case ${KMNAME} in
49 extragear*|playground*)
50 ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}"
51 ESVN_PROJECT="${KMNAME}${ESVN_PROJECT_SUFFIX}"
52 ;;
53 esac
54 fi
55 ;;
56 esac
57
58 # @ECLASS-VARIABLE: KMNAME
59 # @DESCRIPTION:
60 # Name of the parent-module (e.g. kdebase, kdepim, ...). You _must_ set it
61 # _before_ inheriting this eclass, (unlike the other parameters), since it's
62 # used to set $SRC_URI.
63
64 # @ECLASS-VARIABLE: KMMODULE
65 # @DESCRIPTION:
66 # Specify exactly one subdirectory of $KMNAME here. Defaults to $PN.
67 # The subdirectory listed here is treated exactly like items in $KMEXTRA.
68 #
69 # Example: The ebuild name of "kdebase/l10n" is kde-base/kdebase-l10n, because
70 # just 'l10n' would be too confusing. Hence it sets KMMODULE="l10n".
71
72 # @ECLASS-VARIABLE: KMNOMODULE
73 # @DESCRIPTION:
74 # If set to "true", $KMMODULE doesn't have to be defined.
75 #
76 # Example usage: If you're installing subdirectories of a package, like plugins,
77 # you mark the top subdirectory (containing the package) as $KMEXTRACTONLY, and
78 # set KMNOMODULE="true".
79 if [[ -z ${KMMODULE} ]] && [[ ${KMNOMODULE} != true ]]; then
80 KMMODULE=${PN}
81 fi
82
83 # @ECLASS-VARIABLE: KMEXTRA
84 # @DESCRIPTION:
85 # All subdirectories listed here will be extracted, compiled & installed.
86 # $KMMODULE is always added to $KMEXTRA.
87 # If KDE_HANDBOOK is 'always' or 'optional' and handbook USE-flag is set, and if this
88 # directory exists, then "doc/$KMMODULE" is added to $KMEXTRA. If there's additional
89 # documentation in different subdirectories, it should be added to KMEXTRA manually..
90
91 # @ECLASS-VARIABLE: KMCOMPILEONLY
92 # @DESCRIPTION:
93 # All subdirectories listed here will be extracted & compiled, but not installed.
94
95 # TODO: better formulation may be needed
96 # @ECLASS-VARIABLE: KMEXTRACTONLY
97 # @DESCRIPTION:
98 # All subdirectories listed here will be extracted, but neither compiled nor installed.
99 # This can be used to avoid compilation in a subdirectory of a directory in $KMMODULE or $KMEXTRA
100
101 # @ECLASS-VARIABLE: KMTARPARAMS
102 # @DESCRIPTION:
103 # Specify extra parameters to pass to tar, in kde4-meta_src_extract.
104 # '-xpf -j' are passed to tar by default.
105
106 # @FUNCTION: kde4-meta_pkg_setup
107 # @DESCRIPTION:
108 # Currently calls its equivalent in kde4-base.eclass(5) and checks the gcc version.
109 # Use this one in split ebuilds.
110 kde4-meta_pkg_setup() {
111 debug-print-function ${FUNCNAME} "$@"
112
113 kde4-base_pkg_setup
114 }
115
116 # @FUNCTION: kde4-meta_src_unpack
117 # @DESCRIPTION:
118 # This function unpacks the source for split ebuilds.
119 # Further more is processed in kde4-meta_src_extract
120 kde4-meta_src_unpack() {
121 debug-print-function ${FUNCNAME} "$@"
122
123 if [[ ${KDE_BUILD_TYPE} = live ]]; then
124 case "${KDE_SCM}" in
125 svn)
126 S="${WORKDIR}/${P}"
127 mkdir -p "${S}"
128 ESVN_RESTRICT="export" subversion_src_unpack
129 subversion_wc_info
130 subversion_bootstrap
131 ;;
132 git)
133 git-2_src_unpack
134 ;;
135 esac
136 fi
137 kde4-meta_src_extract
138 }
139
140 # @FUNCTION: kde4-meta_src_extract
141 # @DESCRIPTION:
142 # A function to extract the source for a split KDE ebuild.
143 # Also see KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY, KMEXTRACTONLY and
144 # KMTARPARAMS.
145 kde4-meta_src_extract() {
146 debug-print-function ${FUNCNAME} "$@"
147
148 if [[ ${KDE_BUILD_TYPE} = live ]]; then
149 # Export working copy to ${S}
150 einfo "Exporting parts of working copy to ${S}"
151 kde4-meta_create_extractlists
152
153 case ${KDE_SCM} in
154 svn)
155 local rsync_options subdir targetdir wc_path escm
156
157 rsync_options="--group --links --owner --perms --quiet --exclude=.svn/ --exclude=.git/"
158 wc_path="${ESVN_WC_PATH}"
159 escm="{ESVN}"
160
161 # Copy ${KMNAME} non-recursively (toplevel files)
162 rsync ${rsync_options} "${wc_path}"/* "${S}" \
163 || die "${escm}: can't export toplevel files to '${S}'."
164 # Copy cmake directory
165 if [[ -d "${wc_path}/cmake" ]]; then
166 rsync --recursive ${rsync_options} "${wc_path}/cmake" "${S}" \
167 || die "${escm}: can't export cmake files to '${S}'."
168 fi
169 # Copy all subdirectories
170 for subdir in $(__list_needed_subdirectories); do
171 targetdir=""
172 if [[ $subdir = doc/* && ! -e "$wc_path/$subdir" ]]; then
173 continue
174 fi
175
176 [[ ${subdir%/} = */* ]] && targetdir=${subdir%/} && targetdir=${targetdir%/*} && mkdir -p "${S}/${targetdir}"
177 rsync --recursive ${rsync_options} "${wc_path}/${subdir%/}" "${S}/${targetdir}" \
178 || die "${escm}: can't export subdirectory '${subdir}' to '${S}/${targetdir}'."
179 done
180 ;;
181 esac
182 else
183 local abort tarball tarfile f extractlist postfix
184
185 if [[ ${PV} =~ 4.[47].[12345] ]]; then
186 postfix="bz2"
187 KMTARPARAMS+=" --bzip2"
188 else
189 postfix="xz"
190 KMTARPARAMS+=" --xz"
191 fi
192
193 tarball="${KMNAME}-${PV}.tar.${postfix}"
194
195 # Full path to source tarball
196 tarfile="${DISTDIR}/${tarball}"
197
198 # Detect real toplevel dir from tarball name - it will be used upon extraction
199 # and in __list_needed_subdirectories
200 topdir="${tarball%.tar.*}/"
201
202 ebegin "Unpacking parts of ${tarball} to ${WORKDIR}"
203
204 kde4-meta_create_extractlists
205
206 for f in cmake/ CMakeLists.txt ConfigureChecks.cmake config.h.cmake
207 do
208 extractlist+=" ${topdir}${f}"
209 done
210 extractlist+=" $(__list_needed_subdirectories)"
211
212 pushd "${WORKDIR}" > /dev/null
213
214 # @ECLASS-VARIABLE: KDE4_STRICTER
215 # @DESCRIPTION:
216 # Print out all issues found executing tar / kmextract files
217 # Set on if you want to find issues in kde-base ebuild unpack sequences
218 [[ -n ${KDE4_STRICTER} ]] && echo 'tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist}'
219 tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} 2> /dev/null || echo "tar extract command failed at least partially - continuing anyway"
220
221 # Default $S is based on $P; rename the extracted directory to match $S if necessary
222 if [[ ${KMNAME} != ${PN} ]]; then
223 mv ${topdir} ${P} || die "Died while moving \"${topdir}\" to \"${P}\""
224 fi
225
226 popd > /dev/null
227
228 eend $?
229
230 if [[ -n ${KDE4_STRICTER} ]]; then
231 for f in $(__list_needed_subdirectories fatal); do
232 if [[ ! -e ${S}/${f#*/} ]]; then
233 eerror "'${f#*/}' is missing"
234 abort=true
235 fi
236 done
237 [[ -n ${abort} ]] && die "There were missing files."
238 fi
239
240 # We don't need it anymore
241 unset topdir
242 fi
243 }
244
245 # @FUNCTION: kde4-meta_create_extractlists
246 # @DESCRIPTION:
247 # Create lists of files and subdirectories to extract.
248 # Also see descriptions of KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY,
249 # KMEXTRACTONLY and KMTARPARAMS.
250 kde4-meta_create_extractlists() {
251 debug-print-function ${FUNCNAME} "$@"
252
253 # Add default handbook locations
254 # FIXME - legacy code - remove when 4.4.5 is gone or preferrably port 4.4.5.
255 if [[ $(get_kde_version) < 4.5 ]] && use_if_iuse handbook && [[ -z ${KMNOMODULE} ]]; then
256 # We use the basename of $KMMODULE because $KMMODULE can contain
257 # the path to the module subdirectory.
258 KMEXTRA_NONFATAL+="
259 doc/${KMMODULE##*/}"
260 fi
261
262 # Add default handbook locations
263 if [[ -z ${KMNOMODULE} ]] && ( [[ ${KDE_HANDBOOK} == always ]] || ( [[ ${KDE_HANDBOOK} == optional ]] && use handbook ) ); then
264 KMEXTRA_NONFATAL+=" doc/${KMMODULE##*/}"
265 fi
266
267 # Add some CMake-files to KMEXTRACTONLY.
268 # Note that this actually doesn't include KMEXTRA handling.
269 # In those cases you should care to add the relevant files to KMEXTRACTONLY
270 case ${KMNAME} in
271 kde-baseapps)
272 KMEXTRACTONLY+="
273 CTestConfig.cmake
274 config-apps.h.cmake
275 ConfigureChecks.cmake"
276 ;;
277 kde-runtime)
278 KMEXTRACTONLY+="
279 CTestConfig.cmake
280 config-runtime.h.cmake"
281 ;;
282 kde-workspace)
283 KMEXTRACTONLY+="
284 config-unix.h.cmake
285 ConfigureChecks.cmake
286 config-workspace.h.cmake
287 config-X11.h.cmake
288 startkde.cmake
289 KDE4WorkspaceConfig.cmake.in"
290 ;;
291 kdepim)
292 if [[ ${PN} != libkdepim ]]; then
293 KMEXTRACTONLY+="
294 libkdepim/"
295 fi
296 KMEXTRACTONLY+="
297 config-enterprise.h.cmake
298 kleopatra/ConfigureChecks.cmake
299 CTestCustom.cmake
300 kdepim-version.h.cmake
301 kdepim-version.h"
302 if use_if_iuse kontact; then
303 KMEXTRA+="
304 kontact/plugins/${PLUGINNAME:-${PN}}/"
305 fi
306 ;;
307 esac
308 # Don't install cmake modules for split ebuilds, to avoid collisions.
309 # note: kdegraphics >= 4.6.2 does not even have code to do that, so we
310 # should not try in that case
311 # note2: kdeedu 4.6.4 does not have a cmake/modules/ subdir anymore :(
312 # it may be possible to formulate this shorter, but it should also
313 # still be understandable...
314 if [[ ${KMNAME} != kdegraphics || ( ( $(get_kde_version) != 4.6 || ${PV} < 4.6.2 ) && $(get_kde_version) < 4.7 ) ]] \
315 && ! [[ ${KMNAME} == kdeedu && ( ${PV} == 4.6.4 || ${PV} == 4.6.5 ) ]] \
316 && ! [[ ${KMNAME} == kdegames && ${PV} > 4.9.0 ]]; then
317 case ${KMNAME} in
318 kdebase-runtime|kde-runtime|kdebase-workspace|kde-workspace|kdeedu|kdegames|kdegraphics)
319 KMEXTRACTONLY+="
320 cmake/modules/"
321 ;;
322 esac
323 fi
324
325 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME}: KMEXTRACTONLY ${KMEXTRACTONLY}"
326 }
327
328 __list_needed_subdirectories() {
329 local i j kmextra kmextra_expanded kmmodule_expanded kmcompileonly_expanded extractlist
330
331 # We expand KMEXTRA by adding CMakeLists.txt files
332 kmextra="${KMEXTRA}"
333 [[ ${1} != fatal ]] && kmextra+=" ${KMEXTRA_NONFATAL}"
334 for i in ${kmextra}; do
335 kmextra_expanded+=" ${i}"
336 j=$(dirname ${i})
337 while [[ ${j} != "." ]]; do
338 kmextra_expanded+=" ${j}/CMakeLists.txt";
339 j=$(dirname ${j})
340 done
341 done
342
343 # Expand KMMODULE
344 if [[ -n ${KMMODULE} ]]; then
345 kmmodule_expanded="${KMMODULE}"
346 j=$(dirname ${KMMODULE})
347 while [[ ${j} != "." ]]; do
348 kmmodule_expanded+=" ${j}/CMakeLists.txt";
349 j=$(dirname ${j})
350 done
351 fi
352
353 # Expand KMCOMPILEONLY
354 for i in ${KMCOMPILEONLY}; do
355 kmcompileonly_expanded+=" ${i}"
356 j=$(dirname ${i})
357 while [[ ${j} != "." ]]; do
358 kmcompileonly_expanded+=" ${j}/CMakeLists.txt";
359 j=$(dirname ${j})
360 done
361 done
362
363 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmextra_expanded: ${kmextra_expanded}"
364 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmmodule_expanded: ${kmmodule_expanded}"
365 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmcompileonly_expanded: ${kmcompileonly_expanded}"
366
367 # Create final list of stuff to extract
368 # We append topdir only when specified (usually for tarballs)
369 for i in ${kmmodule_expanded} ${kmextra_expanded} ${kmcompileonly_expanded} \
370 ${KMEXTRACTONLY}
371 do
372 extractlist+=" ${topdir}${i}"
373 done
374
375 echo ${extractlist}
376 }
377
378 # @FUNCTION: kde4-meta_src_prepare
379 # @DESCRIPTION:
380 # Meta-package build system configuration handling - commenting out targets, etc..
381 kde4-meta_src_prepare() {
382 debug-print-function ${FUNCNAME} "$@"
383
384 kde4-meta_change_cmakelists
385 kde4-base_src_prepare
386 }
387
388 # @FUNCTION: _change_cmakelists_parent_dirs
389 # @DESCRIPTION:
390 # Adjust CMakeLists.txt to shadow subdirectories
391 # that are not required for the build.
392 _change_cmakelists_parent_dirs() {
393 debug-print-function ${FUNCNAME} "$@"
394
395 local _olddir _dir
396 _dir="${S}"/${1}
397 until [[ ${_dir} == ${S} ]]; do
398 _olddir=$(basename "${_dir}")
399 _dir=$(dirname "${_dir}")
400 debug-print "${LINENO}: processing ${_dir} CMakeLists.txt searching for ${_olddir}"
401 if [[ -f ${_dir}/CMakeLists.txt ]]; then
402 sed -e "/add_subdirectory[[:space:]]*([[:space:]]*${_olddir}[[:space:]]*)/s/#DONOTCOMPILE //g" \
403 -e "/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*${_olddir}[[:space:]]*)/s/#DONOTCOMPILE //g" \
404 -i ${_dir}/CMakeLists.txt || die "${LINENO}: died in ${FUNCNAME} while processing ${_dir}"
405 fi
406 done
407 }
408
409 # @FUNCTION: kde4-meta_change_cmakelists
410 # @DESCRIPTION:
411 # Adjust CMakeLists.txt to comply to our splitting.
412 kde4-meta_change_cmakelists() {
413 debug-print-function ${FUNCNAME} "$@"
414
415 pushd "${S}" > /dev/null
416
417 comment_all_add_subdirectory ./
418
419 # Restore "add_subdirectory( cmake )" in ${S}/CMakeLists.txt
420 if [[ -f CMakeLists.txt ]]; then
421 sed -e '/add_subdirectory[[:space:]]*([[:space:]]*cmake[[:space:]]*)/s/^#DONOTCOMPILE //' \
422 -e '/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*cmake[[:space:]]*)/s/^#DONOTCOMPILE //' \
423 -i CMakeLists.txt || die "${LINENO}: cmake sed died"
424 fi
425
426 # Restore "add_subdirectory( ${ ..." (this is done in kdesdk)
427 if [[ -f CMakeLists.txt ]]; then
428 sed -e '/add_subdirectory[[:space:]]*([[:space:]]*\${/s/^#DONOTCOMPILE //' \
429 -e '/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*\${/s/^#DONOTCOMPILE //' \
430 -i CMakeLists.txt || die "${LINENO}: cmake sed died"
431 fi
432
433 if [[ -z ${KMNOMODULE} ]]; then
434 # Restore "add_subdirectory" in $KMMODULE subdirectories
435 find "${S}"/${KMMODULE} -name CMakeLists.txt -print0 | \
436 xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \
437 die "${LINENO}: died in KMMODULE section"
438 _change_cmakelists_parent_dirs ${KMMODULE}
439 fi
440
441 local i
442
443 # KMEXTRACTONLY section - Some ebuilds need to comment out some subdirs in KMMODULE and they use KMEXTRACTONLY
444 for i in ${KMEXTRACTONLY}; do
445 if [[ -d ${i} && -f ${i}/../CMakeLists.txt ]]; then
446 sed -e "/([[:space:]]*$(basename $i)[[:space:]]*)/s/^/#DONOTCOMPILE /" \
447 -i ${i}/../CMakeLists.txt || \
448 die "${LINENO}: sed died while working in the KMEXTRACTONLY section while processing ${i}"
449 fi
450 done
451
452 # KMCOMPILEONLY
453 for i in ${KMCOMPILEONLY}; do
454 debug-print "${LINENO}: KMCOMPILEONLY, processing ${i}"
455 # Uncomment "add_subdirectory" instructions inside $KMCOMPILEONLY, then comment "install" instructions.
456 find "${S}"/${i} -name CMakeLists.txt -print0 | \
457 xargs -0 sed -i \
458 -e 's/^#DONOTCOMPILE //g' \
459 -e '/install(.*)/I{s/^/#DONOTINSTALL /;}' \
460 -e '/^install(/,/)/I{s/^/#DONOTINSTALL /;}' \
461 -e '/kde4_install_icons(.*)/{s/^/#DONOTINSTALL /;}' || \
462 die "${LINENO}: sed died in the KMCOMPILEONLY section while processing ${i}"
463 _change_cmakelists_parent_dirs ${i}
464 done
465
466 # KMEXTRA section
467 for i in ${KMEXTRA}; do
468 debug-print "${LINENO}: KMEXTRA section, processing ${i}"
469 find "${S}"/${i} -name CMakeLists.txt -print0 | \
470 xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \
471 die "${LINENO}: sed died uncommenting add_subdirectory instructions in KMEXTRA section while processing ${i}"
472 _change_cmakelists_parent_dirs ${i}
473 done
474 # KMEXTRA_NONFATAL section
475 for i in ${KMEXTRA_NONFATAL}; do
476 if [[ -d "${S}"/${i} ]]; then
477 find "${S}"/${i} -name CMakeLists.txt -print0 | \
478 xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \
479 die "${LINENO}: sed died uncommenting add_subdirectory instructions in KMEXTRA section while processing ${i}"
480 _change_cmakelists_parent_dirs ${i}
481 fi
482 done
483
484 case ${KMNAME} in
485 kde-workspace)
486 # COLLISION PROTECT section
487 # Install the startkde script just once, as a part of kde-base/kdebase-startkde,
488 # not as a part of every package.
489 if [[ ${PN} != kdebase-startkde && -f CMakeLists.txt ]]; then
490 # The startkde script moved to kdebase-workspace for KDE4 versions > 3.93.0.
491 sed -e '/startkde/s/^/#DONOTINSTALL /' \
492 -i CMakeLists.txt || die "${LINENO}: sed died in the kdebase-startkde collision prevention section"
493 fi
494 # Remove workspace target prefix in order to get direct linking to workspace libs
495 sed -e '/set(KDE4WORKSPACE_TARGET_PREFIX/s/^/#OVERRIDE /' \
496 -i CMakeLists.txt || die "${LINENO}: sed died in KDE4WORKSPACE_TARGET_PREFIX removal section"
497 # Strip EXPORT feature section from workspace for KDE4 versions > 4.1.82
498 if [[ ${PN} != libkworkspace ]]; then
499 sed -e '/install(FILES ${CMAKE_CURRENT_BINARY_DIR}\/KDE4WorkspaceConfig.cmake/,/^[[:space:]]*FILE KDE4WorkspaceLibraryTargets.cmake )[[:space:]]*^/d' \
500 -i CMakeLists.txt || die "${LINENO}: sed died in kde-workspace strip config install and fix EXPORT section"
501 fi
502 if [[ ${PN} != plasma-workspace ]]; then
503 sed -e '/KActivities/s/REQUIRED//' \
504 -i CMakeLists.txt || die "${LINENO}: sed died in kde-workspace dep reduction section"
505 fi
506 if [[ "${PN}" != "kwin" ]]; then
507 sed -i -e "/^ macro_log_feature(OPENGL_OR_ES_FOUND/s/TRUE/FALSE/" \
508 "${S}"/CMakeLists.txt || die "${LINENO}: sed died removing kde-workspace opengl dependency"
509 fi
510 ;;
511 kde-runtime)
512 # COLLISION PROTECT section
513 # Only install the kde4 script as part of kde-base/kdebase-data
514 if [[ ${PN} != kdebase-data && -f CMakeLists.txt ]]; then
515 sed -e '/^install(PROGRAMS[[:space:]]*[^[:space:]]*\/kde4[[:space:]]/s/^/#DONOTINSTALL /' \
516 -i CMakeLists.txt || die "Sed to exclude bin/kde4 failed"
517 fi
518 ;;
519 kdenetwork)
520 # Disable hardcoded kdepimlibs check
521 sed -e 's/find_package(KdepimLibs REQUIRED)/macro_optional_find_package(KdepimLibs)/' \
522 -i CMakeLists.txt || die "failed to disable hardcoded checks"
523 ;;
524 kdepim)
525 # Disable hardcoded checks
526 sed -r -e '/find_package\(KdepimLibs/s/REQUIRED//' \
527 -e '/find_package\((KdepimLibs|Boost|QGpgme|Akonadi|ZLIB|Strigi|SharedDesktopOntologies|Soprano|Nepomuk)/{/macro_optional_/!s/find/macro_optional_&/}' \
528 -e '/macro_log_feature\((Boost|QGPGME|Akonadi|ZLIB|STRIGI|SHAREDDESKTOPONTOLOGIES|Soprano|Nepomuk)_FOUND/s/ TRUE / FALSE /' \
529 -e 's/if[[:space:]]*([[:space:]]*BUILD_.*)[[:space:]]*/if(1) # &/' \
530 -e 's/if[[:space:]]*([[:space:]]*[[:alnum:]]*_FOUND[[:space:]]*)[[:space:]]*$/if(1) # &/' \
531 -i CMakeLists.txt || die "failed to disable hardcoded checks"
532 # Disable broken or redundant build logic
533 if use_if_iuse kontact || [[ ${PN} = kontact ]]; then
534 sed -e 's/if[[:space:]]*([[:space:]]*BUILD_.*)[[:space:]]*$/if(1) # &/' \
535 -e 's/if[[:space:]]*([[:space:]]*[[:alnum:]]*_FOUND[[:space:]]*)[[:space:]]*$/if(1) # &/' \
536 -i kontact/plugins/CMakeLists.txt || die 'failed to override build logic'
537 fi
538 case ${PV} in
539 4.4*)
540 case ${PN} in
541 kalarm|kmailcvt|kontact|korganizer|korn)
542 sed -n -e '/qt4_generate_dbus_interface(.*org\.kde\.kmail\.\(kmail\|mailcomposer\)\.xml/p' \
543 -e '/add_custom_target(kmail_xml /,/)/p' \
544 -i kmail/CMakeLists.txt || die "uncommenting xml failed"
545 _change_cmakelists_parent_dirs kmail
546 ;;
547 esac
548 ;;
549 esac
550 ;;
551 esac
552
553 popd > /dev/null
554 }
555
556 # @FUNCTION: kde4-meta_src_configure
557 # @DESCRIPTION:
558 # Currently just calls its equivalent in kde4-base.eclass(5). Use this one in split
559 # ebuilds.
560 kde4-meta_src_configure() {
561 debug-print-function ${FUNCNAME} "$@"
562
563 kde4-base_src_configure
564 }
565
566 # @FUNCTION: kde4-meta_src_compile
567 # @DESCRIPTION:
568 # General function for compiling split KDE4 applications.
569 # Overrides kde4-base_src_compile.
570 kde4-meta_src_compile() {
571 debug-print-function ${FUNCNAME} "$@"
572
573 kde4-base_src_compile "$@"
574 }
575
576 # @FUNCTION: kde4-meta_src_test
577 # @DESCRIPTION:
578 # Currently just calls its equivalent in kde4-base.eclass(5) if
579 # I_KNOW_WHAT_I_AM_DOING is set. Use this in split ebuilds.
580 kde4-meta_src_test() {
581 debug-print-function $FUNCNAME "$@"
582
583 if [[ $I_KNOW_WHAT_I_AM_DOING ]]; then
584 kde4-base_src_test
585 else
586 einfo "Tests disabled"
587 fi
588 }
589
590 # @FUNCTION: kde4-meta_src_install
591 # @DESCRIPTION:
592 # Function for installing KDE4 split applications.
593 kde4-meta_src_install() {
594 debug-print-function $FUNCNAME "$@"
595
596 # Search ${S}/${KMMODULE} and install common documentation files found
597 local doc
598 for doc in "${S}/${KMMODULE}"/{AUTHORS,CHANGELOG,ChangeLog*,README*,NEWS,TODO,HACKING}; do
599 [[ -f "${doc}" ]] && [[ -s "${doc}" ]] && dodoc "${doc}"
600 done
601
602 kde4-base_src_install
603 }
604
605 # @FUNCTION: kde4-meta_pkg_preinst
606 # @DESCRIPTION:
607 # Invoke its equivalent in kde4-base.eclass.
608 kde4-meta_pkg_preinst() {
609 debug-print-function ${FUNCNAME} "$@"
610
611 kde4-base_pkg_preinst
612 }
613
614 # @FUNCTION: kde4-meta_pkg_postinst
615 # @DESCRIPTION:
616 # Invoke kbuildsycoca4.
617 kde4-meta_pkg_postinst() {
618 debug-print-function ${FUNCNAME} "$@"
619
620 kde4-base_pkg_postinst
621 }
622
623 # @FUNCTION: kde4-meta_pkg_postrm
624 # @DESCRIPTION:
625 # Currently just calls its equivalent in kde4-base.eclass(5). Use this in split
626 # ebuilds.
627 kde4-meta_pkg_postrm() {
628 debug-print-function ${FUNCNAME} "$@"
629
630 kde4-base_pkg_postrm
631 }
632
633 fi

  ViewVC Help
Powered by ViewVC 1.1.20