/[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.53 Revision 1.64
1# Copyright 1999-2011 Gentoo Foundation 1# Copyright 1999-2012 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.53 2011/06/06 17:51:26 abcd Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-meta.eclass,v 1.64 2012/05/08 22:00:49 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.
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 if [[ ${PV} =~ 4.8.[12345] ]]; then
214 postfix="xz"
215 KMTARPARAMS+=" --xz"
216 else
217 postfix="bz2"
213 KMTARPARAMS+=" --bzip2" 218 KMTARPARAMS+=" --bzip2"
214 postfix="bz2" 219 fi
215 220
216 case ${KMNAME} in 221 case ${KMNAME} in
217 kdebase-apps) 222 kdebase-apps)
218 # kdebase/apps -> kdebase-apps 223 # kdebase/apps -> kdebase-apps
219 tarball="kdebase-${PV}.tar.${postfix}" 224 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 ;; 225 ;;
225 *) 226 *)
226 # Create tarball name from module name (this is the default) 227 # Create tarball name from module name (this is the default)
227 tarball="${KMNAME}-${PV}.tar.${postfix}" 228 tarball="${KMNAME}-${PV}.tar.${postfix}"
228 ;; 229 ;;
239 240
240 kde4-meta_create_extractlists 241 kde4-meta_create_extractlists
241 242
242 for f in cmake/ CMakeLists.txt ConfigureChecks.cmake config.h.cmake 243 for f in cmake/ CMakeLists.txt ConfigureChecks.cmake config.h.cmake
243 do 244 do
244 extractlist+=" ${topdir}${moduleprefix}${f}" 245 extractlist+=" ${topdir}${f}"
245 done 246 done
246 extractlist+=" $(__list_needed_subdirectories)" 247 extractlist+=" $(__list_needed_subdirectories)"
247 248
248 pushd "${WORKDIR}" > /dev/null 249 pushd "${WORKDIR}" > /dev/null
249 250
250 # @ECLASS-VARIABLE: KDE4_STRICTER 251 # @ECLASS-VARIABLE: KDE4_STRICTER
251 # @DESCRIPTION: 252 # @DESCRIPTION:
252 # Print out all issues found executing tar / kmextract files 253 # Print out all issues found executing tar / kmextract files
253 # Set on if you want to find issues in kde-base ebuild unpack sequences 254 # Set on if you want to find issues in kde-base ebuild unpack sequences
254 [[ -n ${KDE4_STRICTER} ]] && echo 'tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist}' 255 [[ -n ${KDE4_STRICTER} ]] && echo 'tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist}'
255 if [[ ${I_KNOW_WHAT_I_AM_DOING} ]]; then
256 # to make the devs happy - bug 338397
257 tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} || ewarn "tar extract command failed at least partially - continuing anyway"
258 else
259 tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} 2> /dev/null || echo "tar extract command failed at least partially - continuing anyway" 256 tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} 2> /dev/null || echo "tar extract command failed at least partially - continuing anyway"
260 fi
261 257
262 # 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
263 if [[ ${KMNAME} != ${PN} ]]; then 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}\""
265 fi 261 fi
266 262
267 popd > /dev/null 263 popd > /dev/null
268 264
269 eend $? 265 eend $?
270
271 # We need to clear it here to make verification below work
272 unset moduleprefix
273 266
274 if [[ -n ${KDE4_STRICTER} ]]; then 267 if [[ -n ${KDE4_STRICTER} ]]; then
275 for f in $(__list_needed_subdirectories fatal); do 268 for f in $(__list_needed_subdirectories fatal); do
276 if [[ ! -e ${S}/${f#*/} ]]; then 269 if [[ ! -e ${S}/${f#*/} ]]; then
277 eerror "'${f#*/}' is missing" 270 eerror "'${f#*/}' is missing"
294kde4-meta_create_extractlists() { 287kde4-meta_create_extractlists() {
295 debug-print-function ${FUNCNAME} "$@" 288 debug-print-function ${FUNCNAME} "$@"
296 289
297 # Add default handbook locations 290 # Add default handbook locations
298 # 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.
299 if ! slot_is_at_least 4.5 ${SLOT} && has handbook ${IUSE//+} && use handbook && [[ -z ${KMNOMODULE} ]]; then 292 if [[ $(get_kde_version) < 4.5 ]] && use_if_iuse handbook && [[ -z ${KMNOMODULE} ]]; then
300 # We use the basename of $KMMODULE because $KMMODULE can contain 293 # We use the basename of $KMMODULE because $KMMODULE can contain
301 # the path to the module subdirectory. 294 # the path to the module subdirectory.
302 KMEXTRA_NONFATAL+=" 295 KMEXTRA_NONFATAL+="
303 doc/${KMMODULE##*/}" 296 doc/${KMMODULE##*/}"
304 fi 297 fi
310 303
311 # Add some CMake-files to KMEXTRACTONLY. 304 # Add some CMake-files to KMEXTRACTONLY.
312 # Note that this actually doesn't include KMEXTRA handling. 305 # Note that this actually doesn't include KMEXTRA handling.
313 # 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
314 case ${KMNAME} in 307 case ${KMNAME} in
315 kdebase)
316 if ! slot_is_at_least 4.6 ${SLOT} || [[ ${PV} == "4.6.0" ]]; then
317 KMEXTRACTONLY+="
318 apps/config-apps.h.cmake
319 apps/ConfigureChecks.cmake"
320 else
321 KMEXTRACTONLY+="
322 config-apps.h.cmake
323 ConfigureChecks.cmake"
324 fi
325 ;;
326 kdebase-apps | kde-baseapps) 308 kdebase | kdebase-apps | kde-baseapps)
327 KMEXTRACTONLY+=" 309 KMEXTRACTONLY+="
328 config-apps.h.cmake 310 config-apps.h.cmake
329 ConfigureChecks.cmake" 311 ConfigureChecks.cmake"
330 ;; 312 ;;
331 kdebase-runtime | kde-runtime) 313 kdebase-runtime | kde-runtime)
354 libkdepim/" 336 libkdepim/"
355 fi 337 fi
356 KMEXTRACTONLY+=" 338 KMEXTRACTONLY+="
357 config-enterprise.h.cmake 339 config-enterprise.h.cmake
358 kleopatra/ConfigureChecks.cmake" 340 kleopatra/ConfigureChecks.cmake"
359 if slot_is_at_least 4.5 ${SLOT}; then 341 if ! [[ $(get_kde_version) < 4.5 ]]; then
360 KMEXTRACTONLY+=" 342 KMEXTRACTONLY+="
361 CTestCustom.cmake 343 CTestCustom.cmake
362 kdepim-version.h.cmake" 344 kdepim-version.h.cmake"
363 else 345 else
364 KMEXTRACTONLY+=" 346 KMEXTRACTONLY+="
365 kdepim-version.h" 347 kdepim-version.h"
366 fi 348 fi
367 if has kontact ${IUSE//+} && use kontact; then 349 if use_if_iuse kontact; then
368 KMEXTRA+=" 350 KMEXTRA+="
369 kontact/plugins/${PLUGINNAME:-${PN}}/" 351 kontact/plugins/${PLUGINNAME:-${PN}}/"
370 fi 352 fi
371 ;; 353 ;;
372 kdeutils) 354 kdeutils)
389 ;; 371 ;;
390 esac 372 esac
391 # Don't install cmake modules for split ebuilds, to avoid collisions. 373 # Don't install cmake modules for split ebuilds, to avoid collisions.
392 # 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
393 # should not try in that case 375 # should not try in that case
394 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
395 case ${KMNAME} in 381 case ${KMNAME} in
396 kdebase-runtime|kde-runtime|kdebase-workspace|kde-workspace|kdeedu|kdegames|kdegraphics) 382 kdebase-runtime|kde-runtime|kdebase-workspace|kde-workspace|kdeedu|kdegames|kdegraphics)
397 case ${PN} in 383 case ${PN} in
398 libkdegames|libkdeedu|libkworkspace) 384 libkdegames|libkdeedu|libkworkspace)
399 KMEXTRA+=" 385 KMEXTRA+="
453 # Create final list of stuff to extract 439 # Create final list of stuff to extract
454 # We append topdir only when specified (usually for tarballs) 440 # We append topdir only when specified (usually for tarballs)
455 for i in ${kmmodule_expanded} ${kmextra_expanded} ${kmcompileonly_expanded} \ 441 for i in ${kmmodule_expanded} ${kmextra_expanded} ${kmcompileonly_expanded} \
456 ${KMEXTRACTONLY} 442 ${KMEXTRACTONLY}
457 do 443 do
458 extractlist+=" ${topdir}${moduleprefix}${i}" 444 extractlist+=" ${topdir}${i}"
459 done 445 done
460 446
461 echo ${extractlist} 447 echo ${extractlist}
462} 448}
463 449
568 if [[ ${PN} != kdebase-startkde && -f CMakeLists.txt ]]; then 554 if [[ ${PN} != kdebase-startkde && -f CMakeLists.txt ]]; then
569 # 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 sed -e '/startkde/s/^/#DONOTINSTALL /' \ 556 sed -e '/startkde/s/^/#DONOTINSTALL /' \
571 -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"
572 fi 558 fi
559 # Remove workspace target prefix in order to get direct linking to workspace libs
560 sed -e '/set(KDE4WORKSPACE_TARGET_PREFIX/s/^/#OVERRIDE /' \
561 -i CMakeLists.txt || die "${LINENO}: sed died in KDE4WORKSPACE_TARGET_PREFIX removal section"
573 # Strip EXPORT feature section from workspace for KDE4 versions > 4.1.82 562 # Strip EXPORT feature section from workspace for KDE4 versions > 4.1.82
574 if [[ ${PN} != libkworkspace ]]; then 563 if [[ ${PN} != libkworkspace ]]; then
575 sed -e '/install(FILES ${CMAKE_CURRENT_BINARY_DIR}\/KDE4WorkspaceConfig.cmake/,/^[[:space:]]*FILE KDE4WorkspaceLibraryTargets.cmake )[[:space:]]*^/d' \ 564 sed -e '/install(FILES ${CMAKE_CURRENT_BINARY_DIR}\/KDE4WorkspaceConfig.cmake/,/^[[:space:]]*FILE KDE4WorkspaceLibraryTargets.cmake )[[:space:]]*^/d' \
576 -i CMakeLists.txt || die "${LINENO}: sed died in kdebase-workspace strip config install and fix EXPORT section" 565 -i CMakeLists.txt || die "${LINENO}: sed died in kde-workspace strip config install and fix EXPORT section"
566 fi
567 if [[ ${PN} != plasma-workspace ]]; then
568 sed -e '/KActivities/s/REQUIRED//' \
569 -i CMakeLists.txt || die "${LINENO}: sed died in kde-workspace dep reduction section"
570 fi
571 if [[ "${PN}" != "kwin" ]]; then
572 sed -i -e "/^ macro_log_feature(OPENGL_OR_ES_FOUND/s/TRUE/FALSE/" \
573 "${S}"/CMakeLists.txt || die "${LINENO}: sed died removing kde-workspace opengl dependency"
577 fi 574 fi
578 ;; 575 ;;
579 kdebase-runtime | kde-runtime) 576 kdebase-runtime | kde-runtime)
580 # COLLISION PROTECT section 577 # COLLISION PROTECT section
581 # Only install the kde4 script as part of kde-base/kdebase-data 578 # Only install the kde4 script as part of kde-base/kdebase-data
592 kdepim) 589 kdepim)
593 # Disable hardcoded checks 590 # Disable hardcoded checks
594 sed -r -e '/find_package\(KdepimLibs/s/REQUIRED//' \ 591 sed -r -e '/find_package\(KdepimLibs/s/REQUIRED//' \
595 -e '/find_package\((KdepimLibs|Boost|QGpgme|Akonadi|ZLIB|Strigi|SharedDesktopOntologies|Soprano|Nepomuk)/{/macro_optional_/!s/find/macro_optional_&/}' \ 592 -e '/find_package\((KdepimLibs|Boost|QGpgme|Akonadi|ZLIB|Strigi|SharedDesktopOntologies|Soprano|Nepomuk)/{/macro_optional_/!s/find/macro_optional_&/}' \
596 -e '/macro_log_feature\((Boost|QGPGME|Akonadi|ZLIB|STRIGI|SHAREDDESKTOPONTOLOGIES|Soprano|Nepomuk)_FOUND/s/ TRUE / FALSE /' \ 593 -e '/macro_log_feature\((Boost|QGPGME|Akonadi|ZLIB|STRIGI|SHAREDDESKTOPONTOLOGIES|Soprano|Nepomuk)_FOUND/s/ TRUE / FALSE /' \
597 -e '/if[[:space:]]*([[:space:]]*BUILD_.*)/s/^/#OVERRIDE /' \ 594 -e 's/if[[:space:]]*([[:space:]]*BUILD_.*)[[:space:]]*/if(1) # &/' \
598 -e '/if[[:space:]]*([[:space:]]*[[:alnum:]]*_FOUND[[:space:]]*)/s/^/#OVERRIDE /' \ 595 -e 's/if[[:space:]]*([[:space:]]*[[:alnum:]]*_FOUND[[:space:]]*)[[:space:]]*$/if(1) # &/' \
599 -i CMakeLists.txt || die "failed to disable hardcoded checks" 596 -i CMakeLists.txt || die "failed to disable hardcoded checks"
600 # Disable broken or redundant build logic 597 # Disable broken or redundant build logic
601 if ( has kontact ${IUSE//+} && use kontact ) || [[ ${PN} = kontact ]]; then 598 if use_if_iuse kontact || [[ ${PN} = kontact ]]; then
602 sed -e '/if[[:space:]]*([[:space:]]*BUILD_.*)/s/^/#OVERRIDE /' \ 599 sed -e 's/if[[:space:]]*([[:space:]]*BUILD_.*)[[:space:]]*$/if(1) # &/' \
603 -e '/if[[:space:]]*([[:space:]]*[[:alnum:]]*_FOUND[[:space:]]*)/s/^/#OVERRIDE /' \ 600 -e 's/if[[:space:]]*([[:space:]]*[[:alnum:]]*_FOUND[[:space:]]*)[[:space:]]*$/if(1) # &/' \
604 -i kontact/plugins/CMakeLists.txt || die 'failed to override build logic' 601 -i kontact/plugins/CMakeLists.txt || die 'failed to override build logic'
605 fi 602 fi
606 if ! slot_is_at_least 4.5 ${SLOT}; then 603 if [[ $(get_kde_version) < 4.5 ]]; then
607 case ${PN} in 604 case ${PN} in
608 kalarm|kmailcvt|kontact|korganizer|korn) 605 kalarm|kmailcvt|kontact|korganizer|korn)
609 sed -n -e '/qt4_generate_dbus_interface(.*org\.kde\.kmail\.\(kmail\|mailcomposer\)\.xml/p' \ 606 sed -n -e '/qt4_generate_dbus_interface(.*org\.kde\.kmail\.\(kmail\|mailcomposer\)\.xml/p' \
610 -e '/add_custom_target(kmail_xml /,/)/p' \ 607 -e '/add_custom_target(kmail_xml /,/)/p' \
611 -i kmail/CMakeLists.txt || die "uncommenting xml failed" 608 -i kmail/CMakeLists.txt || die "uncommenting xml failed"

Legend:
Removed from v.1.53  
changed lines
  Added in v.1.64

  ViewVC Help
Powered by ViewVC 1.1.20