/[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.23
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.23 2009/08/03 21:59:53 wired 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 handbooks
35if [[ ${PN} != khelpcenter ]] && has handbook ${IUSE//+}; then
36 RDEPEND+=" handbook? ( >=kde-base/khelpcenter-${PV}:${SLOT}[kdeprefix=] )"
37fi
38
34# Add dependencies that all packages in a certain module share. 39# Add dependencies that all packages in a certain module share.
35case ${KMNAME} in 40case ${KMNAME} in
36 kdebase|kdebase-workspace|kdebase-runtime) 41 kdebase|kdebase-apps|kdebase-workspace|kdebase-runtime|kdegraphics)
37 DEPEND="${DEPEND} >=kde-base/qimageblitz-0.0.4" 42 COMMONDEPEND+=" >=kde-base/qimageblitz-0.0.4"
38 RDEPEND="${RDEPEND} >=kde-base/qimageblitz-0.0.4"
39 ;; 43 ;;
40 kdepim) 44 kdenetwork)
41 DEPEND="${DEPEND} dev-libs/boost app-office/akonadi-server"
42 RDEPEND="${RDEPEND} dev-libs/boost"
43 if [[ ${PN} != kode ]]; then
44 DEPEND="${DEPEND} >=kde-base/kode-${PV}:${SLOT}[kdeprefix=]" 45 COMMONDEPEND+=" >=kde-base/kdepimlibs-${PV}:${SLOT}[kdeprefix=]"
45 RDEPEND="${RDEPEND} >=kde-base/kode-${PV}:${SLOT}[kdeprefix=]" 46 ;;
46 fi 47 kdepim|kdepim-runtime)
48 COMMONDEPEND+="
49 dev-libs/boost
50 >=kde-base/kdepimlibs-${PV}:${SLOT}[kdeprefix=]
51 "
47 case ${PN} in 52 case ${PN} in
48 akregator|kaddressbook|kjots|kmail|kmobiletools|knode|knotes|korganizer|ktimetracker) 53 akregator|kaddressbook|kjots|kmail|knode|knotes|korganizer|ktimetracker)
49 IUSE="+kontact" 54 IUSE+=" +kontact"
50 DEPEND="${DEPEND} kontact? ( >=kde-base/kontactinterfaces-${PV}:${SLOT}[kdeprefix=] )"
51 RDEPEND="${RDEPEND} kontact? ( >=kde-base/kontactinterfaces-${PV}:${SLOT}[kdeprefix=] )" 55 RDEPEND+=" kontact? ( >=kde-base/kontactinterfaces-${PV}:${SLOT}[kdeprefix=] )"
52 ;; 56 ;;
53 esac 57 esac
54 ;; 58 ;;
55 kdegames) 59 kdegames)
56 if [[ ${PN} != libkdegames ]]; then 60 if [[ ${PN} != libkdegames ]]; then
57 DEPEND="${DEPEND} >=kde-base/libkdegames-${PV}:${SLOT}[kdeprefix=]" 61 COMMONDEPEND+=" >=kde-base/libkdegames-${PV}:${SLOT}[kdeprefix=] "
58 RDEPEND="${RDEPEND} >=kde-base/libkdegames-${PV}:${SLOT}[kdeprefix=]"
59 fi 62 fi
60 ;; 63 ;;
61 koffice) 64 koffice)
62 [[ ${PN} != koffice-data ]] && IUSE="debug" 65 [[ ${PN} != koffice-data ]] && IUSE+=" debug"
63 case ${PV} in 66 RDEPEND+="
64 9999*) DEPEND="${DEPEND} !app-office/${PN}:2" ;;
65 1.9*|2*) DEPEND="${DEPEND} !app-office/${PN}:live" ;;
66 esac
67 DEPEND="${DEPEND}
68 !app-office/${PN}:0 67 !app-office/${PN}:0
69 !app-office/koffice:0 68 !app-office/koffice:0
70 !app-office/koffice-meta:0" 69 !app-office/koffice-meta:0
71 case ${PN} in 70 "
72 koffice-data) 71 if has openexr ${IUSE//+}; then
73 DEPEND="${DEPEND} media-libs/lcms" 72 COMMONDEPEND+=" media-gfx/imagemagick[openexr?]"
74 RDEPEND="${RDEPEND} media-libs/lcms" 73 else
75 ;; 74 COMMONDEPEND+=" media-gfx/imagemagick"
76 *) 75 fi
77 DEPEND="${DEPEND} 76
77 COMMONDEPEND+="
78 dev-cpp/eigen:2 78 dev-cpp/eigen:2
79 media-gfx/imagemagick[openexr?]
80 media-libs/fontconfig 79 media-libs/fontconfig
81 media-libs/freetype:2 80 media-libs/freetype:2
82 " 81 "
83 RDEPEND="${DEPEND}"
84 if [[ ${PN} != koffice-libs && ${PN} != koffice-data ]]; then 82 if [[ ${PN} != koffice-libs && ${PN} != koffice-data ]]; then
85 DEPEND="${DEPEND} 83 COMMONDEPEND+=" >=app-office/koffice-libs-${PV}:${SLOT}"
86 >=app-office/koffice-libs-${PV}:${SLOT}[kdeprefix=]"
87 RDEPEND="${RDEPEND}
88 >=app-office/koffice-libs-${PV}:${SLOT}[kdeprefix=]"
89 fi 84 fi
90 ;;
91 esac
92 ;; 85 ;;
93esac 86esac
87
88DEPEND+=" ${COMMONDEPEND}"
89RDEPEND+=" ${COMMONDEPEND}"
90unset COMMONDEPEND
94 91
95debug-print "line ${LINENO} ${ECLASS}: DEPEND ${DEPEND} - after metapackage-specific dependencies" 92debug-print "line ${LINENO} ${ECLASS}: DEPEND ${DEPEND} - after metapackage-specific dependencies"
96debug-print "line ${LINENO} ${ECLASS}: RDEPEND ${RDEPEND} - after metapackage-specific dependencies" 93debug-print "line ${LINENO} ${ECLASS}: RDEPEND ${RDEPEND} - after metapackage-specific dependencies"
97 94
98# Useful to build kde4-meta style stuff from extragear/playground (plasmoids etc) 95# Useful to build kde4-meta style stuff from extragear/playground (plasmoids etc)
99case ${SLOT} in 96case ${BUILD_TYPE} in
100 live) 97 live)
101 case ${KMNAME} in 98 case ${KMNAME} in
102 extragear*|playground*) 99 extragear*|playground*)
103 ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}" 100 ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}"
101 ESVN_PROJECT="${KMNAME}${ESVN_PROJECT_SUFFIX}"
104 ;; 102 ;;
105 esac 103 esac
106 ;; 104 ;;
107esac 105esac
108 106
133 131
134# @ECLASS-VARIABLE: KMEXTRA 132# @ECLASS-VARIABLE: KMEXTRA
135# @DESCRIPTION: 133# @DESCRIPTION:
136# All subdirectories listed here will be extracted, compiled & installed. 134# All subdirectories listed here will be extracted, compiled & installed.
137# $KMMODULE is always added to $KMEXTRA. 135# $KMMODULE is always added to $KMEXTRA.
138# If the htmlhandbook USE-flag is set, and if this directory exists, 136# If the handbook USE-flag is set, and if this directory exists,
139# then "doc/$KMMODULE" is added to $KMEXTRA. In other cases, this should be 137# then "doc/$KMMODULE" is added to $KMEXTRA. In other cases, this should be
140# handled in the ebuild. 138# handled in the ebuild.
141# If the documentation is in a different subdirectory, you should add it to KMEXTRA. 139# If the documentation is in a different subdirectory, you should add it to KMEXTRA.
142 140
143# @ECLASS-VARIABLE: KMCOMPILEONLY 141# @ECLASS-VARIABLE: KMCOMPILEONLY
211 rsync --recursive ${rsync_options} "${ESVN_WC_PATH}/${kmnamedir}cmake" "${S}" \ 209 rsync --recursive ${rsync_options} "${ESVN_WC_PATH}/${kmnamedir}cmake" "${S}" \
212 || die "${ESVN}: can't export cmake files to '${S}'." 210 || die "${ESVN}: can't export cmake files to '${S}'."
213 fi 211 fi
214 # Copy all subdirectories 212 # Copy all subdirectories
215 for subdir in $(__list_needed_subdirectories); do 213 for subdir in $(__list_needed_subdirectories); do
216 targetdir="" 214 targetdir=""
217 if [[ $subdir = doc/* && ! -e "$ESVN_WC_PATH/$kmnamedir$subdir" ]]; then 215 if [[ $subdir = doc/* && ! -e "$ESVN_WC_PATH/$kmnamedir$subdir" ]]; then
218 continue 216 continue
219 fi 217 fi
220 218
221 [[ ${subdir%/} = */* ]] && targetdir=${subdir%/} && targetdir=${targetdir%/*} && mkdir -p "${S}/${targetdir}" 219 [[ ${subdir%/} = */* ]] && targetdir=${subdir%/} && targetdir=${targetdir%/*} && mkdir -p "${S}/${targetdir}"
222 rsync --recursive ${rsync_options} "${ESVN_WC_PATH}/${kmnamedir}${subdir%/}" "${S}/${targetdir}" \ 220 rsync --recursive ${rsync_options} "${ESVN_WC_PATH}/${kmnamedir}${subdir%/}" "${S}/${targetdir}" \
223 || die "${ESVN}: can't export subdirectory '${subdir}' to '${S}/${targetdir}'." 221 || die "${ESVN}: can't export subdirectory '${subdir}' to '${S}/${targetdir}'."
224 done 222 done
225 223
226 if [[ ${KMNAME} = kdebase-runtime && ${PN} != kdebase-data ]]; then 224 if [[ ${KMNAME} = kdebase-runtime && ${PN} != kdebase-data ]]; then
227 sed -i -e '/^install(PROGRAMS[[:space:]]*[^[:space:]]*\/kde4[[:space:]]/s/^/#DONOTINSTALL /' \ 225 sed -i -e '/^install(PROGRAMS[[:space:]]*[^[:space:]]*\/kde4[[:space:]]/s/^/#DONOTINSTALL /' \
228 "${S}"/CMakeLists.txt || die "Sed to exclude bin/kde4 failed" 226 "${S}"/CMakeLists.txt || die "Sed to exclude bin/kde4 failed"
229 fi 227 fi
230 else 228 else
231 local abort tarball tarfile f extractlist moduleprefix 229 local abort tarball tarfile f extractlist moduleprefix postfix
232 230 case ${PV} in
231 4.3.85 | 4.3.90 | 4.3.95 | 4.3.96 | 4.3.98 | 4.2.85 | 4.2.90 | 4.2.95 | 4.2.96 | 4.2.98)
232 # block for normally packed upstream unstable snapshots
233 KMTARPARAMS+=" --bzip2" # bz2
234 postfix="bz2"
235 ;;
236 4.2.9* | 4.2.8* | 4.2.7* | 4.2.6* | 4.3.9* | 4.3.8* | 4.3.7* | 4.3.6*)
237 KMTARPARAMS+=" --lzma" # lzma
238 postfix="lzma"
239 ;;
240 *)
241 KMTARPARAMS+=" --bzip2" # bz2
242 postfix="bz2"
243 ;;
244 esac
233 case $KMNAME in 245 case ${KMNAME} in
234 kdebase-apps) 246 kdebase-apps)
235 tarball="${KMNAME#-apps}-${PV}.tar.bz2" 247 # kdebase/apps -> kdebase-apps
248 tarball="kdebase-${PV}.tar.${postfix}"
249 # Go one level deeper for kdebase-apps in tarballs
250 moduleprefix=apps/
251 KMTARPARAMS+=" --transform=s|apps/||"
236 ;; 252 ;;
237 *) 253 *)
254 # Create tarball name from module name (this is the default)
238 tarball="${KMNAME}-${PV}.tar.bz2" 255 tarball="${KMNAME}-${PV}.tar.${postfix}"
239 ;; 256 ;;
240 esac 257 esac
258
259 # Full path to source tarball
241 tarfile="${DISTDIR}/${tarball}" 260 tarfile="${DISTDIR}/${tarball}"
261
262 # Detect real toplevel dir from tarball name - it will be used upon extraction
263 # and in __list_needed_subdirectories
264 topdir="${tarball%.tar.*}/"
242 265
243 ebegin "Unpacking parts of ${tarball} to ${WORKDIR}" 266 ebegin "Unpacking parts of ${tarball} to ${WORKDIR}"
244 267
245 kde4-meta_create_extractlists 268 kde4-meta_create_extractlists
246 269
247 for f in cmake/ CMakeLists.txt ConfigureChecks.cmake config.h.cmake \ 270 for f in cmake/ CMakeLists.txt ConfigureChecks.cmake config.h.cmake \
248 AUTHORS COPYING INSTALL README NEWS ChangeLog 271 AUTHORS COPYING INSTALL README NEWS ChangeLog
249 do 272 do
250 extractlist="${extractlist} ${KMNAME}-${PV}/${f}" 273 extractlist+=" ${topdir}${moduleprefix}${f}"
251 done 274 done
252 extractlist="${extractlist} $(__list_needed_subdirectories)" 275 extractlist+=" $(__list_needed_subdirectories)"
253 KMTARPARAMS="${KMTARPARAMS} -j"
254 276
255 pushd "${WORKDIR}" > /dev/null 277 pushd "${WORKDIR}" > /dev/null
256 [[ -n ${KDE4_STRICTER} ]] && echo tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} >&2 278 [[ -n ${KDE4_STRICTER} ]] && echo tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} >&2
257 tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} 2> /dev/null 279 tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} 2> /dev/null
258 280
259 # Default $S is based on $P; rename the extracted directory to match $S if necessary 281 # 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}\"" 282 mv ${topdir} ${P} || die "Died while moving \"${topdir}\" to \"${P}\""
261 283
262 popd > /dev/null 284 popd > /dev/null
263 285
264 eend $? 286 eend $?
265 287
273 abort=true 295 abort=true
274 fi 296 fi
275 done 297 done
276 [[ -n ${abort} ]] && die "There were missing files." 298 [[ -n ${abort} ]] && die "There were missing files."
277 fi 299 fi
300
301 # We don't need it anymore
302 unset topdir
278 fi 303 fi
279} 304}
280 305
281# @FUNCTION: kde4-meta_create_extractlists 306# @FUNCTION: kde4-meta_create_extractlists
282# @DESCRIPTION: 307# @DESCRIPTION:
284# Also see descriptions of KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY, 309# Also see descriptions of KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY,
285# KMEXTRACTONLY and KMTARPARAMS. 310# KMEXTRACTONLY and KMTARPARAMS.
286kde4-meta_create_extractlists() { 311kde4-meta_create_extractlists() {
287 debug-print-function ${FUNCNAME} "$@" 312 debug-print-function ${FUNCNAME} "$@"
288 313
314 # TODO change to KMEXTRA for more strict check
289 if has htmlhandbook ${IUSE//+} && use htmlhandbook; then 315 if has handbook ${IUSE//+} && use handbook && [[ -n ${KMMODULE} ]]; then
290 # We use the basename of $KMMODULE because $KMMODULE can contain 316 # We use the basename of $KMMODULE because $KMMODULE can contain
291 # the path to the module subdirectory. 317 # the path to the module subdirectory.
292 KMEXTRA_NONFATAL="${KMEXTRA_NONFATAL} doc/${KMMODULE##*/}" 318 KMEXTRA_NONFATAL+="
319 doc/${KMMODULE##*/}"
293 fi 320 fi
294 321
295 # Add some CMake-files to KMEXTRACTONLY. 322 # Add some CMake-files to KMEXTRACTONLY.
296 # Note that this actually doesn't include KMEXTRA handling. 323 # Note that this actually doesn't include KMEXTRA handling.
297 # In those cases you should care to add the relevant files to KMEXTRACTONLY 324 # In those cases you should care to add the relevant files to KMEXTRACTONLY
298 case ${KMNAME} in 325 case ${KMNAME} in
299 kdebase) 326 kdebase)
300 KMEXTRACTONLY="${KMEXTRACTONLY} 327 KMEXTRACTONLY+="
301 apps/config-apps.h.cmake 328 apps/config-apps.h.cmake
302 apps/ConfigureChecks.cmake" 329 apps/ConfigureChecks.cmake"
303 ;; 330 ;;
304 kdebase-apps) 331 kdebase-apps)
305 KMEXTRACTONLY="${KMEXTRACTONLY} 332 KMEXTRACTONLY+="
306 config-apps.h.cmake 333 config-apps.h.cmake
307 ConfigureChecks.cmake" 334 ConfigureChecks.cmake"
308 ;; 335 ;;
309 kdebase-runtime) 336 kdebase-runtime)
310 KMEXTRACTONLY="${KMEXTRACTONLY} 337 KMEXTRACTONLY+="
311 config-runtime.h.cmake" 338 config-runtime.h.cmake"
312 ;; 339 ;;
313 kdebase-workspace) 340 kdebase-workspace)
314 KMEXTRACTONLY="${KMEXTRACTONLY} 341 KMEXTRACTONLY+="
315 config-unix.h.cmake 342 config-unix.h.cmake
316 ConfigureChecks.cmake 343 ConfigureChecks.cmake
317 config-workspace.h.cmake 344 config-workspace.h.cmake
318 config-X11.h.cmake 345 config-X11.h.cmake
319 startkde.cmake 346 startkde.cmake
320 KDE4WorkspaceConfig.cmake.in" 347 KDE4WorkspaceConfig.cmake.in"
321 ;; 348 ;;
322 kdegames) 349 kdegames)
323 if [[ ${PN} != libkdegames ]]; then 350 if [[ ${PN} != libkdegames ]]; then
324 KMEXTRACTONLY="${KMEXTRACTONLY} 351 KMEXTRACTONLY+="
325 libkdegames" 352 libkdegames/"
326 fi 353 fi
327 ;; 354 ;;
328 kdepim) 355 kdepim)
329 KMEXTRACTONLY="${KMEXTRACTONLY} 356 if [[ ${PN} != libkdepim ]]; then
357 KMEXTRACTONLY+="
358 libkdepim/"
359 fi
360 case ${SLOT} in
361 4.3|4.4|live)
362 KMEXTRACTONLY+="
363 kdepim-version.h
364 config-enterprise.h.cmake"
365 ;;
366 esac
367 KMEXTRACTONLY+="
330 kleopatra/ConfigureChecks.cmake 368 kleopatra/ConfigureChecks.cmake"
331 libkdepim/kdepim_export.h"
332 if has kontact ${IUSE//+} && use kontact; then 369 if has kontact ${IUSE//+} && use kontact; then
370 KMEXTRA+="
333 KMEXTRA="${KMEXTRA} kontact/plugins/${PLUGINNAME:-${PN}}" 371 kontact/plugins/${PLUGINNAME:-${PN}}/"
334 KMEXTRACTONLY="${KMEXTRACTONLY} kontactinterfaces/" 372 KMEXTRACTONLY+="
373 kontactinterfaces/"
335 fi 374 fi
336 ;; 375 ;;
376 kdeutils)
377 case ${SLOT} in
378 4.3|4.4|live)
379 KMEXTRACTONLY+="
380 kdeutils-version.h"
381 ;;
382 esac
383 ;;
337 koffice) 384 koffice)
338 KMEXTRACTONLY="${KMEXTRACTONLY} 385 KMEXTRACTONLY+="
339 config-endian.h.cmake 386 config-endian.h.cmake
340 filters/config-filters.h.cmake 387 filters/config-filters.h.cmake
341 config-openctl.h.cmake
342 config-openexr.h.cmake 388 config-openexr.h.cmake
343 config-opengl.h.cmake 389 config-opengl.h.cmake
344 config-prefix.h.cmake" 390 config-prefix.h.cmake
391 "
392 case ${PV} in
393 2.0.*)
394 KMEXTRACTONLY+="
395 config-openctl.h.cmake"
396 ;;
397 esac
345 ;; 398 ;;
346 esac 399 esac
347 # Don't install cmake modules for split ebuilds, to avoid collisions. 400 # Don't install cmake modules for split ebuilds, to avoid collisions.
348 case ${KMNAME} in 401 case ${KMNAME} in
402 kdepim)
403 # No need for unpack since 4.2.86
404 # Remove when 4.2 is wiped out from the tree
405 case ${PV} in
406 4.1*|4.2.0|4.2.1|4.2.2|4.2.3|4.2.4|4.2.85)
407 KMCOMPILEONLY+="
408 cmake/modules/"
409 ;;
410 *) ;;
411 esac
412 ;;
349 kdebase-runtime|kdebase-workspace|kdeedu|kdegames|kdegraphics|kdepim) 413 kdebase-runtime|kdebase-workspace|kdeedu|kdegames|kdegraphics)
350 case ${PN} in 414 case ${PN} in
351 libkdegames|libkdeedu|marble|libkworkspace) 415 libkdegames|libkdeedu|libkworkspace)
352 KMEXTRA="${KMEXTRA} 416 KMEXTRA+="
353 cmake/modules/" 417 cmake/modules/"
354 ;; 418 ;;
355 *) 419 *)
356 KMCOMPILEONLY="${KMCOMPILEONLY} 420 KMCOMPILEONLY+="
357 cmake/modules/" 421 cmake/modules/"
358 ;; 422 ;;
359 esac 423 esac
360 ;; 424 ;;
361 esac 425 esac
362 426
363 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME}: KMEXTRACTONLY ${KMEXTRACTONLY}" 427 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME}: KMEXTRACTONLY ${KMEXTRACTONLY}"
364} 428}
365 429
366__list_needed_subdirectories() { 430__list_needed_subdirectories() {
367 local i j kmextra kmextra_expanded kmmodule_expanded kmcompileonly_expanded extractlist topdir 431 local i j kmextra kmextra_expanded kmmodule_expanded kmcompileonly_expanded extractlist
368 432
369 # We expand KMEXTRA by adding CMakeLists.txt files 433 # We expand KMEXTRA by adding CMakeLists.txt files
370 kmextra="${KMEXTRA}" 434 kmextra="${KMEXTRA}"
371 [[ ${1} != fatal ]] && kmextra="${kmextra} ${KMEXTRA_NONFATAL}" 435 [[ ${1} != fatal ]] && kmextra+=" ${KMEXTRA_NONFATAL}"
372 for i in ${kmextra}; do 436 for i in ${kmextra}; do
373 kmextra_expanded="${kmextra_expanded} ${i}" 437 kmextra_expanded+=" ${i}"
374 j=$(dirname ${i}) 438 j=$(dirname ${i})
375 while [[ ${j} != "." ]]; do 439 while [[ ${j} != "." ]]; do
376 kmextra_expanded="${kmextra_expanded} ${j}/CMakeLists.txt"; 440 kmextra_expanded+=" ${j}/CMakeLists.txt";
377 j=$(dirname ${j}) 441 j=$(dirname ${j})
378 done 442 done
379 done 443 done
380 444
381 # Expand KMMODULE 445 # Expand KMMODULE
382 if [[ -n ${KMMODULE} ]]; then 446 if [[ -n ${KMMODULE} ]]; then
383 kmmodule_expanded="${KMMODULE}" 447 kmmodule_expanded="${KMMODULE}"
384 j=$(dirname ${KMMODULE}) 448 j=$(dirname ${KMMODULE})
385 while [[ ${j} != "." ]]; do 449 while [[ ${j} != "." ]]; do
386 kmmodule_expanded="${kmmodule_expanded} ${j}/CMakeLists.txt"; 450 kmmodule_expanded+=" ${j}/CMakeLists.txt";
387 j=$(dirname ${j}) 451 j=$(dirname ${j})
388 done 452 done
389 fi 453 fi
390 454
391 # Expand KMCOMPILEONLY 455 # Expand KMCOMPILEONLY
392 for i in ${KMCOMPILEONLY}; do 456 for i in ${KMCOMPILEONLY}; do
393 kmcompileonly_expanded="${kmcompileonly_expanded} ${i}" 457 kmcompileonly_expanded+=" ${i}"
394 j=$(dirname ${i}) 458 j=$(dirname ${i})
395 while [[ ${j} != "." ]]; do 459 while [[ ${j} != "." ]]; do
396 kmcompileonly_expanded="${kmcompileonly_expanded} ${j}/CMakeLists.txt"; 460 kmcompileonly_expanded+=" ${j}/CMakeLists.txt";
397 j=$(dirname ${j}) 461 j=$(dirname ${j})
398 done 462 done
399 done 463 done
400 464
401 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmextra_expanded: ${kmextra_expanded}" 465 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmextra_expanded: ${kmextra_expanded}"
402 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmmodule_expanded: ${kmmodule_expanded}" 466 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmmodule_expanded: ${kmmodule_expanded}"
403 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmcompileonly_expanded: ${kmcompileonly_expanded}" 467 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmcompileonly_expanded: ${kmcompileonly_expanded}"
404 468
405 case ${PV} in
406 scm|9999*) : ;;
407 *) topdir="${KMNAME}-${PV}/" ;;
408 esac
409 # Create final list of stuff to extract 469 # Create final list of stuff to extract
410 # We append topleveldir only when specified (usually for tarballs) 470 # We append topdir only when specified (usually for tarballs)
411 for i in ${kmmodule_expanded} ${kmextra_expanded} ${kmcompileonly_expanded} \ 471 for i in ${kmmodule_expanded} ${kmextra_expanded} ${kmcompileonly_expanded} \
412 ${KMEXTRACTONLY} 472 ${KMEXTRACTONLY}
413 do 473 do
414 extractlist="${extractlist} ${topdir}${moduleprefix}${i}" 474 extractlist+=" ${topdir}${moduleprefix}${i}"
415 done 475 done
416 476
417 echo ${extractlist} 477 echo ${extractlist}
418} 478}
419 479
424 debug-print-function ${FUNCNAME} "$@" 484 debug-print-function ${FUNCNAME} "$@"
425 485
426 kde4-meta_change_cmakelists 486 kde4-meta_change_cmakelists
427 kde4-base_src_prepare 487 kde4-base_src_prepare
428} 488}
429
430 489
431# FIXME: no comment here? 490# FIXME: no comment here?
432_change_cmakelists_parent_dirs() { 491_change_cmakelists_parent_dirs() {
433 debug-print-function ${FUNCNAME} "$@" 492 debug-print-function ${FUNCNAME} "$@"
434 493
468 find "${S}"/${KMMODULE} -name CMakeLists.txt -print0 | xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \ 527 find "${S}"/${KMMODULE} -name CMakeLists.txt -print0 | xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \
469 die "${LINENO}: died in KMMODULE section" 528 die "${LINENO}: died in KMMODULE section"
470 _change_cmakelists_parent_dirs ${KMMODULE} 529 _change_cmakelists_parent_dirs ${KMMODULE}
471 fi 530 fi
472 531
532 local i
533
534 # KMEXTRACTONLY section - Some ebuilds need to comment out some subdirs in KMMODULE and they use KMEXTRACTONLY
535 for i in ${KMEXTRACTONLY}; do
536 if [[ -d "${S}"/${i} && -f "${S}"/${i}/../CMakeLists.txt ]]; then
537 sed -i -e "/([[:space:]]*$(basename $i)[[:space:]]*)/s/^/#DONOTCOMPILE /" "${S}"/${i}/../CMakeLists.txt || \
538 die "${LINENO}: sed died while working in the KMEXTRACTONLY section while processing ${i}"
539 fi
540 done
541
473 # KMCOMPILEONLY 542 # KMCOMPILEONLY
474 local i
475 for i in ${KMCOMPILEONLY}; do 543 for i in ${KMCOMPILEONLY}; do
476 debug-print "${LINENO}: KMCOMPILEONLY, processing ${i}" 544 debug-print "${LINENO}: KMCOMPILEONLY, processing ${i}"
477 # Uncomment "add_subdirectory" instructions inside $KMCOMPILEONLY, then comment "install" instructions. 545 # Uncomment "add_subdirectory" instructions inside $KMCOMPILEONLY, then comment "install" instructions.
478 find "${S}"/${i} -name CMakeLists.txt -print0 | \ 546 find "${S}"/${i} -name CMakeLists.txt -print0 | \
479 xargs -0 sed -i \ 547 xargs -0 sed -i \
498 if [[ -d "${S}"/${i} ]]; then 566 if [[ -d "${S}"/${i} ]]; then
499 find "${S}"/${i} -name CMakeLists.txt -print0 | \ 567 find "${S}"/${i} -name CMakeLists.txt -print0 | \
500 xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \ 568 xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \
501 die "${LINENO}: sed died uncommenting add_subdirectory instructions in KMEXTRA section while processing ${i}" 569 die "${LINENO}: sed died uncommenting add_subdirectory instructions in KMEXTRA section while processing ${i}"
502 _change_cmakelists_parent_dirs ${i} 570 _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 571 fi
512 done 572 done
513 573
514 case ${KMNAME} in 574 case ${KMNAME} in
515 kdebase-workspace) 575 kdebase-workspace)
521 sed -i -e '/startkde/s/^/#DONOTINSTALL /' "${S}"/CMakeLists.txt || \ 581 sed -i -e '/startkde/s/^/#DONOTINSTALL /' "${S}"/CMakeLists.txt || \
522 die "${LINENO}: sed died in the kdebase-startkde collision prevention section" 582 die "${LINENO}: sed died in the kdebase-startkde collision prevention section"
523 fi 583 fi
524 # Strip EXPORT feature section from workspace for KDE4 versions > 4.1.82 584 # Strip EXPORT feature section from workspace for KDE4 versions > 4.1.82
525 if [[ ${PN} != libkworkspace ]]; then 585 if [[ ${PN} != libkworkspace ]]; then
586 sed -i \
526 sed -i -e '/install(FILES ${CMAKE_CURRENT_BINARY_DIR}\/KDE4WorkspaceConfig.cmake/,/^[[:space:]]*FILE KDE4WorkspaceLibraryTargets.cmake )[[:space:]]*^/d' \ 587 -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" 588 CMakeLists.txt || die "${LINENO}: sed died in kdebase-workspace strip config install and fix EXPORT section"
528 fi 589 fi
529 ;; 590 ;;
530 kdebase-runtime) 591 kdebase-runtime)
531 # COLLISION PROTECT section 592 # COLLISION PROTECT section
532 # Only install the kde4 script as part of kde-base/kdebase-data 593 # Only install the kde4 script as part of kde-base/kdebase-data
542 -e '/add_custom_target(kmail_xml /,/)/p' "${S}"/kmail/CMakeLists.txt || die "uncommenting xml failed" 603 -e '/add_custom_target(kmail_xml /,/)/p' "${S}"/kmail/CMakeLists.txt || die "uncommenting xml failed"
543 _change_cmakelists_parent_dirs kmail 604 _change_cmakelists_parent_dirs kmail
544 ;; 605 ;;
545 esac 606 esac
546 ;; 607 ;;
608 kdewebdev)
609 # Disable hardcoded kdepimlibs check
610 sed -e 's/find_package(KdepimLibs REQUIRED)/macro_optional_find_package(KdepimLibs)/' \
611 -e 's/find_package(LibXml2 REQUIRED)/macro_optional_find_package(LibXml2)/' \
612 -e 's/find_package(LibXslt REQUIRED)/macro_optional_find_package(LibXslt)/' \
613 -e 's/find_package(Boost REQUIRED)/macro_optional_find_package(Boost)/' \
614 -i CMakeLists.txt || die "failed to disable hardcoded checks"
615 ;;
547 koffice) 616 koffice)
548 # prevent collisions 617 # prevent collisions
549 if [[ ${PN} != koffice-data ]]; then 618 if [[ ${PN} != koffice-data ]]; then
550 sed -i -e '/install(.*FindKOfficeLibs.cmake/,/)/ d' \ 619 sed -i -e '/install(.*FindKOfficeLibs.cmake/,/)/ d' \
551 "${S}"/cmake/modules/CMakeLists.txt || \ 620 "${S}"/cmake/modules/CMakeLists.txt || \
552 die "${LINENO}: sed died in collision prevention section" 621 die "${LINENO}: sed died in collision prevention section"
622 case ${PV} in
623 2.0.*)
553 sed -i -n -e '1h;1!H;${g;s/install(.\+config-openexr.h.\+)//;p}' \ 624 sed -i -n -e '1h;1!H;${g;s/install(.\+config-openexr.h.\+)//;p}' \
554 "${S}"/CMakeLists.txt || \ 625 "${S}"/CMakeLists.txt || \
555 die "${LINENO}: sed died in collision prevention section" 626 die "${LINENO}: sed died in collision prevention section"
627 ;;
628 *)
629 sed -i -e '/install(.\+config-openexr\.h.\+)/d' \
630 "${S}"//CMakeLists.txt || \
631 die "${LINENO}: sed died in collision prevention section"
632 ;;
633 esac
556 fi 634 fi
557 esac 635 esac
558 636
559 popd > /dev/null 637 popd > /dev/null
560} 638}
564# Currently just calls its equivalent in kde4-base.eclass(5). Use this one in split 642# Currently just calls its equivalent in kde4-base.eclass(5). Use this one in split
565# ebuilds. 643# ebuilds.
566kde4-meta_src_configure() { 644kde4-meta_src_configure() {
567 debug-print-function ${FUNCNAME} "$@" 645 debug-print-function ${FUNCNAME} "$@"
568 646
647 # Set some cmake default values here (usually workarounds for automagic deps)
648 case ${KMNAME} in
649 kdewebdev)
650 mycmakeargs="
651 -DWITH_KdepimLibs=OFF
652 -DWITH_LibXml2=OFF
653 -DWITH_LibXslt=OFF
654 -DWITH_Boost=OFF
655 -DWITH_LibTidy=OFF
656 ${mycmakeargs}"
657 ;;
658 esac
659
569 kde4-base_src_configure 660 kde4-base_src_configure
570} 661}
571 662
572# @FUNCTION: kde4-meta_src_compile 663# @FUNCTION: kde4-meta_src_compile
573# @DESCRIPTION: 664# @DESCRIPTION:
574# General function for compiling split KDE4 applications. 665# General function for compiling split KDE4 applications.
575# Overrides kde4-base_src_compile. 666# Overrides kde4-base_src_compile.
576kde4-meta_src_compile() { 667kde4-meta_src_compile() {
577 debug-print-function ${FUNCNAME} "$@" 668 debug-print-function ${FUNCNAME} "$@"
578 669
579 kde4-base_src_make 670 kde4-base_src_compile "$@"
580} 671}
581 672
582# @FUNCTION: kde4-meta_src_test 673# @FUNCTION: kde4-meta_src_test
583# @DESCRIPTION: 674# @DESCRIPTION:
584# Currently just calls its equivalent in kde4-base.eclass(5). Use this in split 675# Currently just calls its equivalent in kde4-base.eclass(5). Use this in split
593# @DESCRIPTION: 684# @DESCRIPTION:
594# Function for installing KDE4 split applications. 685# Function for installing KDE4 split applications.
595kde4-meta_src_install() { 686kde4-meta_src_install() {
596 debug-print-function $FUNCNAME "$@" 687 debug-print-function $FUNCNAME "$@"
597 688
598 kde4-meta_src_make_doc 689 kde4-base_src_install
599 cmake-utils_src_install
600
601 if [[ -n ${KMSAVELIBS} ]]; then
602 install_library_dependencies
603 fi
604} 690}
605 691
606# @FUNCTION: kde4-meta_src_make_doc 692# @FUNCTION: kde4-meta_src_make_doc
607# @DESCRIPTION: 693# @DESCRIPTION:
608# This function searches in ${S}/${KMMODULE}, 694# This function searches in ${S}/${KMMODULE},
609# and tries to install "AUTHORS ChangeLog* README* NEWS todo" if these files exist. 695# and tries to install "AUTHORS ChangeLog* README* NEWS TODO" if these files exist.
610kde4-meta_src_make_doc() { 696kde4-meta_src_make_doc() {
611 debug-print-function ${FUNCNAME} "$@" 697 debug-print-function ${FUNCNAME} "$@"
612 698
613 local doc 699 local doc
614 for doc in AUTHORS ChangeLog* README* NEWS TODO; do 700 for doc in AUTHORS ChangeLog* README* NEWS TODO; do
618 kde4-base_src_make_doc 704 kde4-base_src_make_doc
619} 705}
620 706
621# @FUNCTION: kde4-meta_pkg_postinst 707# @FUNCTION: kde4-meta_pkg_postinst
622# @DESCRIPTION: 708# @DESCRIPTION:
623# Currently just calls its equivalent in kde4-base.eclass(5). Use this in split 709# Display information about application handbook and invoke kbuildsycoca4.
624# ebuilds.
625kde4-meta_pkg_postinst() { 710kde4-meta_pkg_postinst() {
626 debug-print-function ${FUNCNAME} "$@" 711 debug-print-function ${FUNCNAME} "$@"
712
713 if has handbook ${IUSE//+} && ! use handbook; then
714 echo
715 einfo "Application handbook for ${PN} has not been installed."
716 einfo "To install handbook, reemerge =${CATEGORY}/${PF} with 'handbook' USE flag."
717 echo
718 fi
627 719
628 kde4-base_pkg_postinst 720 kde4-base_pkg_postinst
629} 721}
630 722
631# @FUNCTION: kde4-meta_pkg_postrm 723# @FUNCTION: kde4-meta_pkg_postrm

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

  ViewVC Help
Powered by ViewVC 1.1.20