/[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.34 Revision 1.43
1# Copyright 1999-2010 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.34 2010/03/15 03:35:39 reavertm Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-meta.eclass,v 1.43 2010/09/15 11:06:33 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.
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 dependencies that all packages in a certain module share. 21# Add dependencies that all packages in a certain module share.
22case ${KMNAME} in 22case ${KMNAME} in
23 kdebase|kdebase-apps|kdebase-workspace|kdebase-runtime|kdegraphics) 23 kdebase|kdebase-apps|kdebase-workspace|kdebase-runtime|kdegraphics)
24 COMMONDEPEND+=" >=kde-base/qimageblitz-0.0.4" 24 COMMONDEPEND+=" >=media-libs/qimageblitz-0.0.4"
25 ;; 25 ;;
26 kdepim|kdepim-runtime) 26 kdepim|kdepim-runtime)
27 ! slot_is_at_least 4.4 ${SLOT} && COMMONDEPEND+=" $(add_kdebase_dep kdepimlibs)"
28 case ${PN} in 27 case ${PN} in
29 akregator|kaddressbook|kjots|kmail|knode|knotes|korganizer|ktimetracker) 28 akregator|kaddressbook|kjots|kmail|knode|knotes|korganizer|ktimetracker)
30 IUSE+=" +kontact" 29 IUSE+=" +kontact"
31 RDEPEND+=" kontact? ( $(add_kdebase_dep kontact) )" 30 RDEPEND+=" kontact? ( $(add_kdebase_dep kontact) )"
32 ;; 31 ;;
99# If set to "true", $KMMODULE doesn't have to be defined. 98# If set to "true", $KMMODULE doesn't have to be defined.
100# 99#
101# Example usage: If you're installing subdirectories of a package, like plugins, 100# Example usage: If you're installing subdirectories of a package, like plugins,
102# you mark the top subdirectory (containing the package) as $KMEXTRACTONLY, and 101# you mark the top subdirectory (containing the package) as $KMEXTRACTONLY, and
103# set KMNOMODULE="true". 102# set KMNOMODULE="true".
104if [[ -z ${KMMODULE} && ${KMNOMODULE} != true ]]; then 103if [[ -z ${KMMODULE} ]] && [[ ${KMNOMODULE} != true ]]; then
105 KMMODULE=${PN} 104 KMMODULE=${PN}
106fi 105fi
107 106
108# @ECLASS-VARIABLE: KMEXTRA 107# @ECLASS-VARIABLE: KMEXTRA
109# @DESCRIPTION: 108# @DESCRIPTION:
110# All subdirectories listed here will be extracted, compiled & installed. 109# All subdirectories listed here will be extracted, compiled & installed.
111# $KMMODULE is always added to $KMEXTRA. 110# $KMMODULE is always added to $KMEXTRA.
112# If the handbook USE-flag is set, and if this directory exists, 111# If KDE_HANDBOOK is 'always' or 'optional' and handbook USE-flag is set, and if this
113# then "doc/$KMMODULE" is added to $KMEXTRA. In other cases, this should be 112# directory exists, then "doc/$KMMODULE" is added to $KMEXTRA. If there's additional
114# handled in the ebuild.
115# If the documentation is in a different subdirectory, you should add it to KMEXTRA. 113# documentation in different subdirectories, it should be added to KMEXTRA manually..
116 114
117# @ECLASS-VARIABLE: KMCOMPILEONLY 115# @ECLASS-VARIABLE: KMCOMPILEONLY
118# @DESCRIPTION: 116# @DESCRIPTION:
119# All subdirectories listed here will be extracted & compiled, but not installed. 117# All subdirectories listed here will be extracted & compiled, but not installed.
120 118
202 "${S}"/CMakeLists.txt || die "Sed to exclude bin/kde4 failed" 200 "${S}"/CMakeLists.txt || die "Sed to exclude bin/kde4 failed"
203 fi 201 fi
204 else 202 else
205 local abort tarball tarfile f extractlist moduleprefix postfix 203 local abort tarball tarfile f extractlist moduleprefix postfix
206 case ${PV} in 204 case ${PV} in
207 4.[34].8[05] | 4.[34].9[0568]) 205 4.[45].8[05] | 4.[45].9[023568])
208 # block for normally packed upstream unstable snapshots 206 # Block for normally packed upstream unstable snapshots
209 KMTARPARAMS+=" --bzip2" # bz2 207 KMTARPARAMS+=" --bzip2" # bz2
210 postfix="bz2" 208 postfix="bz2"
211 ;;
212 4.[34].[6-9]*)
213 # Not passing --xz, as it doesn't work with stable tar
214 KMTARPARAMS+=" --use-compress-program=xz" # xz
215 postfix="xz"
216 ;; 209 ;;
217 *) 210 *)
218 KMTARPARAMS+=" --bzip2" # bz2 211 KMTARPARAMS+=" --bzip2" # bz2
219 postfix="bz2" 212 postfix="bz2"
220 ;; 213 ;;
286# Also see descriptions of KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY, 279# Also see descriptions of KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY,
287# KMEXTRACTONLY and KMTARPARAMS. 280# KMEXTRACTONLY and KMTARPARAMS.
288kde4-meta_create_extractlists() { 281kde4-meta_create_extractlists() {
289 debug-print-function ${FUNCNAME} "$@" 282 debug-print-function ${FUNCNAME} "$@"
290 283
291 # TODO change to KMEXTRA for more strict check 284 # Add default handbook locations
285 # FIXME - legacy code - remove when 4.4.5 is gone or preferrably port 4.4.5.
292 if has handbook ${IUSE//+} && use handbook && [[ -n ${KMMODULE} ]]; then 286 if ! slot_is_at_least 4.5 ${SLOT} && has handbook ${IUSE//+} && use handbook && [[ -z ${KMNOMODULE} ]]; then
293 # We use the basename of $KMMODULE because $KMMODULE can contain 287 # We use the basename of $KMMODULE because $KMMODULE can contain
294 # the path to the module subdirectory. 288 # the path to the module subdirectory.
295 KMEXTRA_NONFATAL+=" 289 KMEXTRA_NONFATAL+="
296 doc/${KMMODULE##*/}" 290 doc/${KMMODULE##*/}"
291 fi
292
293 # Add default handbook locations
294 if [[ -z ${KMNOMODULE} ]] && { [[ ${KDE_HANDBOOK} = always ]] || { [[ ${KDE_HANDBOOK} = optional ]] && use handbook; }; }; then
295 KMEXTRA_NONFATAL+=" doc/${KMMODULE##*/}"
297 fi 296 fi
298 297
299 # Add some CMake-files to KMEXTRACTONLY. 298 # Add some CMake-files to KMEXTRACTONLY.
300 # Note that this actually doesn't include KMEXTRA handling. 299 # Note that this actually doesn't include KMEXTRA handling.
301 # In those cases you should care to add the relevant files to KMEXTRACTONLY 300 # In those cases you should care to add the relevant files to KMEXTRACTONLY
338 KMEXTRACTONLY+=" 337 KMEXTRACTONLY+="
339 config-enterprise.h.cmake 338 config-enterprise.h.cmake
340 kleopatra/ConfigureChecks.cmake" 339 kleopatra/ConfigureChecks.cmake"
341 if slot_is_at_least 4.5 ${SLOT}; then 340 if slot_is_at_least 4.5 ${SLOT}; then
342 KMEXTRACTONLY+=" 341 KMEXTRACTONLY+="
342 CTestCustom.cmake
343 kdepim-version.h.cmake" 343 kdepim-version.h.cmake"
344 else 344 else
345 KMEXTRACTONLY+=" 345 KMEXTRACTONLY+="
346 kdepim-version.h" 346 kdepim-version.h"
347 fi 347 fi
348 if has kontact ${IUSE//+} && use kontact; then 348 if has kontact ${IUSE//+} && use kontact; then
349 KMEXTRA+=" 349 KMEXTRA+="
350 kontact/plugins/${PLUGINNAME:-${PN}}/" 350 kontact/plugins/${PLUGINNAME:-${PN}}/"
351 if ! slot_is_at_least 4.4 ${SLOT}; then
352 KMEXTRACTONLY+="
353 kontactinterfaces/"
354 fi
355 fi 351 fi
356 ;; 352 ;;
357 kdeutils) 353 kdeutils)
358 KMEXTRACTONLY+=" 354 KMEXTRACTONLY+="
359 kdeutils-version.h" 355 kdeutils-version.h"
616 "${S}"/CMakeLists.txt || \ 612 "${S}"/CMakeLists.txt || \
617 die "${LINENO}: sed died in collision prevention section" 613 die "${LINENO}: sed died in collision prevention section"
618 ;; 614 ;;
619 *) ;; 615 *) ;;
620 esac 616 esac
617 # koffice 2.1.[8-9][0-9] and 9999
618 case ${PV} in
619 2.1.8[0-9]|2.1.9[0-9]|9999)
620 sed -e '/^option(BUILD/s/ON/OFF/' \
621 -e '/^if(NOT BUILD_kchart/,/^endif(NOT BUILD_kchart/d' \
622 -e '/^if(BUILD_koreport/,/^endif(BUILD_koreport/d' \
623 -e 's/set(SHOULD_BUILD_F_OFFICE TRUE)/set(SHOULD_BUILD_F_OFFICE FALSE)/' \
624 -i "${S}"/CMakeLists.txt || die "sed died while fixing cmakelists"
625 if [[ ${PN} != koffice-data ]] && [[ ${PV} == 9999 ]]; then
626 sed -e '/config-opengl.h/d' \
627 -i "${S}"/CMakeLists.txt || die "sed died while fixing cmakelists"
628
629 fi
630 ;;
631 *) ;;
632 esac
621 esac 633 esac
622 634
623 popd > /dev/null 635 popd > /dev/null
624} 636}
625 637
645 -DWITH_Boost=OFF 657 -DWITH_Boost=OFF
646 -DWITH_LibTidy=OFF 658 -DWITH_LibTidy=OFF
647 "${mycmakeargs[@]}" 659 "${mycmakeargs[@]}"
648 ) 660 )
649 ;; 661 ;;
662 koffice)
663 case ${PV} in
664 2.1.8[0-9]|2.1.9[0-9]|9999)
665 if [[ ${PN} != "kchart" ]]; then
666 mycmakeargs=(
667 -DBUILD_koreport=OFF
668 "${mycmakeargs[@]}"
669 )
670 fi
671 ;;
672 esac
673 ;;
650 esac 674 esac
651 675
652 kde4-base_src_configure 676 kde4-base_src_configure
653} 677}
654 678
680# @DESCRIPTION: 704# @DESCRIPTION:
681# Function for installing KDE4 split applications. 705# Function for installing KDE4 split applications.
682kde4-meta_src_install() { 706kde4-meta_src_install() {
683 debug-print-function $FUNCNAME "$@" 707 debug-print-function $FUNCNAME "$@"
684 708
709 # Search ${S}/${KMMODULE} and install common documentation files found
710 local doc
711 for doc in "${S}/${KMMODULE}"/{AUTHORS,CHANGELOG,ChangeLog*,README*,NEWS,TODO,HACKING}; do
712 [[ -f "${doc}" ]] && [[ -s "${doc}" ]] && dodoc "${doc}"
713 done
714
685 kde4-base_src_install 715 kde4-base_src_install
686}
687
688# @FUNCTION: kde4-meta_src_make_doc
689# @DESCRIPTION:
690# This function searches in ${S}/${KMMODULE},
691# and tries to install "AUTHORS ChangeLog* README* NEWS TODO" if these files exist.
692kde4-meta_src_make_doc() {
693 debug-print-function ${FUNCNAME} "$@"
694
695 local doc
696 for doc in AUTHORS ChangeLog* README* NEWS TODO; do
697 [[ -s ${KMMODULE}/${doc} ]] && newdoc "${KMMODULE}/${doc}" "${doc}.${KMMODULE##*/}"
698 done
699
700 kde4-base_src_make_doc
701} 716}
702 717
703# @FUNCTION: kde4-meta_pkg_postinst 718# @FUNCTION: kde4-meta_pkg_postinst
704# @DESCRIPTION: 719# @DESCRIPTION:
705# Invoke kbuildsycoca4. 720# Invoke kbuildsycoca4.

Legend:
Removed from v.1.34  
changed lines
  Added in v.1.43

  ViewVC Help
Powered by ViewVC 1.1.20