| 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.35 2010/05/15 15:19:04 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. |
| 22 | case ${KMNAME} in |
22 | case ${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". |
| 104 | if [[ -z ${KMMODULE} && ${KMNOMODULE} != true ]]; then |
103 | if [[ -z ${KMMODULE} ]] && [[ ${KMNOMODULE} != true ]]; then |
| 105 | KMMODULE=${PN} |
104 | KMMODULE=${PN} |
| 106 | fi |
105 | fi |
| 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. |
| 288 | kde4-meta_create_extractlists() { |
286 | kde4-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 |
| … | |
… | |
| 347 | kdepim-version.h" |
351 | kdepim-version.h" |
| 348 | fi |
352 | fi |
| 349 | if has kontact ${IUSE//+} && use kontact; then |
353 | if has kontact ${IUSE//+} && use kontact; then |
| 350 | KMEXTRA+=" |
354 | KMEXTRA+=" |
| 351 | kontact/plugins/${PLUGINNAME:-${PN}}/" |
355 | kontact/plugins/${PLUGINNAME:-${PN}}/" |
| 352 | if ! slot_is_at_least 4.4 ${SLOT}; then |
|
|
| 353 | KMEXTRACTONLY+=" |
|
|
| 354 | kontactinterfaces/" |
|
|
| 355 | fi |
|
|
| 356 | fi |
356 | fi |
| 357 | ;; |
357 | ;; |
| 358 | kdeutils) |
358 | kdeutils) |
| 359 | KMEXTRACTONLY+=" |
359 | KMEXTRACTONLY+=" |
| 360 | kdeutils-version.h" |
360 | kdeutils-version.h" |
| 361 | ;; |
361 | ;; |
| 362 | koffice) |
362 | koffice) |
| 363 | KMEXTRACTONLY+=" |
363 | KMEXTRACTONLY+=" |
| 364 | config-endian.h.cmake |
|
|
| 365 | filters/config-filters.h.cmake |
364 | filters/config-filters.h.cmake |
| 366 | config-openexr.h.cmake |
|
|
| 367 | config-opengl.h.cmake |
|
|
| 368 | config-prefix.h.cmake |
|
|
| 369 | " |
365 | " |
| 370 | case ${PV} in |
366 | case ${PV} in |
| 371 | 2.0.*) |
367 | 2.0.*) |
| 372 | KMEXTRACTONLY+=" |
368 | KMEXTRACTONLY+=" |
| 373 | 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" |
| 374 | ;; |
381 | ;; |
| 375 | esac |
382 | esac |
| 376 | ;; |
383 | ;; |
| 377 | esac |
384 | esac |
| 378 | # Don't install cmake modules for split ebuilds, to avoid collisions. |
385 | # Don't install cmake modules for split ebuilds, to avoid collisions. |
| … | |
… | |
| 709 | # @DESCRIPTION: |
716 | # @DESCRIPTION: |
| 710 | # Function for installing KDE4 split applications. |
717 | # Function for installing KDE4 split applications. |
| 711 | kde4-meta_src_install() { |
718 | kde4-meta_src_install() { |
| 712 | debug-print-function $FUNCNAME "$@" |
719 | debug-print-function $FUNCNAME "$@" |
| 713 | |
720 | |
| 714 | # Search ${S}/${KMMODULE} and install any "AUTHORS ChangeLog* README* NEWS TODO HACKING" found |
721 | # Search ${S}/${KMMODULE} and install common documentation files found |
| 715 | local doc |
722 | local doc |
| 716 | for doc in AUTHORS ChangeLog* README* NEWS TODO HACKING; do |
723 | for doc in "${S}/${KMMODULE}"/{AUTHORS,CHANGELOG,ChangeLog*,README*,NEWS,TODO,HACKING}; do |
| 717 | [[ -s "${S}/${KMMODULE}/${doc}" ]] && dodoc "${S}/${KMMODULE}/${doc}" |
724 | [[ -f "${doc}" ]] && [[ -s "${doc}" ]] && dodoc "${doc}" |
| 718 | done |
725 | done |
| 719 | |
726 | |
| 720 | kde4-base_src_install |
727 | kde4-base_src_install |
| 721 | } |
728 | } |
| 722 | |
729 | |