| 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.39 2010/08/09 15:59: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. |
| … | |
… | |
| 98 | # If set to "true", $KMMODULE doesn't have to be defined. |
98 | # If set to "true", $KMMODULE doesn't have to be defined. |
| 99 | # |
99 | # |
| 100 | # 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, |
| 101 | # you mark the top subdirectory (containing the package) as $KMEXTRACTONLY, and |
101 | # you mark the top subdirectory (containing the package) as $KMEXTRACTONLY, and |
| 102 | # set KMNOMODULE="true". |
102 | # set KMNOMODULE="true". |
| 103 | if [[ -z ${KMMODULE} && ${KMNOMODULE} != true ]]; then |
103 | if [[ -z ${KMMODULE} ]] && [[ ${KMNOMODULE} != true ]]; then |
| 104 | KMMODULE=${PN} |
104 | KMMODULE=${PN} |
| 105 | fi |
105 | fi |
| 106 | |
106 | |
| 107 | # @ECLASS-VARIABLE: KMEXTRA |
107 | # @ECLASS-VARIABLE: KMEXTRA |
| 108 | # @DESCRIPTION: |
108 | # @DESCRIPTION: |
| 109 | # All subdirectories listed here will be extracted, compiled & installed. |
109 | # All subdirectories listed here will be extracted, compiled & installed. |
| 110 | # $KMMODULE is always added to $KMEXTRA. |
110 | # $KMMODULE is always added to $KMEXTRA. |
| 111 | # 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 |
| 112 | # 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 |
| 113 | # handled in the ebuild. |
|
|
| 114 | # 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.. |
| 115 | |
114 | |
| 116 | # @ECLASS-VARIABLE: KMCOMPILEONLY |
115 | # @ECLASS-VARIABLE: KMCOMPILEONLY |
| 117 | # @DESCRIPTION: |
116 | # @DESCRIPTION: |
| 118 | # All subdirectories listed here will be extracted & compiled, but not installed. |
117 | # All subdirectories listed here will be extracted & compiled, but not installed. |
| 119 | |
118 | |
| … | |
… | |
| 201 | "${S}"/CMakeLists.txt || die "Sed to exclude bin/kde4 failed" |
200 | "${S}"/CMakeLists.txt || die "Sed to exclude bin/kde4 failed" |
| 202 | fi |
201 | fi |
| 203 | else |
202 | else |
| 204 | local abort tarball tarfile f extractlist moduleprefix postfix |
203 | local abort tarball tarfile f extractlist moduleprefix postfix |
| 205 | case ${PV} in |
204 | case ${PV} in |
| 206 | 4.[45].8[05] | 4.[45].9[02568]) |
205 | 4.[45].8[05] | 4.[45].9[023568]) |
| 207 | # block for normally packed upstream unstable snapshots |
206 | # Block for normally packed upstream unstable snapshots |
| 208 | KMTARPARAMS+=" --bzip2" # bz2 |
207 | KMTARPARAMS+=" --bzip2" # bz2 |
| 209 | postfix="bz2" |
208 | postfix="bz2" |
| 210 | ;; |
|
|
| 211 | 4.[45].[6-9]*) |
|
|
| 212 | # Not passing --xz, as it doesn't work with stable tar |
|
|
| 213 | KMTARPARAMS+=" --use-compress-program=xz" # xz |
|
|
| 214 | postfix="xz" |
|
|
| 215 | ;; |
209 | ;; |
| 216 | *) |
210 | *) |
| 217 | KMTARPARAMS+=" --bzip2" # bz2 |
211 | KMTARPARAMS+=" --bzip2" # bz2 |
| 218 | postfix="bz2" |
212 | postfix="bz2" |
| 219 | ;; |
213 | ;; |
| … | |
… | |
| 224 | tarball="kdebase-${PV}.tar.${postfix}" |
218 | tarball="kdebase-${PV}.tar.${postfix}" |
| 225 | # Go one level deeper for kdebase-apps in tarballs |
219 | # Go one level deeper for kdebase-apps in tarballs |
| 226 | moduleprefix=apps/ |
220 | moduleprefix=apps/ |
| 227 | KMTARPARAMS+=" --transform=s|apps/||" |
221 | KMTARPARAMS+=" --transform=s|apps/||" |
| 228 | ;; |
222 | ;; |
|
|
223 | kdepim) |
|
|
224 | if [[ ${PV} == 4.5.93 ]] ; then |
|
|
225 | tarball="kdepim-4.6beta3.tar.${postfix}" |
|
|
226 | fi |
|
|
227 | ;; |
| 229 | *) |
228 | *) |
| 230 | # Create tarball name from module name (this is the default) |
229 | # Create tarball name from module name (this is the default) |
| 231 | tarball="${KMNAME}-${PV}.tar.${postfix}" |
230 | tarball="${KMNAME}-${PV}.tar.${postfix}" |
| 232 | ;; |
231 | ;; |
| 233 | esac |
232 | esac |
| … | |
… | |
| 249 | extractlist+=" ${topdir}${moduleprefix}${f}" |
248 | extractlist+=" ${topdir}${moduleprefix}${f}" |
| 250 | done |
249 | done |
| 251 | extractlist+=" $(__list_needed_subdirectories)" |
250 | extractlist+=" $(__list_needed_subdirectories)" |
| 252 | |
251 | |
| 253 | pushd "${WORKDIR}" > /dev/null |
252 | pushd "${WORKDIR}" > /dev/null |
| 254 | [[ -n ${KDE4_STRICTER} ]] && echo tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} >&2 |
253 | [[ -n ${KDE4_STRICTER} ]] && echo tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} |
| 255 | tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} 2> /dev/null |
254 | tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} || ewarn "tar extract command failed at least partially - continuing anyway" |
| 256 | |
255 | |
| 257 | # 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 |
| 258 | mv ${topdir} ${P} || die "Died while moving \"${topdir}\" to \"${P}\"" |
257 | mv ${topdir} ${P} || die "Died while moving \"${topdir}\" to \"${P}\"" |
| 259 | |
258 | |
| 260 | popd > /dev/null |
259 | popd > /dev/null |
| … | |
… | |
| 285 | # Also see descriptions of KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY, |
284 | # Also see descriptions of KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY, |
| 286 | # KMEXTRACTONLY and KMTARPARAMS. |
285 | # KMEXTRACTONLY and KMTARPARAMS. |
| 287 | kde4-meta_create_extractlists() { |
286 | kde4-meta_create_extractlists() { |
| 288 | debug-print-function ${FUNCNAME} "$@" |
287 | debug-print-function ${FUNCNAME} "$@" |
| 289 | |
288 | |
| 290 | # 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. |
| 291 | 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 |
| 292 | # We use the basename of $KMMODULE because $KMMODULE can contain |
292 | # We use the basename of $KMMODULE because $KMMODULE can contain |
| 293 | # the path to the module subdirectory. |
293 | # the path to the module subdirectory. |
| 294 | KMEXTRA_NONFATAL+=" |
294 | KMEXTRA_NONFATAL+=" |
| 295 | 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##*/}" |
| 296 | fi |
301 | fi |
| 297 | |
302 | |
| 298 | # Add some CMake-files to KMEXTRACTONLY. |
303 | # Add some CMake-files to KMEXTRACTONLY. |
| 299 | # Note that this actually doesn't include KMEXTRA handling. |
304 | # Note that this actually doesn't include KMEXTRA handling. |
| 300 | # 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 |
| … | |
… | |
| 354 | KMEXTRACTONLY+=" |
359 | KMEXTRACTONLY+=" |
| 355 | kdeutils-version.h" |
360 | kdeutils-version.h" |
| 356 | ;; |
361 | ;; |
| 357 | koffice) |
362 | koffice) |
| 358 | KMEXTRACTONLY+=" |
363 | KMEXTRACTONLY+=" |
| 359 | config-endian.h.cmake |
|
|
| 360 | filters/config-filters.h.cmake |
364 | filters/config-filters.h.cmake |
| 361 | config-openexr.h.cmake |
|
|
| 362 | config-opengl.h.cmake |
|
|
| 363 | config-prefix.h.cmake |
|
|
| 364 | " |
365 | " |
| 365 | case ${PV} in |
366 | case ${PV} in |
| 366 | 2.0.*) |
367 | 2.0.*) |
| 367 | KMEXTRACTONLY+=" |
368 | KMEXTRACTONLY+=" |
| 368 | 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" |
| 369 | ;; |
381 | ;; |
| 370 | esac |
382 | esac |
| 371 | ;; |
383 | ;; |
| 372 | esac |
384 | esac |
| 373 | # Don't install cmake modules for split ebuilds, to avoid collisions. |
385 | # Don't install cmake modules for split ebuilds, to avoid collisions. |