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

Contents of /eclass/kde4-meta.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.71 - (show annotations) (download)
Thu Aug 15 15:10:05 2013 UTC (10 months, 4 weeks ago) by kensington
Branch: MAIN
Changes since 1.70: +6 -32 lines
Remove old, unused code.

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

  ViewVC Help
Powered by ViewVC 1.1.20