/[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.33 Revision 1.46
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.33 2010/02/02 14:20:16 reavertm Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-meta.eclass,v 1.46 2010/12/29 17:06:51 tampakrap 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 ;;
225 tarball="kdebase-${PV}.tar.${postfix}" 218 tarball="kdebase-${PV}.tar.${postfix}"
226 # Go one level deeper for kdebase-apps in tarballs 219 # Go one level deeper for kdebase-apps in tarballs
227 moduleprefix=apps/ 220 moduleprefix=apps/
228 KMTARPARAMS+=" --transform=s|apps/||" 221 KMTARPARAMS+=" --transform=s|apps/||"
229 ;; 222 ;;
223 kdepim)
224 if [[ ${PV} == 4.5.93 ]] ; then
225 tarball="kdepim-4.6beta3.tar.${postfix}"
226 fi
227 ;;
230 *) 228 *)
231 # Create tarball name from module name (this is the default) 229 # Create tarball name from module name (this is the default)
232 tarball="${KMNAME}-${PV}.tar.${postfix}" 230 tarball="${KMNAME}-${PV}.tar.${postfix}"
233 ;; 231 ;;
234 esac 232 esac
250 extractlist+=" ${topdir}${moduleprefix}${f}" 248 extractlist+=" ${topdir}${moduleprefix}${f}"
251 done 249 done
252 extractlist+=" $(__list_needed_subdirectories)" 250 extractlist+=" $(__list_needed_subdirectories)"
253 251
254 pushd "${WORKDIR}" > /dev/null 252 pushd "${WORKDIR}" > /dev/null
255 [[ -n ${KDE4_STRICTER} ]] && echo tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} >&2 253 [[ -n ${KDE4_STRICTER} ]] && echo tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist}
256 tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} 2> /dev/null 254 tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} || ewarn "tar extract command failed at least partially - continuing anyway"
257 255
258 # Default $S is based on $P; rename the extracted directory to match $S if necessary 256 # Default $S is based on $P; rename the extracted directory to match $S if necessary
259 mv ${topdir} ${P} || die "Died while moving \"${topdir}\" to \"${P}\"" 257 mv ${topdir} ${P} || die "Died while moving \"${topdir}\" to \"${P}\""
260 258
261 popd > /dev/null 259 popd > /dev/null
286# Also see descriptions of KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY, 284# Also see descriptions of KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY,
287# KMEXTRACTONLY and KMTARPARAMS. 285# KMEXTRACTONLY and KMTARPARAMS.
288kde4-meta_create_extractlists() { 286kde4-meta_create_extractlists() {
289 debug-print-function ${FUNCNAME} "$@" 287 debug-print-function ${FUNCNAME} "$@"
290 288
291 # TODO change to KMEXTRA for more strict check 289 # Add default handbook locations
290 # 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 291 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 292 # We use the basename of $KMMODULE because $KMMODULE can contain
294 # the path to the module subdirectory. 293 # the path to the module subdirectory.
295 KMEXTRA_NONFATAL+=" 294 KMEXTRA_NONFATAL+="
296 doc/${KMMODULE##*/}" 295 doc/${KMMODULE##*/}"
296 fi
297
298 # Add default handbook locations
299 if [[ -z ${KMNOMODULE} ]] && { [[ ${KDE_HANDBOOK} = always ]] || { [[ ${KDE_HANDBOOK} = optional ]] && use handbook; }; }; then
300 KMEXTRA_NONFATAL+=" doc/${KMMODULE##*/}"
297 fi 301 fi
298 302
299 # Add some CMake-files to KMEXTRACTONLY. 303 # Add some CMake-files to KMEXTRACTONLY.
300 # Note that this actually doesn't include KMEXTRA handling. 304 # Note that this actually doesn't include KMEXTRA handling.
301 # In those cases you should care to add the relevant files to KMEXTRACTONLY 305 # In those cases you should care to add the relevant files to KMEXTRACTONLY
338 KMEXTRACTONLY+=" 342 KMEXTRACTONLY+="
339 config-enterprise.h.cmake 343 config-enterprise.h.cmake
340 kleopatra/ConfigureChecks.cmake" 344 kleopatra/ConfigureChecks.cmake"
341 if slot_is_at_least 4.5 ${SLOT}; then 345 if slot_is_at_least 4.5 ${SLOT}; then
342 KMEXTRACTONLY+=" 346 KMEXTRACTONLY+="
347 CTestCustom.cmake
343 kdepim-version.h.cmake" 348 kdepim-version.h.cmake"
344 else 349 else
345 KMEXTRACTONLY+=" 350 KMEXTRACTONLY+="
346 kdepim-version.h" 351 kdepim-version.h"
347 fi 352 fi
348 if has kontact ${IUSE//+} && use kontact; then 353 if has kontact ${IUSE//+} && use kontact; then
349 KMEXTRA+=" 354 KMEXTRA+="
350 kontact/plugins/${PLUGINNAME:-${PN}}/" 355 kontact/plugins/${PLUGINNAME:-${PN}}/"
351 if ! slot_is_at_least 4.4 ${SLOT}; then
352 KMEXTRACTONLY+="
353 kontactinterfaces/"
354 fi
355 fi 356 fi
356 ;; 357 ;;
357 kdeutils) 358 kdeutils)
358 KMEXTRACTONLY+=" 359 KMEXTRACTONLY+="
359 kdeutils-version.h" 360 kdeutils-version.h"
360 ;; 361 ;;
361 koffice) 362 koffice)
362 KMEXTRACTONLY+=" 363 KMEXTRACTONLY+="
363 config-endian.h.cmake
364 filters/config-filters.h.cmake 364 filters/config-filters.h.cmake
365 config-openexr.h.cmake
366 config-opengl.h.cmake
367 config-prefix.h.cmake
368 " 365 "
369 case ${PV} in 366 case ${PV} in
370 2.0.*) 367 2.0.*)
371 KMEXTRACTONLY+=" 368 KMEXTRACTONLY+="
372 config-openctl.h.cmake" 369 config-openctl.h.cmake
370 config-endian.h.cmake
371 config-openexr.h.cmake
372 config-opengl.h.cmake
373 config-prefix.h.cmake"
374 ;;
375 2.[12].*)
376 KMEXTRACTONLY+="
377 config-endian.h.cmake
378 config-openexr.h.cmake
379 config-opengl.h.cmake
380 config-prefix.h.cmake"
373 ;; 381 ;;
374 esac 382 esac
375 ;; 383 ;;
376 esac 384 esac
377 # Don't install cmake modules for split ebuilds, to avoid collisions. 385 # Don't install cmake modules for split ebuilds, to avoid collisions.
571 kdepim) 579 kdepim)
572 # Disable hardcoded checks 580 # Disable hardcoded checks
573 sed -r -e '/find_package\(KdepimLibs/s/REQUIRED//' \ 581 sed -r -e '/find_package\(KdepimLibs/s/REQUIRED//' \
574 -e '/find_package\((KdepimLibs|Boost|QGpgme|Akonadi|ZLIB|Strigi|SharedDesktopOntologies|Soprano|Nepomuk)/{/macro_optional_/!s/find/macro_optional_&/}' \ 582 -e '/find_package\((KdepimLibs|Boost|QGpgme|Akonadi|ZLIB|Strigi|SharedDesktopOntologies|Soprano|Nepomuk)/{/macro_optional_/!s/find/macro_optional_&/}' \
575 -e '/macro_log_feature\((Boost|QGPGME|Akonadi|ZLIB|STRIGI|SHAREDDESKTOPONTOLOGIES|Soprano|Nepomuk)_FOUND/s/ TRUE / FALSE /' \ 583 -e '/macro_log_feature\((Boost|QGPGME|Akonadi|ZLIB|STRIGI|SHAREDDESKTOPONTOLOGIES|Soprano|Nepomuk)_FOUND/s/ TRUE / FALSE /' \
584 -e '/if[[:space:]]*([[:space:]]*BUILD_.*)/s/^/#OVERRIDE /' \
585 -e '/if[[:space:]]*([[:space:]]*[[:alnum:]]*_FOUND[[:space:]]*)/s/^/#OVERRIDE /' \
576 -i CMakeLists.txt || die "failed to disable hardcoded checks" 586 -i CMakeLists.txt || die "failed to disable hardcoded checks"
587 # Disable broken or redundant build logic
588 if ( has kontact ${IUSE//+} && use kontact ) || [[ ${PN} = kontact ]]; then
589 sed -e '/if[[:space:]]*([[:space:]]*BUILD_.*)/s/^/#OVERRIDE /' \
590 -e '/if[[:space:]]*([[:space:]]*[[:alnum:]]*_FOUND[[:space:]]*)/s/^/#OVERRIDE /' \
591 -i kontact/plugins/CMakeLists.txt || die 'failed to override build logic'
592 fi
577 if ! slot_is_at_least 4.5 ${SLOT}; then 593 if ! slot_is_at_least 4.5 ${SLOT}; then
578 case ${PN} in 594 case ${PN} in
579 kalarm|kmailcvt|kontact|korganizer|korn) 595 kalarm|kmailcvt|kontact|korganizer|korn)
580 sed -n -e '/qt4_generate_dbus_interface(.*org\.kde\.kmail\.\(kmail\|mailcomposer\)\.xml/p' \ 596 sed -n -e '/qt4_generate_dbus_interface(.*org\.kde\.kmail\.\(kmail\|mailcomposer\)\.xml/p' \
581 -e '/add_custom_target(kmail_xml /,/)/p' \ 597 -e '/add_custom_target(kmail_xml /,/)/p' \
606 2.0.[1-9]) 622 2.0.[1-9])
607 sed -i -n -e '1h;1!H;${g;s/install(.\+config-openexr.h.\+)//;p}' \ 623 sed -i -n -e '1h;1!H;${g;s/install(.\+config-openexr.h.\+)//;p}' \
608 "${S}"/CMakeLists.txt || \ 624 "${S}"/CMakeLists.txt || \
609 die "${LINENO}: sed died in collision prevention section" 625 die "${LINENO}: sed died in collision prevention section"
610 ;; 626 ;;
627 *) ;;
628 esac
629 # koffice 2.1.[8-9][0-9] and 9999
630 case ${PV} in
631 2.1.8[0-9]|2.1.9[0-9]|9999)
632 sed -e '/^option(BUILD/s/ON/OFF/' \
633 -e '/^if(NOT BUILD_kchart/,/^endif(NOT BUILD_kchart/d' \
634 -e '/^if(BUILD_koreport/,/^endif(BUILD_koreport/d' \
635 -e 's/set(SHOULD_BUILD_F_OFFICE TRUE)/set(SHOULD_BUILD_F_OFFICE FALSE)/' \
636 -i "${S}"/CMakeLists.txt || die "sed died while fixing cmakelists"
637 if [[ ${PN} != koffice-data ]] && [[ ${PV} == 9999 ]]; then
638 sed -e '/config-opengl.h/d' \
639 -i "${S}"/CMakeLists.txt || die "sed died while fixing cmakelists"
640
641 fi
642 ;;
611 *) ;; 643 *) ;;
612 esac 644 esac
613 esac 645 esac
614 646
615 popd > /dev/null 647 popd > /dev/null
637 -DWITH_Boost=OFF 669 -DWITH_Boost=OFF
638 -DWITH_LibTidy=OFF 670 -DWITH_LibTidy=OFF
639 "${mycmakeargs[@]}" 671 "${mycmakeargs[@]}"
640 ) 672 )
641 ;; 673 ;;
674 koffice)
675 case ${PV} in
676 2.1.8[0-9]|2.1.9[0-9]|9999)
677 if [[ ${PN} != "kchart" ]]; then
678 mycmakeargs=(
679 -DBUILD_koreport=OFF
680 "${mycmakeargs[@]}"
681 )
682 fi
683 ;;
684 esac
685 ;;
642 esac 686 esac
643 687
644 kde4-base_src_configure 688 kde4-base_src_configure
645} 689}
646 690
672# @DESCRIPTION: 716# @DESCRIPTION:
673# Function for installing KDE4 split applications. 717# Function for installing KDE4 split applications.
674kde4-meta_src_install() { 718kde4-meta_src_install() {
675 debug-print-function $FUNCNAME "$@" 719 debug-print-function $FUNCNAME "$@"
676 720
721 # Search ${S}/${KMMODULE} and install common documentation files found
722 local doc
723 for doc in "${S}/${KMMODULE}"/{AUTHORS,CHANGELOG,ChangeLog*,README*,NEWS,TODO,HACKING}; do
724 [[ -f "${doc}" ]] && [[ -s "${doc}" ]] && dodoc "${doc}"
725 done
726
677 kde4-base_src_install 727 kde4-base_src_install
678}
679
680# @FUNCTION: kde4-meta_src_make_doc
681# @DESCRIPTION:
682# This function searches in ${S}/${KMMODULE},
683# and tries to install "AUTHORS ChangeLog* README* NEWS TODO" if these files exist.
684kde4-meta_src_make_doc() {
685 debug-print-function ${FUNCNAME} "$@"
686
687 local doc
688 for doc in AUTHORS ChangeLog* README* NEWS TODO; do
689 [[ -s ${KMMODULE}/${doc} ]] && newdoc "${KMMODULE}/${doc}" "${doc}.${KMMODULE##*/}"
690 done
691
692 kde4-base_src_make_doc
693} 728}
694 729
695# @FUNCTION: kde4-meta_pkg_postinst 730# @FUNCTION: kde4-meta_pkg_postinst
696# @DESCRIPTION: 731# @DESCRIPTION:
697# Invoke kbuildsycoca4. 732# Invoke kbuildsycoca4.

Legend:
Removed from v.1.33  
changed lines
  Added in v.1.46

  ViewVC Help
Powered by ViewVC 1.1.20