/[gentoo-x86]/eclass/kde4-functions.eclass
Gentoo

Diff of /eclass/kde4-functions.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.5 Revision 1.6
1# Copyright 1999-2008 Gentoo Foundation 1# Copyright 1999-2008 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-functions.eclass,v 1.5 2008/04/04 22:15:24 zlin Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-functions.eclass,v 1.6 2008/05/15 19:49:32 ingmar Exp $
4 4
5# @ECLASS: kde4-functions.eclass 5# @ECLASS: kde4-functions.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# kde@gentoo.org 7# kde@gentoo.org
8# @BLURB: Common ebuild functions for monolithic and split KDE 4 packages 8# @BLURB: Common ebuild functions for monolithic and split KDE 4 packages
79kde-base/kdebase kde-base/kdebugdialog 79kde-base/kdebase kde-base/kdebugdialog
80kde-base/kdebase kde-base/kde-menu 80kde-base/kdebase kde-base/kde-menu
81kde-base/kdebase kde-base/kdesu 81kde-base/kdebase kde-base/kdesu
82kde-base/kdebase kde-base/kfile 82kde-base/kdebase kde-base/kfile
83kde-base/kdebase kde-base/khelpcenter 83kde-base/kdebase kde-base/khelpcenter
84kde-base/kdebase kde-base/kiconfinder
84kde-base/kdebase kde-base/kioclient 85kde-base/kdebase kde-base/kioclient
85kde-base/kdebase kde-base/kmimetypefinder 86kde-base/kdebase kde-base/kmimetypefinder
86kde-base/kdebase kde-base/knetattach 87kde-base/kdebase kde-base/knetattach
87kde-base/kdebase kde-base/knewstuff 88kde-base/kdebase kde-base/knewstuff
88kde-base/kdebase kde-base/knotify 89kde-base/kdebase kde-base/knotify
95kde-base/kdebase kde-base/ktraderclient 96kde-base/kdebase kde-base/ktraderclient
96kde-base/kdebase kde-base/kuiserver 97kde-base/kdebase kde-base/kuiserver
97kde-base/kdebase kde-base/kurifilter-plugins 98kde-base/kdebase kde-base/kurifilter-plugins
98kde-base/kdebase kde-base/nepomuk 99kde-base/kdebase kde-base/nepomuk
99kde-base/kdebase kde-base/phonon 100kde-base/kdebase kde-base/phonon
101kde-base/kdebase kde-base/solid-hardware
100kde-base/kdebase kde-base/soliduiserver 102kde-base/kdebase kde-base/soliduiserver
101kde-base/kdebase kde-base/kcheckpass 103kde-base/kdebase kde-base/kcheckpass
102kde-base/kdebase kde-base/kcminit 104kde-base/kdebase kde-base/kcminit
103kde-base/kdebase kde-base/kdebase-startkde 105kde-base/kdebase kde-base/kdebase-startkde
104kde-base/kdebase kde-base/kstartupconfig 106kde-base/kdebase kde-base/kstartupconfig
153kde-base/kdeedu kde-base/kturtle 155kde-base/kdeedu kde-base/kturtle
154kde-base/kdeedu kde-base/kwordquiz 156kde-base/kdeedu kde-base/kwordquiz
155kde-base/kdeedu kde-base/libkdeedu 157kde-base/kdeedu kde-base/libkdeedu
156kde-base/kdeedu kde-base/marble 158kde-base/kdeedu kde-base/marble
157kde-base/kdeedu kde-base/parley 159kde-base/kdeedu kde-base/parley
160kde-base/kdeedu kde-base/step
158kde-base/kdegames kde-base/bovo 161kde-base/kdegames kde-base/bovo
159kde-base/kdegames kde-base/katomic 162kde-base/kdegames kde-base/katomic
160kde-base/kdegames kde-base/kbattleship 163kde-base/kdegames kde-base/kbattleship
161kde-base/kdegames kde-base/kblackbox 164kde-base/kdegames kde-base/kblackbox
162kde-base/kdegames kde-base/kbounce 165kde-base/kdegames kde-base/kbounce
166kde-base/kdegames kde-base/kdiamond
163kde-base/kdegames kde-base/kfourinline 167kde-base/kdegames kde-base/kfourinline
164kde-base/kdegames kde-base/kgoldrunner 168kde-base/kdegames kde-base/kgoldrunner
165kde-base/kdegames kde-base/kiriki 169kde-base/kdegames kde-base/kiriki
166kde-base/kdegames kde-base/kjumpingcube 170kde-base/kdegames kde-base/kjumpingcube
167kde-base/kdegames kde-base/klines 171kde-base/kdegames kde-base/klines
168kde-base/kdegames kde-base/kmahjongg 172kde-base/kdegames kde-base/kmahjongg
169kde-base/kdegames kde-base/kmines 173kde-base/kdegames kde-base/kmines
170kde-base/kdegames kde-base/knetwalk 174kde-base/kdegames kde-base/knetwalk
171kde-base/kdegames kde-base/kolf 175kde-base/kdegames kde-base/kolf
176kde-base/kdegames kde-base/kollision
172kde-base/kdegames kde-base/konquest 177kde-base/kdegames kde-base/konquest
173kde-base/kdegames kde-base/kpat 178kde-base/kdegames kde-base/kpat
174kde-base/kdegames kde-base/kreversi 179kde-base/kdegames kde-base/kreversi
175kde-base/kdegames kde-base/ksame 180kde-base/kdegames kde-base/ksame
176kde-base/kdegames kde-base/kshisen 181kde-base/kdegames kde-base/kshisen
177kde-base/kdegames kde-base/kspaceduel 182kde-base/kdegames kde-base/kspaceduel
178kde-base/kdegames kde-base/ksquares 183kde-base/kdegames kde-base/ksquares
179kde-base/kdegames kde-base/ksudoku 184kde-base/kdegames kde-base/ksudoku
180kde-base/kdegames kde-base/ktuberling 185kde-base/kdegames kde-base/ktuberling
186kde-base/kdegames kde-base/kubrick
181kde-base/kdegames kde-base/libkdegames 187kde-base/kdegames kde-base/libkdegames
182kde-base/kdegames kde-base/libkmahjongg 188kde-base/kdegames kde-base/libkmahjongg
183kde-base/kdegames kde-base/lskat 189kde-base/kdegames kde-base/lskat
184kde-base/kdegraphics kde-base/gwenview 190kde-base/kdegraphics kde-base/gwenview
185kde-base/kdegraphics kde-base/kamera 191kde-base/kdegraphics kde-base/kamera
190kde-base/kdegraphics kde-base/kruler 196kde-base/kdegraphics kde-base/kruler
191kde-base/kdegraphics kde-base/ksnapshot 197kde-base/kdegraphics kde-base/ksnapshot
192kde-base/kdegraphics kde-base/libkscan 198kde-base/kdegraphics kde-base/libkscan
193kde-base/kdegraphics kde-base/okular 199kde-base/kdegraphics kde-base/okular
194kde-base/kdegraphics kde-base/svgpart 200kde-base/kdegraphics kde-base/svgpart
201kde-base/kdemultimedia kde-base/dragonplayer
195kde-base/kdemultimedia kde-base/juk 202kde-base/kdemultimedia kde-base/juk
196kde-base/kdemultimedia kde-base/kdemultimedia-kioslaves 203kde-base/kdemultimedia kde-base/kdemultimedia-kioslaves
197kde-base/kdemultimedia kde-base/kmix 204kde-base/kdemultimedia kde-base/kmix
198kde-base/kdemultimedia kde-base/kscd 205kde-base/kdemultimedia kde-base/kscd
199kde-base/kdemultimedia kde-base/libkcddb 206kde-base/kdemultimedia kde-base/libkcddb
268kde-base/kdeutils kde-base/ark 275kde-base/kdeutils kde-base/ark
269kde-base/kdeutils kde-base/kcalc 276kde-base/kdeutils kde-base/kcalc
270kde-base/kdeutils kde-base/kcharselect 277kde-base/kdeutils kde-base/kcharselect
271kde-base/kdeutils kde-base/kdessh 278kde-base/kdeutils kde-base/kdessh
272kde-base/kdeutils kde-base/kdf 279kde-base/kdeutils kde-base/kdf
273kde-base/kdeutils kde-base/kedit
274kde-base/kdeutils kde-base/kfloppy 280kde-base/kdeutils kde-base/kfloppy
275kde-base/kdeutils kde-base/kgpg 281kde-base/kdeutils kde-base/kgpg
276kde-base/kdeutils kde-base/khexedit
277kde-base/kdeutils kde-base/kjots 282kde-base/kdeutils kde-base/kjots
278kde-base/kdeutils kde-base/kmilo 283kde-base/kdeutils kde-base/kmilo
279kde-base/kdeutils kde-base/kregexpeditor 284kde-base/kdeutils kde-base/kregexpeditor
280kde-base/kdeutils kde-base/kdessh 285kde-base/kdeutils kde-base/kdessh
281kde-base/kdeutils kde-base/ktimer 286kde-base/kdeutils kde-base/ktimer
349# 354#
350# Note that kde4-base.eclass already does this. 355# Note that kde4-base.eclass already does this.
351buildsycoca() { 356buildsycoca() {
352 debug-print-function ${FUNCNAME} "$@" 357 debug-print-function ${FUNCNAME} "$@"
353 358
354 if [[ -x ${KDEDIR}/bin/kbuildsycoca4 ]] && [[ -z "${ROOT}" || "${ROOT}" == "/" ]]; then 359 if [[ -x ${KDEDIR}/bin/kbuildsycoca4 && -z "${ROOT%%/}" ]]; then
355 # First of all, make sure that the /usr/share/services directory exists 360 # First of all, make sure that the /usr/share/services directory exists
356 # and it has the right permissions 361 # and it has the right permissions
357 mkdir -p /usr/share/services 362 mkdir -p /usr/share/services
358 chown root:0 /usr/share/services 363 chown root:0 /usr/share/services
359 chmod 0755 /usr/share/services 364 chmod 0755 /usr/share/services
371 done 376 done
372 debug-print "kbuildsycoca4 is using ${DBUS_SESSION_BUS_ADDRESS}" 377 debug-print "kbuildsycoca4 is using ${DBUS_SESSION_BUS_ADDRESS}"
373 378
374 ebegin "Running kbuildsycoca4 to build global database" 379 ebegin "Running kbuildsycoca4 to build global database"
375 # This is needed because we support multiple kde versions installed together. 380 # This is needed because we support multiple kde versions installed together.
376 XDG_DATA_DIRS="/usr/share:${KDEDIRS}/share:/usr/local/share" 381 XDG_DATA_DIRS="/usr/share:${KDEDIRS//:/\/share:}/share:/usr/local/share" \
377 ${KDEDIR}/bin/kbuildsycoca4 --global --noincremental &> /dev/null 382 ${KDEDIR}/bin/kbuildsycoca4 --global --noincremental &> /dev/null
378 eend $? 383 eend $?
379 384
380 echo "Killing dbus session for kbuildsycoca4" 385 echo "Killing dbus session for kbuildsycoca4"
381 debug-print "ADDRES ${DBUS_SESSION_BUS_ADDRESS}" 386 debug-print "ADDRESS ${DBUS_SESSION_BUS_ADDRESS}"
382 debug-print "PID: ${DBUS_SESSION_BUS_PID}" 387 debug-print "PID: ${DBUS_SESSION_BUS_PID}"
383 kill ${DBUS_SESSION_BUS_PID} 388 kill ${DBUS_SESSION_BUS_PID}
384 eend $? 389 eend $?
385 unset DBUS_SESSION_BUS_ADDRES DBUS_SESSION_BUS_PID 390 unset DBUS_SESSION_BUS_ADDRESS DBUS_SESSION_BUS_PID
386 391
387 # For some reason this directory gets created with noone other than root 392 # For some reason this directory gets created with noone other than root
388 # being able to read it. Hence we chmod it. 393 # being able to read it. Hence we chmod it.
389 chmod -R 0755 "${ROOT}"/usr/share/kde4 394 chmod -R 0755 "${ROOT}"/usr/share/kde4
390 fi 395 fi
395# @DESCRIPTION: 400# @DESCRIPTION:
396# recursively comment all add_subdirectory instructions in listed directories 401# recursively comment all add_subdirectory instructions in listed directories
397# except the ones in cmake/. 402# except the ones in cmake/.
398comment_all_add_subdirectory() { 403comment_all_add_subdirectory() {
399 find "$@" -name CMakeLists.txt -print0 | grep -vFzZ "./cmake" | \ 404 find "$@" -name CMakeLists.txt -print0 | grep -vFzZ "./cmake" | \
400 xargs -0 sed -i -e '/add_subdirectory/s/^/#DONOTCOMPILE /' || \ 405 xargs -0 sed -i -e '/add_subdirectory/s/^/#DONOTCOMPILE /' -e '/ADD_SUBDIRECTORY/s/^/#DONOTCOMPILE /' || \
401 die "${LINENO}: Initial sed died" 406 die "${LINENO}: Initial sed died"
402} 407}
403 408
404# @ECLASS-VARIABLE: KDE_LINGUAS 409# @ECLASS-VARIABLE: KDE_LINGUAS
405# @DESCRIPTION: 410# @DESCRIPTION:
422enable_selected_linguas() { 427enable_selected_linguas() {
423 local lingua 428 local lingua
424 comment_all_add_subdirectory "${KDE_LINGUAS_DIR:-${S}/po}" 429 comment_all_add_subdirectory "${KDE_LINGUAS_DIR:-${S}/po}"
425 for lingua in ${KDE_LINGUAS}; do 430 for lingua in ${KDE_LINGUAS}; do
426 if use linguas_${lingua}; then 431 if use linguas_${lingua}; then
427 sed -e "/add_subdirectory(\s*${lingua}\s*)\s*$/ s/^#DONOTCOMPILE //" \ 432 sed -e "/add_subdirectory([[:space:]]*${lingua}[[:space:]]*)[[:space:]]*$/ s/^#DONOTCOMPILE //" \
433 -e "/ADD_SUBDIRECTORY([[:space:]]*${lingua}[[:space:]]*)[[:space:]]*$/ s/^#DONOTCOMPILE //" \
428 -i "${KDE_LINGUAS_DIR:-${S}/po}"/CMakeLists.txt || die "Sed to uncomment linguas_${lingua} failed." 434 -i "${KDE_LINGUAS_DIR:-${S}/po}"/CMakeLists.txt || die "Sed to uncomment linguas_${lingua} failed."
429 fi 435 fi
430 done 436 done
431} 437}
432 438
498kde4-functions_check_use() { 504kde4-functions_check_use() {
499 # I like to keep flags sorted 505 # I like to keep flags sorted
500 QT4_BUILT_WITH_USE_CHECK=$(echo "${QT4_BUILT_WITH_USE_CHECK}" | \ 506 QT4_BUILT_WITH_USE_CHECK=$(echo "${QT4_BUILT_WITH_USE_CHECK}" | \
501 tr '[:space:]' '\n' | sort | xargs) 507 tr '[:space:]' '\n' | sort | xargs)
502 508
509 local line missing
510 if [[ -n ${KDE4_BUILT_WITH_USE_CHECK[@]} && $(declare -p KDE4_BUILT_WITH_USE_CHECK) = 'declare -a '* ]]; then
511 KDE4_BUILT_WITH_USE_CHECK=("x11-libs/qt:4 ${QT4_BUILT_WITH_USE_CHECK}"
512 "${KDE4_BUILT_WITH_USE_CHECK[@]}")
513
514 for line in "${KDE4_BUILT_WITH_USE_CHECK[@]}"; do
515 [[ -z ${line} ]] && continue
516 if ! _kde4-functions_built_with_use ${line}; then
517 missing=true
518 fi
519 done
520 else
503 KDE4_BUILT_WITH_USE_CHECK="x11-libs/qt:4 ${QT4_BUILT_WITH_USE_CHECK} 521 KDE4_BUILT_WITH_USE_CHECK="x11-libs/qt:4 ${QT4_BUILT_WITH_USE_CHECK}
504 ${KDE4_BUILT_WITH_USE_CHECK}" 522 ${KDE4_BUILT_WITH_USE_CHECK}"
505 523
506 local line missing
507 while read line; do 524 while read line; do
508 [[ -z ${line} ]] && continue 525 [[ -z ${line} ]] && continue
509 if ! _kde4-functions_built_with_use ${line}; then 526 if ! _kde4-functions_built_with_use ${line}; then
510 missing=true 527 missing=true
511 fi 528 fi
512 done <<< "${KDE4_BUILT_WITH_USE_CHECK}" 529 done <<< "${KDE4_BUILT_WITH_USE_CHECK}"
530 fi
513 if [[ -n ${missing} ]]; then 531 if [[ -n ${missing} ]]; then
514 echo 532 echo
515 eerror "Flags marked with an * are missing." 533 eerror "Flags marked with an * are missing."
516 die "Missing USE flags found" 534 die "Missing USE flags found"
517 fi 535 fi

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

  ViewVC Help
Powered by ViewVC 1.1.20