/[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.37 Revision 1.50
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.37 2010/05/17 01:16:39 reavertm Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-meta.eclass,v 1.50 2011/03/11 19:50:52 dilfridge 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.
10# This eclass provides all necessary functions for writing split KDE ebuilds. 10# This eclass provides all necessary functions for writing split KDE ebuilds.
11# 11#
12# You must define KMNAME to use this eclass, and do so before inheriting it. All other variables are optional. 12# You must define KMNAME to use this eclass, and do so before inheriting it. All other variables are optional.
13# Do not include the same item in more than one of KMMODULE, KMMEXTRA, KMCOMPILEONLY, KMEXTRACTONLY. 13# Do not include the same item in more than one of KMMODULE, KMMEXTRA, KMCOMPILEONLY, KMEXTRACTONLY.
14 14
15inherit kde4-base versionator 15inherit kde4-base toolchain-funcs versionator
16 16
17case ${EAPI:-0} in
18 3)
17EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare src_configure src_compile src_test src_install pkg_postinst pkg_postrm 19 KDEMETA_EXPF="pkg_setup src_unpack src_prepare src_configure src_compile src_test src_install pkg_postinst pkg_postrm"
20 ;;
21 *)
22 KDEMETA_EXPF="pkg_pretend pkg_setup src_unpack src_prepare src_configure src_compile src_test src_install pkg_postinst pkg_postrm"
23 ;;
24esac
25EXPORT_FUNCTIONS ${KDEMETA_EXPF}
18 26
19[[ -z ${KMNAME} ]] && die "kde4-meta.eclass inherited but KMNAME not defined - broken ebuild" 27[[ -z ${KMNAME} ]] && die "kde4-meta.eclass inherited but KMNAME not defined - broken ebuild"
20 28
21# Add dependencies that all packages in a certain module share. 29# Add dependencies that all packages in a certain module share.
22case ${KMNAME} in 30case ${KMNAME} in
23 kdebase|kdebase-apps|kdebase-workspace|kdebase-runtime|kdegraphics) 31 kdebase|kdebase-apps|kdebase-workspace|kdebase-runtime|kdegraphics)
24 COMMONDEPEND+=" >=media-libs/qimageblitz-0.0.4" 32 COMMONDEPEND+=" >=media-libs/qimageblitz-0.0.4"
25 ;; 33 ;;
26 kdepim|kdepim-runtime) 34 kdepim|kdepim-runtime)
27 ! slot_is_at_least 4.4 ${SLOT} && COMMONDEPEND+=" $(add_kdebase_dep kdepimlibs)"
28 case ${PN} in 35 case ${PN} in
29 akregator|kaddressbook|kjots|kmail|knode|knotes|korganizer|ktimetracker) 36 akregator|kaddressbook|kjots|kmail|knode|knotes|korganizer|ktimetracker)
30 IUSE+=" +kontact" 37 IUSE+=" +kontact"
31 RDEPEND+=" kontact? ( $(add_kdebase_dep kontact) )" 38 RDEPEND+=" kontact? ( $(add_kdebase_dep kontact) )"
32 ;; 39 ;;
99# If set to "true", $KMMODULE doesn't have to be defined. 106# If set to "true", $KMMODULE doesn't have to be defined.
100# 107#
101# Example usage: If you're installing subdirectories of a package, like plugins, 108# Example usage: If you're installing subdirectories of a package, like plugins,
102# you mark the top subdirectory (containing the package) as $KMEXTRACTONLY, and 109# you mark the top subdirectory (containing the package) as $KMEXTRACTONLY, and
103# set KMNOMODULE="true". 110# set KMNOMODULE="true".
104if [[ -z ${KMMODULE} && ${KMNOMODULE} != true ]]; then 111if [[ -z ${KMMODULE} ]] && [[ ${KMNOMODULE} != true ]]; then
105 KMMODULE=${PN} 112 KMMODULE=${PN}
106fi 113fi
107 114
108# @ECLASS-VARIABLE: KMEXTRA 115# @ECLASS-VARIABLE: KMEXTRA
109# @DESCRIPTION: 116# @DESCRIPTION:
110# All subdirectories listed here will be extracted, compiled & installed. 117# All subdirectories listed here will be extracted, compiled & installed.
111# $KMMODULE is always added to $KMEXTRA. 118# $KMMODULE is always added to $KMEXTRA.
112# If the handbook USE-flag is set, and if this directory exists, 119# 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 120# 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. 121# documentation in different subdirectories, it should be added to KMEXTRA manually..
116 122
117# @ECLASS-VARIABLE: KMCOMPILEONLY 123# @ECLASS-VARIABLE: KMCOMPILEONLY
118# @DESCRIPTION: 124# @DESCRIPTION:
119# All subdirectories listed here will be extracted & compiled, but not installed. 125# All subdirectories listed here will be extracted & compiled, but not installed.
120 126
127# @ECLASS-VARIABLE: KMTARPARAMS 133# @ECLASS-VARIABLE: KMTARPARAMS
128# @DESCRIPTION: 134# @DESCRIPTION:
129# Specify extra parameters to pass to tar, in kde4-meta_src_extract. 135# Specify extra parameters to pass to tar, in kde4-meta_src_extract.
130# '-xpf -j' are passed to tar by default. 136# '-xpf -j' are passed to tar by default.
131 137
138# @FUNCTION: kde4-meta_pkg_pretend
139# @DESCRIPTION:
140# Currently only checks the gcc version.
141kde4-meta_pkg_pretend() {
142 debug-print-function ${FUNCNAME} "$@"
143
144 slot_is_at_least 4.6 ${SLOT} && ( [[ $(gcc-major-version) -lt 4 ]] || \
145 ( [[ $(gcc-major-version) -eq 4 ]] && [[ $(gcc-minor-version) -le 3 ]] ) ) \
146 && die "Sorry, but gcc-4.3 and earlier wont work for KDE SC 4.6 (see bug 354837)."
147}
148
132# @FUNCTION: kde4-meta_pkg_setup 149# @FUNCTION: kde4-meta_pkg_setup
133# @DESCRIPTION: 150# @DESCRIPTION:
134# Currently just calls its equivalent in kde4-base.eclass(5). Use this one in 151# Currently calls its equivalent in kde4-base.eclass(5) and checks the gcc version.
135# split ebuilds. 152# Use this one in split ebuilds.
136kde4-meta_pkg_setup() { 153kde4-meta_pkg_setup() {
137 debug-print-function ${FUNCNAME} "$@" 154 debug-print-function ${FUNCNAME} "$@"
155
156 has pkg_pretend ${KDEMETA_EXPF} || kde4-meta_pkg_pretend
138 157
139 kde4-base_pkg_setup 158 kde4-base_pkg_setup
140} 159}
141 160
142# @FUNCTION: kde4-meta_src_unpack 161# @FUNCTION: kde4-meta_src_unpack
202 "${S}"/CMakeLists.txt || die "Sed to exclude bin/kde4 failed" 221 "${S}"/CMakeLists.txt || die "Sed to exclude bin/kde4 failed"
203 fi 222 fi
204 else 223 else
205 local abort tarball tarfile f extractlist moduleprefix postfix 224 local abort tarball tarfile f extractlist moduleprefix postfix
206 case ${PV} in 225 case ${PV} in
207 4.[34].8[05] | 4.[34].9[0568]) 226 4.[45].8[05] | 4.[45].9[023568])
208 # block for normally packed upstream unstable snapshots 227 # Block for normally packed upstream unstable snapshots
209 KMTARPARAMS+=" --bzip2" # bz2 228 KMTARPARAMS+=" --bzip2" # bz2
210 postfix="bz2" 229 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 ;; 230 ;;
217 *) 231 *)
218 KMTARPARAMS+=" --bzip2" # bz2 232 KMTARPARAMS+=" --bzip2" # bz2
219 postfix="bz2" 233 postfix="bz2"
220 ;; 234 ;;
221 esac 235 esac
222 case ${KMNAME} in 236 case ${KMNAME} in
223 kdebase-apps) 237 kdebase-apps)
224 # kdebase/apps -> kdebase-apps 238 # kdebase/apps -> kdebase-apps
225 tarball="kdebase-${PV}.tar.${postfix}" 239 tarball="kdebase-${PV}.tar.${postfix}"
240 case ${PV} in
241 4.6.1)
242 ;;
243 *)
226 # Go one level deeper for kdebase-apps in tarballs 244 # Go one level deeper for kdebase-apps in tarballs
227 moduleprefix=apps/ 245 moduleprefix=apps/
228 KMTARPARAMS+=" --transform=s|apps/||" 246 KMTARPARAMS+=" --transform=s|apps/||"
247 ;;
248 esac
249 ;;
250 kdepim)
251 if [[ ${PV} == 4.5.93 ]] ; then
252 tarball="kdepim-4.6beta3.tar.${postfix}"
253 else
254 tarball="${KMNAME}-${PV}.tar.${postfix}"
255 fi
229 ;; 256 ;;
230 *) 257 *)
231 # Create tarball name from module name (this is the default) 258 # Create tarball name from module name (this is the default)
232 tarball="${KMNAME}-${PV}.tar.${postfix}" 259 tarball="${KMNAME}-${PV}.tar.${postfix}"
233 ;; 260 ;;
250 extractlist+=" ${topdir}${moduleprefix}${f}" 277 extractlist+=" ${topdir}${moduleprefix}${f}"
251 done 278 done
252 extractlist+=" $(__list_needed_subdirectories)" 279 extractlist+=" $(__list_needed_subdirectories)"
253 280
254 pushd "${WORKDIR}" > /dev/null 281 pushd "${WORKDIR}" > /dev/null
255 [[ -n ${KDE4_STRICTER} ]] && echo tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} >&2 282 [[ -n ${KDE4_STRICTER} ]] && echo tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist}
256 tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} 2> /dev/null 283 if [[ ${I_KNOW_WHAT_I_AM_DOING} ]]; then
284 # to make the devs happy - bug 338397
285 tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} || ewarn "tar extract command failed at least partially - continuing anyway"
286 else
287 tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} 2> /dev/null || echo "tar extract command failed at least partially - continuing anyway"
288 fi
257 289
258 # Default $S is based on $P; rename the extracted directory to match $S if necessary 290 # 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}\"" 291 mv ${topdir} ${P} || die "Died while moving \"${topdir}\" to \"${P}\""
260 292
261 popd > /dev/null 293 popd > /dev/null
286# Also see descriptions of KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY, 318# Also see descriptions of KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY,
287# KMEXTRACTONLY and KMTARPARAMS. 319# KMEXTRACTONLY and KMTARPARAMS.
288kde4-meta_create_extractlists() { 320kde4-meta_create_extractlists() {
289 debug-print-function ${FUNCNAME} "$@" 321 debug-print-function ${FUNCNAME} "$@"
290 322
291 # TODO change to KMEXTRA for more strict check 323 # Add default handbook locations
324 # 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 325 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 326 # We use the basename of $KMMODULE because $KMMODULE can contain
294 # the path to the module subdirectory. 327 # the path to the module subdirectory.
295 KMEXTRA_NONFATAL+=" 328 KMEXTRA_NONFATAL+="
296 doc/${KMMODULE##*/}" 329 doc/${KMMODULE##*/}"
330 fi
331
332 # Add default handbook locations
333 if [[ -z ${KMNOMODULE} ]] && { [[ ${KDE_HANDBOOK} = always ]] || { [[ ${KDE_HANDBOOK} = optional ]] && use handbook; }; }; then
334 KMEXTRA_NONFATAL+=" doc/${KMMODULE##*/}"
297 fi 335 fi
298 336
299 # Add some CMake-files to KMEXTRACTONLY. 337 # Add some CMake-files to KMEXTRACTONLY.
300 # Note that this actually doesn't include KMEXTRA handling. 338 # Note that this actually doesn't include KMEXTRA handling.
301 # In those cases you should care to add the relevant files to KMEXTRACTONLY 339 # In those cases you should care to add the relevant files to KMEXTRACTONLY
302 case ${KMNAME} in 340 case ${KMNAME} in
303 kdebase) 341 kdebase)
342 case ${PV} in
343 4.6.1)
304 KMEXTRACTONLY+=" 344 KMEXTRACTONLY+="
345 config-apps.h.cmake
346 ConfigureChecks.cmake"
347 ;;
348 *)
349 KMEXTRACTONLY+="
305 apps/config-apps.h.cmake 350 apps/config-apps.h.cmake
306 apps/ConfigureChecks.cmake" 351 apps/ConfigureChecks.cmake"
352 ;;
353 esac
307 ;; 354 ;;
308 kdebase-apps) 355 kdebase-apps)
309 KMEXTRACTONLY+=" 356 KMEXTRACTONLY+="
310 config-apps.h.cmake 357 config-apps.h.cmake
311 ConfigureChecks.cmake" 358 ConfigureChecks.cmake"
347 kdepim-version.h" 394 kdepim-version.h"
348 fi 395 fi
349 if has kontact ${IUSE//+} && use kontact; then 396 if has kontact ${IUSE//+} && use kontact; then
350 KMEXTRA+=" 397 KMEXTRA+="
351 kontact/plugins/${PLUGINNAME:-${PN}}/" 398 kontact/plugins/${PLUGINNAME:-${PN}}/"
352 if ! slot_is_at_least 4.4 ${SLOT}; then
353 KMEXTRACTONLY+="
354 kontactinterfaces/"
355 fi
356 fi 399 fi
357 ;; 400 ;;
358 kdeutils) 401 kdeutils)
359 KMEXTRACTONLY+=" 402 KMEXTRACTONLY+="
360 kdeutils-version.h" 403 kdeutils-version.h"
361 ;; 404 ;;
362 koffice) 405 koffice)
363 KMEXTRACTONLY+=" 406 KMEXTRACTONLY+="
364 config-endian.h.cmake
365 filters/config-filters.h.cmake 407 filters/config-filters.h.cmake
366 config-openexr.h.cmake
367 config-opengl.h.cmake
368 config-prefix.h.cmake
369 " 408 "
370 case ${PV} in 409 case ${PV} in
371 2.0.*) 410 2.0.*)
372 KMEXTRACTONLY+=" 411 KMEXTRACTONLY+="
373 config-openctl.h.cmake" 412 config-openctl.h.cmake
413 config-endian.h.cmake
414 config-openexr.h.cmake
415 config-opengl.h.cmake
416 config-prefix.h.cmake"
417 ;;
418 2.[12].*)
419 KMEXTRACTONLY+="
420 config-endian.h.cmake
421 config-openexr.h.cmake
422 config-opengl.h.cmake
423 config-prefix.h.cmake"
374 ;; 424 ;;
375 esac 425 esac
376 ;; 426 ;;
377 esac 427 esac
378 # Don't install cmake modules for split ebuilds, to avoid collisions. 428 # Don't install cmake modules for split ebuilds, to avoid collisions.
712 debug-print-function $FUNCNAME "$@" 762 debug-print-function $FUNCNAME "$@"
713 763
714 # Search ${S}/${KMMODULE} and install common documentation files found 764 # Search ${S}/${KMMODULE} and install common documentation files found
715 local doc 765 local doc
716 for doc in "${S}/${KMMODULE}"/{AUTHORS,CHANGELOG,ChangeLog*,README*,NEWS,TODO,HACKING}; do 766 for doc in "${S}/${KMMODULE}"/{AUTHORS,CHANGELOG,ChangeLog*,README*,NEWS,TODO,HACKING}; do
717 [[ -s "${doc}" ]] && dodoc "${doc}" 767 [[ -f "${doc}" ]] && [[ -s "${doc}" ]] && dodoc "${doc}"
718 done 768 done
719 769
720 kde4-base_src_install 770 kde4-base_src_install
721} 771}
722 772

Legend:
Removed from v.1.37  
changed lines
  Added in v.1.50

  ViewVC Help
Powered by ViewVC 1.1.20