/[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.51 Revision 1.54
1# Copyright 1999-2011 Gentoo Foundation 1# Copyright 1999-2011 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.51 2011/04/06 14:22:14 scarabeus Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-meta.eclass,v 1.54 2011/06/07 20:11:04 abcd 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.
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
15[[ -z ${KMNAME} ]] && die "kde4-meta.eclass inherited but KMNAME not defined - broken ebuild" 15[[ -z ${KMNAME} ]] && die "kde4-meta.eclass inherited but KMNAME not defined - broken ebuild"
16 16
17inherit kde4-base toolchain-funcs versionator 17inherit kde4-base versionator
18 18
19case ${EAPI:-0} in
20 3)
21 KDEMETA_EXPF="pkg_setup src_unpack src_prepare src_configure src_compile src_test src_install pkg_preinst pkg_postinst pkg_postrm" 19KDEMETA_EXPF="pkg_setup src_unpack src_prepare src_configure src_compile src_test src_install pkg_preinst pkg_postinst pkg_postrm"
22 ;;
23 *)
24 KDEMETA_EXPF="pkg_pretend pkg_setup src_unpack src_prepare src_configure src_compile src_test src_install pkg_preinst pkg_postinst pkg_postrm"
25 ;;
26esac
27EXPORT_FUNCTIONS ${KDEMETA_EXPF} 20EXPORT_FUNCTIONS ${KDEMETA_EXPF}
28 21
29# Add dependencies that all packages in a certain module share. 22# Add dependencies that all packages in a certain module share.
30case ${KMNAME} in 23case ${KMNAME} in
31 kdebase|kdebase-apps|kdebase-workspace|kdebase-runtime|kdegraphics) 24 kdebase|kdebase-apps|kde-baseapps|kdebase-workspace|kde-workspace|kdebase-runtime|kde-runtime|kdegraphics)
32 COMMONDEPEND+=" >=media-libs/qimageblitz-0.0.4" 25 COMMONDEPEND+=" >=media-libs/qimageblitz-0.0.4"
33 ;; 26 ;;
34 kdepim|kdepim-runtime) 27 kdepim|kdepim-runtime)
35 case ${PN} in 28 case ${PN} in
36 akregator|kaddressbook|kjots|kmail|knode|knotes|korganizer|ktimetracker) 29 akregator|kaddressbook|kjots|kmail|knode|knotes|korganizer|ktimetracker)
135# @ECLASS-VARIABLE: KMTARPARAMS 128# @ECLASS-VARIABLE: KMTARPARAMS
136# @DESCRIPTION: 129# @DESCRIPTION:
137# Specify extra parameters to pass to tar, in kde4-meta_src_extract. 130# Specify extra parameters to pass to tar, in kde4-meta_src_extract.
138# '-xpf -j' are passed to tar by default. 131# '-xpf -j' are passed to tar by default.
139 132
140# @FUNCTION: kde4-meta_pkg_pretend
141# @DESCRIPTION:
142# Currently only checks the gcc version.
143kde4-meta_pkg_pretend() {
144 debug-print-function ${FUNCNAME} "$@"
145
146 slot_is_at_least 4.6 ${SLOT} && ( [[ $(gcc-major-version) -lt 4 ]] || \
147 ( [[ $(gcc-major-version) -eq 4 && $(gcc-minor-version) -le 3 ]] ) ) \
148 && die "Sorry, but gcc-4.3 and earlier wont work for KDE SC 4.6 (see bug 354837)."
149}
150
151# @FUNCTION: kde4-meta_pkg_setup 133# @FUNCTION: kde4-meta_pkg_setup
152# @DESCRIPTION: 134# @DESCRIPTION:
153# Currently calls its equivalent in kde4-base.eclass(5) and checks the gcc version. 135# Currently calls its equivalent in kde4-base.eclass(5) and checks the gcc version.
154# Use this one in split ebuilds. 136# Use this one in split ebuilds.
155kde4-meta_pkg_setup() { 137kde4-meta_pkg_setup() {
156 debug-print-function ${FUNCNAME} "$@" 138 debug-print-function ${FUNCNAME} "$@"
157
158 has pkg_pretend ${KDEMETA_EXPF} || kde4-meta_pkg_pretend
159 139
160 kde4-base_pkg_setup 140 kde4-base_pkg_setup
161} 141}
162 142
163# @FUNCTION: kde4-meta_src_unpack 143# @FUNCTION: kde4-meta_src_unpack
176 ESVN_RESTRICT="export" subversion_src_unpack 156 ESVN_RESTRICT="export" subversion_src_unpack
177 subversion_wc_info 157 subversion_wc_info
178 subversion_bootstrap 158 subversion_bootstrap
179 ;; 159 ;;
180 git) 160 git)
181 git_src_unpack 161 git-2_src_unpack
182 ;; 162 ;;
183 esac 163 esac
184 fi 164 fi
185 kde4-meta_src_extract 165 kde4-meta_src_extract
186} 166}
226 || die "${escm}: can't export subdirectory '${subdir}' to '${S}/${targetdir}'." 206 || die "${escm}: can't export subdirectory '${subdir}' to '${S}/${targetdir}'."
227 done 207 done
228 ;; 208 ;;
229 esac 209 esac
230 else 210 else
231 local abort tarball tarfile f extractlist moduleprefix postfix 211 local abort tarball tarfile f extractlist postfix
232 212
233 KMTARPARAMS+=" --bzip2" 213 KMTARPARAMS+=" --bzip2"
234 postfix="bz2" 214 postfix="bz2"
235 215
236 case ${KMNAME} in 216 case ${KMNAME} in
237 kdebase-apps) 217 kdebase-apps)
238 # kdebase/apps -> kdebase-apps 218 # kdebase/apps -> kdebase-apps
239 tarball="kdebase-${PV}.tar.${postfix}" 219 tarball="kdebase-${PV}.tar.${postfix}"
240 if ! slot_is_at_least 4.6 ${SLOT} || [[ ${PV} == "4.6.0" ]]; then
241 moduleprefix=apps/
242 KMTARPARAMS+=" --transform=s|apps/||"
243 fi
244 ;; 220 ;;
245 *) 221 *)
246 # Create tarball name from module name (this is the default) 222 # Create tarball name from module name (this is the default)
247 tarball="${KMNAME}-${PV}.tar.${postfix}" 223 tarball="${KMNAME}-${PV}.tar.${postfix}"
248 ;; 224 ;;
257 233
258 ebegin "Unpacking parts of ${tarball} to ${WORKDIR}" 234 ebegin "Unpacking parts of ${tarball} to ${WORKDIR}"
259 235
260 kde4-meta_create_extractlists 236 kde4-meta_create_extractlists
261 237
262 for f in cmake/ CMakeLists.txt ConfigureChecks.cmake config.h.cmake \ 238 for f in cmake/ CMakeLists.txt ConfigureChecks.cmake config.h.cmake
263 AUTHORS COPYING INSTALL README NEWS ChangeLog
264 do 239 do
265 extractlist+=" ${topdir}${moduleprefix}${f}" 240 extractlist+=" ${topdir}${f}"
266 done 241 done
267 extractlist+=" $(__list_needed_subdirectories)" 242 extractlist+=" $(__list_needed_subdirectories)"
268 243
269 pushd "${WORKDIR}" > /dev/null 244 pushd "${WORKDIR}" > /dev/null
270 245
279 else 254 else
280 tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} 2> /dev/null || echo "tar extract command failed at least partially - continuing anyway" 255 tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} 2> /dev/null || echo "tar extract command failed at least partially - continuing anyway"
281 fi 256 fi
282 257
283 # Default $S is based on $P; rename the extracted directory to match $S if necessary 258 # Default $S is based on $P; rename the extracted directory to match $S if necessary
259 if [[ ${KMNAME} != ${PN} ]]; then
284 mv ${topdir} ${P} || die "Died while moving \"${topdir}\" to \"${P}\"" 260 mv ${topdir} ${P} || die "Died while moving \"${topdir}\" to \"${P}\""
261 fi
285 262
286 popd > /dev/null 263 popd > /dev/null
287 264
288 eend $? 265 eend $?
289
290 # We need to clear it here to make verification below work
291 unset moduleprefix
292 266
293 if [[ -n ${KDE4_STRICTER} ]]; then 267 if [[ -n ${KDE4_STRICTER} ]]; then
294 for f in $(__list_needed_subdirectories fatal); do 268 for f in $(__list_needed_subdirectories fatal); do
295 if [[ ! -e ${S}/${f#*/} ]]; then 269 if [[ ! -e ${S}/${f#*/} ]]; then
296 eerror "'${f#*/}' is missing" 270 eerror "'${f#*/}' is missing"
313kde4-meta_create_extractlists() { 287kde4-meta_create_extractlists() {
314 debug-print-function ${FUNCNAME} "$@" 288 debug-print-function ${FUNCNAME} "$@"
315 289
316 # Add default handbook locations 290 # Add default handbook locations
317 # FIXME - legacy code - remove when 4.4.5 is gone or preferrably port 4.4.5. 291 # FIXME - legacy code - remove when 4.4.5 is gone or preferrably port 4.4.5.
318 if ! slot_is_at_least 4.5 ${SLOT} && has handbook ${IUSE//+} && use handbook && [[ -z ${KMNOMODULE} ]]; then 292 if [[ $(get_kde_version) < 4.5 ]] && has handbook ${IUSE//+} && use handbook && [[ -z ${KMNOMODULE} ]]; then
319 # We use the basename of $KMMODULE because $KMMODULE can contain 293 # We use the basename of $KMMODULE because $KMMODULE can contain
320 # the path to the module subdirectory. 294 # the path to the module subdirectory.
321 KMEXTRA_NONFATAL+=" 295 KMEXTRA_NONFATAL+="
322 doc/${KMMODULE##*/}" 296 doc/${KMMODULE##*/}"
323 fi 297 fi
329 303
330 # Add some CMake-files to KMEXTRACTONLY. 304 # Add some CMake-files to KMEXTRACTONLY.
331 # Note that this actually doesn't include KMEXTRA handling. 305 # Note that this actually doesn't include KMEXTRA handling.
332 # In those cases you should care to add the relevant files to KMEXTRACTONLY 306 # In those cases you should care to add the relevant files to KMEXTRACTONLY
333 case ${KMNAME} in 307 case ${KMNAME} in
334 kdebase) 308 kdebase | kdebase-apps | kde-base-apps)
335 if ! slot_is_at_least 4.6 ${SLOT} || [[ ${PV} == "4.6.0" ]]; then
336 KMEXTRACTONLY+="
337 apps/config-apps.h.cmake
338 apps/ConfigureChecks.cmake"
339 else
340 KMEXTRACTONLY+="
341 config-apps.h.cmake
342 ConfigureChecks.cmake"
343 fi
344 ;;
345 kdebase-apps)
346 KMEXTRACTONLY+=" 309 KMEXTRACTONLY+="
347 config-apps.h.cmake 310 config-apps.h.cmake
348 ConfigureChecks.cmake" 311 ConfigureChecks.cmake"
349 ;; 312 ;;
350 kdebase-runtime) 313 kdebase-runtime | kde-runtime)
351 KMEXTRACTONLY+=" 314 KMEXTRACTONLY+="
352 config-runtime.h.cmake" 315 config-runtime.h.cmake"
353 ;; 316 ;;
354 kdebase-workspace) 317 kdebase-workspace | kde-workspace)
355 KMEXTRACTONLY+=" 318 KMEXTRACTONLY+="
356 config-unix.h.cmake 319 config-unix.h.cmake
357 ConfigureChecks.cmake 320 ConfigureChecks.cmake
358 config-workspace.h.cmake 321 config-workspace.h.cmake
359 config-X11.h.cmake 322 config-X11.h.cmake
373 libkdepim/" 336 libkdepim/"
374 fi 337 fi
375 KMEXTRACTONLY+=" 338 KMEXTRACTONLY+="
376 config-enterprise.h.cmake 339 config-enterprise.h.cmake
377 kleopatra/ConfigureChecks.cmake" 340 kleopatra/ConfigureChecks.cmake"
378 if slot_is_at_least 4.5 ${SLOT}; then 341 if ! [[ $(get_kde_version) < 4.5 ]]; then
379 KMEXTRACTONLY+=" 342 KMEXTRACTONLY+="
380 CTestCustom.cmake 343 CTestCustom.cmake
381 kdepim-version.h.cmake" 344 kdepim-version.h.cmake"
382 else 345 else
383 KMEXTRACTONLY+=" 346 KMEXTRACTONLY+="
408 ;; 371 ;;
409 esac 372 esac
410 # Don't install cmake modules for split ebuilds, to avoid collisions. 373 # Don't install cmake modules for split ebuilds, to avoid collisions.
411 # note: kdegraphics >= 4.6.2 does not even have code to do that, so we 374 # note: kdegraphics >= 4.6.2 does not even have code to do that, so we
412 # should not try in that case 375 # should not try in that case
413 if [[ ${KMNAME} != kdegraphics ]] || { [[ ${SLOT} != 4.6 || ${PV} < 4.6.2 ]] && ! slot_is_at_least 4.7 ${SLOT}; }; then 376 # note2: kdeedu 4.6.4 does not have a cmake/modules/ subdir anymore :(
377 # it may be possible to formulate this shorter, but it should also
378 # still be understandable...
379 if [[ ${KMNAME} != kdegraphics || ( ( $(get_kde_version) != 4.6 || ${PV} < 4.6.2 ) && $(get_kde_version) < 4.7 ) ]] \
380 && ! [[ ${KMNAME} == kdeedu && ${PV} == 4.6.4 ]]; then
414 case ${KMNAME} in 381 case ${KMNAME} in
415 kdebase-runtime|kdebase-workspace|kdeedu|kdegames|kdegraphics) 382 kdebase-runtime|kde-runtime|kdebase-workspace|kde-workspace|kdeedu|kdegames|kdegraphics)
416 case ${PN} in 383 case ${PN} in
417 libkdegames|libkdeedu|libkworkspace) 384 libkdegames|libkdeedu|libkworkspace)
418 KMEXTRA+=" 385 KMEXTRA+="
419 cmake/modules/" 386 cmake/modules/"
420 ;; 387 ;;
472 # Create final list of stuff to extract 439 # Create final list of stuff to extract
473 # We append topdir only when specified (usually for tarballs) 440 # We append topdir only when specified (usually for tarballs)
474 for i in ${kmmodule_expanded} ${kmextra_expanded} ${kmcompileonly_expanded} \ 441 for i in ${kmmodule_expanded} ${kmextra_expanded} ${kmcompileonly_expanded} \
475 ${KMEXTRACTONLY} 442 ${KMEXTRACTONLY}
476 do 443 do
477 extractlist+=" ${topdir}${moduleprefix}${i}" 444 extractlist+=" ${topdir}${i}"
478 done 445 done
479 446
480 echo ${extractlist} 447 echo ${extractlist}
481} 448}
482 449
578 _change_cmakelists_parent_dirs ${i} 545 _change_cmakelists_parent_dirs ${i}
579 fi 546 fi
580 done 547 done
581 548
582 case ${KMNAME} in 549 case ${KMNAME} in
583 kdebase-workspace) 550 kdebase-workspace | kde-workspace)
584 # COLLISION PROTECT section 551 # COLLISION PROTECT section
585 # Install the startkde script just once, as a part of kde-base/kdebase-startkde, 552 # Install the startkde script just once, as a part of kde-base/kdebase-startkde,
586 # not as a part of every package. 553 # not as a part of every package.
587 if [[ ${PN} != kdebase-startkde && -f CMakeLists.txt ]]; then 554 if [[ ${PN} != kdebase-startkde && -f CMakeLists.txt ]]; then
588 # The startkde script moved to kdebase-workspace for KDE4 versions > 3.93.0. 555 # The startkde script moved to kdebase-workspace for KDE4 versions > 3.93.0.
593 if [[ ${PN} != libkworkspace ]]; then 560 if [[ ${PN} != libkworkspace ]]; then
594 sed -e '/install(FILES ${CMAKE_CURRENT_BINARY_DIR}\/KDE4WorkspaceConfig.cmake/,/^[[:space:]]*FILE KDE4WorkspaceLibraryTargets.cmake )[[:space:]]*^/d' \ 561 sed -e '/install(FILES ${CMAKE_CURRENT_BINARY_DIR}\/KDE4WorkspaceConfig.cmake/,/^[[:space:]]*FILE KDE4WorkspaceLibraryTargets.cmake )[[:space:]]*^/d' \
595 -i CMakeLists.txt || die "${LINENO}: sed died in kdebase-workspace strip config install and fix EXPORT section" 562 -i CMakeLists.txt || die "${LINENO}: sed died in kdebase-workspace strip config install and fix EXPORT section"
596 fi 563 fi
597 ;; 564 ;;
598 kdebase-runtime) 565 kdebase-runtime | kde-runtime)
599 # COLLISION PROTECT section 566 # COLLISION PROTECT section
600 # Only install the kde4 script as part of kde-base/kdebase-data 567 # Only install the kde4 script as part of kde-base/kdebase-data
601 if [[ ${PN} != kdebase-data && -f CMakeLists.txt ]]; then 568 if [[ ${PN} != kdebase-data && -f CMakeLists.txt ]]; then
602 sed -e '/^install(PROGRAMS[[:space:]]*[^[:space:]]*\/kde4[[:space:]]/s/^/#DONOTINSTALL /' \ 569 sed -e '/^install(PROGRAMS[[:space:]]*[^[:space:]]*\/kde4[[:space:]]/s/^/#DONOTINSTALL /' \
603 -i CMakeLists.txt || die "Sed to exclude bin/kde4 failed" 570 -i CMakeLists.txt || die "Sed to exclude bin/kde4 failed"
620 if ( has kontact ${IUSE//+} && use kontact ) || [[ ${PN} = kontact ]]; then 587 if ( has kontact ${IUSE//+} && use kontact ) || [[ ${PN} = kontact ]]; then
621 sed -e '/if[[:space:]]*([[:space:]]*BUILD_.*)/s/^/#OVERRIDE /' \ 588 sed -e '/if[[:space:]]*([[:space:]]*BUILD_.*)/s/^/#OVERRIDE /' \
622 -e '/if[[:space:]]*([[:space:]]*[[:alnum:]]*_FOUND[[:space:]]*)/s/^/#OVERRIDE /' \ 589 -e '/if[[:space:]]*([[:space:]]*[[:alnum:]]*_FOUND[[:space:]]*)/s/^/#OVERRIDE /' \
623 -i kontact/plugins/CMakeLists.txt || die 'failed to override build logic' 590 -i kontact/plugins/CMakeLists.txt || die 'failed to override build logic'
624 fi 591 fi
625 if ! slot_is_at_least 4.5 ${SLOT}; then 592 if [[ $(get_kde_version) < 4.5 ]]; then
626 case ${PN} in 593 case ${PN} in
627 kalarm|kmailcvt|kontact|korganizer|korn) 594 kalarm|kmailcvt|kontact|korganizer|korn)
628 sed -n -e '/qt4_generate_dbus_interface(.*org\.kde\.kmail\.\(kmail\|mailcomposer\)\.xml/p' \ 595 sed -n -e '/qt4_generate_dbus_interface(.*org\.kde\.kmail\.\(kmail\|mailcomposer\)\.xml/p' \
629 -e '/add_custom_target(kmail_xml /,/)/p' \ 596 -e '/add_custom_target(kmail_xml /,/)/p' \
630 -i kmail/CMakeLists.txt || die "uncommenting xml failed" 597 -i kmail/CMakeLists.txt || die "uncommenting xml failed"

Legend:
Removed from v.1.51  
changed lines
  Added in v.1.54

  ViewVC Help
Powered by ViewVC 1.1.20