/[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.31 Revision 1.40
1# Copyright 1999-2009 Gentoo Foundation 1# Copyright 1999-2010 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.31 2009/12/14 19:44:15 abcd Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-meta.eclass,v 1.40 2010/09/11 04:25:23 reavertm 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.
16 16
17EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare src_configure src_compile src_test src_install pkg_postinst pkg_postrm 17EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare src_configure src_compile src_test src_install pkg_postinst pkg_postrm
18 18
19[[ -z ${KMNAME} ]] && die "kde4-meta.eclass inherited but KMNAME not defined - broken ebuild" 19[[ -z ${KMNAME} ]] && die "kde4-meta.eclass inherited but KMNAME not defined - broken ebuild"
20 20
21# Add khelpcenter dependency when installing handbooks
22if [[ ${PN} != khelpcenter ]] && has handbook ${IUSE//+}; then
23 RDEPEND+=" handbook? ( $(add_kdebase_dep khelpcenter) )"
24fi
25
26# Add dependencies that all packages in a certain module share. 21# Add dependencies that all packages in a certain module share.
27case ${KMNAME} in 22case ${KMNAME} in
28 kdebase|kdebase-apps|kdebase-workspace|kdebase-runtime|kdegraphics) 23 kdebase|kdebase-apps|kdebase-workspace|kdebase-runtime|kdegraphics)
29 COMMONDEPEND+=" >=kde-base/qimageblitz-0.0.4" 24 COMMONDEPEND+=" >=media-libs/qimageblitz-0.0.4"
30 ;; 25 ;;
31 kdepim|kdepim-runtime) 26 kdepim|kdepim-runtime)
32 COMMONDEPEND+=" $(add_kdebase_dep kdepimlibs)"
33 case ${PN} in 27 case ${PN} in
34 akregator|kaddressbook|kjots|kmail|knode|knotes|korganizer|ktimetracker) 28 akregator|kaddressbook|kjots|kmail|knode|knotes|korganizer|ktimetracker)
35 IUSE+=" +kontact" 29 IUSE+=" +kontact"
36 if ! slot_is_at_least 4.4 ${SLOT}; then
37 RDEPEND+=" kontact? ( $(add_kdebase_dep kontactinterfaces) )" 30 RDEPEND+=" kontact? ( $(add_kdebase_dep kontact) )"
38 fi
39 ;; 31 ;;
40 esac 32 esac
41 ;; 33 ;;
42 kdegames) 34 kdegames)
43 if [[ ${PN} != libkdegames ]]; then 35 if [[ ${PN} != libkdegames ]]; then
209 "${S}"/CMakeLists.txt || die "Sed to exclude bin/kde4 failed" 201 "${S}"/CMakeLists.txt || die "Sed to exclude bin/kde4 failed"
210 fi 202 fi
211 else 203 else
212 local abort tarball tarfile f extractlist moduleprefix postfix 204 local abort tarball tarfile f extractlist moduleprefix postfix
213 case ${PV} in 205 case ${PV} in
214 4.3.8[05] | 4.3.9[0568]) 206 4.[45].8[05] | 4.[45].9[023568])
215 # block for normally packed upstream unstable snapshots 207 # Block for normally packed upstream unstable snapshots
216 KMTARPARAMS+=" --bzip2" # bz2 208 KMTARPARAMS+=" --bzip2" # bz2
217 postfix="bz2" 209 postfix="bz2"
218 ;;
219 4.3.[6-9]*)
220 # Not passing --xz, as it doesn't work with stable tar
221 KMTARPARAMS+=" --use-compress-program=xz" # xz
222 postfix="xz"
223 ;; 210 ;;
224 *) 211 *)
225 KMTARPARAMS+=" --bzip2" # bz2 212 KMTARPARAMS+=" --bzip2" # bz2
226 postfix="bz2" 213 postfix="bz2"
227 ;; 214 ;;
332 ;; 319 ;;
333 kdegames) 320 kdegames)
334 if [[ ${PN} != libkdegames ]]; then 321 if [[ ${PN} != libkdegames ]]; then
335 KMEXTRACTONLY+=" 322 KMEXTRACTONLY+="
336 libkdegames/" 323 libkdegames/"
324 KMLOADLIBS="${KMLOADLIBS} libkdegames"
337 fi 325 fi
338 ;; 326 ;;
339 kdepim) 327 kdepim)
340 if [[ ${PN} != libkdepim ]]; then 328 if [[ ${PN} != libkdepim ]]; then
341 KMEXTRACTONLY+=" 329 KMEXTRACTONLY+="
342 libkdepim/" 330 libkdepim/"
343 fi 331 fi
344 case ${SLOT} in
345 4.3|4.4|live)
346 KMEXTRACTONLY+="
347 kdepim-version.h
348 config-enterprise.h.cmake"
349 ;;
350 esac
351 KMEXTRACTONLY+=" 332 KMEXTRACTONLY+="
333 config-enterprise.h.cmake
352 kleopatra/ConfigureChecks.cmake" 334 kleopatra/ConfigureChecks.cmake"
335 if slot_is_at_least 4.5 ${SLOT}; then
336 KMEXTRACTONLY+="
337 CTestCustom.cmake
338 kdepim-version.h.cmake"
339 else
340 KMEXTRACTONLY+="
341 kdepim-version.h"
342 fi
353 if has kontact ${IUSE//+} && use kontact; then 343 if has kontact ${IUSE//+} && use kontact; then
354 KMEXTRA+=" 344 KMEXTRA+="
355 kontact/plugins/${PLUGINNAME:-${PN}}/" 345 kontact/plugins/${PLUGINNAME:-${PN}}/"
356 if ! slot_is_at_least 4.4 ${SLOT}; then
357 KMEXTRACTONLY+="
358 kontactinterfaces/"
359 fi
360 fi 346 fi
361 ;; 347 ;;
362 kdeutils) 348 kdeutils)
363 case ${SLOT} in
364 4.3|4.4|live)
365 KMEXTRACTONLY+=" 349 KMEXTRACTONLY+="
366 kdeutils-version.h" 350 kdeutils-version.h"
367 ;;
368 esac
369 ;; 351 ;;
370 koffice) 352 koffice)
371 KMEXTRACTONLY+=" 353 KMEXTRACTONLY+="
372 config-endian.h.cmake 354 config-endian.h.cmake
373 filters/config-filters.h.cmake 355 filters/config-filters.h.cmake
383 esac 365 esac
384 ;; 366 ;;
385 esac 367 esac
386 # Don't install cmake modules for split ebuilds, to avoid collisions. 368 # Don't install cmake modules for split ebuilds, to avoid collisions.
387 case ${KMNAME} in 369 case ${KMNAME} in
388 kdepim)
389 # No need for unpack since 4.2.86
390 # Remove when 4.2 is wiped out from the tree
391 case ${PV} in
392 4.2.[0-4])
393 KMCOMPILEONLY+="
394 cmake/modules/"
395 ;;
396 esac
397 ;;
398 kdebase-runtime|kdebase-workspace|kdeedu|kdegames|kdegraphics) 370 kdebase-runtime|kdebase-workspace|kdeedu|kdegames|kdegraphics)
399 case ${PN} in 371 case ${PN} in
400 libkdegames|libkdeedu|libkworkspace) 372 libkdegames|libkdeedu|libkworkspace)
401 KMEXTRA+=" 373 KMEXTRA+="
402 cmake/modules/" 374 cmake/modules/"
488 -i ${_dir}/CMakeLists.txt || die "${LINENO}: died in ${FUNCNAME} while processing ${_dir}" 460 -i ${_dir}/CMakeLists.txt || die "${LINENO}: died in ${FUNCNAME} while processing ${_dir}"
489 fi 461 fi
490 done 462 done
491} 463}
492 464
493# FIXME: add description
494# @FUNCTION: kde4-meta_change_cmakelists 465# @FUNCTION: kde4-meta_change_cmakelists
495# @DESCRIPTION: 466# @DESCRIPTION:
467# Adjust CMakeLists.txt to comply to our splitting.
496kde4-meta_change_cmakelists() { 468kde4-meta_change_cmakelists() {
497 debug-print-function ${FUNCNAME} "$@" 469 debug-print-function ${FUNCNAME} "$@"
498 470
499 pushd "${S}" > /dev/null 471 pushd "${S}" > /dev/null
500 472
586 # Disable hardcoded kdepimlibs check 558 # Disable hardcoded kdepimlibs check
587 sed -e 's/find_package(KdepimLibs REQUIRED)/macro_optional_find_package(KdepimLibs)/' \ 559 sed -e 's/find_package(KdepimLibs REQUIRED)/macro_optional_find_package(KdepimLibs)/' \
588 -i CMakeLists.txt || die "failed to disable hardcoded checks" 560 -i CMakeLists.txt || die "failed to disable hardcoded checks"
589 ;; 561 ;;
590 kdepim) 562 kdepim)
563 # Disable hardcoded checks
564 sed -r -e '/find_package\(KdepimLibs/s/REQUIRED//' \
565 -e '/find_package\((KdepimLibs|Boost|QGpgme|Akonadi|ZLIB|Strigi|SharedDesktopOntologies|Soprano|Nepomuk)/{/macro_optional_/!s/find/macro_optional_&/}' \
566 -e '/macro_log_feature\((Boost|QGPGME|Akonadi|ZLIB|STRIGI|SHAREDDESKTOPONTOLOGIES|Soprano|Nepomuk)_FOUND/s/ TRUE / FALSE /' \
567 -e '/if[[:space:]]*([[:space:]]*BUILD_.*)/s/^/#OVERRIDE /' \
568 -e '/if[[:space:]]*([[:space:]]*[[:alnum:]]*_FOUND[[:space:]]*)/s/^/#OVERRIDE /' \
569 -i CMakeLists.txt || die "failed to disable hardcoded checks"
570 # Disable broken or redundant build logic
571 if ( has kontact ${IUSE//+} && use kontact ) || [[ ${PN} = kontact ]]; then
572 sed -e '/if[[:space:]]*([[:space:]]*BUILD_.*)/s/^/#OVERRIDE /' \
573 -e '/if[[:space:]]*([[:space:]]*[[:alnum:]]*_FOUND[[:space:]]*)/s/^/#OVERRIDE /' \
574 -i kontact/plugins/CMakeLists.txt || die 'failed to override build logic'
575 fi
576 if ! slot_is_at_least 4.5 ${SLOT}; then
591 case ${PN} in 577 case ${PN} in
592 kaddressbook|kalarm|kmailcvt|kontact|korganizer|korn) 578 kalarm|kmailcvt|kontact|korganizer|korn)
593 sed -n -e '/qt4_generate_dbus_interface(.*org\.kde\.kmail\.\(kmail\|mailcomposer\)\.xml/p' \ 579 sed -n -e '/qt4_generate_dbus_interface(.*org\.kde\.kmail\.\(kmail\|mailcomposer\)\.xml/p' \
594 -e '/add_custom_target(kmail_xml /,/)/p' \ 580 -e '/add_custom_target(kmail_xml /,/)/p' \
595 -i kmail/CMakeLists.txt || die "uncommenting xml failed" 581 -i kmail/CMakeLists.txt || die "uncommenting xml failed"
596 _change_cmakelists_parent_dirs kmail 582 _change_cmakelists_parent_dirs kmail
597 ;; 583 ;;
598 esac 584 esac
585 fi
599 ;; 586 ;;
600 kdewebdev) 587 kdewebdev)
601 # Disable hardcoded kdepimlibs check 588 # Disable hardcoded checks
602 sed -e 's/find_package(KdepimLibs REQUIRED)/macro_optional_find_package(KdepimLibs)/' \ 589 sed -e 's/find_package(KdepimLibs REQUIRED)/macro_optional_find_package(KdepimLibs)/' \
603 -e 's/find_package(LibXml2 REQUIRED)/macro_optional_find_package(LibXml2)/' \ 590 -e 's/find_package(LibXml2 REQUIRED)/macro_optional_find_package(LibXml2)/' \
604 -e 's/find_package(LibXslt REQUIRED)/macro_optional_find_package(LibXslt)/' \ 591 -e 's/find_package(LibXslt REQUIRED)/macro_optional_find_package(LibXslt)/' \
605 -e 's/find_package(Boost REQUIRED)/macro_optional_find_package(Boost)/' \ 592 -e 's/find_package(Boost REQUIRED)/macro_optional_find_package(Boost)/' \
606 -i CMakeLists.txt || die "failed to disable hardcoded checks" 593 -i CMakeLists.txt || die "failed to disable hardcoded checks"
607 ;; 594 ;;
608 koffice) 595 koffice)
609 # prevent collisions 596 # Prevent collisions
610 if [[ ${PN} != koffice-data ]]; then 597 if [[ ${PN} != koffice-data ]]; then
611 sed -e '/install(.*FindKOfficeLibs.cmake/,/)/ d' \ 598 sed -e '/install(.*FindKOfficeLibs.cmake/,/)/ d' \
612 -i cmake/modules/CMakeLists.txt || die "${LINENO}: sed died in collision prevention section" 599 -i cmake/modules/CMakeLists.txt || die "${LINENO}: sed died in collision prevention section"
613 sed -e '/install(.\+config-openexr\.h.\+)/d' \ 600 sed -e '/install(.\+config-openexr\.h.\+)/d' \
614 -i CMakeLists.txt || die "${LINENO}: sed died in collision prevention section" 601 -i CMakeLists.txt || die "${LINENO}: sed died in collision prevention section"
618 2.0.[1-9]) 605 2.0.[1-9])
619 sed -i -n -e '1h;1!H;${g;s/install(.\+config-openexr.h.\+)//;p}' \ 606 sed -i -n -e '1h;1!H;${g;s/install(.\+config-openexr.h.\+)//;p}' \
620 "${S}"/CMakeLists.txt || \ 607 "${S}"/CMakeLists.txt || \
621 die "${LINENO}: sed died in collision prevention section" 608 die "${LINENO}: sed died in collision prevention section"
622 ;; 609 ;;
610 *) ;;
611 esac
612 # koffice 2.1.[8-9][0-9] and 9999
613 case ${PV} in
614 2.1.8[0-9]|2.1.9[0-9]|9999)
615 sed -e '/^option(BUILD/s/ON/OFF/' \
616 -e '/^if(NOT BUILD_kchart/,/^endif(NOT BUILD_kchart/d' \
617 -e '/^if(BUILD_koreport/,/^endif(BUILD_koreport/d' \
618 -e 's/set(SHOULD_BUILD_F_OFFICE TRUE)/set(SHOULD_BUILD_F_OFFICE FALSE)/' \
619 -i "${S}"/CMakeLists.txt || die "sed died while fixing cmakelists"
620 if [[ ${PN} != koffice-data ]] && [[ ${PV} == 9999 ]]; then
621 sed -e '/config-opengl.h/d' \
622 -i "${S}"/CMakeLists.txt || die "sed died while fixing cmakelists"
623
624 fi
625 ;;
623 *) ;; 626 *) ;;
624 esac 627 esac
625 esac 628 esac
626 629
627 popd > /dev/null 630 popd > /dev/null
649 -DWITH_Boost=OFF 652 -DWITH_Boost=OFF
650 -DWITH_LibTidy=OFF 653 -DWITH_LibTidy=OFF
651 "${mycmakeargs[@]}" 654 "${mycmakeargs[@]}"
652 ) 655 )
653 ;; 656 ;;
657 koffice)
658 case ${PV} in
659 2.1.8[0-9]|2.1.9[0-9]|9999)
660 if [[ ${PN} != "kchart" ]]; then
661 mycmakeargs=(
662 -DBUILD_koreport=OFF
663 "${mycmakeargs[@]}"
664 )
665 fi
666 ;;
667 esac
668 ;;
654 esac 669 esac
655 670
656 kde4-base_src_configure 671 kde4-base_src_configure
657} 672}
658 673
684# @DESCRIPTION: 699# @DESCRIPTION:
685# Function for installing KDE4 split applications. 700# Function for installing KDE4 split applications.
686kde4-meta_src_install() { 701kde4-meta_src_install() {
687 debug-print-function $FUNCNAME "$@" 702 debug-print-function $FUNCNAME "$@"
688 703
704 # Search ${S}/${KMMODULE} and install common documentation files found
705 local doc
706 for doc in "${S}/${KMMODULE}"/{AUTHORS,CHANGELOG,ChangeLog*,README*,NEWS,TODO,HACKING}; do
707 [[ -f "${doc}" ]] && [[ -s "${doc}" ]] && dodoc "${doc}"
708 done
709
689 kde4-base_src_install 710 kde4-base_src_install
690}
691
692# @FUNCTION: kde4-meta_src_make_doc
693# @DESCRIPTION:
694# This function searches in ${S}/${KMMODULE},
695# and tries to install "AUTHORS ChangeLog* README* NEWS TODO" if these files exist.
696kde4-meta_src_make_doc() {
697 debug-print-function ${FUNCNAME} "$@"
698
699 local doc
700 for doc in AUTHORS ChangeLog* README* NEWS TODO; do
701 [[ -s ${KMMODULE}/${doc} ]] && newdoc "${KMMODULE}/${doc}" "${doc}.${KMMODULE##*/}"
702 done
703
704 kde4-base_src_make_doc
705} 711}
706 712
707# @FUNCTION: kde4-meta_pkg_postinst 713# @FUNCTION: kde4-meta_pkg_postinst
708# @DESCRIPTION: 714# @DESCRIPTION:
709# Invoke kbuildsycoca4. 715# Invoke kbuildsycoca4.

Legend:
Removed from v.1.31  
changed lines
  Added in v.1.40

  ViewVC Help
Powered by ViewVC 1.1.20