/[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.52 Revision 1.57
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.52 2011/05/01 13:52:09 scarabeus Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-meta.eclass,v 1.57 2011/10/06 14:13:29 alexxy 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.
19KDEMETA_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"
20EXPORT_FUNCTIONS ${KDEMETA_EXPF} 20EXPORT_FUNCTIONS ${KDEMETA_EXPF}
21 21
22# Add dependencies that all packages in a certain module share. 22# Add dependencies that all packages in a certain module share.
23case ${KMNAME} in 23case ${KMNAME} in
24 kdebase|kdebase-apps|kdebase-workspace|kdebase-runtime|kdegraphics) 24 kdebase|kdebase-apps|kde-baseapps|kdebase-workspace|kde-workspace|kdebase-runtime|kde-runtime|kdegraphics)
25 COMMONDEPEND+=" >=media-libs/qimageblitz-0.0.4" 25 COMMONDEPEND+=" >=media-libs/qimageblitz-0.0.4"
26 ;; 26 ;;
27 kdepim|kdepim-runtime) 27 kdepim|kdepim-runtime)
28 case ${PN} in 28 case ${PN} in
29 akregator|kaddressbook|kjots|kmail|knode|knotes|korganizer|ktimetracker) 29 akregator|kaddressbook|kjots|kmail|knode|knotes|korganizer|ktimetracker)
178 einfo "Exporting parts of working copy to ${S}" 178 einfo "Exporting parts of working copy to ${S}"
179 kde4-meta_create_extractlists 179 kde4-meta_create_extractlists
180 180
181 case ${KDE_SCM} in 181 case ${KDE_SCM} in
182 svn) 182 svn)
183 local rsync_options subdir kmnamedir targetdir wc_path escm 183 local rsync_options subdir targetdir wc_path escm
184 184
185 rsync_options="--group --links --owner --perms --quiet --exclude=.svn/ --exclude=.git/" 185 rsync_options="--group --links --owner --perms --quiet --exclude=.svn/ --exclude=.git/"
186 wc_path="${ESVN_WC_PATH}" 186 wc_path="${ESVN_WC_PATH}"
187 escm="{ESVN}" 187 escm="{ESVN}"
188 188
189 # Copy ${KMNAME} non-recursively (toplevel files) 189 # Copy ${KMNAME} non-recursively (toplevel files)
190 rsync ${rsync_options} "${wc_path}"/${kmnamedir}* "${S}" \ 190 rsync ${rsync_options} "${wc_path}"/* "${S}" \
191 || die "${escm}: can't export toplevel files to '${S}'." 191 || die "${escm}: can't export toplevel files to '${S}'."
192 # Copy cmake directory 192 # Copy cmake directory
193 if [[ -d "${wc_path}/${kmnamedir}cmake" ]]; then 193 if [[ -d "${wc_path}/cmake" ]]; then
194 rsync --recursive ${rsync_options} "${wc_path}/${kmnamedir}cmake" "${S}" \ 194 rsync --recursive ${rsync_options} "${wc_path}/cmake" "${S}" \
195 || die "${escm}: can't export cmake files to '${S}'." 195 || die "${escm}: can't export cmake files to '${S}'."
196 fi 196 fi
197 # Copy all subdirectories 197 # Copy all subdirectories
198 for subdir in $(__list_needed_subdirectories); do 198 for subdir in $(__list_needed_subdirectories); do
199 targetdir="" 199 targetdir=""
200 if [[ $subdir = doc/* && ! -e "$wc_path/$kmnamedir$subdir" ]]; then 200 if [[ $subdir = doc/* && ! -e "$wc_path/$subdir" ]]; then
201 continue 201 continue
202 fi 202 fi
203 203
204 [[ ${subdir%/} = */* ]] && targetdir=${subdir%/} && targetdir=${targetdir%/*} && mkdir -p "${S}/${targetdir}" 204 [[ ${subdir%/} = */* ]] && targetdir=${subdir%/} && targetdir=${targetdir%/*} && mkdir -p "${S}/${targetdir}"
205 rsync --recursive ${rsync_options} "${wc_path}/${kmnamedir}${subdir%/}" "${S}/${targetdir}" \ 205 rsync --recursive ${rsync_options} "${wc_path}/${subdir%/}" "${S}/${targetdir}" \
206 || die "${escm}: can't export subdirectory '${subdir}' to '${S}/${targetdir}'." 206 || die "${escm}: can't export subdirectory '${subdir}' to '${S}/${targetdir}'."
207 done 207 done
208 ;; 208 ;;
209 esac 209 esac
210 else 210 else
211 local abort tarball tarfile f extractlist moduleprefix postfix 211 local abort tarball tarfile f extractlist postfix
212 212
213 KMTARPARAMS+=" --bzip2" 213 KMTARPARAMS+=" --bzip2"
214 postfix="bz2" 214 postfix="bz2"
215 215
216 case ${KMNAME} in 216 case ${KMNAME} in
217 kdebase-apps) 217 kdebase-apps)
218 # kdebase/apps -> kdebase-apps 218 # kdebase/apps -> kdebase-apps
219 tarball="kdebase-${PV}.tar.${postfix}" 219 tarball="kdebase-${PV}.tar.${postfix}"
220 if ! slot_is_at_least 4.6 ${SLOT} || [[ ${PV} == "4.6.0" ]]; then
221 moduleprefix=apps/
222 KMTARPARAMS+=" --transform=s|apps/||"
223 fi
224 ;; 220 ;;
225 *) 221 *)
226 # Create tarball name from module name (this is the default) 222 # Create tarball name from module name (this is the default)
227 tarball="${KMNAME}-${PV}.tar.${postfix}" 223 tarball="${KMNAME}-${PV}.tar.${postfix}"
228 ;; 224 ;;
237 233
238 ebegin "Unpacking parts of ${tarball} to ${WORKDIR}" 234 ebegin "Unpacking parts of ${tarball} to ${WORKDIR}"
239 235
240 kde4-meta_create_extractlists 236 kde4-meta_create_extractlists
241 237
242 for f in cmake/ CMakeLists.txt ConfigureChecks.cmake config.h.cmake \ 238 for f in cmake/ CMakeLists.txt ConfigureChecks.cmake config.h.cmake
243 AUTHORS COPYING INSTALL README NEWS ChangeLog
244 do 239 do
245 extractlist+=" ${topdir}${moduleprefix}${f}" 240 extractlist+=" ${topdir}${f}"
246 done 241 done
247 extractlist+=" $(__list_needed_subdirectories)" 242 extractlist+=" $(__list_needed_subdirectories)"
248 243
249 pushd "${WORKDIR}" > /dev/null 244 pushd "${WORKDIR}" > /dev/null
250 245
259 else 254 else
260 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"
261 fi 256 fi
262 257
263 # 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
264 mv ${topdir} ${P} || die "Died while moving \"${topdir}\" to \"${P}\"" 260 mv ${topdir} ${P} || die "Died while moving \"${topdir}\" to \"${P}\""
261 fi
265 262
266 popd > /dev/null 263 popd > /dev/null
267 264
268 eend $? 265 eend $?
269
270 # We need to clear it here to make verification below work
271 unset moduleprefix
272 266
273 if [[ -n ${KDE4_STRICTER} ]]; then 267 if [[ -n ${KDE4_STRICTER} ]]; then
274 for f in $(__list_needed_subdirectories fatal); do 268 for f in $(__list_needed_subdirectories fatal); do
275 if [[ ! -e ${S}/${f#*/} ]]; then 269 if [[ ! -e ${S}/${f#*/} ]]; then
276 eerror "'${f#*/}' is missing" 270 eerror "'${f#*/}' is missing"
293kde4-meta_create_extractlists() { 287kde4-meta_create_extractlists() {
294 debug-print-function ${FUNCNAME} "$@" 288 debug-print-function ${FUNCNAME} "$@"
295 289
296 # Add default handbook locations 290 # Add default handbook locations
297 # 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.
298 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
299 # We use the basename of $KMMODULE because $KMMODULE can contain 293 # We use the basename of $KMMODULE because $KMMODULE can contain
300 # the path to the module subdirectory. 294 # the path to the module subdirectory.
301 KMEXTRA_NONFATAL+=" 295 KMEXTRA_NONFATAL+="
302 doc/${KMMODULE##*/}" 296 doc/${KMMODULE##*/}"
303 fi 297 fi
309 303
310 # Add some CMake-files to KMEXTRACTONLY. 304 # Add some CMake-files to KMEXTRACTONLY.
311 # Note that this actually doesn't include KMEXTRA handling. 305 # Note that this actually doesn't include KMEXTRA handling.
312 # 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
313 case ${KMNAME} in 307 case ${KMNAME} in
314 kdebase) 308 kdebase | kdebase-apps | kde-baseapps)
315 if ! slot_is_at_least 4.6 ${SLOT} || [[ ${PV} == "4.6.0" ]]; then
316 KMEXTRACTONLY+="
317 apps/config-apps.h.cmake
318 apps/ConfigureChecks.cmake"
319 else
320 KMEXTRACTONLY+="
321 config-apps.h.cmake
322 ConfigureChecks.cmake"
323 fi
324 ;;
325 kdebase-apps)
326 KMEXTRACTONLY+=" 309 KMEXTRACTONLY+="
327 config-apps.h.cmake 310 config-apps.h.cmake
328 ConfigureChecks.cmake" 311 ConfigureChecks.cmake"
329 ;; 312 ;;
330 kdebase-runtime) 313 kdebase-runtime | kde-runtime)
331 KMEXTRACTONLY+=" 314 KMEXTRACTONLY+="
332 config-runtime.h.cmake" 315 config-runtime.h.cmake"
333 ;; 316 ;;
334 kdebase-workspace) 317 kdebase-workspace | kde-workspace)
335 KMEXTRACTONLY+=" 318 KMEXTRACTONLY+="
336 config-unix.h.cmake 319 config-unix.h.cmake
337 ConfigureChecks.cmake 320 ConfigureChecks.cmake
338 config-workspace.h.cmake 321 config-workspace.h.cmake
339 config-X11.h.cmake 322 config-X11.h.cmake
353 libkdepim/" 336 libkdepim/"
354 fi 337 fi
355 KMEXTRACTONLY+=" 338 KMEXTRACTONLY+="
356 config-enterprise.h.cmake 339 config-enterprise.h.cmake
357 kleopatra/ConfigureChecks.cmake" 340 kleopatra/ConfigureChecks.cmake"
358 if slot_is_at_least 4.5 ${SLOT}; then 341 if ! [[ $(get_kde_version) < 4.5 ]]; then
359 KMEXTRACTONLY+=" 342 KMEXTRACTONLY+="
360 CTestCustom.cmake 343 CTestCustom.cmake
361 kdepim-version.h.cmake" 344 kdepim-version.h.cmake"
362 else 345 else
363 KMEXTRACTONLY+=" 346 KMEXTRACTONLY+="
388 ;; 371 ;;
389 esac 372 esac
390 # Don't install cmake modules for split ebuilds, to avoid collisions. 373 # Don't install cmake modules for split ebuilds, to avoid collisions.
391 # 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
392 # should not try in that case 375 # should not try in that case
393 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 || ${PV} == 4.6.5 ) ]]; then
394 case ${KMNAME} in 381 case ${KMNAME} in
395 kdebase-runtime|kdebase-workspace|kdeedu|kdegames|kdegraphics) 382 kdebase-runtime|kde-runtime|kdebase-workspace|kde-workspace|kdeedu|kdegames|kdegraphics)
396 case ${PN} in 383 case ${PN} in
397 libkdegames|libkdeedu|libkworkspace) 384 libkdegames|libkdeedu|libkworkspace)
398 KMEXTRA+=" 385 KMEXTRA+="
399 cmake/modules/" 386 cmake/modules/"
400 ;; 387 ;;
452 # Create final list of stuff to extract 439 # Create final list of stuff to extract
453 # We append topdir only when specified (usually for tarballs) 440 # We append topdir only when specified (usually for tarballs)
454 for i in ${kmmodule_expanded} ${kmextra_expanded} ${kmcompileonly_expanded} \ 441 for i in ${kmmodule_expanded} ${kmextra_expanded} ${kmcompileonly_expanded} \
455 ${KMEXTRACTONLY} 442 ${KMEXTRACTONLY}
456 do 443 do
457 extractlist+=" ${topdir}${moduleprefix}${i}" 444 extractlist+=" ${topdir}${i}"
458 done 445 done
459 446
460 echo ${extractlist} 447 echo ${extractlist}
461} 448}
462 449
558 _change_cmakelists_parent_dirs ${i} 545 _change_cmakelists_parent_dirs ${i}
559 fi 546 fi
560 done 547 done
561 548
562 case ${KMNAME} in 549 case ${KMNAME} in
563 kdebase-workspace) 550 kdebase-workspace | kde-workspace)
564 # COLLISION PROTECT section 551 # COLLISION PROTECT section
565 # 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,
566 # not as a part of every package. 553 # not as a part of every package.
567 if [[ ${PN} != kdebase-startkde && -f CMakeLists.txt ]]; then 554 if [[ ${PN} != kdebase-startkde && -f CMakeLists.txt ]]; then
568 # 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.
570 -i CMakeLists.txt || die "${LINENO}: sed died in the kdebase-startkde collision prevention section" 557 -i CMakeLists.txt || die "${LINENO}: sed died in the kdebase-startkde collision prevention section"
571 fi 558 fi
572 # Strip EXPORT feature section from workspace for KDE4 versions > 4.1.82 559 # Strip EXPORT feature section from workspace for KDE4 versions > 4.1.82
573 if [[ ${PN} != libkworkspace ]]; then 560 if [[ ${PN} != libkworkspace ]]; then
574 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' \
575 -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 kde-workspace strip config install and fix EXPORT section"
576 fi 563 fi
564 if [[ ${PN} != plasma-workspace ]]; then
565 sed -e '/KActivities/s/REQUIRED//' \
566 -i CMakeLists.txt || die "${LINENO}: sed died in kde-workspace dep reduction section"
567 fi
577 ;; 568 ;;
578 kdebase-runtime) 569 kdebase-runtime | kde-runtime)
579 # COLLISION PROTECT section 570 # COLLISION PROTECT section
580 # Only install the kde4 script as part of kde-base/kdebase-data 571 # Only install the kde4 script as part of kde-base/kdebase-data
581 if [[ ${PN} != kdebase-data && -f CMakeLists.txt ]]; then 572 if [[ ${PN} != kdebase-data && -f CMakeLists.txt ]]; then
582 sed -e '/^install(PROGRAMS[[:space:]]*[^[:space:]]*\/kde4[[:space:]]/s/^/#DONOTINSTALL /' \ 573 sed -e '/^install(PROGRAMS[[:space:]]*[^[:space:]]*\/kde4[[:space:]]/s/^/#DONOTINSTALL /' \
583 -i CMakeLists.txt || die "Sed to exclude bin/kde4 failed" 574 -i CMakeLists.txt || die "Sed to exclude bin/kde4 failed"
600 if ( has kontact ${IUSE//+} && use kontact ) || [[ ${PN} = kontact ]]; then 591 if ( has kontact ${IUSE//+} && use kontact ) || [[ ${PN} = kontact ]]; then
601 sed -e '/if[[:space:]]*([[:space:]]*BUILD_.*)/s/^/#OVERRIDE /' \ 592 sed -e '/if[[:space:]]*([[:space:]]*BUILD_.*)/s/^/#OVERRIDE /' \
602 -e '/if[[:space:]]*([[:space:]]*[[:alnum:]]*_FOUND[[:space:]]*)/s/^/#OVERRIDE /' \ 593 -e '/if[[:space:]]*([[:space:]]*[[:alnum:]]*_FOUND[[:space:]]*)/s/^/#OVERRIDE /' \
603 -i kontact/plugins/CMakeLists.txt || die 'failed to override build logic' 594 -i kontact/plugins/CMakeLists.txt || die 'failed to override build logic'
604 fi 595 fi
605 if ! slot_is_at_least 4.5 ${SLOT}; then 596 if [[ $(get_kde_version) < 4.5 ]]; then
606 case ${PN} in 597 case ${PN} in
607 kalarm|kmailcvt|kontact|korganizer|korn) 598 kalarm|kmailcvt|kontact|korganizer|korn)
608 sed -n -e '/qt4_generate_dbus_interface(.*org\.kde\.kmail\.\(kmail\|mailcomposer\)\.xml/p' \ 599 sed -n -e '/qt4_generate_dbus_interface(.*org\.kde\.kmail\.\(kmail\|mailcomposer\)\.xml/p' \
609 -e '/add_custom_target(kmail_xml /,/)/p' \ 600 -e '/add_custom_target(kmail_xml /,/)/p' \
610 -i kmail/CMakeLists.txt || die "uncommenting xml failed" 601 -i kmail/CMakeLists.txt || die "uncommenting xml failed"

Legend:
Removed from v.1.52  
changed lines
  Added in v.1.57

  ViewVC Help
Powered by ViewVC 1.1.20