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

Contents of /eclass/kde4-functions.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (hide annotations) (download)
Thu Oct 2 06:49:02 2008 UTC (6 years, 2 months ago) by jmbsvicetto
Branch: MAIN
Changes since 1.7: +105 -84 lines
Bumped kde4 eclasses.
Add kde-4.1.2 into the tree from the kde-testing overlay.

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

  ViewVC Help
Powered by ViewVC 1.1.20