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

Diff of /eclass/kde4-meta.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.11 Revision 1.20
1# Copyright 1999-2009 Gentoo Foundation 1# Copyright 1999-2009 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-meta.eclass,v 1.11 2009/03/01 11:44:09 scarabeus Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-meta.eclass,v 1.20 2009/05/28 09:47:52 scarabeus Exp $
4# 4#
5# @ECLASS: kde4-meta.eclass 5# @ECLASS: kde4-meta.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# kde@gentoo.org 7# kde@gentoo.org
8# @BLURB: Eclass for writing "split" KDE packages. 8# @BLURB: Eclass for writing "split" KDE packages.
29 HOMEPAGE="http://www.koffice.org/" 29 HOMEPAGE="http://www.koffice.org/"
30 LICENSE="GPL-2" 30 LICENSE="GPL-2"
31 ;; 31 ;;
32esac 32esac
33 33
34# Add khelpcenter dependency when installing
35if [[ ${PN} != khelpcenter ]] && has doc ${IUSE//+} && use doc; then
36 RDEPEND="${RDEPEND}
37 >=kde-base/khelpcenter-${PV}:${SLOT}[kdeprefix=]
38 "
39fi
40
34# Add dependencies that all packages in a certain module share. 41# Add dependencies that all packages in a certain module share.
35case ${KMNAME} in 42case ${KMNAME} in
36 kdebase|kdebase-workspace|kdebase-runtime) 43 kdebase|kdebase-apps|kdebase-workspace|kdebase-runtime|kdegraphic)
44 DEPEND="${DEPEND}
37 DEPEND="${DEPEND} >=kde-base/qimageblitz-0.0.4" 45 >=kde-base/qimageblitz-0.0.4
38 RDEPEND="${RDEPEND} >=kde-base/qimageblitz-0.0.4" 46 "
47 RDEPEND="${RDEPEND}
48 >=kde-base/qimageblitz-0.0.4
49 "
50 ;;
51 kdenetwork)
52 DEPEND="${DEPEND}
53 >=kde-base/kdepimlibs-${PV}:${SLOT}[kdeprefix=]
54 "
55 RDEPEND="${RDEPEND}
56 >=kde-base/kdepimlibs-${PV}:${SLOT}[kdeprefix=]
57 "
39 ;; 58 ;;
40 kdepim) 59 kdepim)
41 DEPEND="${DEPEND} dev-libs/boost app-office/akonadi-server" 60 DEPEND="${DEPEND}
42 RDEPEND="${RDEPEND} dev-libs/boost" 61 dev-libs/boost
43 if [[ ${PN} != kode ]]; then
44 DEPEND="${DEPEND} >=kde-base/kode-${PV}:${SLOT}[kdeprefix=]" 62 >=kde-base/kdepimlibs-${PV}:${SLOT}[kdeprefix=]
45 RDEPEND="${RDEPEND} >=kde-base/kode-${PV}:${SLOT}[kdeprefix=]" 63 "
46 fi 64 RDEPEND="${RDEPEND}
65 dev-libs/boost
66 >=kde-base/kdepimlibs-${PV}:${SLOT}[kdeprefix=]
67 "
47 case ${PN} in 68 case ${PN} in
48 akregator|kaddressbook|kjots|kmail|kmobiletools|knode|knotes|korganizer|ktimetracker) 69 akregator|kaddressbook|kjots|kmail|kmobiletools|knode|knotes|korganizer|ktimetracker)
49 IUSE="+kontact" 70 IUSE="+kontact"
71 RDEPEND="${RDEPEND}
50 DEPEND="${DEPEND} kontact? ( >=kde-base/kontactinterfaces-${PV}:${SLOT}[kdeprefix=] )" 72 kontact? ( >=kde-base/kontactinterfaces-${PV}:${SLOT}[kdeprefix=] )
51 RDEPEND="${RDEPEND} kontact? ( >=kde-base/kontactinterfaces-${PV}:${SLOT}[kdeprefix=] )" 73 "
52 ;; 74 ;;
53 esac 75 esac
54 ;; 76 ;;
55 kdegames) 77 kdegames)
56 if [[ ${PN} != libkdegames ]]; then 78 if [[ ${PN} != libkdegames ]]; then
79 DEPEND="${DEPEND}
57 DEPEND="${DEPEND} >=kde-base/libkdegames-${PV}:${SLOT}[kdeprefix=]" 80 >=kde-base/libkdegames-${PV}:${SLOT}[kdeprefix=]
81 "
82 RDEPEND="${RDEPEND}
58 RDEPEND="${RDEPEND} >=kde-base/libkdegames-${PV}:${SLOT}[kdeprefix=]" 83 >=kde-base/libkdegames-${PV}:${SLOT}[kdeprefix=]
84 "
59 fi 85 fi
60 ;; 86 ;;
61 koffice) 87 koffice)
62 [[ ${PN} != koffice-data ]] && IUSE="debug" 88 [[ ${PN} != koffice-data ]] && IUSE="debug"
63 case ${PV} in
64 9999*) DEPEND="${DEPEND} !app-office/${PN}:2" ;;
65 1.9*|2*) DEPEND="${DEPEND} !app-office/${PN}:live" ;;
66 esac
67 DEPEND="${DEPEND} 89 RDEPEND="${RDEPEND}
68 !app-office/${PN}:0 90 !app-office/${PN}:0
69 !app-office/koffice:0 91 !app-office/koffice:0
70 !app-office/koffice-meta:0" 92 !app-office/koffice-meta:0
71 case ${PN} in 93 "
72 koffice-data) 94 COMMON_DEPEND="
73 DEPEND="${DEPEND} media-libs/lcms"
74 RDEPEND="${RDEPEND} media-libs/lcms"
75 ;;
76 *)
77 DEPEND="${DEPEND}
78 dev-cpp/eigen:2 95 dev-cpp/eigen:2
79 media-gfx/imagemagick[openexr?] 96 media-gfx/imagemagick[openexr?]
80 media-libs/fontconfig 97 media-libs/fontconfig
81 media-libs/freetype:2 98 media-libs/freetype:2
82 " 99 "
83 RDEPEND="${DEPEND}" 100 DEPEND="${DEPEND} ${COMMON_DEPEND}"
101 RDEPEND="${RDEPEND} ${COMMON_DEPEND}"
102 unset COMMON_DEPEND
84 if [[ ${PN} != koffice-libs && ${PN} != koffice-data ]]; then 103 if [[ ${PN} != koffice-libs && ${PN} != koffice-data ]]; then
85 DEPEND="${DEPEND} 104 DEPEND="${DEPEND}
86 >=app-office/koffice-libs-${PV}:${SLOT}[kdeprefix=]" 105 >=app-office/koffice-libs-${PV}:${SLOT}
106 "
87 RDEPEND="${RDEPEND} 107 RDEPEND="${RDEPEND}
88 >=app-office/koffice-libs-${PV}:${SLOT}[kdeprefix=]" 108 >=app-office/koffice-libs-${PV}:${SLOT}
109 "
89 fi 110 fi
90 ;;
91 esac
92 ;; 111 ;;
93esac 112esac
94 113
95debug-print "line ${LINENO} ${ECLASS}: DEPEND ${DEPEND} - after metapackage-specific dependencies" 114debug-print "line ${LINENO} ${ECLASS}: DEPEND ${DEPEND} - after metapackage-specific dependencies"
96debug-print "line ${LINENO} ${ECLASS}: RDEPEND ${RDEPEND} - after metapackage-specific dependencies" 115debug-print "line ${LINENO} ${ECLASS}: RDEPEND ${RDEPEND} - after metapackage-specific dependencies"
97 116
98# Useful to build kde4-meta style stuff from extragear/playground (plasmoids etc) 117# Useful to build kde4-meta style stuff from extragear/playground (plasmoids etc)
99case ${SLOT} in 118case ${BUILD_TYPE} in
100 live) 119 live)
101 case ${KMNAME} in 120 case ${KMNAME} in
102 extragear*|playground*) 121 extragear*|playground*)
103 ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}" 122 ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}"
123 ESVN_PROJECT="${KMNAME}${ESVN_PROJECT_SUFFIX}"
104 ;; 124 ;;
105 esac 125 esac
106 ;; 126 ;;
107esac 127esac
108 128
133 153
134# @ECLASS-VARIABLE: KMEXTRA 154# @ECLASS-VARIABLE: KMEXTRA
135# @DESCRIPTION: 155# @DESCRIPTION:
136# All subdirectories listed here will be extracted, compiled & installed. 156# All subdirectories listed here will be extracted, compiled & installed.
137# $KMMODULE is always added to $KMEXTRA. 157# $KMMODULE is always added to $KMEXTRA.
138# If the htmlhandbook USE-flag is set, and if this directory exists, 158# If the doc USE-flag is set, and if this directory exists,
139# then "doc/$KMMODULE" is added to $KMEXTRA. In other cases, this should be 159# then "doc/$KMMODULE" is added to $KMEXTRA. In other cases, this should be
140# handled in the ebuild. 160# handled in the ebuild.
141# If the documentation is in a different subdirectory, you should add it to KMEXTRA. 161# If the documentation is in a different subdirectory, you should add it to KMEXTRA.
142 162
143# @ECLASS-VARIABLE: KMCOMPILEONLY 163# @ECLASS-VARIABLE: KMCOMPILEONLY
211 rsync --recursive ${rsync_options} "${ESVN_WC_PATH}/${kmnamedir}cmake" "${S}" \ 231 rsync --recursive ${rsync_options} "${ESVN_WC_PATH}/${kmnamedir}cmake" "${S}" \
212 || die "${ESVN}: can't export cmake files to '${S}'." 232 || die "${ESVN}: can't export cmake files to '${S}'."
213 fi 233 fi
214 # Copy all subdirectories 234 # Copy all subdirectories
215 for subdir in $(__list_needed_subdirectories); do 235 for subdir in $(__list_needed_subdirectories); do
216 targetdir="" 236 targetdir=""
217 if [[ $subdir = doc/* && ! -e "$ESVN_WC_PATH/$kmnamedir$subdir" ]]; then 237 if [[ $subdir = doc/* && ! -e "$ESVN_WC_PATH/$kmnamedir$subdir" ]]; then
218 continue 238 continue
219 fi 239 fi
220 240
221 [[ ${subdir%/} = */* ]] && targetdir=${subdir%/} && targetdir=${targetdir%/*} && mkdir -p "${S}/${targetdir}" 241 [[ ${subdir%/} = */* ]] && targetdir=${subdir%/} && targetdir=${targetdir%/*} && mkdir -p "${S}/${targetdir}"
222 rsync --recursive ${rsync_options} "${ESVN_WC_PATH}/${kmnamedir}${subdir%/}" "${S}/${targetdir}" \ 242 rsync --recursive ${rsync_options} "${ESVN_WC_PATH}/${kmnamedir}${subdir%/}" "${S}/${targetdir}" \
223 || die "${ESVN}: can't export subdirectory '${subdir}' to '${S}/${targetdir}'." 243 || die "${ESVN}: can't export subdirectory '${subdir}' to '${S}/${targetdir}'."
224 done 244 done
225 245
226 if [[ ${KMNAME} = kdebase-runtime && ${PN} != kdebase-data ]]; then 246 if [[ ${KMNAME} = kdebase-runtime && ${PN} != kdebase-data ]]; then
227 sed -i -e '/^install(PROGRAMS[[:space:]]*[^[:space:]]*\/kde4[[:space:]]/s/^/#DONOTINSTALL /' \ 247 sed -i -e '/^install(PROGRAMS[[:space:]]*[^[:space:]]*\/kde4[[:space:]]/s/^/#DONOTINSTALL /' \
228 "${S}"/CMakeLists.txt || die "Sed to exclude bin/kde4 failed" 248 "${S}"/CMakeLists.txt || die "Sed to exclude bin/kde4 failed"
229 fi 249 fi
230 else 250 else
231 local abort tarball tarfile f extractlist moduleprefix 251 local abort tarball tarfile f extractlist moduleprefix postfix
232 252 case ${PV} in
233 case $KMNAME in 253 4.2.85)
234 kdebase-apps) 254 # block for normally packed upstream unstable snapshots
235 tarball="${KMNAME#-apps}-${PV}.tar.bz2" 255 KMTARPARAMS="${KMTARPARAMS} --bzip2" # bz2
256 postfix="bz2"
257 ;;
258 4.2.9* | 4.2.8* | 4.2.7* | 4.2.6*)
259 KMTARPARAMS="${KMTARPARAMS} --lzma" # lzma
260 postfix="lzma"
236 ;; 261 ;;
237 *) 262 *)
238 tarball="${KMNAME}-${PV}.tar.bz2" 263 KMTARPARAMS="${KMTARPARAMS} --bzip2" # bz2
264 postfix="bz2"
239 ;; 265 ;;
240 esac 266 esac
267 case ${KMNAME} in
268 kdebase-apps)
269 # kdebase/apps -> kdebasa-apps
270 tarball="kdebase-${PV}.tar.${postfix}"
271 # Go one level deeper for kdebase-apps in tarballs
272 moduleprefix=apps/
273 KMTARPARAMS="${KMTARPARAMS} --transform=s|apps/||"
274 ;;
275 *)
276 # Create tarball name from module name (this is the default)
277 tarball="${KMNAME}-${PV}.tar.${postfix}"
278 ;;
279 esac
280
281 # Full patch to source tarball
241 tarfile="${DISTDIR}/${tarball}" 282 tarfile="${DISTDIR}/${tarball}"
283
284 # Detect real toplevel dir from tarball name - it will be used upon extraction
285 # and in __list_needed_subdirectories
286 topdir="${tarball%.tar.*}/"
242 287
243 ebegin "Unpacking parts of ${tarball} to ${WORKDIR}" 288 ebegin "Unpacking parts of ${tarball} to ${WORKDIR}"
244 289
245 kde4-meta_create_extractlists 290 kde4-meta_create_extractlists
246 291
247 for f in cmake/ CMakeLists.txt ConfigureChecks.cmake config.h.cmake \ 292 for f in cmake/ CMakeLists.txt ConfigureChecks.cmake config.h.cmake \
248 AUTHORS COPYING INSTALL README NEWS ChangeLog 293 AUTHORS COPYING INSTALL README NEWS ChangeLog
249 do 294 do
250 extractlist="${extractlist} ${KMNAME}-${PV}/${f}" 295 extractlist="${extractlist} ${topdir}${moduleprefix}${f}"
251 done 296 done
252 extractlist="${extractlist} $(__list_needed_subdirectories)" 297 extractlist="${extractlist} $(__list_needed_subdirectories)"
253 KMTARPARAMS="${KMTARPARAMS} -j"
254 298
255 pushd "${WORKDIR}" > /dev/null 299 pushd "${WORKDIR}" > /dev/null
256 [[ -n ${KDE4_STRICTER} ]] && echo tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} >&2 300 [[ -n ${KDE4_STRICTER} ]] && echo tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} >&2
257 tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} 2> /dev/null 301 tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} 2> /dev/null
258 302
259 # Default $S is based on $P; rename the extracted directory to match $S if necessary 303 # Default $S is based on $P; rename the extracted directory to match $S if necessary
260 mv ${KMNAME}-${PV} ${P} || die "Died while moving \"${KMNAME}-${PV}\" to \"${P}\"" 304 mv ${topdir} ${P} || die "Died while moving \"${topdir}\" to \"${P}\""
261 305
262 popd > /dev/null 306 popd > /dev/null
263 307
264 eend $? 308 eend $?
265 309
273 abort=true 317 abort=true
274 fi 318 fi
275 done 319 done
276 [[ -n ${abort} ]] && die "There were missing files." 320 [[ -n ${abort} ]] && die "There were missing files."
277 fi 321 fi
322
323 # We don't need it anymore
324 unset topdir
278 fi 325 fi
279} 326}
280 327
281# @FUNCTION: kde4-meta_create_extractlists 328# @FUNCTION: kde4-meta_create_extractlists
282# @DESCRIPTION: 329# @DESCRIPTION:
284# Also see descriptions of KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY, 331# Also see descriptions of KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY,
285# KMEXTRACTONLY and KMTARPARAMS. 332# KMEXTRACTONLY and KMTARPARAMS.
286kde4-meta_create_extractlists() { 333kde4-meta_create_extractlists() {
287 debug-print-function ${FUNCNAME} "$@" 334 debug-print-function ${FUNCNAME} "$@"
288 335
289 if has htmlhandbook ${IUSE//+} && use htmlhandbook; then 336 # TODO change to KMEXTRA for more strict check
337 if has doc ${IUSE//+} && use doc && [[ -n ${KMMODULE} ]]; then
290 # We use the basename of $KMMODULE because $KMMODULE can contain 338 # We use the basename of $KMMODULE because $KMMODULE can contain
291 # the path to the module subdirectory. 339 # the path to the module subdirectory.
292 KMEXTRA_NONFATAL="${KMEXTRA_NONFATAL} doc/${KMMODULE##*/}" 340 KMEXTRA_NONFATAL="${KMEXTRA_NONFATAL} doc/${KMMODULE##*/}"
293 fi 341 fi
294 342
324 KMEXTRACTONLY="${KMEXTRACTONLY} 372 KMEXTRACTONLY="${KMEXTRACTONLY}
325 libkdegames" 373 libkdegames"
326 fi 374 fi
327 ;; 375 ;;
328 kdepim) 376 kdepim)
377 if [[ ${PN} != libkdepim ]]; then
378 KMEXTRACTONLY="${KMEXTRACTONLY}
379 libkdepim"
380 fi
381 case ${SLOT} in
382 4.3|live)
383 KMEXTRACTONLY="${KMEXTRACTONLY}
384 kdepim-version.h
385 config-enterprise.h.cmake"
386 ;;
387 esac
329 KMEXTRACTONLY="${KMEXTRACTONLY} 388 KMEXTRACTONLY="${KMEXTRACTONLY}
330 kleopatra/ConfigureChecks.cmake 389 kleopatra/ConfigureChecks.cmake"
331 libkdepim/kdepim_export.h"
332 if has kontact ${IUSE//+} && use kontact; then 390 if has kontact ${IUSE//+} && use kontact; then
333 KMEXTRA="${KMEXTRA} kontact/plugins/${PLUGINNAME:-${PN}}" 391 KMEXTRA="${KMEXTRA} kontact/plugins/${PLUGINNAME:-${PN}}"
334 KMEXTRACTONLY="${KMEXTRACTONLY} kontactinterfaces/" 392 KMEXTRACTONLY="${KMEXTRACTONLY} kontactinterfaces/"
335 fi 393 fi
336 ;; 394 ;;
344 config-prefix.h.cmake" 402 config-prefix.h.cmake"
345 ;; 403 ;;
346 esac 404 esac
347 # Don't install cmake modules for split ebuilds, to avoid collisions. 405 # Don't install cmake modules for split ebuilds, to avoid collisions.
348 case ${KMNAME} in 406 case ${KMNAME} in
407 kdepim)
408 # No need for unpack since 4.2.86
409 # Remove when 4.2 is wiped out from the tree
410 case ${PV} in
411 4.1*|4.2.0|4.2.1|4.2.2|4.2.3|4.2.4|4.2.85)
412 KMCOMPILEONLY="${KMCOMPILEONLY}
413 cmake/modules/"
414 ;;
415 *) ;;
416 esac
417 ;;
349 kdebase-runtime|kdebase-workspace|kdeedu|kdegames|kdegraphics|kdepim) 418 kdebase-runtime|kdebase-workspace|kdeedu|kdegames|kdegraphics)
350 case ${PN} in 419 case ${PN} in
351 libkdegames|libkdeedu|marble|libkworkspace) 420 libkdegames|libkdeedu|libkworkspace)
352 KMEXTRA="${KMEXTRA} 421 KMEXTRA="${KMEXTRA}
353 cmake/modules/" 422 cmake/modules/"
354 ;; 423 ;;
355 *) 424 *)
356 KMCOMPILEONLY="${KMCOMPILEONLY} 425 KMCOMPILEONLY="${KMCOMPILEONLY}
362 431
363 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME}: KMEXTRACTONLY ${KMEXTRACTONLY}" 432 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME}: KMEXTRACTONLY ${KMEXTRACTONLY}"
364} 433}
365 434
366__list_needed_subdirectories() { 435__list_needed_subdirectories() {
367 local i j kmextra kmextra_expanded kmmodule_expanded kmcompileonly_expanded extractlist topdir 436 local i j kmextra kmextra_expanded kmmodule_expanded kmcompileonly_expanded extractlist
368 437
369 # We expand KMEXTRA by adding CMakeLists.txt files 438 # We expand KMEXTRA by adding CMakeLists.txt files
370 kmextra="${KMEXTRA}" 439 kmextra="${KMEXTRA}"
371 [[ ${1} != fatal ]] && kmextra="${kmextra} ${KMEXTRA_NONFATAL}" 440 [[ ${1} != fatal ]] && kmextra="${kmextra} ${KMEXTRA_NONFATAL}"
372 for i in ${kmextra}; do 441 for i in ${kmextra}; do
400 469
401 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmextra_expanded: ${kmextra_expanded}" 470 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmextra_expanded: ${kmextra_expanded}"
402 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmmodule_expanded: ${kmmodule_expanded}" 471 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmmodule_expanded: ${kmmodule_expanded}"
403 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmcompileonly_expanded: ${kmcompileonly_expanded}" 472 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmcompileonly_expanded: ${kmcompileonly_expanded}"
404 473
405 case ${PV} in
406 scm|9999*) : ;;
407 *) topdir="${KMNAME}-${PV}/" ;;
408 esac
409 # Create final list of stuff to extract 474 # Create final list of stuff to extract
410 # We append topleveldir only when specified (usually for tarballs) 475 # We append topdir only when specified (usually for tarballs)
411 for i in ${kmmodule_expanded} ${kmextra_expanded} ${kmcompileonly_expanded} \ 476 for i in ${kmmodule_expanded} ${kmextra_expanded} ${kmcompileonly_expanded} \
412 ${KMEXTRACTONLY} 477 ${KMEXTRACTONLY}
413 do 478 do
414 extractlist="${extractlist} ${topdir}${moduleprefix}${i}" 479 extractlist="${extractlist} ${topdir}${moduleprefix}${i}"
415 done 480 done
424 debug-print-function ${FUNCNAME} "$@" 489 debug-print-function ${FUNCNAME} "$@"
425 490
426 kde4-meta_change_cmakelists 491 kde4-meta_change_cmakelists
427 kde4-base_src_prepare 492 kde4-base_src_prepare
428} 493}
429
430 494
431# FIXME: no comment here? 495# FIXME: no comment here?
432_change_cmakelists_parent_dirs() { 496_change_cmakelists_parent_dirs() {
433 debug-print-function ${FUNCNAME} "$@" 497 debug-print-function ${FUNCNAME} "$@"
434 498
468 find "${S}"/${KMMODULE} -name CMakeLists.txt -print0 | xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \ 532 find "${S}"/${KMMODULE} -name CMakeLists.txt -print0 | xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \
469 die "${LINENO}: died in KMMODULE section" 533 die "${LINENO}: died in KMMODULE section"
470 _change_cmakelists_parent_dirs ${KMMODULE} 534 _change_cmakelists_parent_dirs ${KMMODULE}
471 fi 535 fi
472 536
537 local i
538
539 # KMEXTRACTONLY section - Some ebuilds need to comment out some subdirs in KMMODULE and they use KMEXTRACTONLY
540 for i in ${KMEXTRACTONLY}; do
541 if [[ -d "${S}"/${i} && -f "${S}"/${i}/../CMakeLists.txt ]]; then
542 sed -i -e "/([[:space:]]*$(basename $i)[[:space:]]*)/s/^/#DONOTCOMPILE /" "${S}"/${i}/../CMakeLists.txt || \
543 die "${LINENO}: sed died while working in the KMEXTRACTONLY section while processing ${i}"
544 fi
545 done
546
473 # KMCOMPILEONLY 547 # KMCOMPILEONLY
474 local i
475 for i in ${KMCOMPILEONLY}; do 548 for i in ${KMCOMPILEONLY}; do
476 debug-print "${LINENO}: KMCOMPILEONLY, processing ${i}" 549 debug-print "${LINENO}: KMCOMPILEONLY, processing ${i}"
477 # Uncomment "add_subdirectory" instructions inside $KMCOMPILEONLY, then comment "install" instructions. 550 # Uncomment "add_subdirectory" instructions inside $KMCOMPILEONLY, then comment "install" instructions.
478 find "${S}"/${i} -name CMakeLists.txt -print0 | \ 551 find "${S}"/${i} -name CMakeLists.txt -print0 | \
479 xargs -0 sed -i \ 552 xargs -0 sed -i \
498 if [[ -d "${S}"/${i} ]]; then 571 if [[ -d "${S}"/${i} ]]; then
499 find "${S}"/${i} -name CMakeLists.txt -print0 | \ 572 find "${S}"/${i} -name CMakeLists.txt -print0 | \
500 xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \ 573 xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \
501 die "${LINENO}: sed died uncommenting add_subdirectory instructions in KMEXTRA section while processing ${i}" 574 die "${LINENO}: sed died uncommenting add_subdirectory instructions in KMEXTRA section while processing ${i}"
502 _change_cmakelists_parent_dirs ${i} 575 _change_cmakelists_parent_dirs ${i}
503 fi
504 done
505
506 # KMEXTRACTONLY section - Some ebuilds need to comment out some subdirs in KMMODULE and they use KMEXTRACTONLY
507 for i in ${KMEXTRACTONLY}; do
508 if [[ -d "${S}"/${i} && -f "${S}"/${i}/../CMakeLists.txt ]]; then
509 sed -i -e "/([[:space:]]*$(basename $i)[[:space:]]*)/s/^/#DONOTCOMPILE /" "${S}"/${i}/../CMakeLists.txt || \
510 die "${LINENO}: sed died while working in the KMEXTRACTONLY section while processing ${i}"
511 fi 576 fi
512 done 577 done
513 578
514 case ${KMNAME} in 579 case ${KMNAME} in
515 kdebase-workspace) 580 kdebase-workspace)
521 sed -i -e '/startkde/s/^/#DONOTINSTALL /' "${S}"/CMakeLists.txt || \ 586 sed -i -e '/startkde/s/^/#DONOTINSTALL /' "${S}"/CMakeLists.txt || \
522 die "${LINENO}: sed died in the kdebase-startkde collision prevention section" 587 die "${LINENO}: sed died in the kdebase-startkde collision prevention section"
523 fi 588 fi
524 # Strip EXPORT feature section from workspace for KDE4 versions > 4.1.82 589 # Strip EXPORT feature section from workspace for KDE4 versions > 4.1.82
525 if [[ ${PN} != libkworkspace ]]; then 590 if [[ ${PN} != libkworkspace ]]; then
591 sed -i \
526 sed -i -e '/install(FILES ${CMAKE_CURRENT_BINARY_DIR}\/KDE4WorkspaceConfig.cmake/,/^[[:space:]]*FILE KDE4WorkspaceLibraryTargets.cmake )[[:space:]]*^/d' \ 592 -e '/install(FILES ${CMAKE_CURRENT_BINARY_DIR}\/KDE4WorkspaceConfig.cmake/,/^[[:space:]]*FILE KDE4WorkspaceLibraryTargets.cmake )[[:space:]]*^/d' \
527 CMakeLists.txt || die "${LINENO}: sed died in kdebase-workspace strip EXPORT section" 593 CMakeLists.txt || die "${LINENO}: sed died in kdebase-workspace strip config install and fix EXPORT section"
528 fi 594 fi
529 ;; 595 ;;
530 kdebase-runtime) 596 kdebase-runtime)
531 # COLLISION PROTECT section 597 # COLLISION PROTECT section
532 # Only install the kde4 script as part of kde-base/kdebase-data 598 # Only install the kde4 script as part of kde-base/kdebase-data
541 sed -i -n -e '/qt4_generate_dbus_interface(.*org\.kde\.kmail\.\(kmail\|mailcomposer\)\.xml/p' \ 607 sed -i -n -e '/qt4_generate_dbus_interface(.*org\.kde\.kmail\.\(kmail\|mailcomposer\)\.xml/p' \
542 -e '/add_custom_target(kmail_xml /,/)/p' "${S}"/kmail/CMakeLists.txt || die "uncommenting xml failed" 608 -e '/add_custom_target(kmail_xml /,/)/p' "${S}"/kmail/CMakeLists.txt || die "uncommenting xml failed"
543 _change_cmakelists_parent_dirs kmail 609 _change_cmakelists_parent_dirs kmail
544 ;; 610 ;;
545 esac 611 esac
612 ;;
613 kdewebdev)
614 # Disable hardcoded kdepimlibs check
615 sed -e 's/find_package(KdepimLibs REQUIRED)/macro_optional_find_package(KdepimLibs)/' \
616 -e 's/find_package(LibXml2 REQUIRED)/macro_optional_find_package(LibXml2)/' \
617 -e 's/find_package(LibXslt REQUIRED)/macro_optional_find_package(LibXslt)/' \
618 -e 's/find_package(Boost REQUIRED)/macro_optional_find_package(Boost)/' \
619 -i CMakeLists.txt || die "failed to disable hardcoded checks"
546 ;; 620 ;;
547 koffice) 621 koffice)
548 # prevent collisions 622 # prevent collisions
549 if [[ ${PN} != koffice-data ]]; then 623 if [[ ${PN} != koffice-data ]]; then
550 sed -i -e '/install(.*FindKOfficeLibs.cmake/,/)/ d' \ 624 sed -i -e '/install(.*FindKOfficeLibs.cmake/,/)/ d' \
564# Currently just calls its equivalent in kde4-base.eclass(5). Use this one in split 638# Currently just calls its equivalent in kde4-base.eclass(5). Use this one in split
565# ebuilds. 639# ebuilds.
566kde4-meta_src_configure() { 640kde4-meta_src_configure() {
567 debug-print-function ${FUNCNAME} "$@" 641 debug-print-function ${FUNCNAME} "$@"
568 642
643 # Set some cmake default values here (usually workarounds for automagic deps)
644 case ${KMNAME} in
645 kdewebdev)
646 mycmakeargs="
647 -DWITH_KdepimLibs=OFF
648 -DWITH_LibXml2=OFF
649 -DWITH_LibXslt=OFF
650 -DWITH_Boost=OFF
651 -DWITH_LibTidy=OFF
652 ${mycmakeargs}"
653 ;;
654 esac
655
569 kde4-base_src_configure 656 kde4-base_src_configure
570} 657}
571 658
572# @FUNCTION: kde4-meta_src_compile 659# @FUNCTION: kde4-meta_src_compile
573# @DESCRIPTION: 660# @DESCRIPTION:
574# General function for compiling split KDE4 applications. 661# General function for compiling split KDE4 applications.
575# Overrides kde4-base_src_compile. 662# Overrides kde4-base_src_compile.
576kde4-meta_src_compile() { 663kde4-meta_src_compile() {
577 debug-print-function ${FUNCNAME} "$@" 664 debug-print-function ${FUNCNAME} "$@"
578 665
579 kde4-base_src_make 666 kde4-base_src_compile
580} 667}
581 668
582# @FUNCTION: kde4-meta_src_test 669# @FUNCTION: kde4-meta_src_test
583# @DESCRIPTION: 670# @DESCRIPTION:
584# Currently just calls its equivalent in kde4-base.eclass(5). Use this in split 671# Currently just calls its equivalent in kde4-base.eclass(5). Use this in split
593# @DESCRIPTION: 680# @DESCRIPTION:
594# Function for installing KDE4 split applications. 681# Function for installing KDE4 split applications.
595kde4-meta_src_install() { 682kde4-meta_src_install() {
596 debug-print-function $FUNCNAME "$@" 683 debug-print-function $FUNCNAME "$@"
597 684
598 kde4-meta_src_make_doc 685 kde4-base_src_install
599 cmake-utils_src_install
600
601 if [[ -n ${KMSAVELIBS} ]]; then
602 install_library_dependencies
603 fi
604} 686}
605 687
606# @FUNCTION: kde4-meta_src_make_doc 688# @FUNCTION: kde4-meta_src_make_doc
607# @DESCRIPTION: 689# @DESCRIPTION:
608# This function searches in ${S}/${KMMODULE}, 690# This function searches in ${S}/${KMMODULE},
618 kde4-base_src_make_doc 700 kde4-base_src_make_doc
619} 701}
620 702
621# @FUNCTION: kde4-meta_pkg_postinst 703# @FUNCTION: kde4-meta_pkg_postinst
622# @DESCRIPTION: 704# @DESCRIPTION:
623# Currently just calls its equivalent in kde4-base.eclass(5). Use this in split 705# Display information about application handbook and invoke kbuildsycoca4.
624# ebuilds.
625kde4-meta_pkg_postinst() { 706kde4-meta_pkg_postinst() {
626 debug-print-function ${FUNCNAME} "$@" 707 debug-print-function ${FUNCNAME} "$@"
708
709 if has doc ${IUSE//+} && ! use doc; then
710 echo
711 einfo "Application handbook for ${PN} has not been installed."
712 einfo "To install handbook, reemerge =${CATEGORY}/${P} with 'doc' USE flag."
713 echo
714 fi
627 715
628 kde4-base_pkg_postinst 716 kde4-base_pkg_postinst
629} 717}
630 718
631# @FUNCTION: kde4-meta_pkg_postrm 719# @FUNCTION: kde4-meta_pkg_postrm

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.20

  ViewVC Help
Powered by ViewVC 1.1.20