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

Contents of /eclass/kde4-functions.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download)
Fri Apr 4 22:15:24 2008 UTC (6 years, 8 months ago) by zlin
Branch: MAIN
Changes since 1.4: +30 -1 lines
Add support for making PATCHES an array for proper quoting. Add KDE_LINGUAS support to kde4-functions.eclass and use it in kde4-base.eclass in the unpack phase.

1 # Copyright 1999-2008 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/eclass/kde4-functions.eclass,v 1.4 2008/03/13 17:57:51 ingmar Exp $
4
5 # @ECLASS: kde4-functions.eclass
6 # @MAINTAINER:
7 # kde@gentoo.org
8 # @BLURB: Common ebuild functions for monolithic and split KDE 4 packages
9 # @DESCRIPTION:
10 # This eclass contains all functions shared by the different eclasses,
11 # for KDE 4 monolithic and split ebuilds.
12 #
13 # NOTE: This eclass uses the SLOT dependencies from EAPI="1" or compatible,
14 # hence you must define EAPI="1" in the ebuild, before inheriting any eclasses.
15
16 # @ECLASS-VARIABLE: KDEBASE
17 # @DESCRIPTION:
18 # This gets set to a non-zero value when a package is considered a kde or
19 # koffice ebuild.
20
21 if [[ "${CATEGORY}" == "kde-base" ]]; then
22 debug-print "${ECLASS}: KDEBASE ebuild recognized"
23 KDEBASE="kde-base"
24 fi
25
26 # is this a koffice ebuild?
27 if [[ "${KMNAME}" == "koffice" || "${PN}" == "koffice" ]]; then
28 debug-print "${ECLASS}: KOFFICE ebuild recognized"
29 KDEBASE="koffice"
30 fi
31
32 # @ECLASS-VARIABLE: KDE_DERIVATION_MAP
33 # @DESCRIPTION:
34 # Map of the monolithic->split ebuild derivation.
35 # Used to build dependencies describing the relationships between them:
36 # Monolithic ebuilds block their split counterparts in the same slot, and vice versa.
37 #
38 # Also see get-parent-package(), get-child-packages(), is-parent-package()
39 KDE_DERIVATION_MAP='
40 kde-base/kdeaccessibility kde-base/kdeaccessibility-colorschemes
41 kde-base/kdeaccessibility kde-base/kdeaccessibility-iconthemes
42 kde-base/kdeaccessibility kde-base/kmag
43 kde-base/kdeaccessibility kde-base/kmousetool
44 kde-base/kdeaccessibility kde-base/kmouth
45 kde-base/kdeaccessibility kde-base/kttsd
46 kde-base/kdeadmin kde-base/kcron
47 kde-base/kdeadmin kde-base/kdat
48 kde-base/kdeadmin kde-base/knetworkconf
49 kde-base/kdeadmin kde-base/ksysv
50 kde-base/kdeadmin kde-base/kuser
51 kde-base/kdeadmin kde-base/lilo-config
52 kde-base/kdeadmin kde-base/secpolicy
53 kde-base/kdeartwork kde-base/kdeartwork-colorschemes
54 kde-base/kdeartwork kde-base/kdeartwork-emoticons
55 kde-base/kdeartwork kde-base/kdeartwork-icewm-themes
56 kde-base/kdeartwork kde-base/kdeartwork-iconthemes
57 kde-base/kdeartwork kde-base/kdeartwork-kscreensaver
58 kde-base/kdeartwork kde-base/kdeartwork-kworldclock
59 kde-base/kdeartwork kde-base/kdeartwork-sounds
60 kde-base/kdeartwork kde-base/kdeartwork-styles
61 kde-base/kdeartwork kde-base/kdeartwork-wallpapers
62 kde-base/kdebase kde-base/dolphin
63 kde-base/kdebase kde-base/kappfinder
64 kde-base/kdebase kde-base/kdepasswd
65 kde-base/kdebase kde-base/kdialog
66 kde-base/kdebase kde-base/keditbookmarks
67 kde-base/kdebase kde-base/kfind
68 kde-base/kdebase kde-base/kinfocenter
69 kde-base/kdebase kde-base/konqueror
70 kde-base/kdebase kde-base/konsole
71 kde-base/kdebase kde-base/kwrite
72 kde-base/kdebase kde-base/libkonq
73 kde-base/kdebase kde-base/nsplugins
74 kde-base/kdebase kde-base/drkonqi
75 kde-base/kdebase kde-base/kcmshell
76 kde-base/kdebase kde-base/kcontrol
77 kde-base/kdebase kde-base/kdebase-data
78 kde-base/kdebase kde-base/kdebase-kioslaves
79 kde-base/kdebase kde-base/kdebugdialog
80 kde-base/kdebase kde-base/kde-menu
81 kde-base/kdebase kde-base/kdesu
82 kde-base/kdebase kde-base/kfile
83 kde-base/kdebase kde-base/khelpcenter
84 kde-base/kdebase kde-base/kioclient
85 kde-base/kdebase kde-base/kmimetypefinder
86 kde-base/kdebase kde-base/knetattach
87 kde-base/kdebase kde-base/knewstuff
88 kde-base/kdebase kde-base/knotify
89 kde-base/kdebase kde-base/kpasswdserver
90 kde-base/kdebase kde-base/kquitapp
91 kde-base/kdebase kde-base/kreadconfig
92 kde-base/kdebase kde-base/kstart
93 kde-base/kdebase kde-base/kstyles
94 kde-base/kdebase kde-base/ktimezoned
95 kde-base/kdebase kde-base/ktraderclient
96 kde-base/kdebase kde-base/kuiserver
97 kde-base/kdebase kde-base/kurifilter-plugins
98 kde-base/kdebase kde-base/nepomuk
99 kde-base/kdebase kde-base/phonon
100 kde-base/kdebase kde-base/soliduiserver
101 kde-base/kdebase kde-base/kcheckpass
102 kde-base/kdebase kde-base/kcminit
103 kde-base/kdebase kde-base/kdebase-startkde
104 kde-base/kdebase kde-base/kstartupconfig
105 kde-base/kdebase kde-base/kde-menu-icons
106 kde-base/kdebase kde-base/kde-wallpapers
107 kde-base/kdebase kde-base/kdm
108 kde-base/kdebase kde-base/khotkeys
109 kde-base/kdebase kde-base/klipper
110 kde-base/kdebase kde-base/kmenuedit
111 kde-base/kdebase kde-base/krunner
112 kde-base/kdebase kde-base/kscreensaver
113 kde-base/kdebase kde-base/ksmserver
114 kde-base/kdebase kde-base/ksplash
115 kde-base/kdebase kde-base/ksysguard
116 kde-base/kdebase kde-base/ksystraycmd
117 kde-base/kdebase kde-base/ktip
118 kde-base/kdebase kde-base/kwin
119 kde-base/kdebase kde-base/libkworkspace
120 kde-base/kdebase kde-base/libplasma
121 kde-base/kdebase kde-base/libtaskmanager
122 kde-base/kdebase kde-base/plasma
123 kde-base/kdebase kde-base/solid
124 kde-base/kdebase kde-base/systemsettings
125 kde-base/kdebindings kde-base/kalyptus
126 kde-base/kdebindings kde-base/kdejava
127 kde-base/kdebindings kde-base/kimono
128 kde-base/kdebindings kde-base/kjsembed
129 kde-base/kdebindings kde-base/korundum
130 kde-base/kdebindings kde-base/krosspython
131 kde-base/kdebindings kde-base/krossruby
132 kde-base/kdebindings kde-base/pykde4
133 kde-base/kdebindings kde-base/qyoto
134 kde-base/kdebindings kde-base/qtjava
135 kde-base/kdebindings kde-base/qtruby
136 kde-base/kdebindings kde-base/qtsharp
137 kde-base/kdebindings kde-base/smoke
138 kde-base/kdebindings kde-base/xparts
139 kde-base/kdeedu kde-base/blinken
140 kde-base/kdeedu kde-base/kalgebra
141 kde-base/kdeedu kde-base/kalzium
142 kde-base/kdeedu kde-base/kanagram
143 kde-base/kdeedu kde-base/kbruch
144 kde-base/kdeedu kde-base/kgeography
145 kde-base/kdeedu kde-base/khangman
146 kde-base/kdeedu kde-base/kig
147 kde-base/kdeedu kde-base/kiten
148 kde-base/kdeedu kde-base/klettres
149 kde-base/kdeedu kde-base/kmplot
150 kde-base/kdeedu kde-base/kpercentage
151 kde-base/kdeedu kde-base/kstars
152 kde-base/kdeedu kde-base/ktouch
153 kde-base/kdeedu kde-base/kturtle
154 kde-base/kdeedu kde-base/kwordquiz
155 kde-base/kdeedu kde-base/libkdeedu
156 kde-base/kdeedu kde-base/marble
157 kde-base/kdeedu kde-base/parley
158 kde-base/kdegames kde-base/bovo
159 kde-base/kdegames kde-base/katomic
160 kde-base/kdegames kde-base/kbattleship
161 kde-base/kdegames kde-base/kblackbox
162 kde-base/kdegames kde-base/kbounce
163 kde-base/kdegames kde-base/kfourinline
164 kde-base/kdegames kde-base/kgoldrunner
165 kde-base/kdegames kde-base/kiriki
166 kde-base/kdegames kde-base/kjumpingcube
167 kde-base/kdegames kde-base/klines
168 kde-base/kdegames kde-base/kmahjongg
169 kde-base/kdegames kde-base/kmines
170 kde-base/kdegames kde-base/knetwalk
171 kde-base/kdegames kde-base/kolf
172 kde-base/kdegames kde-base/konquest
173 kde-base/kdegames kde-base/kpat
174 kde-base/kdegames kde-base/kreversi
175 kde-base/kdegames kde-base/ksame
176 kde-base/kdegames kde-base/kshisen
177 kde-base/kdegames kde-base/kspaceduel
178 kde-base/kdegames kde-base/ksquares
179 kde-base/kdegames kde-base/ksudoku
180 kde-base/kdegames kde-base/ktuberling
181 kde-base/kdegames kde-base/libkdegames
182 kde-base/kdegames kde-base/libkmahjongg
183 kde-base/kdegames kde-base/lskat
184 kde-base/kdegraphics kde-base/gwenview
185 kde-base/kdegraphics kde-base/kamera
186 kde-base/kdegraphics kde-base/kcolorchooser
187 kde-base/kdegraphics kde-base/kgamma
188 kde-base/kdegraphics kde-base/kghostview
189 kde-base/kdegraphics kde-base/kolourpaint
190 kde-base/kdegraphics kde-base/kruler
191 kde-base/kdegraphics kde-base/ksnapshot
192 kde-base/kdegraphics kde-base/libkscan
193 kde-base/kdegraphics kde-base/okular
194 kde-base/kdegraphics kde-base/svgpart
195 kde-base/kdemultimedia kde-base/juk
196 kde-base/kdemultimedia kde-base/kdemultimedia-kioslaves
197 kde-base/kdemultimedia kde-base/kmix
198 kde-base/kdemultimedia kde-base/kscd
199 kde-base/kdemultimedia kde-base/libkcddb
200 kde-base/kdemultimedia kde-base/libkcompactdisc
201 kde-base/kdenetwork kde-base/kdenetwork-filesharing
202 kde-base/kdenetwork kde-base/kdnssd
203 kde-base/kdenetwork kde-base/kget
204 kde-base/kdenetwork kde-base/knewsticker
205 kde-base/kdenetwork kde-base/kopete
206 kde-base/kdenetwork kde-base/kppp
207 kde-base/kdenetwork kde-base/krdc
208 kde-base/kdenetwork kde-base/krfb
209 kde-base/kdepim kde-base/akonadi
210 kde-base/kdepim kde-base/akregator
211 kde-base/kdepim kde-base/certmanager
212 kde-base/kdepim kde-base/kabc2mutt
213 kde-base/kdepim kde-base/kabcclient
214 kde-base/kdepim kde-base/kaddressbook
215 kde-base/kdepim kde-base/kalarm
216 kde-base/kdepim kde-base/kdemaildir
217 kde-base/kdepim kde-base/kdepim-kioslaves
218 kde-base/kdepim kde-base/kdepim-kresources
219 kde-base/kdepim kde-base/kdepim-wizards
220 kde-base/kdepim kde-base/kfeed
221 kde-base/kdepim kde-base/kitchensync
222 kde-base/kdepim kde-base/kleopatra
223 kde-base/kdepim kde-base/kmail
224 kde-base/kdepim kde-base/kmailcvt
225 kde-base/kdepim kde-base/kmobiletools
226 kde-base/kdepim kde-base/knode
227 kde-base/kdepim kde-base/knotes
228 kde-base/kdepim kde-base/kode
229 kde-base/kdepim kde-base/konsolekalendar
230 kde-base/kdepim kde-base/kontact
231 kde-base/kdepim kde-base/kontact-specialdates
232 kde-base/kdepim kde-base/korganizer
233 kde-base/kdepim kde-base/korn
234 kde-base/kdepim kde-base/kpilot
235 kde-base/kdepim kde-base/ktimetracker
236 kde-base/kdepim kde-base/ktnef
237 kde-base/kdepim kde-base/libkdepim
238 kde-base/kdepim kde-base/libkholidays
239 kde-base/kdepim kde-base/libkleo
240 kde-base/kdepim kde-base/libkpgp
241 kde-base/kdepim kde-base/libksieve
242 kde-base/kdepim kde-base/mailtransport
243 kde-base/kdepim kde-base/mimelib
244 kde-base/kdepim kde-base/networkstatus
245 kde-base/kdesdk kde-base/cervisia
246 kde-base/kdesdk kde-base/kdeaccounts-plugin
247 kde-base/kdesdk kde-base/kapptemplate
248 kde-base/kdesdk kde-base/kate
249 kde-base/kdesdk kde-base/kbabel
250 kde-base/kdesdk kde-base/kbugbuster
251 kde-base/kdesdk kde-base/kcachegrind
252 kde-base/kdesdk kde-base/kdesdk-kioslaves
253 kde-base/kdesdk kde-base/kdesdk-misc
254 kde-base/kdesdk kde-base/kdesdk-scripts
255 kde-base/kdesdk kde-base/kmtrace
256 kde-base/kdesdk kde-base/kompare
257 kde-base/kdesdk kde-base/kspy
258 kde-base/kdesdk kde-base/kstartperf
259 kde-base/kdesdk kde-base/strigi-analyzer
260 kde-base/kdesdk kde-base/kuiviewer
261 kde-base/kdesdk kde-base/poxml
262 kde-base/kdesdk kde-base/umbrello
263 kde-base/kdetoys kde-base/amor
264 kde-base/kdetoys kde-base/kteatime
265 kde-base/kdetoys kde-base/ktux
266 kde-base/kdetoys kde-base/kweather
267 kde-base/kdetoys kde-base/kworldclock
268 kde-base/kdeutils kde-base/ark
269 kde-base/kdeutils kde-base/kcalc
270 kde-base/kdeutils kde-base/kcharselect
271 kde-base/kdeutils kde-base/kdessh
272 kde-base/kdeutils kde-base/kdf
273 kde-base/kdeutils kde-base/kedit
274 kde-base/kdeutils kde-base/kfloppy
275 kde-base/kdeutils kde-base/kgpg
276 kde-base/kdeutils kde-base/khexedit
277 kde-base/kdeutils kde-base/kjots
278 kde-base/kdeutils kde-base/kmilo
279 kde-base/kdeutils kde-base/kregexpeditor
280 kde-base/kdeutils kde-base/kdessh
281 kde-base/kdeutils kde-base/ktimer
282 kde-base/kdeutils kde-base/kwallet
283 kde-base/kdeutils kde-base/superkaramba
284 kde-base/kdeutils kde-base/sweeper
285 kde-base/kdewebdev kde-base/kfilereplace
286 kde-base/kdewebdev kde-base/kimagemapeditor
287 kde-base/kdewebdev kde-base/klinkstatus
288 kde-base/kdewebdev kde-base/kxsldbg
289 kde-base/kdewebdev kde-base/quanta
290 app-office/koffice app-office/karbon
291 app-office/koffice app-office/kchart
292 app-office/koffice app-office/kexi
293 app-office/koffice app-office/kformula
294 app-office/koffice app-office/kivio
295 app-office/koffice app-office/koffice-data
296 app-office/koffice app-office/koffice-libs
297 app-office/koffice app-office/koshell
298 app-office/koffice app-office/kplato
299 app-office/koffice app-office/kpresenter
300 app-office/koffice app-office/krita
301 app-office/koffice app-office/kspread
302 app-office/koffice app-office/kugar
303 app-office/koffice app-office/kword
304 '
305
306 # @FUNCTION: get-parent-package
307 # @USAGE: <split ebuild>
308 # @DESCRIPTION:
309 # Echoes the name of the monolithic package that a given split ebuild was derived from.
310 get-parent-package() {
311 local parent child
312 while read parent child; do
313 if [[ "${child}" == "$1" ]]; then
314 echo ${parent}
315 return 0
316 fi
317 done <<< "$KDE_DERIVATION_MAP"
318 die "Package $target not found in KDE_DERIVATION_MAP, please report bug"
319 }
320
321 # @FUNCTION: get-child-packages
322 # @USAGE: <monolithic ebuild>
323 # @DESCRIPTION:
324 # Echoes the names of all (split) ebuilds derived from a given monolithic ebuild.
325 get-child-packages() {
326 local parent child
327 while read parent child; do
328 [[ "${parent}" == "$1" ]] && echo -n "${child} "
329 done <<< "$KDE_DERIVATION_MAP"
330 }
331
332 # @FUNCTION: is-parent-package
333 # @USAGE: <$CATEGORY/$PN>
334 # @DESCRIPTION:
335 # Returns zero exit-status if the given package is a parent (monolithic) ebuild.
336 # Returns non-zero exit-status if it's not.
337 is-parent-package() {
338 local parent child
339 while read parent child; do
340 [[ "${parent}" == "$1" ]] && return 0
341 done <<< "$KDE_DERIVATION_MAP"
342 return 1
343 }
344
345 # @FUNCTION: buildsycoca
346 # @DESCRIPTION:
347 # Function to rebuild the KDE System Configuration Cache.
348 # All KDE ebuilds should run this in pkg_postinst and pkg_postrm.
349 #
350 # Note that kde4-base.eclass already does this.
351 buildsycoca() {
352 debug-print-function ${FUNCNAME} "$@"
353
354 if [[ -x ${KDEDIR}/bin/kbuildsycoca4 ]] && [[ -z "${ROOT}" || "${ROOT}" == "/" ]]; then
355 # First of all, make sure that the /usr/share/services directory exists
356 # and it has the right permissions
357 mkdir -p /usr/share/services
358 chown root:0 /usr/share/services
359 chmod 0755 /usr/share/services
360
361 # kbuildsycoca4 needs a running dbus session to work correctly.
362 # We have to start a new dbus session, because the DBUS_SESSION_BUS_ADDRESS in the environment
363 # could from from the user's environment (through su [without '-']), causing kbuildsycoca4 to hang.
364
365 echo "Starting dbus session for kbuildsycoca4"
366 local _i
367 for _i in $(dbus-launch); do
368 # We export both the ADDRESS _and_ the PID. We need the latter only to kill our session.
369 debug-print "Exporting: ${_i}"
370 export "${_i}";
371 done
372 debug-print "kbuildsycoca4 is using ${DBUS_SESSION_BUS_ADDRESS}"
373
374 ebegin "Running kbuildsycoca4 to build global database"
375 # This is needed because we support multiple kde versions installed together.
376 XDG_DATA_DIRS="/usr/share:${KDEDIRS}/share:/usr/local/share"
377 ${KDEDIR}/bin/kbuildsycoca4 --global --noincremental &> /dev/null
378 eend $?
379
380 echo "Killing dbus session for kbuildsycoca4"
381 debug-print "ADDRES ${DBUS_SESSION_BUS_ADDRESS}"
382 debug-print "PID: ${DBUS_SESSION_BUS_PID}"
383 kill ${DBUS_SESSION_BUS_PID}
384 eend $?
385 unset DBUS_SESSION_BUS_ADDRES DBUS_SESSION_BUS_PID
386
387 # For some reason this directory gets created with noone other than root
388 # being able to read it. Hence we chmod it.
389 chmod -R 0755 "${ROOT}"/usr/share/kde4
390 fi
391 }
392
393 # @FUNCTION: comment_all_add_subdirectory
394 # @USAGE: [list of directory names]
395 # @DESCRIPTION:
396 # recursively comment all add_subdirectory instructions in listed directories
397 # except the ones in cmake/.
398 comment_all_add_subdirectory() {
399 find "$@" -name CMakeLists.txt -print0 | grep -vFzZ "./cmake" | \
400 xargs -0 sed -i -e '/add_subdirectory/s/^/#DONOTCOMPILE /' || \
401 die "${LINENO}: Initial sed died"
402 }
403
404 # @ECLASS-VARIABLE: KDE_LINGUAS
405 # @DESCRIPTION:
406 # This is a whitespace-separated list of translations that this ebuild supports.
407 # These translations automatically get added to IUSE. Therefore ebuilds must set
408 # this variable before inheriting any eclasses. To only enable selected
409 # translations ebuilds must call enable_selected_linguas(). kde4-base.eclass does
410 # this for you.
411 #
412 # Example: KDE_LINGUAS="en_GB de nl"
413 for _lingua in ${KDE_LINGUAS}; do
414 IUSE="${IUSE} linguas_${_lingua}"
415 done
416
417 # @FUNCTION: enable_selected_linguas
418 # @DESCRIPTION:
419 # Enable translations based on LINGUAS settings and what translations are
420 # supported (see KDE_LINGUAS). By default translations are found in "${S}"/po
421 # but this default can be overridden by defining KDE_LINGUAS_DIR.
422 enable_selected_linguas() {
423 local lingua
424 comment_all_add_subdirectory "${KDE_LINGUAS_DIR:-${S}/po}"
425 for lingua in ${KDE_LINGUAS}; do
426 if use linguas_${lingua}; then
427 sed -e "/add_subdirectory(\s*${lingua}\s*)\s*$/ s/^#DONOTCOMPILE //" \
428 -i "${KDE_LINGUAS_DIR:-${S}/po}"/CMakeLists.txt || die "Sed to uncomment linguas_${lingua} failed."
429 fi
430 done
431 }
432
433 # @ECLASS-VARIABLE: QT4_BUILT_WITH_USE_CHECK
434 # @DESCRIPTION:
435 # A list of USE flags that x11-libs/qt:4 needs to be built with.
436 #
437 # This list is automatically appended to KDE4_BUILT_WITH_USE_CHECK,
438 # so don't call qt4_pkg_setup manually.
439
440 # @ECLASS-VARIABLE: KDE4_BUILT_WITH_USE_CHECK
441 # @DESCRIPTION:
442 # The contents of $KDE4_BUILT_WITH_USE_CHECK gets fed to built_with_use
443 # (eutils.eclass), line per line.
444 #
445 # Example:
446 # @CODE
447 # pkg_setup() {
448 # KDE4_BUILT_WITH_USE_CHECK="--missing true sys-apps/dbus X"
449 # use alsa && KDE4_BUILT_WITH_USE_CHECK="${KDE4_BUILT_WITH_USE_CHECK}
450 # --missing true media-libs/alsa-lib midi"
451 # kde4-base_pkg_setup
452 # }
453 # @CODE
454
455 # run built_with_use on each flag and print appropriate error messages if any
456 # flags are missing
457 _kde4-functions_built_with_use() {
458 local missing opt pkg flag flags
459
460 if [[ ${1} = "--missing" ]]; then
461 missing="${1} ${2}" && shift 2
462 fi
463 if [[ ${1:0:1} = "-" ]]; then
464 opt=${1} && shift
465 fi
466
467 pkg=${1} && shift
468
469 for flag in "${@}"; do
470 flags="${flags} ${flag}"
471 if ! built_with_use ${missing} ${opt} ${pkg} ${flag}; then
472 flags="${flags}*"
473 else
474 [[ ${opt} = "-o" ]] && return 0
475 fi
476 done
477 if [[ "${flags# }" = "${@}" ]]; then
478 return 0
479 fi
480 if [[ ${opt} = "-o" ]]; then
481 eerror "This package requires '${pkg}' to be built with any of the following USE flags: '$*'."
482 else
483 eerror "This package requires '${pkg}' to be built with the following USE flags: '${flags# }'."
484 fi
485 return 1
486 }
487
488 # @FUNCTION: kde4-functions_check_use
489 # @DESCRIPTION:
490 # Check if the Qt4 libraries are built with the USE flags listed in
491 # $QT4_BUILT_WITH_USE_CHECK.
492 #
493 # Check if a list of packages are built with certain USE flags, as listed in
494 # $KDE4_BUILT_WITH_USE_CHECK.
495 #
496 # If any of the required USE flags are missing, an eerror will be printed for
497 # each package with missing USE flags.
498 kde4-functions_check_use() {
499 # I like to keep flags sorted
500 QT4_BUILT_WITH_USE_CHECK=$(echo "${QT4_BUILT_WITH_USE_CHECK}" | \
501 tr '[:space:]' '\n' | sort | xargs)
502
503 KDE4_BUILT_WITH_USE_CHECK="x11-libs/qt:4 ${QT4_BUILT_WITH_USE_CHECK}
504 ${KDE4_BUILT_WITH_USE_CHECK}"
505
506 local line missing
507 while read line; do
508 [[ -z ${line} ]] && continue
509 if ! _kde4-functions_built_with_use ${line}; then
510 missing=true
511 fi
512 done <<< "${KDE4_BUILT_WITH_USE_CHECK}"
513 if [[ -n ${missing} ]]; then
514 echo
515 eerror "Flags marked with an * are missing."
516 die "Missing USE flags found"
517 fi
518 }

  ViewVC Help
Powered by ViewVC 1.1.20