/[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.12
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.12 2009/03/09 19:41:26 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.
31 ;; 31 ;;
32esac 32esac
33 33
34# Add dependencies that all packages in a certain module share. 34# Add dependencies that all packages in a certain module share.
35case ${KMNAME} in 35case ${KMNAME} in
36 kdebase|kdebase-workspace|kdebase-runtime) 36 kdebase|kdebase-{apps,workspace,runtime})
37 DEPEND="${DEPEND}
37 DEPEND="${DEPEND} >=kde-base/qimageblitz-0.0.4" 38 >=kde-base/qimageblitz-0.0.4
38 RDEPEND="${RDEPEND} >=kde-base/qimageblitz-0.0.4" 39 "
40 RDEPEND="${RDEPEND}
41 >=kde-base/qimageblitz-0.0.4
42 "
43 ;;
44 kdenetwork)
45 DEPEND="${DEPEND}
46 >=kde-base/kdepimlibs-${PV}:${SLOT}[kdeprefix=]
47 "
48 RDEPEND="${RDEPEND}
49 >=kde-base/kdepimlibs-${PV}:${SLOT}[kdeprefix=]
50 "
39 ;; 51 ;;
40 kdepim) 52 kdepim)
41 DEPEND="${DEPEND} dev-libs/boost app-office/akonadi-server" 53 DEPEND="${DEPEND}
42 RDEPEND="${RDEPEND} dev-libs/boost" 54 dev-libs/boost
43 if [[ ${PN} != kode ]]; then
44 DEPEND="${DEPEND} >=kde-base/kode-${PV}:${SLOT}[kdeprefix=]" 55 >=kde-base/kdepimlibs-${PV}:${SLOT}[kdeprefix=]
45 RDEPEND="${RDEPEND} >=kde-base/kode-${PV}:${SLOT}[kdeprefix=]" 56 "
46 fi 57 RDEPEND="${RDEPEND}
58 dev-libs/boost
59 >=kde-base/kdepimlibs-${PV}:${SLOT}[kdeprefix=]
60 "
47 case ${PN} in 61 case ${PN} in
48 akregator|kaddressbook|kjots|kmail|kmobiletools|knode|knotes|korganizer|ktimetracker) 62 akregator|kaddressbook|kjots|kmail|kmobiletools|knode|knotes|korganizer|ktimetracker)
49 IUSE="+kontact" 63 IUSE="+kontact"
64 RDEPEND="${RDEPEND}
50 DEPEND="${DEPEND} kontact? ( >=kde-base/kontactinterfaces-${PV}:${SLOT}[kdeprefix=] )" 65 kontact? ( >=kde-base/kontactinterfaces-${PV}:${SLOT}[kdeprefix=] )
51 RDEPEND="${RDEPEND} kontact? ( >=kde-base/kontactinterfaces-${PV}:${SLOT}[kdeprefix=] )" 66 "
52 ;; 67 ;;
53 esac 68 esac
54 ;; 69 ;;
55 kdegames) 70 kdegames)
56 if [[ ${PN} != libkdegames ]]; then 71 if [[ ${PN} != libkdegames ]]; then
72 DEPEND="${DEPEND}
57 DEPEND="${DEPEND} >=kde-base/libkdegames-${PV}:${SLOT}[kdeprefix=]" 73 >=kde-base/libkdegames-${PV}:${SLOT}[kdeprefix=]
74 "
75 RDEPEND="${RDEPEND}
58 RDEPEND="${RDEPEND} >=kde-base/libkdegames-${PV}:${SLOT}[kdeprefix=]" 76 >=kde-base/libkdegames-${PV}:${SLOT}[kdeprefix=]
77 "
59 fi 78 fi
60 ;; 79 ;;
61 koffice) 80 koffice)
62 [[ ${PN} != koffice-data ]] && IUSE="debug" 81 [[ ${PN} != koffice-data ]] && IUSE="debug"
63 case ${PV} in 82 case ${PV} in
64 9999*) DEPEND="${DEPEND} !app-office/${PN}:2" ;; 83 9999*)
65 1.9*|2*) DEPEND="${DEPEND} !app-office/${PN}:live" ;; 84 DEPEND="${DEPEND}
85 !app-office/${PN}:2
86 "
87 ;;
88 1.9*|2*)
89 DEPEND="${DEPEND}
90 !app-office/${PN}:live
91 "
92 ;;
66 esac 93 esac
67 DEPEND="${DEPEND} 94 DEPEND="${DEPEND}
68 !app-office/${PN}:0 95 !app-office/${PN}:0
69 !app-office/koffice:0 96 !app-office/koffice:0
70 !app-office/koffice-meta:0" 97 !app-office/koffice-meta:0
98 "
71 case ${PN} in 99 case ${PN} in
72 koffice-data) 100 koffice-data)
73 DEPEND="${DEPEND} media-libs/lcms" 101 DEPEND="${DEPEND}
74 RDEPEND="${RDEPEND} media-libs/lcms" 102 media-libs/lcms
103 "
104 RDEPEND="${RDEPEND}
105 media-libs/lcms
106 "
75 ;; 107 ;;
76 *) 108 *)
77 DEPEND="${DEPEND} 109 COMMON_DEPEND="
78 dev-cpp/eigen:2 110 dev-cpp/eigen:2
79 media-gfx/imagemagick[openexr?] 111 media-gfx/imagemagick[openexr?]
80 media-libs/fontconfig 112 media-libs/fontconfig
81 media-libs/freetype:2 113 media-libs/freetype:2
82 " 114 "
83 RDEPEND="${DEPEND}" 115 DEPEND="${DEPEND} ${COMMON_DEPEND}"
116 RDEPEND="${RDEPEND} ${COMMON_DEPEND}"
117 unset COMMON_DEPEND
84 if [[ ${PN} != koffice-libs && ${PN} != koffice-data ]]; then 118 if [[ ${PN} != koffice-libs && ${PN} != koffice-data ]]; then
85 DEPEND="${DEPEND} 119 DEPEND="${DEPEND}
86 >=app-office/koffice-libs-${PV}:${SLOT}[kdeprefix=]" 120 >=app-office/koffice-libs-${PV}:${SLOT}[kdeprefix=]
121 "
87 RDEPEND="${RDEPEND} 122 RDEPEND="${RDEPEND}
88 >=app-office/koffice-libs-${PV}:${SLOT}[kdeprefix=]" 123 >=app-office/koffice-libs-${PV}:${SLOT}[kdeprefix=]
124 "
89 fi 125 fi
90 ;; 126 ;;
91 esac 127 esac
92 ;; 128 ;;
93esac 129esac
211 rsync --recursive ${rsync_options} "${ESVN_WC_PATH}/${kmnamedir}cmake" "${S}" \ 247 rsync --recursive ${rsync_options} "${ESVN_WC_PATH}/${kmnamedir}cmake" "${S}" \
212 || die "${ESVN}: can't export cmake files to '${S}'." 248 || die "${ESVN}: can't export cmake files to '${S}'."
213 fi 249 fi
214 # Copy all subdirectories 250 # Copy all subdirectories
215 for subdir in $(__list_needed_subdirectories); do 251 for subdir in $(__list_needed_subdirectories); do
216 targetdir="" 252 targetdir=""
217 if [[ $subdir = doc/* && ! -e "$ESVN_WC_PATH/$kmnamedir$subdir" ]]; then 253 if [[ $subdir = doc/* && ! -e "$ESVN_WC_PATH/$kmnamedir$subdir" ]]; then
218 continue 254 continue
219 fi 255 fi
220 256
221 [[ ${subdir%/} = */* ]] && targetdir=${subdir%/} && targetdir=${targetdir%/*} && mkdir -p "${S}/${targetdir}" 257 [[ ${subdir%/} = */* ]] && targetdir=${subdir%/} && targetdir=${targetdir%/*} && mkdir -p "${S}/${targetdir}"
222 rsync --recursive ${rsync_options} "${ESVN_WC_PATH}/${kmnamedir}${subdir%/}" "${S}/${targetdir}" \ 258 rsync --recursive ${rsync_options} "${ESVN_WC_PATH}/${kmnamedir}${subdir%/}" "${S}/${targetdir}" \
223 || die "${ESVN}: can't export subdirectory '${subdir}' to '${S}/${targetdir}'." 259 || die "${ESVN}: can't export subdirectory '${subdir}' to '${S}/${targetdir}'."
224 done 260 done
225 261
226 if [[ ${KMNAME} = kdebase-runtime && ${PN} != kdebase-data ]]; then 262 if [[ ${KMNAME} = kdebase-runtime && ${PN} != kdebase-data ]]; then
227 sed -i -e '/^install(PROGRAMS[[:space:]]*[^[:space:]]*\/kde4[[:space:]]/s/^/#DONOTINSTALL /' \ 263 sed -i -e '/^install(PROGRAMS[[:space:]]*[^[:space:]]*\/kde4[[:space:]]/s/^/#DONOTINSTALL /' \
228 "${S}"/CMakeLists.txt || die "Sed to exclude bin/kde4 failed" 264 "${S}"/CMakeLists.txt || die "Sed to exclude bin/kde4 failed"
229 fi 265 fi
230 else 266 else
231 local abort tarball tarfile f extractlist moduleprefix 267 local abort tarball tarfile f extractlist moduleprefix postfix
232 268 case ${PV} in
269 4.2.9* | 4.2.8* | 4.2.7* | 4.2.6*)
270 KMTARPARAMS="${KMTARPARAMS} --lzma" # lzma
271 postfix="lzma"
272 ;;
273 *)
274 KMTARPARAMS="${KMTARPARAMS} --bzip2" # bz2
275 postfix="bz2"
276 ;;
277 esac
233 case $KMNAME in 278 case ${KMNAME} in
234 kdebase-apps) 279 kdebase-apps)
235 tarball="${KMNAME#-apps}-${PV}.tar.bz2" 280 # kdebase/apps -> kdebasa-apps
281 tarball="kdebase-${PV}.tar.${postfix}"
282 # Go one level deeper for kdebase-apps in tarballs
283 moduleprefix=apps/
284 KMTARPARAMS="${KMTARPARAMS} --transform=s|apps/||"
236 ;; 285 ;;
237 *) 286 *)
287 # Create tarball name from module name (this is the default)
238 tarball="${KMNAME}-${PV}.tar.bz2" 288 tarball="${KMNAME}-${PV}.tar.${postfix}"
239 ;; 289 ;;
240 esac 290 esac
291
292 # Full patch to source tarball
241 tarfile="${DISTDIR}/${tarball}" 293 tarfile="${DISTDIR}/${tarball}"
294
295 # Detect real toplevel dir from tarball name - it will be used upon extraction
296 # and in __list_needed_subdirectories
297 topdir="${tarball%.tar.*}/"
242 298
243 ebegin "Unpacking parts of ${tarball} to ${WORKDIR}" 299 ebegin "Unpacking parts of ${tarball} to ${WORKDIR}"
244 300
245 kde4-meta_create_extractlists 301 kde4-meta_create_extractlists
246 302
247 for f in cmake/ CMakeLists.txt ConfigureChecks.cmake config.h.cmake \ 303 for f in cmake/ CMakeLists.txt ConfigureChecks.cmake config.h.cmake \
248 AUTHORS COPYING INSTALL README NEWS ChangeLog 304 AUTHORS COPYING INSTALL README NEWS ChangeLog
249 do 305 do
250 extractlist="${extractlist} ${KMNAME}-${PV}/${f}" 306 extractlist="${extractlist} ${topdir}${moduleprefix}${f}"
251 done 307 done
252 extractlist="${extractlist} $(__list_needed_subdirectories)" 308 extractlist="${extractlist} $(__list_needed_subdirectories)"
253 KMTARPARAMS="${KMTARPARAMS} -j"
254 309
255 pushd "${WORKDIR}" > /dev/null 310 pushd "${WORKDIR}" > /dev/null
256 [[ -n ${KDE4_STRICTER} ]] && echo tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} >&2 311 [[ -n ${KDE4_STRICTER} ]] && echo tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} >&2
257 tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} 2> /dev/null 312 tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} 2> /dev/null
258 313
259 # Default $S is based on $P; rename the extracted directory to match $S if necessary 314 # 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}\"" 315 mv ${topdir} ${P} || die "Died while moving \"${topdir}\" to \"${P}\""
261 316
262 popd > /dev/null 317 popd > /dev/null
263 318
264 eend $? 319 eend $?
265 320
273 abort=true 328 abort=true
274 fi 329 fi
275 done 330 done
276 [[ -n ${abort} ]] && die "There were missing files." 331 [[ -n ${abort} ]] && die "There were missing files."
277 fi 332 fi
333
334 # We don't need it anymore
335 unset topdir
278 fi 336 fi
279} 337}
280 338
281# @FUNCTION: kde4-meta_create_extractlists 339# @FUNCTION: kde4-meta_create_extractlists
282# @DESCRIPTION: 340# @DESCRIPTION:
324 KMEXTRACTONLY="${KMEXTRACTONLY} 382 KMEXTRACTONLY="${KMEXTRACTONLY}
325 libkdegames" 383 libkdegames"
326 fi 384 fi
327 ;; 385 ;;
328 kdepim) 386 kdepim)
387 if [[ ${PN} != libkdepim ]]; then
388 KMEXTRACTONLY="${KMEXTRACTONLY}
389 libkdepim"
390 fi
329 KMEXTRACTONLY="${KMEXTRACTONLY} 391 KMEXTRACTONLY="${KMEXTRACTONLY}
330 kleopatra/ConfigureChecks.cmake 392 kleopatra/ConfigureChecks.cmake"
331 libkdepim/kdepim_export.h"
332 if has kontact ${IUSE//+} && use kontact; then 393 if has kontact ${IUSE//+} && use kontact; then
333 KMEXTRA="${KMEXTRA} kontact/plugins/${PLUGINNAME:-${PN}}" 394 KMEXTRA="${KMEXTRA} kontact/plugins/${PLUGINNAME:-${PN}}"
334 KMEXTRACTONLY="${KMEXTRACTONLY} kontactinterfaces/" 395 KMEXTRACTONLY="${KMEXTRACTONLY} kontactinterfaces/"
335 fi 396 fi
336 ;; 397 ;;
362 423
363 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME}: KMEXTRACTONLY ${KMEXTRACTONLY}" 424 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME}: KMEXTRACTONLY ${KMEXTRACTONLY}"
364} 425}
365 426
366__list_needed_subdirectories() { 427__list_needed_subdirectories() {
367 local i j kmextra kmextra_expanded kmmodule_expanded kmcompileonly_expanded extractlist topdir 428 local i j kmextra kmextra_expanded kmmodule_expanded kmcompileonly_expanded extractlist
368 429
369 # We expand KMEXTRA by adding CMakeLists.txt files 430 # We expand KMEXTRA by adding CMakeLists.txt files
370 kmextra="${KMEXTRA}" 431 kmextra="${KMEXTRA}"
371 [[ ${1} != fatal ]] && kmextra="${kmextra} ${KMEXTRA_NONFATAL}" 432 [[ ${1} != fatal ]] && kmextra="${kmextra} ${KMEXTRA_NONFATAL}"
372 for i in ${kmextra}; do 433 for i in ${kmextra}; do
400 461
401 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmextra_expanded: ${kmextra_expanded}" 462 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmextra_expanded: ${kmextra_expanded}"
402 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmmodule_expanded: ${kmmodule_expanded}" 463 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmmodule_expanded: ${kmmodule_expanded}"
403 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmcompileonly_expanded: ${kmcompileonly_expanded}" 464 debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmcompileonly_expanded: ${kmcompileonly_expanded}"
404 465
405 case ${PV} in
406 scm|9999*) : ;;
407 *) topdir="${KMNAME}-${PV}/" ;;
408 esac
409 # Create final list of stuff to extract 466 # Create final list of stuff to extract
410 # We append topleveldir only when specified (usually for tarballs) 467 # We append topdir only when specified (usually for tarballs)
411 for i in ${kmmodule_expanded} ${kmextra_expanded} ${kmcompileonly_expanded} \ 468 for i in ${kmmodule_expanded} ${kmextra_expanded} ${kmcompileonly_expanded} \
412 ${KMEXTRACTONLY} 469 ${KMEXTRACTONLY}
413 do 470 do
414 extractlist="${extractlist} ${topdir}${moduleprefix}${i}" 471 extractlist="${extractlist} ${topdir}${moduleprefix}${i}"
415 done 472 done
424 debug-print-function ${FUNCNAME} "$@" 481 debug-print-function ${FUNCNAME} "$@"
425 482
426 kde4-meta_change_cmakelists 483 kde4-meta_change_cmakelists
427 kde4-base_src_prepare 484 kde4-base_src_prepare
428} 485}
429
430 486
431# FIXME: no comment here? 487# FIXME: no comment here?
432_change_cmakelists_parent_dirs() { 488_change_cmakelists_parent_dirs() {
433 debug-print-function ${FUNCNAME} "$@" 489 debug-print-function ${FUNCNAME} "$@"
434 490
468 find "${S}"/${KMMODULE} -name CMakeLists.txt -print0 | xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \ 524 find "${S}"/${KMMODULE} -name CMakeLists.txt -print0 | xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \
469 die "${LINENO}: died in KMMODULE section" 525 die "${LINENO}: died in KMMODULE section"
470 _change_cmakelists_parent_dirs ${KMMODULE} 526 _change_cmakelists_parent_dirs ${KMMODULE}
471 fi 527 fi
472 528
529 local i
530
531 # KMEXTRACTONLY section - Some ebuilds need to comment out some subdirs in KMMODULE and they use KMEXTRACTONLY
532 for i in ${KMEXTRACTONLY}; do
533 if [[ -d "${S}"/${i} && -f "${S}"/${i}/../CMakeLists.txt ]]; then
534 sed -i -e "/([[:space:]]*$(basename $i)[[:space:]]*)/s/^/#DONOTCOMPILE /" "${S}"/${i}/../CMakeLists.txt || \
535 die "${LINENO}: sed died while working in the KMEXTRACTONLY section while processing ${i}"
536 fi
537 done
538
473 # KMCOMPILEONLY 539 # KMCOMPILEONLY
474 local i
475 for i in ${KMCOMPILEONLY}; do 540 for i in ${KMCOMPILEONLY}; do
476 debug-print "${LINENO}: KMCOMPILEONLY, processing ${i}" 541 debug-print "${LINENO}: KMCOMPILEONLY, processing ${i}"
477 # Uncomment "add_subdirectory" instructions inside $KMCOMPILEONLY, then comment "install" instructions. 542 # Uncomment "add_subdirectory" instructions inside $KMCOMPILEONLY, then comment "install" instructions.
478 find "${S}"/${i} -name CMakeLists.txt -print0 | \ 543 find "${S}"/${i} -name CMakeLists.txt -print0 | \
479 xargs -0 sed -i \ 544 xargs -0 sed -i \
501 die "${LINENO}: sed died uncommenting add_subdirectory instructions in KMEXTRA section while processing ${i}" 566 die "${LINENO}: sed died uncommenting add_subdirectory instructions in KMEXTRA section while processing ${i}"
502 _change_cmakelists_parent_dirs ${i} 567 _change_cmakelists_parent_dirs ${i}
503 fi 568 fi
504 done 569 done
505 570
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
512 done
513
514 case ${KMNAME} in 571 case ${KMNAME} in
515 kdebase-workspace) 572 kdebase-workspace)
516 # COLLISION PROTECT section 573 # COLLISION PROTECT section
517 # Install the startkde script just once, as a part of kde-base/kdebase-startkde, 574 # Install the startkde script just once, as a part of kde-base/kdebase-startkde,
518 # not as a part of every package. 575 # not as a part of every package.

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

  ViewVC Help
Powered by ViewVC 1.1.20