/[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.1 Revision 1.48
1# Copyright 1999-2008 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-functions.eclass,v 1.1 2008/01/16 22:47:45 ingmar Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-functions.eclass,v 1.48 2011/05/24 20:54:58 abcd Exp $
4
5inherit versionator
4 6
5# @ECLASS: kde4-functions.eclass 7# @ECLASS: kde4-functions.eclass
6# @MAINTAINER: 8# @MAINTAINER:
7# kde@gentoo.org 9# kde@gentoo.org
8# @BLURB: Common ebuild functions for monolithic and split KDE 4 packages 10# @BLURB: Common ebuild functions for KDE 4 packages
9# @DESCRIPTION: 11# @DESCRIPTION:
10# This eclass contains all functions shared by the different eclasses, 12# This eclass contains all functions shared by the different eclasses,
11# for KDE 4 monolithic and split ebuilds. 13# for KDE 4 ebuilds.
12# 14
13# NOTE: This eclass uses the SLOT dependencies from EAPI="1" or compatible, 15# @ECLASS-VARIABLE: EAPI
14# hence you must define EAPI="1" in the ebuild, before inheriting any eclasses. 16# @DESCRIPTION:
17# Currently kde4 eclasses support EAPI 3 and 4.
18case ${EAPI:-0} in
19 4|3) : ;;
20 *) die "EAPI=${EAPI} is not supported" ;;
21esac
22
23# @ECLASS-VARIABLE: KDE_OVERRIDE_MINIMAL
24# @DESCRIPTION:
25# For use only in very few well-defined cases; normally it should be unset.
26# If this variable is set, all calls to add_kdebase_dep return a dependency on
27# at least this version, independent of the version of the package itself.
28# If you know exactly that one specific NEW KDE component builds and runs fine
29# with all the rest of KDE at an OLDER version, you can set this old version here.
30# Warning- may lead to general instability and kill your pet targh.
15 31
16# @ECLASS-VARIABLE: KDEBASE 32# @ECLASS-VARIABLE: KDEBASE
17# @DESCRIPTION: 33# @DESCRIPTION:
18# This gets set to a non-zero value when a package is considered a kde or 34# This gets set to a non-zero value when a package is considered a kde or
19# koffice ebuild. 35# koffice ebuild.
20
21if [[ "${CATEGORY}" == "kde-base" ]]; then 36if [[ ${CATEGORY} = kde-base ]]; then
22 debug-print "${ECLASS}: KDEBASE ebuild recognized" 37 debug-print "${ECLASS}: KDEBASE ebuild recognized"
23 KDEBASE="kde-base" 38 KDEBASE=kde-base
39elif [[ ${KMNAME-${PN}} = koffice ]]; then
40 debug-print "${ECLASS}: KOFFICE ebuild recognized"
41 KDEBASE=koffice
42elif [[ ${KMNAME-${PN}} = kdevelop ]]; then
43 debug-print "${ECLASS}: KDEVELOP ebuild recognized"
44 KDEBASE=kdevelop
24fi 45fi
25 46
26# is this a koffice ebuild? 47# @ECLASS-VARIABLE: KDE_SLOTS
27if [[ "${KMNAME}" == "koffice" || "${PN}" == "koffice" ]]; then 48# @DESCRIPTION:
28 debug-print "${ECLASS}: KOFFICE ebuild recognized" 49# The slots used by all KDE versions later than 4.0. The live KDE releases use
29 KDEBASE="koffice" 50# KDE_LIVE_SLOTS instead. Values should be ordered.
51KDE_SLOTS=( "4.1" "4.2" "4.3" "4.4" "4.5" "4.6" "4.7" )
52
53# @ECLASS-VARIABLE: KDE_LIVE_SLOTS
54# @DESCRIPTION:
55# The slots used by KDE live versions. Values should be ordered.
56KDE_LIVE_SLOTS=( "live" )
57
58# determine the build type
59if [[ ${SLOT} = live || ${PV} = *9999* ]]; then
60 BUILD_TYPE="live"
61else
62 BUILD_TYPE="release"
30fi 63fi
64export BUILD_TYPE
31 65
66# Set reponame and SCM for moduleses that have fully migrated to git
67# (hack - it's here because it needs to be before SCM inherits from kde4-base)
68if [[ ${BUILD_TYPE} == live ]]; then
69 case "${KMNAME}" in
70 kdebase-workspace)
71 KDE_SCM="git"
72 EGIT_REPONAME=${EGIT_REPONAME:=kde-workspace}
73 ;;
74 kdebase-runtime)
75 KDE_SCM="git"
76 EGIT_REPONAME=${EGIT_REPONAME:=kde-runtime}
77 ;;
78 kdebase-apps)
79 KDE_SCM="git"
80 EGIT_REPONAME=${EGIT_REPONAME:=kde-baseapps}
81 ;;
82 esac
83fi
84
32# @ECLASS-VARIABLE: KDE_DERIVATION_MAP 85# @ECLASS-VARIABLE: KDE_SCM
33# @DESCRIPTION: 86# @DESCRIPTION:
34# Map of the monolithic->split ebuild derivation. 87# If this is a live package which scm does it use
35# Used to build dependencies describing the relationships between them: 88# Everything else uses svn by default
36# Monolithic ebuilds block their split counterparts in the same slot, and vice versa. 89KDE_SCM="${KDE_SCM:-svn}"
90case ${KDE_SCM} in
91 svn|git) ;;
92 *) die "KDE_SCM: ${KDE_SCM} is not supported" ;;
93esac
94
95# @ECLASS-VARIABLE: KDE_LINGUAS
96# @DESCRIPTION:
97# This is a whitespace-separated list of translations this ebuild supports.
98# These translations are automatically added to IUSE. Therefore ebuilds must set
99# this variable before inheriting any eclasses. To enable only selected
100# translations, ebuilds must call enable_selected_linguas(). kde4-{base,meta}.eclass does
101# this for you.
37# 102#
38# Also see get-parent-package(), get-child-packages(), is-parent-package() 103# Example: KDE_LINGUAS="en_GB de nl"
39KDE_DERIVATION_MAP=' 104if [[ ${BUILD_TYPE} != live || -n ${KDE_LINGUAS_LIVE_OVERRIDE} ]]; then
40kde-base/kdeaccessibility kde-base/kdeaccessibility-colorschemes 105 for _lingua in ${KDE_LINGUAS}; do
41kde-base/kdeaccessibility kde-base/kdeaccessibility-iconthemes 106 IUSE="${IUSE} linguas_${_lingua}"
42kde-base/kdeaccessibility kde-base/kmag 107 done
43kde-base/kdeaccessibility kde-base/kmousetool 108fi
44kde-base/kdeaccessibility kde-base/kmouth
45kde-base/kdeaccessibility kde-base/kttsd
46kde-base/kdeadmin kde-base/kcron
47kde-base/kdeadmin kde-base/kdat
48kde-base/kdeadmin kde-base/knetworkconf
49kde-base/kdeadmin kde-base/ksysv
50kde-base/kdeadmin kde-base/kuser
51kde-base/kdeadmin kde-base/lilo-config
52kde-base/kdeadmin kde-base/secpolicy
53kde-base/kdeartwork kde-base/kdeartwork-colorschemes
54kde-base/kdeartwork kde-base/kdeartwork-emoticons
55kde-base/kdeartwork kde-base/kdeartwork-icewm-themes
56kde-base/kdeartwork kde-base/kdeartwork-iconthemes
57kde-base/kdeartwork kde-base/kdeartwork-kscreensaver
58kde-base/kdeartwork kde-base/kdeartwork-kworldclock
59kde-base/kdeartwork kde-base/kdeartwork-sounds
60kde-base/kdeartwork kde-base/kdeartwork-styles
61kde-base/kdeartwork kde-base/kdeartwork-wallpapers
62kde-base/kdebase kde-base/dolphin
63kde-base/kdebase kde-base/kappfinder
64kde-base/kdebase kde-base/kdepasswd
65kde-base/kdebase kde-base/kdialog
66kde-base/kdebase kde-base/keditbookmarks
67kde-base/kdebase kde-base/kfind
68kde-base/kdebase kde-base/konqueror
69kde-base/kdebase kde-base/konsole
70kde-base/kdebase kde-base/kwrite
71kde-base/kdebase kde-base/libkonq
72kde-base/kdebase kde-base/nsplugins
73kde-base/kdebase kde-base/drkonqi
74kde-base/kdebase kde-base/kcmshell
75kde-base/kdebase kde-base/kcontrol
76kde-base/kdebase kde-base/kdebase-data
77kde-base/kdebase kde-base/kdebase-kioslaves
78kde-base/kdebase kde-base/kdebugdialog
79kde-base/kdebase kde-base/kde-menu
80kde-base/kdebase kde-base/kdesu
81kde-base/kdebase kde-base/kfile
82kde-base/kdebase kde-base/khelpcenter
83kde-base/kdebase kde-base/kioclient
84kde-base/kdebase kde-base/kmimetypefinder
85kde-base/kdebase kde-base/knetattach
86kde-base/kdebase kde-base/knewstuff
87kde-base/kdebase kde-base/knotify
88kde-base/kdebase kde-base/kpasswdserver
89kde-base/kdebase kde-base/kquitapp
90kde-base/kdebase kde-base/kreadconfig
91kde-base/kdebase kde-base/kstart
92kde-base/kdebase kde-base/kstyles
93kde-base/kdebase kde-base/ktimezoned
94kde-base/kdebase kde-base/ktraderclient
95kde-base/kdebase kde-base/kuiserver
96kde-base/kdebase kde-base/kurifilter-plugins
97kde-base/kdebase kde-base/nepomuk
98kde-base/kdebase kde-base/phonon
99kde-base/kdebase kde-base/soliduiserver
100kde-base/kdebase kde-base/kcheckpass
101kde-base/kdebase kde-base/kcminit
102kde-base/kdebase kde-base/kdebase-startkde
103kde-base/kdebase kde-base/kstartupconfig
104kde-base/kdebase kde-base/kde-menu-icons
105kde-base/kdebase kde-base/kde-wallpapers
106kde-base/kdebase kde-base/kdm
107kde-base/kdebase kde-base/khotkeys
108kde-base/kdebase kde-base/klipper
109kde-base/kdebase kde-base/kmenuedit
110kde-base/kdebase kde-base/krunner
111kde-base/kdebase kde-base/kscreensaver
112kde-base/kdebase kde-base/ksmserver
113kde-base/kdebase kde-base/ksplash
114kde-base/kdebase kde-base/ksysguard
115kde-base/kdebase kde-base/ksystraycmd
116kde-base/kdebase kde-base/ktip
117kde-base/kdebase kde-base/kwin
118kde-base/kdebase kde-base/libkworkspace
119kde-base/kdebase kde-base/libplasma
120kde-base/kdebase kde-base/libtaskmanager
121kde-base/kdebase kde-base/plasma
122kde-base/kdebase kde-base/solid
123kde-base/kdebase kde-base/systemsettings
124kde-base/kdebindings kde-base/kalyptus
125kde-base/kdebindings kde-base/kdejava
126kde-base/kdebindings kde-base/kimono
127kde-base/kdebindings kde-base/kjsembed
128kde-base/kdebindings kde-base/korundum
129kde-base/kdebindings kde-base/krosspython
130kde-base/kdebindings kde-base/krossruby
131kde-base/kdebindings kde-base/pykde4
132kde-base/kdebindings kde-base/qyoto
133kde-base/kdebindings kde-base/qtjava
134kde-base/kdebindings kde-base/qtruby
135kde-base/kdebindings kde-base/qtsharp
136kde-base/kdebindings kde-base/smoke
137kde-base/kdebindings kde-base/xparts
138kde-base/kdeedu kde-base/blinken
139kde-base/kdeedu kde-base/kalgebra
140kde-base/kdeedu kde-base/kalzium
141kde-base/kdeedu kde-base/kanagram
142kde-base/kdeedu kde-base/kbruch
143kde-base/kdeedu kde-base/kgeography
144kde-base/kdeedu kde-base/khangman
145kde-base/kdeedu kde-base/kig
146kde-base/kdeedu kde-base/kiten
147kde-base/kdeedu kde-base/klettres
148kde-base/kdeedu kde-base/kmplot
149kde-base/kdeedu kde-base/kpercentage
150kde-base/kdeedu kde-base/kstars
151kde-base/kdeedu kde-base/ktouch
152kde-base/kdeedu kde-base/kturtle
153kde-base/kdeedu kde-base/kwordquiz
154kde-base/kdeedu kde-base/libkdeedu
155kde-base/kdeedu kde-base/marble
156kde-base/kdeedu kde-base/parley
157kde-base/kdegames kde-base/bovo
158kde-base/kdegames kde-base/katomic
159kde-base/kdegames kde-base/kbattleship
160kde-base/kdegames kde-base/kblackbox
161kde-base/kdegames kde-base/kbounce
162kde-base/kdegames kde-base/kfourinline
163kde-base/kdegames kde-base/kgoldrunner
164kde-base/kdegames kde-base/kiriki
165kde-base/kdegames kde-base/kjumpingcube
166kde-base/kdegames kde-base/klines
167kde-base/kdegames kde-base/kmahjongg
168kde-base/kdegames kde-base/kmines
169kde-base/kdegames kde-base/knetwalk
170kde-base/kdegames kde-base/kolf
171kde-base/kdegames kde-base/konquest
172kde-base/kdegames kde-base/kpat
173kde-base/kdegames kde-base/kreversi
174kde-base/kdegames kde-base/ksame
175kde-base/kdegames kde-base/kshisen
176kde-base/kdegames kde-base/kspaceduel
177kde-base/kdegames kde-base/ksquares
178kde-base/kdegames kde-base/ksudoku
179kde-base/kdegames kde-base/ktuberling
180kde-base/kdegames kde-base/libkdegames
181kde-base/kdegames kde-base/libkmahjongg
182kde-base/kdegames kde-base/lskat
183kde-base/kdegraphics kde-base/gwenview
184kde-base/kdegraphics kde-base/kamera
185kde-base/kdegraphics kde-base/kcolorchooser
186kde-base/kdegraphics kde-base/kgamma
187kde-base/kdegraphics kde-base/kghostview
188kde-base/kdegraphics kde-base/kolourpaint
189kde-base/kdegraphics kde-base/kruler
190kde-base/kdegraphics kde-base/ksnapshot
191kde-base/kdegraphics kde-base/libkscan
192kde-base/kdegraphics kde-base/okular
193kde-base/kdegraphics kde-base/svgpart
194kde-base/kdemultimedia kde-base/juk
195kde-base/kdemultimedia kde-base/kdemultimedia-kioslaves
196kde-base/kdemultimedia kde-base/kmix
197kde-base/kdemultimedia kde-base/kscd
198kde-base/kdemultimedia kde-base/libkcddb
199kde-base/kdemultimedia kde-base/libkcompactdisc
200kde-base/kdenetwork kde-base/kdenetwork-filesharing
201kde-base/kdenetwork kde-base/kdnssd
202kde-base/kdenetwork kde-base/kget
203kde-base/kdenetwork kde-base/knewsticker
204kde-base/kdenetwork kde-base/kopete
205kde-base/kdenetwork kde-base/kppp
206kde-base/kdenetwork kde-base/krdc
207kde-base/kdenetwork kde-base/krfb
208kde-base/kdepim kde-base/akonadi
209kde-base/kdepim kde-base/akregator
210kde-base/kdepim kde-base/certmanager
211kde-base/kdepim kde-base/kabc2mutt
212kde-base/kdepim kde-base/kabcclient
213kde-base/kdepim kde-base/kaddressbook
214kde-base/kdepim kde-base/kalarm
215kde-base/kdepim kde-base/kdemaildir
216kde-base/kdepim kde-base/kdepim-kioslaves
217kde-base/kdepim kde-base/kdepim-kresources
218kde-base/kdepim kde-base/kdepim-wizards
219kde-base/kdepim kde-base/kfeed
220kde-base/kdepim kde-base/kitchensync
221kde-base/kdepim kde-base/kleopatra
222kde-base/kdepim kde-base/kmail
223kde-base/kdepim kde-base/kmailcvt
224kde-base/kdepim kde-base/kmobiletools
225kde-base/kdepim kde-base/knode
226kde-base/kdepim kde-base/knotes
227kde-base/kdepim kde-base/kode
228kde-base/kdepim kde-base/konsolekalendar
229kde-base/kdepim kde-base/kontact
230kde-base/kdepim kde-base/kontact-specialdates
231kde-base/kdepim kde-base/korganizer
232kde-base/kdepim kde-base/korn
233kde-base/kdepim kde-base/kpilot
234kde-base/kdepim kde-base/ktimetracker
235kde-base/kdepim kde-base/ktnef
236kde-base/kdepim kde-base/libkdepim
237kde-base/kdepim kde-base/libkholidays
238kde-base/kdepim kde-base/libkleo
239kde-base/kdepim kde-base/libkpgp
240kde-base/kdepim kde-base/libksieve
241kde-base/kdepim kde-base/mailtransport
242kde-base/kdepim kde-base/mimelib
243kde-base/kdepim kde-base/networkstatus
244kde-base/kdesdk kde-base/cervisia
245kde-base/kdesdk kde-base/kdeaccounts-plugin
246kde-base/kdesdk kde-base/kapptemplate
247kde-base/kdesdk kde-base/kate
248kde-base/kdesdk kde-base/kbabel
249kde-base/kdesdk kde-base/kbugbuster
250kde-base/kdesdk kde-base/kcachegrind
251kde-base/kdesdk kde-base/kdesdk-kioslaves
252kde-base/kdesdk kde-base/kdesdk-misc
253kde-base/kdesdk kde-base/kdesdk-scripts
254kde-base/kdesdk kde-base/kmtrace
255kde-base/kdesdk kde-base/kompare
256kde-base/kdesdk kde-base/kspy
257kde-base/kdesdk kde-base/kstartperf
258kde-base/kdesdk kde-base/strigi-analyzer
259kde-base/kdesdk kde-base/kuiviewer
260kde-base/kdesdk kde-base/poxml
261kde-base/kdesdk kde-base/umbrello
262kde-base/kdetoys kde-base/amor
263kde-base/kdetoys kde-base/kteatime
264kde-base/kdetoys kde-base/ktux
265kde-base/kdetoys kde-base/kweather
266kde-base/kdetoys kde-base/kworldclock
267kde-base/kdeutils kde-base/ark
268kde-base/kdeutils kde-base/kcalc
269kde-base/kdeutils kde-base/kcharselect
270kde-base/kdeutils kde-base/kdessh
271kde-base/kdeutils kde-base/kdf
272kde-base/kdeutils kde-base/kedit
273kde-base/kdeutils kde-base/kfloppy
274kde-base/kdeutils kde-base/kgpg
275kde-base/kdeutils kde-base/khexedit
276kde-base/kdeutils kde-base/kjots
277kde-base/kdeutils kde-base/kmilo
278kde-base/kdeutils kde-base/kregexpeditor
279kde-base/kdeutils kde-base/kdessh
280kde-base/kdeutils kde-base/ktimer
281kde-base/kdeutils kde-base/kwallet
282kde-base/kdeutils kde-base/superkaramba
283kde-base/kdeutils kde-base/sweeper
284kde-base/kdewebdev kde-base/kfilereplace
285kde-base/kdewebdev kde-base/kimagemapeditor
286kde-base/kdewebdev kde-base/klinkstatus
287kde-base/kdewebdev kde-base/kxsldbg
288kde-base/kdewebdev kde-base/quanta
289app-office/koffice app-office/karbon
290app-office/koffice app-office/kchart
291app-office/koffice app-office/kexi
292app-office/koffice app-office/kformula
293app-office/koffice app-office/kivio
294app-office/koffice app-office/koffice-data
295app-office/koffice app-office/koffice-libs
296app-office/koffice app-office/koshell
297app-office/koffice app-office/kplato
298app-office/koffice app-office/kpresenter
299app-office/koffice app-office/krita
300app-office/koffice app-office/kspread
301app-office/koffice app-office/kugar
302app-office/koffice app-office/kword
303'
304 109
305# @FUNCTION: get-parent-package 110# @FUNCTION: slot_is_at_least
306# @USAGE: <split ebuild> 111# @USAGE: <want> <have>
307# @DESCRIPTION: 112# @DESCRIPTION:
308# Echoes the name of the monolithic package that a given split ebuild was derived from. 113# Version aware slot comparator.
309get-parent-package() { 114# Current implementation relies on the fact, that slots can be compared like
310 local parent child 115# string literals (and let's keep it this way).
311 while read parent child; do 116slot_is_at_least() {
312 if [[ "${child}" == "$1" ]]; then 117 [[ "${2}" > "${1}" || "${2}" = "${1}" ]]
313 echo ${parent}
314 return 0
315 fi
316 done <<< "$KDE_DERIVATION_MAP"
317 die "Package $target not found in KDE_DERIVATION_MAP, please report bug"
318}
319
320# @FUNCTION: get-child-packages
321# @USAGE: <monolithic ebuild>
322# @DESCRIPTION:
323# Echoes the names of all (split) ebuilds derived from a given monolithic ebuild.
324get-child-packages() {
325 local parent child
326 while read parent child; do
327 [[ "${parent}" == "$1" ]] && echo -n "${child} "
328 done <<< "$KDE_DERIVATION_MAP"
329}
330
331# @FUNCTION: is-parent-package
332# @USAGE: <$CATEGORY/$PN>
333# @DESCRIPTION:
334# Returns zero exit-status if the given package is a parent (monolithic) ebuild.
335# Returns non-zero exit-status if it's not.
336is-parent-package() {
337 local parent child
338 while read parent child; do
339 [[ "${parent}" == "$1" ]] && return 0
340 done <<< "$KDE_DERIVATION_MAP"
341 return 1
342} 118}
343 119
344# @FUNCTION: buildsycoca 120# @FUNCTION: buildsycoca
345# @DESCRIPTION: 121# @DESCRIPTION:
346# Function to rebuild the KDE System Configuration Cache. 122# Function to rebuild the KDE System Configuration Cache.
347# All KDE ebuilds should run this in pkg_postinst and pkg_postrm. 123# All KDE ebuilds should run this in pkg_postinst and pkg_postrm.
348#
349# Note that kde4-base.eclass already does this.
350buildsycoca() { 124buildsycoca() {
351 debug-print-function ${FUNCNAME} "$@" 125 debug-print-function ${FUNCNAME} "$@"
352 126
353 if [[ -x ${KDEDIR}/bin/kbuildsycoca4 ]] && [[ -z "${ROOT}" || "${ROOT}" == "/" ]]; then 127 # We no longer need to run kbuildsycoca4, as kded does that automatically, as needed
354 # First of all, make sure that the /usr/share/services directory exists
355 # and it has the right permissions
356 mkdir -p /usr/share/services
357 chown root:0 /usr/share/services
358 chmod 0755 /usr/share/services
359 128
360 # kbuildsycoca4 needs a running dbus session to work correctly. 129 # fix permission for some directories
361 # We have to start a new dbus session, because the DBUS_SESSION_BUS_ADDRESS in the environment 130 for x in share/{config,kde4}; do
362 # could from from the user's environment (through su [without '-']), causing kbuildsycoca4 to hang. 131 [[ ${KDEDIR} == /usr ]] && DIRS=${EROOT}usr || DIRS="${EROOT}usr ${EROOT}${KDEDIR}"
363 132 for y in ${DIRS}; do
364 einfo "Starting dbus session for kbuildsycoca4" 133 [[ -d "${y}/${x}" ]] || break # nothing to do if directory does not exist
365 local _i 134 # fixes Bug 318237
366 for _i in $(dbus-launch); do 135 if use userland_BSD ; then
367 # We export both the ADDRESS _and_ the PID. We need the latter only to kill our session. 136 [[ $(stat -f %p "${y}/${x}") != 40755 ]]
368 debug-print "Exporting: ${_i}" 137 local stat_rtn="$?"
369 export "${_i}"; 138 else
139 [[ $(stat --format=%a "${y}/${x}") != 755 ]]
140 local stat_rtn=$?
141 fi
142 if [[ $stat_rtn != 1 ]] ; then
143 ewarn "QA Notice:"
144 ewarn "Package ${PN} is breaking ${y}/${x} permissions."
145 ewarn "Please report this issue to gentoo bugzilla."
146 einfo "Permissions will get adjusted automatically now."
147 find "${y}/${x}" -type d -print0 | xargs -0 chmod 755
148 fi
370 done 149 done
371 debug-print "kbuildsycoca4 is using ${DBUS_SESSION_BUS_ADDRESS}" 150 done
372
373 ebegin "Running kbuildsycoca4 to build global database"
374 # This is needed because we support multiple kde versions installed together.
375 XDG_DATA_DIRS="/usr/share:${KDEDIRS}/share:/usr/local/share"
376 ${KDEDIR}/bin/kbuildsycoca4 --global --noincremental &> /dev/null
377 eend $?
378
379 einfo "Killing dbus session for kbuildsycoca4"
380 debug-print "ADDRES ${DBUS_SESSION_BUS_ADDRESS}"
381 debug-print "PID: ${DBUS_SESSION_BUS_PID}"
382 kill ${DBUS_SESSION_BUS_PID}
383 eend $?
384 unset DBUS_SESSION_BUS_ADDRES DBUS_SESSION_BUS_PID
385 fi
386} 151}
387 152
388# @FUNCTION: comment_all_add_subdirectory 153# @FUNCTION: comment_all_add_subdirectory
389# @USAGE: [list of directory names] 154# @USAGE: [list of directory names]
390# @DESCRIPTION: 155# @DESCRIPTION:
391# recursively comment all add_subdirectory instructions in listed directories 156# Recursively comment all add_subdirectory instructions in listed directories,
392# except the ones in cmake/. 157# except those in cmake/.
393comment_all_add_subdirectory() { 158comment_all_add_subdirectory() {
394 find "$@" -name CMakeLists.txt -print0 | grep -vFzZ "./cmake" | \ 159 find "$@" -name CMakeLists.txt -print0 | grep -vFzZ "./cmake" | \
395 xargs -0 sed -i -e '/add_subdirectory/s/^/#DONOTCOMPILE /' || \ 160 xargs -0 sed -i \
161 -e '/^[[:space:]]*add_subdirectory/s/^/#DONOTCOMPILE /' \
162 -e '/^[[:space:]]*ADD_SUBDIRECTORY/s/^/#DONOTCOMPILE /' \
163 -e '/^[[:space:]]*macro_optional_add_subdirectory/s/^/#DONOTCOMPILE /' \
164 -e '/^[[:space:]]*MACRO_OPTIONAL_ADD_SUBDIRECTORY/s/^/#DONOTCOMPILE /' \
396 die "${LINENO}: Initial sed died" 165 || die "${LINENO}: Initial sed died"
397} 166}
398 167
399# @ECLASS-VARIABLE: QT4_BUILT_WITH_USE_CHECK 168# @FUNCTION: enable_selected_linguas
169# @DESCRIPTION:
170# Enable translations based on LINGUAS settings and translations supported by
171# the package (see KDE_LINGUAS). By default, translations are found in "${S}"/po
172# but this default can be overridden by defining KDE_LINGUAS_DIR.
173enable_selected_linguas() {
174 debug-print-function ${FUNCNAME} "$@"
175
176 local x
177
178 # if there is no linguas defined we enable everything
179 if ! $(env | grep -q "^LINGUAS="); then
180 return 0
181 fi
182
183 # @ECLASS-VARIABLE: KDE_LINGUAS_DIR
400# @DESCRIPTION: 184 # @DESCRIPTION:
401# A list of USE flags that x11-libs/qt:4 needs to be built with. 185 # Specified folder where application translations are located.
186 # Can be defined as array of folders where translations are located.
187 # Note that space separated list of dirs is not supported.
188 # Default value is set to "po".
189 if [[ "$(declare -p KDE_LINGUAS_DIR 2>/dev/null 2>&1)" == "declare -a"* ]]; then
190 debug-print "$FUNCNAME: we have these subfolders defined: ${KDE_LINGUAS_DIR}"
191 for x in ${KDE_LINGUAS_DIR[@]}; do
192 _enable_selected_linguas_dir ${x}
193 done
194 else
195 KDE_LINGUAS_DIR=${KDE_LINGUAS_DIR:="po"}
196 _enable_selected_linguas_dir ${KDE_LINGUAS_DIR}
197 fi
198}
199
200# @FUNCTION: enable_selected_doc_linguas
201# @DESCRIPTION:
202# Enable only selected linguas enabled doc folders.
203enable_selected_doc_linguas() {
204 debug-print-function ${FUNCNAME} "$@"
205
206 # if there is no linguas defined we enable everything
207 if ! $(env | grep -q "^LINGUAS="); then
208 return 0
209 fi
210
211 # @ECLASS-VARIABLE: KDE_DOC_DIRS
212 # @DESCRIPTION:
213 # Variable specifying whitespace separated patterns for documentation locations.
214 # Default is "doc/%lingua"
215 KDE_DOC_DIRS=${KDE_DOC_DIRS:='doc/%lingua'}
216 local linguas
217 for pattern in ${KDE_DOC_DIRS}; do
218
219 local handbookdir=`dirname ${pattern}`
220 local translationdir=`basename ${pattern}`
221 # Do filename pattern supplied, treat as directory
222 [[ ${handbookdir} = '.' ]] && handbookdir=${translationdir} && translationdir=
223 [[ -d ${handbookdir} ]] || die 'wrong doc dir specified'
224
225 if ! use handbook; then
226 # Disable whole directory
227 sed -e "/add_subdirectory[[:space:]]*([[:space:]]*${handbookdir}[[:space:]]*)/s/^/#DONOTCOMPILE /" \
228 -e "/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*${handbookdir}[[:space:]]*)/s/^/#DONOTCOMPILE /" \
229 -i CMakeLists.txt || die 'failed to comment out all handbooks'
230 else
231 # Disable subdirectories recursively
232 comment_all_add_subdirectory "${handbookdir}"
233 # Add requested translations
234 local lingua
235 for lingua in en ${KDE_LINGUAS}; do
236 if [[ ${lingua} = en ]] || use linguas_${lingua}; then
237 if [[ -d ${handbookdir}/${translationdir//%lingua/${lingua}} ]]; then
238 sed -e "/add_subdirectory[[:space:]]*([[:space:]]*${translationdir//%lingua/${lingua}}/s/^#DONOTCOMPILE //" \
239 -e "/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*${translationdir//%lingua/${lingua}}/s/^#DONOTCOMPILE //" \
240 -i "${handbookdir}"/CMakeLists.txt && ! has ${lingua} ${linguas} && linguas="${linguas} ${lingua}"
241 fi
242 fi
243 done
244 fi
245
246 done
247 [[ -n "${linguas}" ]] && einfo "Enabling handbook translations:${linguas}"
248}
249
250# @FUNCTION: migrate_store_dir
251# @DESCRIPTION:
252# Universal store dir migration
253# * performs split of kdebase to kdebase-apps when needed
254# * moves playground/extragear kde4-base-style to toplevel dir
255migrate_store_dir() {
256 if [[ ${KDE_SCM} != svn ]]; then
257 die "migrate_store_dir() only makes sense for subversion"
258 fi
259
260 local cleandir="${ESVN_STORE_DIR}/KDE"
261
262 if [[ -d ${cleandir} ]]; then
263 ewarn "'${cleandir}' has been found. Moving contents to new location."
264 addwrite "${ESVN_STORE_DIR}"
265 # Split kdebase
266 local module
267 if pushd "${cleandir}"/kdebase/kdebase > /dev/null; then
268 for module in `find . -maxdepth 1 -type d -name [a-z0-9]\*`; do
269 module="${module#./}"
270 mkdir -p "${ESVN_STORE_DIR}/kdebase-${module}" && mv -f "${module}" "${ESVN_STORE_DIR}/kdebase-${module}" || \
271 die "Failed to move to '${ESVN_STORE_DIR}/kdebase-${module}'."
272 done
273 popd > /dev/null
274 rm -fr "${cleandir}/kdebase" || \
275 die "Failed to remove ${cleandir}/kdebase. You need to remove it manually."
276 fi
277 # Move the rest
278 local pkg
279 for pkg in "${cleandir}"/*; do
280 mv -f "${pkg}" "${ESVN_STORE_DIR}"/ || eerror "Failed to move '${pkg}'"
281 done
282 rmdir "${cleandir}" || die "Could not move obsolete KDE store dir. Please move '${cleandir}' contents to appropriate location (possibly ${ESVN_STORE_DIR}) and manually remove '${cleandir}' in order to continue."
283 fi
284
285 if ! hasq kde4-meta ${INHERITED}; then
286 case ${KMNAME} in
287 extragear*|playground*)
288 local scmlocalpath="${ESVN_STORE_DIR}"/"${KMNAME}"/"${PN}"
289 if [[ -d "${scmlocalpath}" ]]; then
290 local destdir="${ESVN_STORE_DIR}"/"${ESVN_PROJECT}"/"`basename "${ESVN_REPO_URI}"`"
291 ewarn "'${scmlocalpath}' has been found."
292 ewarn "Moving contents to new location: ${destdir}"
293 addwrite "${ESVN_STORE_DIR}"
294 mkdir -p "${ESVN_STORE_DIR}"/"${ESVN_PROJECT}" && mv -f "${scmlocalpath}" "${destdir}" \
295 || die "Failed to move to '${scmlocalpath}'"
296 # Try cleaning empty directories
297 rmdir "`dirname "${scmlocalpath}"`" 2> /dev/null
298 fi
299 ;;
300 esac
301 fi
302}
303
304# Functions handling KMLOADLIBS and KMSAVELIBS
305
306# @FUNCTION: save_library_dependencies
307# @DESCRIPTION:
308# Add exporting CMake dependencies for current package
309save_library_dependencies() {
310 local depsfile="${T}/${PN}:${SLOT}"
311
312 ebegin "Saving library dependencies in ${depsfile##*/}"
313 echo "EXPORT_LIBRARY_DEPENDENCIES(\"${depsfile}\")" >> "${S}/CMakeLists.txt" || \
314 die "Failed to save the library dependencies."
315 eend $?
316}
317
318# @FUNCTION: install_library_dependencies
319# @DESCRIPTION:
320# Install generated CMake library dependencies to /var/lib/kde
321install_library_dependencies() {
322 local depsfile="${T}/${PN}:${SLOT}"
323
324 ebegin "Installing library dependencies as ${depsfile##*/}"
325 insinto /var/lib/kde
326 doins "${depsfile}" || die "Failed to install library dependencies."
327 eend $?
328}
329
330# @FUNCTION: load_library_dependencies
331# @DESCRIPTION:
332# Inject specified library dependencies in current package
333load_library_dependencies() {
334 local pn i depsfile
335 ebegin "Injecting library dependencies from '${KMLOADLIBS}'"
336
337 i=0
338 for pn in ${KMLOADLIBS} ; do
339 ((i++))
340 depsfile="${EPREFIX}/var/lib/kde/${pn}:${SLOT}"
341 [[ -r ${depsfile} ]] || die "Depsfile '${depsfile}' not accessible. You probably need to reinstall ${pn}."
342 sed -i -e "${i}iINCLUDE(\"${depsfile}\")" "${S}/CMakeLists.txt" || \
343 die "Failed to include library dependencies for ${pn}"
344 done
345 eend $?
346}
347
348# @FUNCTION: block_other_slots
349# @DESCRIPTION:
350# Create blocks for the current package in other slots when
351# installed with USE=-kdeprefix
352block_other_slots() {
353 debug-print-function ${FUNCNAME} "$@"
354
355 _do_blocker ${PN} 0:${SLOT}
356}
357
358# @FUNCTION: add_blocker
359# @DESCRIPTION:
360# Create correct RDEPEND value for blocking correct package.
361# Useful for file-collision blocks.
362# Parameters are package and version(s) to block.
363# add_blocker kdelibs 4.2.4
364# If no version is specified, then all versions will be blocked
365# If any arguments (from 2 on) contain a ":", then different versions
366# are blocked in different slots. (Unlisted slots get the version without
367# a ":", if none, then all versions are blocked). The parameter is then of
368# the form VERSION:SLOT. Any VERSION of 0 means that no blocker will be
369# added for that slot (or, if no slot, then for any unlisted slot).
370# A parameter of the form :SLOT means to block all versions from that slot.
371# If VERSION begins with "<", then "!<foo" will be used instead of "!<=foo".
372# As a special case, if a parameter with slot "3.5" is passed, then that slot
373# may also be blocked.
402# 374#
403# This list is automatically appended to KDE4_BUILT_WITH_USE_CHECK, 375# Versions that match "4.x.50" are equivalent to all slots up to (and including)
404# so don't call qt4_pkg_setup manually. 376# "4.x", but nothing following slot "4.x"
405
406# @ECLASS-VARIABLE: KDE4_BUILT_WITH_USE_CHECK
407# @DESCRIPTION:
408# The contents of $KDE4_BUILT_WITH_USE_CHECK gets fed to built_with_use
409# (eutils.eclass), line per line.
410# 377#
411# Example: 378# As an example, if SLOT=live, then
412# @CODE 379# add_blocker kdelibs 0 :4.3 '<4.3.96:4.4' 9999:live
413# pkg_setup() { 380# will add the following to RDEPEND:
414# KDE4_BUILT_WITH_USE_CHECK="--missing true sys-apps/dbus X" 381# !kdeprefix? ( !kde-base/kdelibs:4.3[-kdeprefix] )
415# use alsa && KDE4_BUILT_WITH_USE_CHECK="${KDE4_BUILT_WITH_USE_CHECK} 382# !kdeprefix? ( !<kde-base/kdelibs-4.3.96:4.4[-kdeprefix] )
416# --missing true media-libs/alsa-lib midi" 383# !<=kde-base/kdelibs-9999:live
417# kde4-base_pkg_setup 384add_blocker() {
418# } 385 debug-print-function ${FUNCNAME} "$@"
419# @CODE
420 386
421# run built_with_use on each flag and print appropriate error messages if any 387 RDEPEND+=" $(_do_blocker "$@")"
422# flags are missing 388}
423_kde4-functions_built_with_use() {
424 local missing opt pkg flag flags
425 389
426 if [[ ${1} = "--missing" ]]; then 390# @FUNCTION: add_kdebase_dep
427 missing="${1} ${2}" && shift 2 391# @DESCRIPTION:
392# Create proper dependency for kde-base/ dependencies, adding SLOT when needed
393# (and *only* when needed).
394# This takes 1 to 3 arguments. The first being the package name, the optional
395# second is additional USE flags to append, and the optional third is the
396# version to use instead of the automatic version (use sparingly).
397# The output of this should be added directly to DEPEND/RDEPEND, and may be
398# wrapped in a USE conditional (but not an || conditional without an extra set
399# of parentheses).
400add_kdebase_dep() {
401 debug-print-function ${FUNCNAME} "$@"
402
403 local ver
404
405 if [[ -n ${3} ]]; then
406 ver=${3}
407 elif [[ -n ${KDE_OVERRIDE_MINIMAL} ]]; then
408 ver=${KDE_OVERRIDE_MINIMAL}
409 elif [[ ${KDEBASE} != kde-base ]]; then
410 ver=${KDE_MINIMAL}
411 # FIXME remove hack when kdepim-4.4.* is gone
412 elif [[ ( ${KMNAME} == kdepim || ${PN} == kdepim-runtime ) && ${SLOT} == 4.4 && ${1} =~ ^(kde(pim)?libs|oxygen-icons)$ ]]; then
413 ver=4.4.5
414 # FIXME remove hack when kdepim-4.6beta is gone
415 elif [[ ( ${KMNAME} == kdepim || ${PN} == kdepim-runtime ) && ${PV} == 4.5.98 && ${1} =~ ^(kde(pim)?libs|oxygen-icons)$ ]]; then
416 ver=4.5.90
417 # if building stable-live version depend just on slot
418 # to allow merging packages against more stable basic stuff
419 elif [[ ${PV} == *.9999 ]]; then
420 ver=${SLOT}
421 else
422 ver=${PV}
423 fi
424
425 [[ -z ${1} ]] && die "Missing parameter"
426
427 local use=${2:+,${2}}
428
429 if [[ ${KDEBASE} = kde-base ]]; then
430 echo " !kdeprefix? ( >=kde-base/${1}-${ver}[aqua=,-kdeprefix${use}] )"
431 # kdeprefix is no-go for kdepim 4.4
432 [[ ( ${KMNAME} == kdepim || ${PN} == kdepim-runtime ) && ${SLOT} == 4.4 ]] || \
433 echo " kdeprefix? ( >=kde-base/${1}-${ver}:${SLOT}[aqua=,kdeprefix${use}] )"
434 elif [[ ${ver} == live ]]; then
435 echo " kde-base/${1}:live[aqua=${use}]"
436 else
437 echo " >=kde-base/${1}-${ver}[aqua=${use}]"
438 fi
439}
440
441# _greater_max_in_slot ver slot
442# slot must be 4.x or live
443# returns true if ver is >= the maximum possibile version in slot
444_greater_max_in_slot() {
445 local ver=$1
446 local slot=$2
447 # If slot is live, then return false
448 # (nothing is greater than the maximum live version)
449 [[ $slot == live ]] && return 1
450 # Otherwise, for slot X.Y, test against X.Y.50
451 local test=${slot}.50
452 version_compare $1 ${test}
453 # 1 = '<', 2 = '=', 3 = '>'
454 (( $? != 1 ))
455}
456
457# _less_min_in_slot ver slot
458# slot must be 4.x or live
459# returns true if ver is <= the minimum possibile version in slot
460_less_min_in_slot() {
461 local ver=$1
462 local slot=$2
463 # If slot == live, then test with "9999_pre", so that 9999 tests false
464 local test=9999_pre
465 # If slot == X.Y, then test with X.(Y-1).50
466 [[ $slot != live ]] && test=${slot%.*}.$((${slot#*.} - 1)).50
467 version_compare $1 ${test}
468 # 1 = '<', 2 = '=', 3 = '>'
469 (( $? != 3 ))
470}
471
472# Internal function used for add_blocker and block_other_slots
473# This takes the same parameters as add_blocker, but echos to
474# stdout instead of updating a variable.
475_do_blocker() {
476 debug-print-function ${FUNCNAME} "$@"
477
478 [[ -z ${1} ]] && die "Missing parameter"
479 local pkg=kde-base/$1 use
480 shift
481 if [[ $pkg == *\[*\] ]]; then
482 use=${pkg#*\[}
483 use=${use%\]}
484 pkg=${pkg%\[*\]}
485 fi
486
487 local param slot def="unset" var atom
488 # The following variables will hold parameters that contain ":"
489 # - block_3_5
490 # - block_4_1
491 # - block_4_2
492 # - block_4_3
493 # - block_4_4
494 # - block_live
495 for slot in 3.5 ${KDE_SLOTS[@]} ${KDE_LIVE_SLOTS[@]}; do
496 local block_${slot//./_}="unset"
497 done
498
499 # This construct goes through each parameter passed, and sets
500 # either def or block_* to the version passed
501 for param; do
502 # If the parameter does not have a ":" in it...
503 if [[ ${param/:} == ${param} ]]; then
504 def=${param}
505 else # the parameter *does* have a ":" in it
506 # so everything after the : is the slot...
507 slot=${param#*:}
508 # ...and everything before the : is the version
509 local block_${slot//./_}=${param%:*}
428 fi 510 fi
511 done
512
513 for slot in ${KDE_SLOTS[@]} ${KDE_LIVE_SLOTS[@]}; do
514 # ${var} contains the name of the variable we care about for this slot
515 # ${!var} is it's value
516 var=block_${slot//./_}
517 # if we didn't pass *:${slot}, then use the unsloted value
518 [[ ${!var} == "unset" ]] && var=def
519
520 # If no version was passed, or the version is greater than the maximum
521 # possible version in this slot, block all versions in this slot
522 if [[ ${!var} == "unset" ]] || [[ -z ${!var} ]] || _greater_max_in_slot ${!var#<} ${slot}; then
523 atom=${pkg}
524 # If the version is "0" or less than the minimum possible version in
525 # this slot, do nothing
526 elif [[ ${!var} == "0" ]] || _less_min_in_slot ${!var#<} ${slot}; then
527 continue
528 # If the version passed begins with a "<", then use "<" instead of "<="
429 if [[ ${1:0:1} = "-" ]]; then 529 elif [[ ${!var:0:1} == "<" ]]; then
430 opt=${1} && shift 530 # this also removes the first character of the version, which is a "<"
431 fi 531 atom="<${pkg}-${!var:1}"
432
433 pkg=${1} && shift
434
435 for flag in "${@}"; do
436 flags="${flags} ${flag}"
437 if ! built_with_use ${missing} ${opt} ${pkg} ${flag}; then
438 flags="${flags}*"
439 else 532 else
440 [[ ${opt} = "-o" ]] && return 0 533 atom="<=${pkg}-${!var}"
441 fi
442 done
443 if [[ "${flags# }" = "${@}" ]]; then
444 return 0
445 fi 534 fi
446 if [[ ${opt} = "-o" ]]; then 535 # we always block our own slot, ignoring kdeprefix
447 eerror "This package requires '${pkg}' to be built with any of the following USE flags: '$*'." 536 if [[ ${SLOT} == ${slot} ]]; then
537 echo " !${atom}:${slot}${use:+[${use}]}"
448 else 538 else
449 eerror "This package requires '${pkg}' to be built with the following USE flags: '${flags# }'." 539 # we only block other slots on -kdeprefix
540 echo " !kdeprefix? ( !${atom}:${slot}[-kdeprefix${use:+,${use}}] )"
450 fi 541 fi
451 return 1 542 done
452}
453 543
454# @FUNCTION: kde4-functions_check_use 544 # This is a special case block for :3.5; it does not use the
455# @DESCRIPTION: 545 # default version passed, and no blocker is output *unless* a version
456# Check if the Qt4 libraries are built with the USE flags listed in 546 # is passed, or ":3.5" is passed to explicitly request a block on all
457# $QT4_BUILT_WITH_USE_CHECK. 547 # 3.5 versions.
458# 548 if [[ ${block_3_5} != "unset" && ${block_3_5} != "0" ]]; then
459# Check if a list of packages are built with certain USE flags, as listed in 549 if [[ -z ${block_3_5} ]]; then
460# $KDE4_BUILT_WITH_USE_CHECK. 550 atom=${pkg}
461# 551 elif [[ ${block_3_5:0:1} == "<" ]]; then
462# If any of the required USE flags are missing, an eerror will be printed for 552 atom="<${pkg}-${block_3_5:1}"
463# each package with missing USE flags. 553 else
464kde4-functions_check_use() { 554 atom="<=${pkg}-${block_3_5}"
465 # I like to keep flags sorted 555 fi
466 QT4_BUILT_WITH_USE_CHECK=$(echo "${QT4_BUILT_WITH_USE_CHECK}" | \ 556 echo " !${atom}:3.5${use:+[${use}]}"
467 tr '[:space:]' '\n' | sort | xargs) 557 fi
558}
468 559
469 KDE4_BUILT_WITH_USE_CHECK="x11-libs/qt:4 ${QT4_BUILT_WITH_USE_CHECK} 560# local function to enable specified translations for specified directory
470 ${KDE4_BUILT_WITH_USE_CHECK}" 561# used from kde4-functions_enable_selected_linguas function
562_enable_selected_linguas_dir() {
563 local lingua linguas sr_mess wp
564 local dir=${1}
471 565
472 local line missing 566 [[ -d ${dir} ]] || die "linguas dir \"${dir}\" does not exist"
473 while read line; do 567 comment_all_add_subdirectory "${dir}"
474 [[ -z ${line} ]] && continue 568 pushd "${dir}" > /dev/null
475 if ! _kde4-functions_built_with_use ${line}; then 569
476 missing=true 570 # fix all various crazy sr@Latn variations
571 # this part is only ease for ebuilds, so there wont be any die when this
572 # fail at any point
573 sr_mess="sr@latn sr@latin sr@Latin"
574 for wp in ${sr_mess}; do
575 [[ -e ${wp}.po ]] && mv "${wp}.po" "sr@Latn.po"
576 if [[ -d ${wp} ]]; then
577 # move dir and fix cmakelists
578 mv "${wp}" "sr@Latn"
579 sed -i \
580 -e "s:${wp}:sr@Latn:g" \
581 CMakeLists.txt
582 fi
583 done
584
585 for lingua in ${KDE_LINGUAS}; do
586 if [[ -e ${lingua}.po ]]; then
587 mv "${lingua}.po" "${lingua}.po.old"
588 fi
589 done
590
591 for lingua in ${KDE_LINGUAS}; do
592 if use linguas_${lingua} ; then
593 if [[ -d ${lingua} ]]; then
594 linguas="${linguas} ${lingua}"
595 sed -e "/add_subdirectory([[:space:]]*${lingua}[[:space:]]*)[[:space:]]*$/ s/^#DONOTCOMPILE //" \
596 -e "/ADD_SUBDIRECTORY([[:space:]]*${lingua}[[:space:]]*)[[:space:]]*$/ s/^#DONOTCOMPILE //" \
597 -i CMakeLists.txt || die "Sed to uncomment linguas_${lingua} failed."
477 fi 598 fi
478 done <<< "${KDE4_BUILT_WITH_USE_CHECK}" 599 if [[ -e ${lingua}.po.old ]]; then
479 if [[ -n ${missing} ]]; then 600 linguas="${linguas} ${lingua}"
480 echo 601 mv "${lingua}.po.old" "${lingua}.po"
481 eerror "Flags marked with an * are missing." 602 fi
482 die "Missing USE flags found"
483 fi 603 fi
604 done
605 [[ -n ${linguas} ]] && echo ">>> Enabling languages: ${linguas}"
606
607 popd > /dev/null
484} 608}
609
610_calculate_kde_slot() {
611 local ver=${1:-${PV}}
612 local major=$(get_major_version ${ver})
613 local minor=$(get_version_component_range 2 ${ver})
614 local micro=$(get_version_component_range 3 ${ver})
615 [[ ${ver} == 9999 ]] && echo live
616 (( major == 4 && micro == 9999 )) && echo ${major}.${minor}
617 if (( major == 4 && micro != 9999 )); then
618 (( micro < 50 )) && echo ${major}.${minor} || echo ${major}.$((minor + 1))
619 fi
620}

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.48

  ViewVC Help
Powered by ViewVC 1.1.20