Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/kde-sunset:master commit in: eclass/
Date: Fri, 06 Apr 2018 00:53:59
Message-Id: 1522975976.6a6c6d087d85efc0acddae97a0bff1e2c0e1c456.asturm@gentoo
1 commit: 6a6c6d087d85efc0acddae97a0bff1e2c0e1c456
2 Author: Andreas Sturmlechner <andreas.sturmlechner <AT> gmail <DOT> com>
3 AuthorDate: Fri Apr 6 00:52:56 2018 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Fri Apr 6 00:52:56 2018 +0000
6 URL: https://gitweb.gentoo.org/proj/kde-sunset.git/commit/?id=6a6c6d08
7
8 kde4-{base,functions,meta}.eclass: Import from Gentoo ebuild repository
9
10 eclass/kde4-base.eclass | 963 +++++++++++++++++++++++++++++++++++++++++++
11 eclass/kde4-functions.eclass | 431 +++++++++++++++++++
12 eclass/kde4-meta.eclass | 631 ++++++++++++++++++++++++++++
13 3 files changed, 2025 insertions(+)
14
15 diff --git a/eclass/kde4-base.eclass b/eclass/kde4-base.eclass
16 new file mode 100644
17 index 0000000..8abade2
18 --- /dev/null
19 +++ b/eclass/kde4-base.eclass
20 @@ -0,0 +1,963 @@
21 +# Copyright 1999-2017 Gentoo Foundation
22 +# Distributed under the terms of the GNU General Public License v2
23 +
24 +# @DEAD
25 +# Removal on 2018-05-03.
26 +# @ECLASS: kde4-base.eclass
27 +# @MAINTAINER:
28 +# kde@g.o
29 +# @BLURB: This eclass provides functions for kde 4.X ebuilds
30 +# @DESCRIPTION:
31 +# The kde4-base.eclass provides support for building KDE4 based ebuilds
32 +# and KDE4 applications.
33 +#
34 +# NOTE: KDE 4 ebuilds currently support EAPI 5. This will be
35 +# reviewed over time as new EAPI versions are approved.
36 +
37 +if [[ -z ${_KDE4_BASE_ECLASS} ]]; then
38 +_KDE4_BASE_ECLASS=1
39 +
40 +# @ECLASS-VARIABLE: KDE_SELINUX_MODULE
41 +# @DESCRIPTION:
42 +# If set to "none", do nothing.
43 +# For any other value, add selinux to IUSE, and depending on that useflag
44 +# add a dependency on sec-policy/selinux-${KDE_SELINUX_MODULE} to (R)DEPEND
45 +: ${KDE_SELINUX_MODULE:=none}
46 +
47 +# @ECLASS-VARIABLE: VIRTUALDBUS_TEST
48 +# @DESCRIPTION:
49 +# If defined, launch and use a private dbus session during src_test.
50 +
51 +# @ECLASS-VARIABLE: VIRTUALX_REQUIRED
52 +# @DESCRIPTION:
53 +# For proper description see virtualx.eclass manpage.
54 +# Here we redefine default value to be manual, if your package needs virtualx
55 +# for tests you should proceed with setting VIRTUALX_REQUIRED=test.
56 +: ${VIRTUALX_REQUIRED:=manual}
57 +
58 +inherit kde4-functions toolchain-funcs flag-o-matic gnome2-utils virtualx versionator eutils multilib xdg-utils
59 +
60 +if [[ ${KDE_BUILD_TYPE} = live ]]; then
61 + case ${KDE_SCM} in
62 + svn) inherit subversion ;;
63 + git) inherit git-r3 ;;
64 + esac
65 +fi
66 +
67 +# @ECLASS-VARIABLE: CMAKE_REQUIRED
68 +# @DESCRIPTION:
69 +# Specify if cmake buildsystem is being used. Possible values are 'always' and 'never'.
70 +# Please note that if it's set to 'never' you need to explicitly override following phases:
71 +# src_configure, src_compile, src_test and src_install.
72 +# Defaults to 'always'.
73 +: ${CMAKE_REQUIRED:=always}
74 +if [[ ${CMAKE_REQUIRED} = always ]]; then
75 + buildsystem_eclass="cmake-utils"
76 + export_fns="src_configure src_compile src_test src_install"
77 +fi
78 +
79 +# @ECLASS-VARIABLE: KDE_MINIMAL
80 +# @DESCRIPTION:
81 +# This variable is used when KDE_REQUIRED is set, to specify required KDE minimal
82 +# version for apps to work. Currently defaults to 4.4
83 +# One may override this variable to raise version requirements.
84 +# Note that it is fixed to ${PV} for kde-base packages.
85 +KDE_MINIMAL="${KDE_MINIMAL:-4.4}"
86 +
87 +# Set slot for KDEBASE known packages
88 +case ${KDEBASE} in
89 + kde-base)
90 + SLOT=4/$(get_version_component_range 1-2)
91 + KDE_MINIMAL="${PV}"
92 + ;;
93 + kdevelop)
94 + if [[ ${KDE_BUILD_TYPE} = live ]]; then
95 + # @ECLASS-VARIABLE: KDEVELOP_VERSION
96 + # @DESCRIPTION:
97 + # Specifies KDevelop version. Default is 4.0.0 for tagged packages and 9999 for live packages.
98 + # Applies to KDEBASE=kdevelop only.
99 + KDEVELOP_VERSION="${KDEVELOP_VERSION:-4.9999}"
100 + # @ECLASS-VARIABLE: KDEVPLATFORM_VERSION
101 + # @DESCRIPTION:
102 + # Specifies KDevplatform version. Default is 1.0.0 for tagged packages and 9999 for live packages.
103 + # Applies to KDEBASE=kdevelop only.
104 + KDEVPLATFORM_VERSION="${KDEVPLATFORM_VERSION:-4.9999}"
105 + else
106 + case ${PN} in
107 + kdevelop)
108 + KDEVELOP_VERSION=${PV}
109 + KDEVPLATFORM_VERSION="$(($(get_major_version)-3)).$(get_after_major_version)"
110 + ;;
111 + kdevplatform|kdevelop-php*|kdevelop-python)
112 + KDEVELOP_VERSION="$(($(get_major_version)+3)).$(get_after_major_version)"
113 + KDEVPLATFORM_VERSION=${PV}
114 + ;;
115 + *)
116 + KDEVELOP_VERSION="${KDEVELOP_VERSION:-4.0.0}"
117 + KDEVPLATFORM_VERSION="${KDEVPLATFORM_VERSION:-1.0.0}"
118 + esac
119 + fi
120 + SLOT="4"
121 + ;;
122 +esac
123 +
124 +inherit ${buildsystem_eclass}
125 +
126 +EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare ${export_fns} pkg_preinst pkg_postinst pkg_postrm
127 +
128 +unset buildsystem_eclass
129 +unset export_fns
130 +
131 +# @ECLASS-VARIABLE: DECLARATIVE_REQUIRED
132 +# @DESCRIPTION:
133 +# Is qtdeclarative required? Possible values are 'always', 'optional' and 'never'.
134 +# This variable must be set before inheriting any eclasses. Defaults to 'never'.
135 +DECLARATIVE_REQUIRED="${DECLARATIVE_REQUIRED:-never}"
136 +
137 +# @ECLASS-VARIABLE: QT3SUPPORT_REQUIRED
138 +# @DESCRIPTION:
139 +# Is qt3support required? Possible values are 'true' or 'false'.
140 +# This variable must be set before inheriting any eclasses. Defaults to 'false'.
141 +QT3SUPPORT_REQUIRED="${QT3SUPPORT_REQUIRED:-false}"
142 +
143 +# @ECLASS-VARIABLE: QTHELP_REQUIRED
144 +# @DESCRIPTION:
145 +# Is qthelp required? Possible values are 'always', 'optional' and 'never'.
146 +# This variable must be set before inheriting any eclasses. Defaults to 'never'.
147 +QTHELP_REQUIRED="${QTHELP_REQUIRED:-never}"
148 +
149 +# @ECLASS-VARIABLE: OPENGL_REQUIRED
150 +# @DESCRIPTION:
151 +# Is qtopengl required? Possible values are 'always', 'optional' and 'never'.
152 +# This variable must be set before inheriting any eclasses. Defaults to 'never'.
153 +OPENGL_REQUIRED="${OPENGL_REQUIRED:-never}"
154 +
155 +# @ECLASS-VARIABLE: MULTIMEDIA_REQUIRED
156 +# @DESCRIPTION:
157 +# Is qtmultimedia required? Possible values are 'always', 'optional' and 'never'.
158 +# This variable must be set before inheriting any eclasses. Defaults to 'never'.
159 +MULTIMEDIA_REQUIRED="${MULTIMEDIA_REQUIRED:-never}"
160 +
161 +# @ECLASS-VARIABLE: SQL_REQUIRED
162 +# @DESCRIPTION:
163 +# Is qtsql required? Possible values are 'always', 'optional' and 'never'.
164 +# This variable must be set before inheriting any eclasses. Defaults to 'never'.
165 +SQL_REQUIRED="${SQL_REQUIRED:-never}"
166 +
167 +# @ECLASS-VARIABLE: WEBKIT_REQUIRED
168 +# @DESCRIPTION:
169 +# Is qtwebkit required? Possible values are 'always', 'optional' and 'never'.
170 +# This variable must be set before inheriting any eclasses. Defaults to 'never'.
171 +WEBKIT_REQUIRED="${WEBKIT_REQUIRED:-never}"
172 +
173 +# @ECLASS-VARIABLE: CPPUNIT_REQUIRED
174 +# @DESCRIPTION:
175 +# Is cppunit required for tests? Possible values are 'always', 'optional' and 'never'.
176 +# This variable must be set before inheriting any eclasses. Defaults to 'never'.
177 +CPPUNIT_REQUIRED="${CPPUNIT_REQUIRED:-never}"
178 +
179 +# @ECLASS-VARIABLE: KDE_REQUIRED
180 +# @DESCRIPTION:
181 +# Is kde required? Possible values are 'always', 'optional' and 'never'.
182 +# This variable must be set before inheriting any eclasses. Defaults to 'always'
183 +# If set to 'always' or 'optional', KDE_MINIMAL may be overridden as well.
184 +# Note that for kde-base packages this variable is fixed to 'always'.
185 +KDE_REQUIRED="${KDE_REQUIRED:-always}"
186 +
187 +# @ECLASS-VARIABLE: KDE_HANDBOOK
188 +# @DESCRIPTION:
189 +# Set to enable handbook in application. Possible values are 'always', 'optional'
190 +# (handbook USE flag) and 'never'.
191 +# This variable must be set before inheriting any eclasses. Defaults to 'never'.
192 +# It adds default handbook dirs for kde-base packages to KMEXTRA and in any case it
193 +# ensures buildtime and runtime dependencies.
194 +KDE_HANDBOOK="${KDE_HANDBOOK:-never}"
195 +
196 +# @ECLASS-VARIABLE: KDE_LINGUAS_LIVE_OVERRIDE
197 +# @DESCRIPTION:
198 +# Set this varible if you want your live package to manage its
199 +# translations. (Mostly all kde ebuilds does not ship documentation
200 +# and translations in live ebuilds)
201 +if [[ ${KDE_BUILD_TYPE} == live && -z ${KDE_LINGUAS_LIVE_OVERRIDE} ]]; then
202 + # Kdebase actually provides the handbooks even for live stuff
203 + [[ ${KDEBASE} == kde-base ]] || KDE_HANDBOOK=never
204 + KDE_LINGUAS=""
205 +fi
206 +
207 +# Setup packages inheriting this eclass
208 +case ${KDEBASE} in
209 + kde-base)
210 + HOMEPAGE="https://www.kde.org/"
211 + LICENSE="GPL-2"
212 + if [[ ${KDE_BUILD_TYPE} = live && -z ${I_KNOW_WHAT_I_AM_DOING} ]]; then
213 + # Disable tests for live ebuilds by default
214 + RESTRICT+=" test"
215 + fi
216 +
217 + # This code is to prevent portage from searching GENTOO_MIRRORS for
218 + # packages that will never be mirrored. (As they only will ever be in
219 + # the overlay).
220 + case ${PV} in
221 + *9999* | 4.?.[6-9]? | 4.??.[6-9]? | ??.?.[6-9]? | ??.??.[6-9]?)
222 + RESTRICT+=" mirror"
223 + ;;
224 + esac
225 + ;;
226 + kdevelop)
227 + HOMEPAGE="https://www.kdevelop.org/"
228 + LICENSE="GPL-2"
229 + ;;
230 +esac
231 +
232 +# @ECLASS-VARIABLE: QT_MINIMAL
233 +# @DESCRIPTION:
234 +# Determine version of qt we enforce as minimal for the package.
235 +QT_MINIMAL="${QT_MINIMAL:-4.8.5}"
236 +
237 +# Declarative dependencies
238 +qtdeclarativedepend="
239 + >=dev-qt/qtdeclarative-${QT_MINIMAL}:4
240 +"
241 +case ${DECLARATIVE_REQUIRED} in
242 + always)
243 + COMMONDEPEND+=" ${qtdeclarativedepend}"
244 + ;;
245 + optional)
246 + IUSE+=" declarative"
247 + COMMONDEPEND+=" declarative? ( ${qtdeclarativedepend} )"
248 + ;;
249 + *) ;;
250 +esac
251 +unset qtdeclarativedepend
252 +
253 +# Qt3Support dependencies
254 +qt3supportdepend="
255 + >=dev-qt/qt3support-${QT_MINIMAL}:4[accessibility]
256 +"
257 +case ${QT3SUPPORT_REQUIRED} in
258 + true)
259 + COMMONDEPEND+=" ${qt3supportdepend}"
260 + [[ -n ${qtcoreuse} ]] && qtcoreuse+=",qt3support" || qtcoreuse="qt3support"
261 + [[ -n ${qtsqluse} ]] && qtsqluse+=",qt3support" || qtsqluse="qt3support"
262 + [[ -n ${kdelibsuse} ]] && kdelibsuse+=",qt3support(+)" || kdelibsuse="qt3support(+)"
263 + ;;
264 + *) ;;
265 +esac
266 +unset qt3supportdepend
267 +
268 +# QtHelp dependencies
269 +qthelpdepend="
270 + >=dev-qt/qthelp-${QT_MINIMAL}:4
271 +"
272 +case ${QTHELP_REQUIRED} in
273 + always)
274 + COMMONDEPEND+=" ${qthelpdepend}"
275 + ;;
276 + optional)
277 + IUSE+=" qthelp"
278 + COMMONDEPEND+=" qthelp? ( ${qthelpdepend} )"
279 + ;;
280 +esac
281 +unset qthelpdepend
282 +
283 +# OpenGL dependencies
284 +qtopengldepend="
285 + >=dev-qt/qtopengl-${QT_MINIMAL}:4
286 +"
287 +case ${OPENGL_REQUIRED} in
288 + always)
289 + COMMONDEPEND+=" ${qtopengldepend}"
290 + ;;
291 + optional)
292 + IUSE+=" opengl"
293 + COMMONDEPEND+=" opengl? ( ${qtopengldepend} )"
294 + ;;
295 + *) ;;
296 +esac
297 +unset qtopengldepend
298 +
299 +# MultiMedia dependencies
300 +qtmultimediadepend="
301 + >=dev-qt/qtmultimedia-${QT_MINIMAL}:4
302 +"
303 +case ${MULTIMEDIA_REQUIRED} in
304 + always)
305 + COMMONDEPEND+=" ${qtmultimediadepend}"
306 + ;;
307 + optional)
308 + IUSE+=" multimedia"
309 + COMMONDEPEND+=" multimedia? ( ${qtmultimediadepend} )"
310 + ;;
311 + *) ;;
312 +esac
313 +unset qtmultimediadepend
314 +
315 +# Sql dependencies
316 +[[ -n ${qtsqluse} ]] && qtsqluse="[${qtsqluse}]"
317 +qtsqldepend="
318 + >=dev-qt/qtsql-${QT_MINIMAL}:4${qtsqluse}
319 +"
320 +case ${SQL_REQUIRED} in
321 + always)
322 + COMMONDEPEND+=" ${qtsqldepend}"
323 + ;;
324 + optional)
325 + IUSE+=" sql"
326 + COMMONDEPEND+=" sql? ( ${qtsqldepend} )"
327 + ;;
328 + *) ;;
329 +esac
330 +unset qtsqluse
331 +unset qtsqldepend
332 +
333 +# WebKit dependencies
334 +qtwebkitdepend="
335 + >=dev-qt/qtwebkit-${QT_MINIMAL}:4
336 +"
337 +case ${WEBKIT_REQUIRED} in
338 + always)
339 + COMMONDEPEND+=" ${qtwebkitdepend}"
340 + [[ -n ${kdelibsuse} ]] && kdelibsuse+=",webkit(+)" || kdelibsuse="webkit(+)"
341 + ;;
342 + optional)
343 + IUSE+=" +webkit"
344 + COMMONDEPEND+=" webkit? ( ${qtwebkitdepend} )"
345 + [[ -n ${kdelibsuse} ]] && kdelibsuse+=",webkit?" || kdelibsuse="webkit?"
346 + ;;
347 + *) ;;
348 +esac
349 +unset qtwebkitdepend
350 +
351 +# CppUnit dependencies
352 +cppuintdepend="
353 + dev-util/cppunit
354 +"
355 +case ${CPPUNIT_REQUIRED} in
356 + always)
357 + DEPEND+=" ${cppuintdepend}"
358 + ;;
359 + optional)
360 + IUSE+=" test"
361 + DEPEND+=" test? ( ${cppuintdepend} )"
362 + ;;
363 + *) ;;
364 +esac
365 +unset cppuintdepend
366 +
367 +# KDE dependencies
368 +# Qt accessibility classes are needed in various places, bug 325461
369 +[[ -n ${qtcoreuse} ]] && qtcoreuse+=",ssl" || qtcoreuse="ssl"
370 +[[ -n ${qtcoreuse} ]] && qtcoreuse="[${qtcoreuse}]"
371 +kdecommondepend="
372 + dev-lang/perl
373 + >=dev-qt/designer-${QT_MINIMAL}:4
374 + >=dev-qt/qtcore-${QT_MINIMAL}:4${qtcoreuse}
375 + >=dev-qt/qtdbus-${QT_MINIMAL}:4
376 + >=dev-qt/qtgui-${QT_MINIMAL}:4[accessibility,dbus(+)]
377 + >=dev-qt/qtscript-${QT_MINIMAL}:4
378 + >=dev-qt/qtsvg-${QT_MINIMAL}:4
379 + >=dev-qt/qttest-${QT_MINIMAL}:4
380 +"
381 +unset qtcoreuse
382 +
383 +if [[ ${PN} != kdelibs ]]; then
384 + [[ -n ${kdelibsuse} ]] && kdelibsuse="[${kdelibsuse}]"
385 + kdecommondepend+=" kde-frameworks/kdelibs:4${kdelibsuse}"
386 + if [[ ${KDEBASE} = kdevelop ]]; then
387 + if [[ ${PN} != kdevplatform ]]; then
388 + # @ECLASS-VARIABLE: KDEVPLATFORM_REQUIRED
389 + # @DESCRIPTION:
390 + # Specifies whether kdevplatform is required. Possible values are 'always' (default) and 'never'.
391 + # Applies to KDEBASE=kdevelop only.
392 + KDEVPLATFORM_REQUIRED="${KDEVPLATFORM_REQUIRED:-always}"
393 + case ${KDEVPLATFORM_REQUIRED} in
394 + always)
395 + kdecommondepend+="
396 + >=dev-util/kdevplatform-${KDEVPLATFORM_VERSION}:4
397 + "
398 + ;;
399 + *) ;;
400 + esac
401 + fi
402 + fi
403 +fi
404 +unset kdelibsuse
405 +
406 +kdedepend="
407 + dev-util/automoc
408 + virtual/pkgconfig
409 + >=x11-libs/libXtst-1.1.0
410 + x11-proto/xf86vidmodeproto
411 +"
412 +
413 +kderdepend=""
414 +
415 +# all packages needs oxygen icons for basic iconset
416 +if [[ ${PN} != oxygen-icons ]]; then
417 + kderdepend+=" kde-frameworks/oxygen-icons"
418 +fi
419 +
420 +# add a dependency over kde4-l10n
421 +if [[ ${KDEBASE} != "kde-base" && -n ${KDE_LINGUAS} ]]; then
422 + for _lingua in $(kde4_lingua_to_l10n ${KDE_LINGUAS}); do
423 + # if our package has linguas, pull in kde4-l10n with selected lingua enabled,
424 + # but only for selected ones.
425 + # this can't be done on one line because if user doesn't use any localisation
426 + # then he is probably not interested in kde4-l10n at all.
427 + kderdepend+="
428 + l10n_${_lingua}? ( $(add_kdeapps_dep kde4-l10n "l10n_${_lingua}(+)") )
429 + "
430 + done
431 + unset _lingua
432 +fi
433 +
434 +kdehandbookdepend="
435 + app-text/docbook-xml-dtd:4.2
436 + app-text/docbook-xsl-stylesheets
437 +"
438 +kdehandbookrdepend="
439 + kde-frameworks/kdelibs:4[handbook]
440 +"
441 +case ${KDE_HANDBOOK} in
442 + always)
443 + kdedepend+=" ${kdehandbookdepend}"
444 + [[ ${PN} != kdelibs ]] && kderdepend+=" ${kdehandbookrdepend}"
445 + ;;
446 + optional)
447 + IUSE+=" +handbook"
448 + kdedepend+=" handbook? ( ${kdehandbookdepend} )"
449 + [[ ${PN} != kdelibs ]] && kderdepend+=" handbook? ( ${kdehandbookrdepend} )"
450 + ;;
451 + *) ;;
452 +esac
453 +unset kdehandbookdepend kdehandbookrdepend
454 +
455 +case ${KDE_SELINUX_MODULE} in
456 + none) ;;
457 + *)
458 + IUSE+=" selinux"
459 + kderdepend+=" selinux? ( sec-policy/selinux-${KDE_SELINUX_MODULE} )"
460 + ;;
461 +esac
462 +
463 +case ${KDE_REQUIRED} in
464 + always)
465 + [[ -n ${kdecommondepend} ]] && COMMONDEPEND+=" ${kdecommondepend}"
466 + [[ -n ${kdedepend} ]] && DEPEND+=" ${kdedepend}"
467 + [[ -n ${kderdepend} ]] && RDEPEND+=" ${kderdepend}"
468 + ;;
469 + optional)
470 + IUSE+=" kde"
471 + [[ -n ${kdecommondepend} ]] && COMMONDEPEND+=" kde? ( ${kdecommondepend} )"
472 + [[ -n ${kdedepend} ]] && DEPEND+=" kde? ( ${kdedepend} )"
473 + [[ -n ${kderdepend} ]] && RDEPEND+=" kde? ( ${kderdepend} )"
474 + ;;
475 + *) ;;
476 +esac
477 +
478 +unset kdecommondepend kdedepend kderdepend
479 +
480 +debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: COMMONDEPEND is ${COMMONDEPEND}"
481 +debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: DEPEND (only) is ${DEPEND}"
482 +debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: RDEPEND (only) is ${RDEPEND}"
483 +
484 +# Accumulate dependencies set by this eclass
485 +DEPEND+=" ${COMMONDEPEND}"
486 +RDEPEND+=" ${COMMONDEPEND}"
487 +unset COMMONDEPEND
488 +
489 +# Fetch section - If the ebuild's category is not 'kde-base' and if it is not a
490 +# kdevelop ebuild, the URI should be set in the ebuild itself
491 +_calculate_src_uri() {
492 + debug-print-function ${FUNCNAME} "$@"
493 +
494 + local _kmname _kmname_pv
495 +
496 + # we calculate URI only for known KDEBASE modules
497 + [[ -n ${KDEBASE} ]] || return
498 +
499 + # calculate tarball module name
500 + if [[ -n ${KMNAME} ]]; then
501 + _kmname="${KMNAME}"
502 + else
503 + _kmname=${PN}
504 + fi
505 + _kmname_pv="${_kmname}-${PV}"
506 + case ${KDEBASE} in
507 + kde-base)
508 + case ${PV} in
509 + 4.4.20*)
510 + # KDEPIM 4.4 no-akonadi branch, special case
511 + # TODO: Remove this part when KDEPIM 4.4 gets out of the tree
512 + SRC_URI="https://dev.gentoo.org/~dilfridge/distfiles/${_kmname_pv}.tar.xz" ;;
513 + 4.?.[6-9]? | 4.??.[6-9]?)
514 + # Unstable KDE SC releases
515 + SRC_URI="mirror://kde/unstable/${PV}/src/${_kmname_pv}.tar.xz" ;;
516 + 4.11.22)
517 + # Part of 15.08.0 actually, sigh. Not stable for next release!
518 + SRC_URI="mirror://kde/Attic/applications/15.08.0/src/${_kmname_pv}.tar.xz" ;;
519 + 4.14.3)
520 + # Last SC release
521 + SRC_URI="mirror://kde/stable/${PV}/src/${_kmname_pv}.tar.xz" ;;
522 + 4.14.10)
523 + # Part of 15.04.3 actually, sigh. Used by last version of KDE PIM 4.
524 + SRC_URI="mirror://kde/Attic/applications/15.04.3/src/${_kmname_pv}.tar.xz" ;;
525 + 4.14.11*)
526 + # KDEPIM 4.14 snapshot with Gentoo patches
527 + SRC_URI="https://dev.gentoo.org/~asturm/distfiles/${_kmname_pv}.tar.xz" ;;
528 + 16.12.3)
529 + SRC_URI="mirror://kde/Attic/applications/16.12.3/src/${_kmname_pv}.tar.xz" ;;
530 + ??.?.[6-9]? | ??.??.[4-9]?)
531 + # Unstable KDE Applications releases
532 + SRC_URI="mirror://kde/unstable/applications/${PV}/src/${_kmname}-${PV}.tar.xz" ;;
533 + *)
534 + # Stable KDE Applications releases
535 + SRC_URI="mirror://kde/stable/applications/${PV}/src/${_kmname}-${PV}.tar.xz"
536 + ;;
537 + esac
538 + ;;
539 + kdevelop|kdevelop-php*|kdevplatform)
540 + case ${KDEVELOP_VERSION} in
541 + 4.[123].[6-9]*) SRC_URI="mirror://kde/unstable/kdevelop/${KDEVELOP_VERSION}/src/${P}.tar.xz" ;;
542 + 4.7.3) SRC_URI="mirror://kde/stable/kdevelop/${KDEVELOP_VERSION}/src/${P}.tar.bz2" ;;
543 + 4.7.4) SRC_URI="mirror://kde/stable/kdevelop/${KDEVELOP_VERSION}/${P}.tar.xz" ;;
544 + *) SRC_URI="mirror://kde/stable/kdevelop/${KDEVELOP_VERSION}/src/${P}.tar.xz" ;;
545 + esac
546 + ;;
547 + esac
548 +}
549 +
550 +_calculate_live_repo() {
551 + debug-print-function ${FUNCNAME} "$@"
552 +
553 + SRC_URI=""
554 + case ${KDE_SCM} in
555 + svn)
556 + # Determine branch URL based on live type
557 + local branch_prefix
558 + case ${PV} in
559 + 9999*)
560 + # trunk
561 + branch_prefix="trunk/KDE"
562 + ;;
563 + *)
564 + # branch
565 + branch_prefix="branches/KDE/$(get_kde_version)"
566 +
567 + if [[ ${PV} == ??.??.49.9999 && ${CATEGORY} = kde-apps ]]; then
568 + branch_prefix="branches/Applications/$(get_kde_version)"
569 + fi
570 +
571 + # @ECLASS-VARIABLE: ESVN_PROJECT_SUFFIX
572 + # @DESCRIPTION
573 + # Suffix appended to ESVN_PROJECT depending on fetched branch.
574 + # Defaults is empty (for -9999 = trunk), and "-${PV}" otherwise.
575 + ESVN_PROJECT_SUFFIX="-${PV}"
576 + ;;
577 + esac
578 + # @ECLASS-VARIABLE: ESVN_MIRROR
579 + # @DESCRIPTION:
580 + # This variable allows easy overriding of default kde mirror service
581 + # (anonsvn) with anything else you might want to use.
582 + ESVN_MIRROR=${ESVN_MIRROR:=svn://anonsvn.kde.org/home/kde}
583 + # Split ebuild, or extragear stuff
584 + if [[ -n ${KMNAME} ]]; then
585 + ESVN_PROJECT="${KMNAME}${ESVN_PROJECT_SUFFIX}"
586 + if [[ -z ${KMNOMODULE} ]] && [[ -z ${KMMODULE} ]]; then
587 + KMMODULE="${PN}"
588 + fi
589 + # Split kde-base/ ebuilds: (they reside in trunk/KDE)
590 + case ${KMNAME} in
591 + kdebase-*)
592 + ESVN_REPO_URI="${ESVN_MIRROR}/${branch_prefix}/kdebase/${KMNAME#kdebase-}"
593 + ;;
594 + kdelibs-*)
595 + ESVN_REPO_URI="${ESVN_MIRROR}/${branch_prefix}/kdelibs/${KMNAME#kdelibs-}"
596 + ;;
597 + kdereview*)
598 + ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}/${KMMODULE}"
599 + ;;
600 + kdesupport)
601 + ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}/${KMMODULE}"
602 + ESVN_PROJECT="${PN}${ESVN_PROJECT_SUFFIX}"
603 + ;;
604 + kde*)
605 + ESVN_REPO_URI="${ESVN_MIRROR}/${branch_prefix}/${KMNAME}"
606 + ;;
607 + extragear*|playground*)
608 + # Unpack them in toplevel dir, so that they won't conflict with kde4-meta
609 + # build packages from same svn location.
610 + ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}/${KMMODULE}"
611 + ESVN_PROJECT="${PN}${ESVN_PROJECT_SUFFIX}"
612 + ;;
613 + *)
614 + ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}/${KMMODULE}"
615 + ;;
616 + esac
617 + else
618 + # kdelibs, kdepimlibs
619 + ESVN_REPO_URI="${ESVN_MIRROR}/${branch_prefix}/${PN}"
620 + ESVN_PROJECT="${PN}${ESVN_PROJECT_SUFFIX}"
621 + fi
622 + # @ECLASS-VARIABLE: ESVN_UP_FREQ
623 + # @DESCRIPTION:
624 + # This variable is used for specifying the timeout between svn synces
625 + # for kde-base modules. Does not affect misc apps.
626 + # Default value is 1 hour.
627 + [[ ${KDEBASE} = kde-base ]] && ESVN_UP_FREQ=${ESVN_UP_FREQ:-1}
628 + ;;
629 + git)
630 + local _kmname
631 + # @ECLASS-VARIABLE: EGIT_MIRROR
632 + # @DESCRIPTION:
633 + # This variable allows easy overriding of default kde mirror service
634 + # (anongit) with anything else you might want to use.
635 + EGIT_MIRROR=${EGIT_MIRROR:=https://anongit.kde.org}
636 +
637 + # @ECLASS-VARIABLE: EGIT_REPONAME
638 + # @DESCRIPTION:
639 + # This variable allows overriding of default repository
640 + # name. Specify only if this differ from PN and KMNAME.
641 + if [[ -n ${EGIT_REPONAME} ]]; then
642 + # the repository and kmname different
643 + _kmname=${EGIT_REPONAME}
644 + elif [[ -n ${KMNAME} ]]; then
645 + _kmname=${KMNAME}
646 + else
647 + _kmname=${PN}
648 + fi
649 +
650 + # default branching
651 + [[ ${PV} != 4.9999* && ${PV} != 9999 && ${KDEBASE} == kde-base ]] && \
652 + EGIT_BRANCH="KDE/$(get_kde_version)"
653 +
654 + # Applications branching
655 + [[ ${PV} == ??.??.49.9999 && ${KDEBASE} == kde-base ]] && \
656 + EGIT_BRANCH="Applications/$(get_kde_version)"
657 +
658 + # default repo uri
659 + EGIT_REPO_URI+=( "${EGIT_MIRROR}/${_kmname}" )
660 +
661 + debug-print "${FUNCNAME}: Repository: ${EGIT_REPO_URI}"
662 + debug-print "${FUNCNAME}: Branch: ${EGIT_BRANCH}"
663 + ;;
664 + esac
665 +}
666 +
667 +case ${KDE_BUILD_TYPE} in
668 + live) _calculate_live_repo ;;
669 + *) _calculate_src_uri ;;
670 +esac
671 +
672 +debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: SRC_URI is ${SRC_URI}"
673 +
674 +# @ECLASS-VARIABLE: PREFIX
675 +# @DESCRIPTION:
676 +# Set the installation PREFIX for non kde-base applications. It defaults to /usr.
677 +# kde-base packages go into KDE4 installation directory (/usr).
678 +# No matter the PREFIX, package will be built against KDE installed in /usr.
679 +
680 +# @FUNCTION: kde4-base_pkg_setup
681 +# @DESCRIPTION:
682 +# Do some basic settings
683 +kde4-base_pkg_setup() {
684 + debug-print-function ${FUNCNAME} "$@"
685 +
686 + if has handbook ${IUSE} || has "+handbook" ${IUSE} && [[ "${KDE_HANDBOOK}" != optional ]] ; then
687 + eqawarn "Handbook support is enabled via KDE_HANDBOOK=optional in the ebuild."
688 + eqawarn "Please do not just set IUSE=handbook, as this leads to dependency errors."
689 + fi
690 +
691 + # Don't set KDEHOME during compilation, it will cause access violations
692 + unset KDEHOME
693 +
694 + KDEDIR=/usr
695 + : ${PREFIX:=/usr}
696 + EKDEDIR=${EPREFIX}/usr
697 +
698 + # Point to correct QT plugins path
699 + QT_PLUGIN_PATH="${EPREFIX}/usr/$(get_libdir)/kde4/plugins/"
700 +
701 + # Fix XDG collision with sandbox
702 + export XDG_CONFIG_HOME="${T}"
703 +}
704 +
705 +# @FUNCTION: kde4-base_src_unpack
706 +# @DESCRIPTION:
707 +# This function unpacks the source tarballs for KDE4 applications.
708 +kde4-base_src_unpack() {
709 + debug-print-function ${FUNCNAME} "$@"
710 +
711 + if [[ ${KDE_BUILD_TYPE} = live ]]; then
712 + case ${KDE_SCM} in
713 + svn)
714 + subversion_src_unpack
715 + ;;
716 + git)
717 + git-r3_src_unpack
718 + ;;
719 + esac
720 + else
721 + unpack ${A}
722 + fi
723 +}
724 +
725 +# @FUNCTION: kde4-base_src_prepare
726 +# @DESCRIPTION:
727 +# General pre-configure and pre-compile function for KDE4 applications.
728 +# It also handles translations if KDE_LINGUAS is defined. See KDE_LINGUAS and
729 +# enable_selected_linguas() and enable_selected_doc_linguas()
730 +# in kde4-functions.eclass(5) for further details.
731 +kde4-base_src_prepare() {
732 + debug-print-function ${FUNCNAME} "$@"
733 +
734 + # enable handbook and linguas only when not using live ebuild
735 +
736 + # Only enable selected languages, used for KDE extragear apps.
737 + if [[ -n ${KDE_LINGUAS} ]]; then
738 + enable_selected_linguas
739 + fi
740 +
741 + # Enable/disable handbooks for kde4-base packages
742 + # kde4-l10n inherits kde4-base but is metapackage, so no check for doc
743 + # kdelibs inherits kde4-base but handle installing the handbook itself
744 + if ! has kde4-meta ${INHERITED} && in_iuse handbook; then
745 + if [[ ${KDEBASE} == kde-base ]]; then
746 + if [[ ${PN} != kde4-l10n && ${PN} != kdepim-l10n && ${PN} != kdelibs ]] && use !handbook; then
747 + # documentation in kde4-functions
748 + : ${KDE_DOC_DIRS:=doc}
749 + local dir
750 + for dir in ${KDE_DOC_DIRS}; do
751 + sed -e "\!^[[:space:]]*add_subdirectory[[:space:]]*([[:space:]]*${dir}[[:space:]]*)!s/^/#DONOTCOMPILE /" \
752 + -e "\!^[[:space:]]*ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*${dir}[[:space:]]*)!s/^/#DONOTCOMPILE /" \
753 + -e "\!^[[:space:]]*macro_optional_add_subdirectory[[:space:]]*([[:space:]]*${dir}[[:space:]]*)!s/^/#DONOTCOMPILE /" \
754 + -e "\!^[[:space:]]*MACRO_OPTIONAL_ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*${dir}[[:space:]]*)!s/^/#DONOTCOMPILE /" \
755 + -i CMakeLists.txt || die "failed to comment out handbook"
756 + done
757 + fi
758 + else
759 + enable_selected_doc_linguas
760 + fi
761 + fi
762 +
763 + # SCM bootstrap
764 + if [[ ${KDE_BUILD_TYPE} = live ]]; then
765 + case ${KDE_SCM} in
766 + svn) subversion_src_prepare ;;
767 + esac
768 + fi
769 +
770 + # Apply patches, cmake-utils does the job already
771 + cmake-utils_src_prepare
772 +
773 + # Save library dependencies
774 + if [[ -n ${KMSAVELIBS} ]] ; then
775 + save_library_dependencies
776 + fi
777 +
778 + # Inject library dependencies
779 + if [[ -n ${KMLOADLIBS} ]] ; then
780 + load_library_dependencies
781 + fi
782 +
783 + # Hack for manuals relying on outdated DTD, only outside kde-base/...
784 + if [[ -z ${KDEBASE} ]]; then
785 + find "${S}" -name "*.docbook" \
786 + -exec sed -i -r \
787 + -e 's:-//KDE//DTD DocBook XML V4\.1(\..)?-Based Variant V1\.[01]//EN:-//KDE//DTD DocBook XML V4.2-Based Variant V1.1//EN:g' {} + \
788 + || die 'failed to fix DocBook variant version'
789 + fi
790 +}
791 +
792 +# @FUNCTION: kde4-base_src_configure
793 +# @DESCRIPTION:
794 +# Function for configuring the build of KDE4 applications.
795 +kde4-base_src_configure() {
796 + debug-print-function ${FUNCNAME} "$@"
797 +
798 + # Build tests in src_test only, where we override this value
799 + local cmakeargs=(-DKDE4_BUILD_TESTS=OFF)
800 +
801 + if use_if_iuse debug; then
802 + # Set "real" debug mode
803 + CMAKE_KDE_BUILD_TYPE="Debugfull"
804 + else
805 + # Handle common release builds
806 + append-cppflags -DQT_NO_DEBUG
807 + fi
808 +
809 + # Set distribution name
810 + [[ ${PN} = kdelibs ]] && cmakeargs+=(-DKDE_DISTRIBUTION_TEXT=Gentoo)
811 +
812 + # Here we set the install prefix
813 + tc-is-cross-compiler || cmakeargs+=(-DCMAKE_INSTALL_PREFIX="${EPREFIX}${PREFIX}")
814 +
815 + # Use colors
816 + QTEST_COLORED=1
817 +
818 + # Shadow existing installations
819 + unset KDEDIRS
820 +
821 + #qmake -query QT_INSTALL_LIBS unavailable when cross-compiling
822 + tc-is-cross-compiler && cmakeargs+=(-DQT_LIBRARY_DIR=${ROOT}/usr/$(get_libdir)/qt4)
823 + #kde-config -path data unavailable when cross-compiling
824 + tc-is-cross-compiler && cmakeargs+=(-DKDE4_DATA_DIR=${ROOT}/usr/share/apps/)
825 +
826 + # sysconf needs to be /etc, not /usr/etc
827 + cmakeargs+=(-DSYSCONF_INSTALL_DIR="${EPREFIX}"/etc)
828 +
829 + if [[ $(declare -p mycmakeargs 2>&-) != "declare -a mycmakeargs="* ]]; then
830 + if [[ ${mycmakeargs} ]]; then
831 + eqawarn "mycmakeargs should always be declared as an array, not a string"
832 + fi
833 + mycmakeargs=(${mycmakeargs})
834 + fi
835 +
836 + mycmakeargs=("${cmakeargs[@]}" "${mycmakeargs[@]}")
837 +
838 + cmake-utils_src_configure
839 +}
840 +
841 +# @FUNCTION: kde4-base_src_compile
842 +# @DESCRIPTION:
843 +# General function for compiling KDE4 applications.
844 +kde4-base_src_compile() {
845 + debug-print-function ${FUNCNAME} "$@"
846 +
847 + cmake-utils_src_compile "$@"
848 +}
849 +
850 +# @FUNCTION: kde4-base_src_test
851 +# @DESCRIPTION:
852 +# Function for testing KDE4 applications.
853 +kde4-base_src_test() {
854 + debug-print-function ${FUNCNAME} "$@"
855 +
856 + local kded4_pid
857 +
858 + _test_runner() {
859 + if [[ -n "${VIRTUALDBUS_TEST}" ]]; then
860 + export $(dbus-launch)
861 + kded4 2>&1 > /dev/null &
862 + kded4_pid=$!
863 + fi
864 +
865 + cmake-utils_src_test
866 + }
867 +
868 + # When run as normal user during ebuild development with the ebuild command, the
869 + # kde tests tend to access the session DBUS. This however is not possible in a real
870 + # emerge or on the tinderbox.
871 + # > make sure it does not happen, so bad tests can be recognized and disabled
872 + unset DBUS_SESSION_BUS_ADDRESS DBUS_SESSION_BUS_PID
873 +
874 + # Override this value, set in kde4-base_src_configure()
875 + mycmakeargs+=(-DKDE4_BUILD_TESTS=ON)
876 + cmake-utils_src_configure
877 + kde4-base_src_compile
878 +
879 + if [[ ${VIRTUALX_REQUIRED} == always || ${VIRTUALX_REQUIRED} == test ]]; then
880 + # check for sanity if anyone already redefined VIRTUALX_COMMAND from the default
881 + if [[ ${VIRTUALX_COMMAND} != emake ]]; then
882 + # surprise- we are already INSIDE virtualmake!!!
883 + debug-print "QA Notice: This version of kde4-base.eclass includes the virtualx functionality."
884 + debug-print " You may NOT set VIRTUALX_COMMAND or call virtualmake from the ebuild."
885 + debug-print " Setting VIRTUALX_REQUIRED is completely sufficient. See the"
886 + debug-print " kde4-base.eclass docs for details... Applying workaround."
887 + _test_runner
888 + else
889 + virtx _test_runner
890 + fi
891 + else
892 + _test_runner
893 + fi
894 +
895 + if [ -n "${kded4_pid}" ] ; then
896 + kill ${kded4_pid}
897 + fi
898 +
899 + if [ -n "${DBUS_SESSION_BUS_PID}" ] ; then
900 + kill ${DBUS_SESSION_BUS_PID}
901 + fi
902 +}
903 +
904 +# @FUNCTION: kde4-base_src_install
905 +# @DESCRIPTION:
906 +# Function for installing KDE4 applications.
907 +kde4-base_src_install() {
908 + debug-print-function ${FUNCNAME} "$@"
909 +
910 + if [[ -n ${KMSAVELIBS} ]] ; then
911 + install_library_dependencies
912 + fi
913 +
914 + # Install common documentation of KDE4 applications
915 + local doc
916 + if ! has kde4-meta ${INHERITED}; then
917 + for doc in "${S}"/{AUTHORS,CHANGELOG,ChangeLog*,README*,NEWS,TODO,HACKING}; do
918 + [[ -f ${doc} && -s ${doc} ]] && dodoc "${doc}"
919 + done
920 + for doc in "${S}"/*/{AUTHORS,CHANGELOG,ChangeLog*,README*,NEWS,TODO,HACKING}; do
921 + [[ -f ${doc} && -s ${doc} ]] && newdoc "${doc}" "$(basename $(dirname ${doc})).$(basename ${doc})"
922 + done
923 + fi
924 +
925 + cmake-utils_src_install
926 +
927 + # We don't want ${PREFIX}/share/doc/HTML to be compressed,
928 + # because then khelpcenter can't find the docs
929 + [[ -d ${ED}/${PREFIX}/share/doc/HTML ]] &&
930 + docompress -x ${PREFIX}/share/doc/HTML
931 +}
932 +
933 +# @FUNCTION: kde4-base_pkg_preinst
934 +# @DESCRIPTION:
935 +# Function storing icon caches
936 +kde4-base_pkg_preinst() {
937 + debug-print-function ${FUNCNAME} "$@"
938 +
939 + gnome2_icon_savelist
940 + if [[ ${KDE_BUILD_TYPE} == live && ${KDE_SCM} == svn ]]; then
941 + subversion_pkg_preinst
942 + fi
943 +}
944 +
945 +# @FUNCTION: kde4-base_pkg_postinst
946 +# @DESCRIPTION:
947 +# Function to rebuild the KDE System Configuration Cache after an application has been installed.
948 +kde4-base_pkg_postinst() {
949 + debug-print-function ${FUNCNAME} "$@"
950 +
951 + if [[ -n ${GNOME2_ECLASS_ICONS} ]]; then
952 + gnome2_icon_cache_update
953 + fi
954 + xdg_desktop_database_update
955 + xdg_mimeinfo_database_update
956 + buildsycoca
957 +
958 + if [[ -z ${I_KNOW_WHAT_I_AM_DOING} ]]; then
959 + if [[ ${KDE_BUILD_TYPE} = live ]]; then
960 + echo
961 + einfo "WARNING! This is an experimental live ebuild of ${CATEGORY}/${PN}"
962 + einfo "Use it at your own risk."
963 + einfo "Do _NOT_ file bugs at bugs.gentoo.org because of this ebuild!"
964 + echo
965 + fi
966 + fi
967 +}
968 +
969 +# @FUNCTION: kde4-base_pkg_postrm
970 +# @DESCRIPTION:
971 +# Function to rebuild the KDE System Configuration Cache after an application has been removed.
972 +kde4-base_pkg_postrm() {
973 + debug-print-function ${FUNCNAME} "$@"
974 +
975 + if [[ -n ${GNOME2_ECLASS_ICONS} ]]; then
976 + gnome2_icon_cache_update
977 + fi
978 + xdg_desktop_database_update
979 + xdg_mimeinfo_database_update
980 + buildsycoca
981 +}
982 +
983 +fi
984
985 diff --git a/eclass/kde4-functions.eclass b/eclass/kde4-functions.eclass
986 new file mode 100644
987 index 0000000..98f972c
988 --- /dev/null
989 +++ b/eclass/kde4-functions.eclass
990 @@ -0,0 +1,431 @@
991 +# Copyright 1999-2016 Gentoo Foundation
992 +# Distributed under the terms of the GNU General Public License v2
993 +
994 +# @DEAD
995 +# Removal on 2018-05-03.
996 +# @ECLASS: kde4-functions.eclass
997 +# @MAINTAINER:
998 +# kde@g.o
999 +# @BLURB: Common ebuild functions for KDE 4 packages
1000 +# @DESCRIPTION:
1001 +# This eclass contains all functions shared by the different eclasses,
1002 +# for KDE 4 ebuilds.
1003 +
1004 +if [[ -z ${_KDE4_FUNCTIONS_ECLASS} ]]; then
1005 +_KDE4_FUNCTIONS_ECLASS=1
1006 +
1007 +inherit versionator
1008 +
1009 +# @ECLASS-VARIABLE: EAPI
1010 +# @DESCRIPTION:
1011 +# Currently kde4 eclasses support EAPI 5 and 6.
1012 +case ${EAPI} in
1013 + 5|6) : ;;
1014 + *) die "EAPI=${EAPI:-0} is not supported" ;;
1015 +esac
1016 +
1017 +# @ECLASS-VARIABLE: KDE_OVERRIDE_MINIMAL
1018 +# @DESCRIPTION:
1019 +# For use only in very few well-defined cases; normally it should be unset.
1020 +# If this variable is set, all calls to add_kdebase_dep return a dependency on
1021 +# at least this version, independent of the version of the package itself.
1022 +# If you know exactly that one specific NEW KDE component builds and runs fine
1023 +# with all the rest of KDE at an OLDER version, you can set this old version here.
1024 +# Warning- may lead to general instability and kill your pet targh.
1025 +
1026 +# @ECLASS-VARIABLE: KDEBASE
1027 +# @DESCRIPTION:
1028 +# This gets set to a non-zero value when a package is considered a kde or
1029 +# kdevelop ebuild.
1030 +if [[ ${CATEGORY} = kde-base || ${CATEGORY} == kde-plasma || ${CATEGORY} = kde-apps || ${CATEGORY} = kde-frameworks ]]; then
1031 + debug-print "${ECLASS}: KDEBASE ebuild recognized"
1032 + KDEBASE=kde-base
1033 +elif [[ ${KMNAME-${PN}} = kdevelop ]]; then
1034 + KDEBASE=kdevelop
1035 +fi
1036 +
1037 +debug-print "${ECLASS}: ${KDEBASE} ebuild recognized"
1038 +
1039 +# determine the build type
1040 +if [[ ${PV} = *9999* ]]; then
1041 + KDE_BUILD_TYPE="live"
1042 +else
1043 + KDE_BUILD_TYPE="release"
1044 +fi
1045 +export KDE_BUILD_TYPE
1046 +
1047 +# Set reponame and SCM for modules that have fully migrated to git
1048 +# (hack - it's here because it needs to be before SCM inherits from kde4-base)
1049 +if [[ ${KDE_BUILD_TYPE} == live ]]; then
1050 + case "${KMNAME}" in
1051 + kdebase-workspace)
1052 + EGIT_REPONAME=${EGIT_REPONAME:=kde-workspace}
1053 + ;;
1054 + kdebase-runtime)
1055 + EGIT_REPONAME=${EGIT_REPONAME:=kde-runtime}
1056 + ;;
1057 + esac
1058 +fi
1059 +
1060 +# @ECLASS-VARIABLE: KDE_SCM
1061 +# @DESCRIPTION:
1062 +# If this is a live package which scm does it use
1063 +# Everything else uses git by default
1064 +KDE_SCM="${KDE_SCM:-git}"
1065 +case ${KDE_SCM} in
1066 + svn|git) ;;
1067 + *) die "KDE_SCM: ${KDE_SCM} is not supported" ;;
1068 +esac
1069 +
1070 +# @FUNCTION: kde4_lingua_to_l10n
1071 +# @USAGE: <lingua>...
1072 +# @INTERNAL
1073 +# @DESCRIPTION:
1074 +# Output l10n flag name(s) (without prefix(es)) appropriate for given KDE
1075 +# locale(s).
1076 +kde4_lingua_to_l10n() {
1077 + local l
1078 + for l; do
1079 + case ${l} in
1080 + ca@valencia) echo ca-valencia;;
1081 + sr@ijekavian) echo sr-ijekavsk;;
1082 + sr@ijekavianlatin) echo sr-Latn-ijekavsk;;
1083 + sr@latin|sr@Latn) echo sr-Latn;;
1084 + uz@cyrillic) echo uz-Cyrl;;
1085 + *@*) die "${FUNCNAME}: Unhandled KDE_LINGUAS: ${l}";;
1086 + *) echo "${l/_/-}";;
1087 + esac
1088 + done
1089 +}
1090 +
1091 +# @ECLASS-VARIABLE: KDE_LINGUAS
1092 +# @DESCRIPTION:
1093 +# This is a whitespace-separated list of translations this ebuild supports.
1094 +# These translations are automatically added to IUSE. Therefore ebuilds must set
1095 +# this variable before inheriting any eclasses. To enable only selected
1096 +# translations, ebuilds must call enable_selected_linguas(). kde4-{base,meta}.eclass does
1097 +# this for you.
1098 +#
1099 +# Example: KDE_LINGUAS="de en_GB nl"
1100 +if [[ ${KDE_BUILD_TYPE} != live || -n ${KDE_LINGUAS_LIVE_OVERRIDE} ]]; then
1101 + for _lingua in $(kde4_lingua_to_l10n ${KDE_LINGUAS}); do
1102 + IUSE="${IUSE} l10n_${_lingua}"
1103 + done
1104 +fi
1105 +
1106 +# @FUNCTION: buildsycoca
1107 +# @DESCRIPTION:
1108 +# Function to rebuild the KDE System Configuration Cache.
1109 +# All KDE ebuilds should run this in pkg_postinst and pkg_postrm.
1110 +buildsycoca() {
1111 + debug-print-function ${FUNCNAME} "$@"
1112 +
1113 + # We no longer need to run kbuildsycoca4, as kded does that automatically, as needed
1114 +
1115 + # fix permission for some directories
1116 + for x in usr/share/{config,kde4}; do
1117 + DIRS=${EROOT}usr
1118 + [[ -d "${EROOT}${x}" ]] || break # nothing to do if directory does not exist
1119 + # fixes Bug 318237
1120 + if use userland_BSD ; then
1121 + [[ $(stat -f %p "${EROOT}${x}") != 40755 ]]
1122 + local stat_rtn="$?"
1123 + else
1124 + [[ $(stat --format=%a "${EROOT}${x}") != 755 ]]
1125 + local stat_rtn=$?
1126 + fi
1127 + if [[ $stat_rtn != 1 ]] ; then
1128 + ewarn "QA Notice:"
1129 + ewarn "Package ${PN} is breaking ${EROOT}${x} permissions."
1130 + ewarn "Please report this issue to gentoo bugzilla."
1131 + einfo "Permissions will get adjusted automatically now."
1132 + find "${EROOT}${x}" -type d -print0 | xargs -0 chmod 755
1133 + fi
1134 + done
1135 +}
1136 +
1137 +# @FUNCTION: comment_all_add_subdirectory
1138 +# @USAGE: [list of directory names]
1139 +# @DESCRIPTION:
1140 +# Recursively comment all add_subdirectory instructions in listed directories,
1141 +# except those in cmake/.
1142 +comment_all_add_subdirectory() {
1143 + find "$@" -name CMakeLists.txt -print0 | grep -vFzZ "./cmake" | \
1144 + xargs -0 sed -i \
1145 + -e '/^[[:space:]]*add_subdirectory/s/^/#DONOTCOMPILE /' \
1146 + -e '/^[[:space:]]*ADD_SUBDIRECTORY/s/^/#DONOTCOMPILE /' \
1147 + -e '/^[[:space:]]*macro_optional_add_subdirectory/s/^/#DONOTCOMPILE /' \
1148 + -e '/^[[:space:]]*MACRO_OPTIONAL_ADD_SUBDIRECTORY/s/^/#DONOTCOMPILE /' \
1149 + || die "${LINENO}: Initial sed died"
1150 +}
1151 +
1152 +# @FUNCTION: enable_selected_linguas
1153 +# @DESCRIPTION:
1154 +# Enable translations based on L10N settings and translations supported by
1155 +# the package (see KDE_LINGUAS). By default, translations are found in "${S}"/po
1156 +# but this default can be overridden by defining KDE_LINGUAS_DIR.
1157 +enable_selected_linguas() {
1158 + debug-print-function ${FUNCNAME} "$@"
1159 +
1160 + local x
1161 +
1162 + # @ECLASS-VARIABLE: KDE_LINGUAS_DIR
1163 + # @DESCRIPTION:
1164 + # Specified folder where application translations are located.
1165 + # Can be defined as array of folders where translations are located.
1166 + # Note that space separated list of dirs is not supported.
1167 + # Default value is set to "po".
1168 + if [[ "$(declare -p KDE_LINGUAS_DIR 2>/dev/null 2>&1)" == "declare -a"* ]]; then
1169 + debug-print "$FUNCNAME: we have these subfolders defined: ${KDE_LINGUAS_DIR}"
1170 + for x in ${KDE_LINGUAS_DIR[@]}; do
1171 + _enable_selected_linguas_dir ${x}
1172 + done
1173 + else
1174 + KDE_LINGUAS_DIR=${KDE_LINGUAS_DIR:="po"}
1175 + _enable_selected_linguas_dir ${KDE_LINGUAS_DIR}
1176 + fi
1177 +}
1178 +
1179 +# @FUNCTION: enable_selected_doc_linguas
1180 +# @DESCRIPTION:
1181 +# Enable only selected L10N enabled doc folders.
1182 +enable_selected_doc_linguas() {
1183 + debug-print-function ${FUNCNAME} "$@"
1184 +
1185 + # @ECLASS-VARIABLE: KDE_DOC_DIRS
1186 + # @DESCRIPTION:
1187 + # Variable specifying whitespace separated patterns for documentation locations.
1188 + # Default is "doc/%lingua"
1189 + KDE_DOC_DIRS=${KDE_DOC_DIRS:='doc/%lingua'}
1190 + local linguas
1191 + for pattern in ${KDE_DOC_DIRS}; do
1192 +
1193 + local handbookdir=`dirname ${pattern}`
1194 + local translationdir=`basename ${pattern}`
1195 + # Do filename pattern supplied, treat as directory
1196 + [[ ${handbookdir} = '.' ]] && handbookdir=${translationdir} && translationdir=
1197 + [[ -d ${handbookdir} ]] || die 'wrong doc dir specified'
1198 +
1199 + if ! use handbook; then
1200 + # Disable whole directory
1201 + sed -e "/add_subdirectory[[:space:]]*([[:space:]]*${handbookdir}[[:space:]]*)/s/^/#DONOTCOMPILE /" \
1202 + -e "/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*${handbookdir}[[:space:]]*)/s/^/#DONOTCOMPILE /" \
1203 + -i CMakeLists.txt || die 'failed to comment out all handbooks'
1204 + else
1205 + # Disable subdirectories recursively
1206 + comment_all_add_subdirectory "${handbookdir}"
1207 +
1208 + # In certain packages, the default handbook is en_US instead of the usual en. Since there is no en_US 'translation',
1209 + # it makes no sense to add to KDE_LINGUAS which causes this type of handbook to not be installed.
1210 + if [[ -d "${handbookdir}/en_US" && ! -d "${handbookdir}/en" ]]; then
1211 + mv "${handbookdir}/en_US" "${handbookdir}/en" || die
1212 + sed -e "s/en_US/en/" -i "${handbookdir}/CMakeLists.txt"
1213 + fi
1214 +
1215 + # Add requested translations
1216 + local lingua
1217 + for lingua in en ${KDE_LINGUAS}; do
1218 + if [[ ${lingua} = en ]] || use "l10n_$(kde4_lingua_to_l10n "${lingua}")"; then
1219 + if [[ -d ${handbookdir}/${translationdir//%lingua/${lingua}} ]]; then
1220 + sed -e "/add_subdirectory[[:space:]]*([[:space:]]*${translationdir//%lingua/${lingua}}/s/^#DONOTCOMPILE //" \
1221 + -e "/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*${translationdir//%lingua/${lingua}}/s/^#DONOTCOMPILE //" \
1222 + -i "${handbookdir}"/CMakeLists.txt && ! has ${lingua} ${linguas} && linguas="${linguas} ${lingua}"
1223 + fi
1224 + fi
1225 + done
1226 + fi
1227 +
1228 + done
1229 + [[ -n "${linguas}" ]] && einfo "Enabling handbook translations:${linguas}"
1230 +}
1231 +
1232 +# Functions handling KMLOADLIBS and KMSAVELIBS
1233 +
1234 +# @FUNCTION: save_library_dependencies
1235 +# @DESCRIPTION:
1236 +# Add exporting CMake dependencies for current package
1237 +save_library_dependencies() {
1238 + local depsfile="${T}/${PN}"
1239 +
1240 + ebegin "Saving library dependencies in ${depsfile##*/}"
1241 + echo "EXPORT_LIBRARY_DEPENDENCIES(\"${depsfile}\")" >> "${S}/CMakeLists.txt" || \
1242 + die "Failed to save the library dependencies."
1243 + eend $?
1244 +}
1245 +
1246 +# @FUNCTION: install_library_dependencies
1247 +# @DESCRIPTION:
1248 +# Install generated CMake library dependencies to /var/lib/kde
1249 +install_library_dependencies() {
1250 + local depsfile="${T}/${PN}"
1251 +
1252 + ebegin "Installing library dependencies as ${depsfile##*/}"
1253 + insinto /var/lib/kde
1254 + doins "${depsfile}" || die "Failed to install library dependencies."
1255 + eend $?
1256 +}
1257 +
1258 +# @FUNCTION: load_library_dependencies
1259 +# @DESCRIPTION:
1260 +# Inject specified library dependencies in current package
1261 +load_library_dependencies() {
1262 + local pn i depsfile
1263 + ebegin "Injecting library dependencies from '${KMLOADLIBS}'"
1264 +
1265 + i=0
1266 + for pn in ${KMLOADLIBS} ; do
1267 + ((i++))
1268 + depsfile="${EPREFIX}/var/lib/kde/${pn}"
1269 + [[ -r ${depsfile} ]] || depsfile="${EPREFIX}/var/lib/kde/${pn}:$(get_kde_version)"
1270 + [[ -r ${depsfile} ]] || die "Depsfile '${depsfile}' not accessible. You probably need to reinstall ${pn}."
1271 + sed -i -e "${i}iINCLUDE(\"${depsfile}\")" "${S}/CMakeLists.txt" || \
1272 + die "Failed to include library dependencies for ${pn}"
1273 + done
1274 + eend $?
1275 +}
1276 +
1277 +# @FUNCTION: add_kdeapps_dep
1278 +# @DESCRIPTION:
1279 +# Create proper dependency for kde-apps/ dependencies.
1280 +# This takes 1 to 3 arguments. The first being the package name, the optional
1281 +# second is additional USE flags to append, and the optional third is the
1282 +# version to use instead of the automatic version (use sparingly).
1283 +# The output of this should be added directly to DEPEND/RDEPEND, and may be
1284 +# wrapped in a USE conditional (but not an || conditional without an extra set
1285 +# of parentheses).
1286 +add_kdeapps_dep() {
1287 + debug-print-function ${FUNCNAME} "$@"
1288 +
1289 + local ver
1290 +
1291 + if [[ -n ${2} ]] ; then
1292 + local use="[${2}]"
1293 + fi
1294 +
1295 + if [[ -n ${3} ]]; then
1296 + ver=${3}
1297 + elif [[ -n ${KDE_OVERRIDE_MINIMAL} ]]; then
1298 + ver=${KDE_OVERRIDE_MINIMAL}
1299 + elif [[ ${KDEBASE} != kde-base ]]; then
1300 + ver=${KDE_MINIMAL}
1301 + # if building kde-apps, live master or stable-live branch,
1302 + # use the final SC version since there are no further general releases.
1303 + # except when it is kdepim split packages, which rely on same-version deps
1304 + elif [[ ${CATEGORY} == kde-apps || ${PV} == *9999 ]] && [[ ${KMNAME} != "kdepim" ]]; then
1305 + ver=4.14.3
1306 + else
1307 + ver=${PV}
1308 + fi
1309 +
1310 + [[ -z ${1} ]] && die "Missing parameter"
1311 +
1312 + echo " >=kde-apps/${1}-${ver}:4${use}"
1313 +}
1314 +
1315 +# @FUNCTION: add_kdebase_dep
1316 +# @DESCRIPTION:
1317 +# Create proper dependency for kde-base/ dependencies.
1318 +# This takes 1 to 3 arguments. The first being the package name, the optional
1319 +# second is additional USE flags to append, and the optional third is the
1320 +# version to use instead of the automatic version (use sparingly).
1321 +# The output of this should be added directly to DEPEND/RDEPEND, and may be
1322 +# wrapped in a USE conditional (but not an || conditional without an extra set
1323 +# of parentheses).
1324 +add_kdebase_dep() {
1325 + debug-print-function ${FUNCNAME} "$@"
1326 +
1327 + local ver
1328 +
1329 + if [[ -n ${2} ]] ; then
1330 + local use="[${2}]"
1331 + fi
1332 +
1333 + if [[ -n ${3} ]]; then
1334 + ver=${3}
1335 + elif [[ -n ${KDE_OVERRIDE_MINIMAL} ]]; then
1336 + ver=${KDE_OVERRIDE_MINIMAL}
1337 + elif [[ ${KDEBASE} != kde-base ]]; then
1338 + ver=${KDE_MINIMAL}
1339 + # if building live master or kde-apps, use the final SC version
1340 + # since there are no further general releases.
1341 + elif [[ ${CATEGORY} == kde-apps || ${PV} == 9999 ]]; then
1342 + ver=4.14.3
1343 + # if building a live version branch (eg. 4.11.49.9999) use the major version
1344 + elif [[ ${PV} == *.9999 ]]; then
1345 + ver=$(get_kde_version)
1346 + else
1347 + ver=${PV}
1348 + fi
1349 +
1350 + [[ -z ${1} ]] && die "Missing parameter"
1351 +
1352 + echo " >=kde-base/${1}-${ver}:4${use}"
1353 +}
1354 +
1355 +# local function to enable specified translations for specified directory
1356 +# used from kde4-functions_enable_selected_linguas function
1357 +_enable_selected_linguas_dir() {
1358 + local lingua linguas sr_mess wp
1359 + local dir=${1}
1360 +
1361 + [[ -d ${dir} ]] || die "linguas dir \"${dir}\" does not exist"
1362 + comment_all_add_subdirectory "${dir}"
1363 + pushd "${dir}" > /dev/null || die
1364 +
1365 + # fix all various crazy sr@Latn variations
1366 + # this part is only ease for ebuilds, so there wont be any die when this
1367 + # fail at any point
1368 + sr_mess="sr@latn sr@latin sr@Latin"
1369 + for wp in ${sr_mess}; do
1370 + [[ -e ${wp}.po ]] && mv "${wp}.po" "sr@××××.po"
1371 + if [[ -d ${wp} ]]; then
1372 + # move dir and fix cmakelists
1373 + mv "${wp}" "sr@Latn"
1374 + sed -i \
1375 + -e "s:${wp}:sr@Latn:g" \
1376 + CMakeLists.txt
1377 + fi
1378 + done
1379 +
1380 + for lingua in ${KDE_LINGUAS}; do
1381 + if [[ -e ${lingua}.po ]]; then
1382 + mv "${lingua}.po" "${lingua}.po.old"
1383 + fi
1384 + done
1385 +
1386 + for lingua in ${KDE_LINGUAS}; do
1387 + if use "l10n_$(kde4_lingua_to_l10n ${lingua})" ; then
1388 + if [[ -d ${lingua} ]]; then
1389 + linguas="${linguas} ${lingua}"
1390 + sed -e "/add_subdirectory([[:space:]]*${lingua}[[:space:]]*)[[:space:]]*$/ s/^#DONOTCOMPILE //" \
1391 + -e "/ADD_SUBDIRECTORY([[:space:]]*${lingua}[[:space:]]*)[[:space:]]*$/ s/^#DONOTCOMPILE //" \
1392 + -i CMakeLists.txt || die "Sed to uncomment linguas_${lingua} failed."
1393 + fi
1394 + if [[ -e ${lingua}.po.old ]]; then
1395 + linguas="${linguas} ${lingua}"
1396 + mv "${lingua}.po.old" "${lingua}.po"
1397 + fi
1398 + fi
1399 + done
1400 + [[ -n ${linguas} ]] && echo ">>> Enabling languages: ${linguas}"
1401 +
1402 + popd > /dev/null || die
1403 +}
1404 +
1405 +# @FUNCTION: get_kde_version
1406 +# @DESCRIPTION:
1407 +# Translates an ebuild version into a major.minor KDE SC
1408 +# release version. If no version is specified, ${PV} is used.
1409 +get_kde_version() {
1410 + local ver=${1:-${PV}}
1411 + local major=$(get_major_version ${ver})
1412 + local minor=$(get_version_component_range 2 ${ver})
1413 + local micro=$(get_version_component_range 3 ${ver})
1414 + if [[ ${ver} == 9999 ]]; then
1415 + echo live
1416 + else
1417 + (( micro < 50 )) && echo ${major}.${minor} || echo ${major}.$((minor + 1))
1418 + fi
1419 +}
1420 +
1421 +fi
1422
1423 diff --git a/eclass/kde4-meta.eclass b/eclass/kde4-meta.eclass
1424 new file mode 100644
1425 index 0000000..88d9ef8
1426 --- /dev/null
1427 +++ b/eclass/kde4-meta.eclass
1428 @@ -0,0 +1,631 @@
1429 +# Copyright 1999-2016 Gentoo Foundation
1430 +# Distributed under the terms of the GNU General Public License v2
1431 +#
1432 +# @DEAD
1433 +# Removal on 2018-03-06.
1434 +# @ECLASS: kde4-meta.eclass
1435 +# @MAINTAINER:
1436 +# kde@g.o
1437 +# @BLURB: Eclass for writing "split" KDE packages.
1438 +# @DESCRIPTION:
1439 +# This eclass provides all necessary functions for writing split KDE ebuilds.
1440 +#
1441 +# You must define KMNAME to use this eclass, and do so before inheriting it. All other variables are optional.
1442 +# Do not include the same item in more than one of KMMODULE, KMMEXTRA, KMCOMPILEONLY, KMEXTRACTONLY.
1443 +
1444 +if [[ -z ${_KDE4_META_ECLASS} ]]; then
1445 +_KDE4_META_ECLASS=1
1446 +
1447 +[[ -z ${KMNAME} ]] && die "kde4-meta.eclass inherited but KMNAME not defined - broken ebuild"
1448 +
1449 +inherit kde4-base
1450 +
1451 +KDEMETA_EXPF="pkg_setup src_unpack src_prepare src_configure src_compile src_test src_install pkg_preinst pkg_postinst pkg_postrm"
1452 +EXPORT_FUNCTIONS ${KDEMETA_EXPF}
1453 +
1454 +# Add dependencies that all packages in a certain module share.
1455 +case ${KMNAME} in
1456 + kdepim|kdepim-runtime)
1457 + case ${PN} in
1458 + akregator|kaddressbook|kjots|kmail|knode|knotes|korganizer|ktimetracker)
1459 + IUSE+=" +kontact"
1460 + RDEPEND+=" kontact? ( $(add_kdeapps_dep kontact '' ${PV}) )"
1461 + ;;
1462 + esac
1463 + ;;
1464 +esac
1465 +
1466 +DEPEND+=" ${COMMONDEPEND}"
1467 +RDEPEND+=" ${COMMONDEPEND}"
1468 +unset COMMONDEPEND
1469 +
1470 +debug-print "line ${LINENO} ${ECLASS}: DEPEND ${DEPEND} - after metapackage-specific dependencies"
1471 +debug-print "line ${LINENO} ${ECLASS}: RDEPEND ${RDEPEND} - after metapackage-specific dependencies"
1472 +
1473 +# Useful to build kde4-meta style stuff from extragear/playground (plasmoids etc)
1474 +case ${KDE_BUILD_TYPE} in
1475 + live)
1476 + if [[ ${KDE_SCM} == svn ]]; then
1477 + case ${KMNAME} in
1478 + extragear*|playground*)
1479 + ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}"
1480 + ESVN_PROJECT="${KMNAME}${ESVN_PROJECT_SUFFIX}"
1481 + ;;
1482 + esac
1483 + fi
1484 + ;;
1485 +esac
1486 +
1487 +# @ECLASS-VARIABLE: KMNAME
1488 +# @DESCRIPTION:
1489 +# Name of the parent-module (e.g. kdebase, kdepim, ...). You _must_ set it
1490 +# _before_ inheriting this eclass, (unlike the other parameters), since it's
1491 +# used to set $SRC_URI.
1492 +
1493 +# @ECLASS-VARIABLE: KMMODULE
1494 +# @DESCRIPTION:
1495 +# Specify exactly one subdirectory of $KMNAME here. Defaults to $PN.
1496 +# The subdirectory listed here is treated exactly like items in $KMEXTRA.
1497 +#
1498 +# Example: The ebuild name of "kdebase/l10n" is kde-base/kdebase-l10n, because
1499 +# just 'l10n' would be too confusing. Hence it sets KMMODULE="l10n".
1500 +
1501 +# @ECLASS-VARIABLE: KMNOMODULE
1502 +# @DESCRIPTION:
1503 +# If set to "true", $KMMODULE doesn't have to be defined.
1504 +#
1505 +# Example usage: If you're installing subdirectories of a package, like plugins,
1506 +# you mark the top subdirectory (containing the package) as $KMEXTRACTONLY, and
1507 +# set KMNOMODULE="true".
1508 +if [[ -z ${KMMODULE} ]] && [[ ${KMNOMODULE} != true ]]; then
1509 + KMMODULE=${PN}
1510 +fi
1511 +
1512 +# @ECLASS-VARIABLE: KMEXTRA
1513 +# @DESCRIPTION:
1514 +# All subdirectories listed here will be extracted, compiled & installed.
1515 +# $KMMODULE is always added to $KMEXTRA.
1516 +# If KDE_HANDBOOK is 'always' or 'optional' and handbook USE-flag is set, and if this
1517 +# directory exists, then "doc/$KMMODULE" is added to $KMEXTRA. If there's additional
1518 +# documentation in different subdirectories, it should be added to KMEXTRA manually..
1519 +
1520 +# @ECLASS-VARIABLE: KMCOMPILEONLY
1521 +# @DESCRIPTION:
1522 +# All subdirectories listed here will be extracted & compiled, but not installed.
1523 +
1524 +# TODO: better formulation may be needed
1525 +# @ECLASS-VARIABLE: KMEXTRACTONLY
1526 +# @DESCRIPTION:
1527 +# All subdirectories listed here will be extracted, but neither compiled nor installed.
1528 +# This can be used to avoid compilation in a subdirectory of a directory in $KMMODULE or $KMEXTRA
1529 +
1530 +# @ECLASS-VARIABLE: KMTARPARAMS
1531 +# @DESCRIPTION:
1532 +# Specify extra parameters to pass to tar, in kde4-meta_src_extract.
1533 +# '-xpf -j' are passed to tar by default.
1534 +
1535 +# @FUNCTION: kde4-meta_pkg_setup
1536 +# @DESCRIPTION:
1537 +# Currently calls its equivalent in kde4-base.eclass(5) and checks the gcc version.
1538 +# Use this one in split ebuilds.
1539 +kde4-meta_pkg_setup() {
1540 + debug-print-function ${FUNCNAME} "$@"
1541 +
1542 + kde4-base_pkg_setup
1543 +}
1544 +
1545 +# @FUNCTION: kde4-meta_src_unpack
1546 +# @DESCRIPTION:
1547 +# This function unpacks the source for split ebuilds.
1548 +# Further more is processed in kde4-meta_src_extract
1549 +kde4-meta_src_unpack() {
1550 + debug-print-function ${FUNCNAME} "$@"
1551 +
1552 + if [[ ${KDE_BUILD_TYPE} = live ]]; then
1553 + case "${KDE_SCM}" in
1554 + svn)
1555 + S="${WORKDIR}/${P}"
1556 + mkdir -p "${S}"
1557 + ESVN_RESTRICT="export" subversion_src_unpack
1558 + subversion_wc_info
1559 + subversion_bootstrap
1560 + ;;
1561 + git)
1562 + git-r3_src_unpack
1563 + ;;
1564 + esac
1565 + fi
1566 + kde4-meta_src_extract
1567 +}
1568 +
1569 +# @FUNCTION: kde4-meta_src_extract
1570 +# @DESCRIPTION:
1571 +# A function to extract the source for a split KDE ebuild.
1572 +# Also see KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY, KMEXTRACTONLY and
1573 +# KMTARPARAMS.
1574 +kde4-meta_src_extract() {
1575 + debug-print-function ${FUNCNAME} "$@"
1576 +
1577 + if [[ ${KDE_BUILD_TYPE} = live ]]; then
1578 + # Export working copy to ${S}
1579 + einfo "Exporting parts of working copy to ${S}"
1580 + kde4-meta_create_extractlists
1581 +
1582 + case ${KDE_SCM} in
1583 + svn)
1584 + local rsync_options subdir targetdir wc_path escm
1585 +
1586 + rsync_options="--group --links --owner --perms --quiet --exclude=.svn/ --exclude=.git/"
1587 + wc_path="${ESVN_WC_PATH}"
1588 + escm="{ESVN}"
1589 +
1590 + # Copy ${KMNAME} non-recursively (toplevel files)
1591 + rsync ${rsync_options} "${wc_path}"/* "${S}" \
1592 + || die "${escm}: can't export toplevel files to '${S}'."
1593 + # Copy cmake directory
1594 + if [[ -d "${wc_path}/cmake" ]]; then
1595 + rsync --recursive ${rsync_options} "${wc_path}/cmake" "${S}" \
1596 + || die "${escm}: can't export cmake files to '${S}'."
1597 + fi
1598 + # Copy all subdirectories
1599 + for subdir in $(_list_needed_subdirectories); do
1600 + targetdir=""
1601 + if [[ $subdir = doc/* && ! -e "$wc_path/$subdir" ]]; then
1602 + continue
1603 + fi
1604 +
1605 + [[ ${subdir%/} = */* ]] && targetdir=${subdir%/} && targetdir=${targetdir%/*} && mkdir -p "${S}/${targetdir}"
1606 + rsync --recursive ${rsync_options} "${wc_path}/${subdir%/}" "${S}/${targetdir}" \
1607 + || die "${escm}: can't export subdirectory '${subdir}' to '${S}/${targetdir}'."
1608 + done
1609 + ;;
1610 + esac
1611 + else
1612 + local abort tarball tarfile f extractlist postfix
1613 +
1614 + if [[ ${PV} =~ 4.4.11 ]]; then
1615 + postfix="bz2"
1616 + KMTARPARAMS+=" --bzip2"
1617 + else
1618 + postfix="xz"
1619 + KMTARPARAMS+=" --xz"
1620 + fi
1621 +
1622 + tarball="${KMNAME}-${PV}.tar.${postfix}"
1623 +
1624 + # Full path to source tarball
1625 + tarfile="${DISTDIR}/${tarball}"
1626 +
1627 + # Detect real toplevel dir from tarball name - it will be used upon extraction
1628 + # and in _list_needed_subdirectories
1629 + topdir="${tarball%.tar.*}/"
1630 +
1631 + ebegin "Unpacking parts of ${tarball} to ${WORKDIR}"
1632 +
1633 + kde4-meta_create_extractlists
1634 +
1635 + for f in cmake/ CMakeLists.txt ConfigureChecks.cmake config.h.cmake
1636 + do
1637 + extractlist+=" ${topdir}${f}"
1638 + done
1639 + extractlist+=" $(_list_needed_subdirectories)"
1640 +
1641 + pushd "${WORKDIR}" > /dev/null || die
1642 +
1643 + # @ECLASS-VARIABLE: KDE4_STRICTER
1644 + # @DESCRIPTION:
1645 + # Print out all issues found executing tar / kmextract files
1646 + # Set on if you want to find issues in kde-base ebuild unpack sequences
1647 + [[ -n ${KDE4_STRICTER} ]] && echo 'tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist}'
1648 + tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} 2> /dev/null || echo "tar extract command failed at least partially - continuing anyway"
1649 +
1650 + # Default $S is based on $P; rename the extracted directory to match $S if necessary
1651 + if [[ ${KMNAME} != ${PN} ]]; then
1652 + mv ${topdir} ${P} || die "Died while moving \"${topdir}\" to \"${P}\""
1653 + fi
1654 +
1655 + popd > /dev/null || die
1656 +
1657 + eend $?
1658 +
1659 + if [[ -n ${KDE4_STRICTER} ]]; then
1660 + for f in $(_list_needed_subdirectories fatal); do
1661 + if [[ ! -e ${S}/${f#*/} ]]; then
1662 + eerror "'${f#*/}' is missing"
1663 + abort=true
1664 + fi
1665 + done
1666 + [[ -n ${abort} ]] && die "There were missing files."
1667 + fi
1668 +
1669 + # We don't need it anymore
1670 + unset topdir
1671 + fi
1672 +}
1673 +
1674 +# @FUNCTION: kde4-meta_create_extractlists
1675 +# @DESCRIPTION:
1676 +# Create lists of files and subdirectories to extract.
1677 +# Also see descriptions of KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY,
1678 +# KMEXTRACTONLY and KMTARPARAMS.
1679 +kde4-meta_create_extractlists() {
1680 + debug-print-function ${FUNCNAME} "$@"
1681 +
1682 + # Add default handbook locations
1683 + # FIXME - legacy code - remove when 4.4.5 is gone or preferrably port 4.4.5.
1684 + if [[ $(get_kde_version) < 4.5 ]] && use_if_iuse handbook && [[ -z ${KMNOMODULE} ]]; then
1685 + # We use the basename of $KMMODULE because $KMMODULE can contain
1686 + # the path to the module subdirectory.
1687 + KMEXTRA_NONFATAL+="
1688 + doc/${KMMODULE##*/}"
1689 + fi
1690 +
1691 + # Add default handbook locations
1692 + if [[ -z ${KMNOMODULE} ]] && ( [[ ${KDE_HANDBOOK} == always ]] || ( [[ ${KDE_HANDBOOK} == optional ]] && use handbook ) ); then
1693 + KMEXTRA_NONFATAL+=" doc/${KMMODULE##*/}"
1694 + fi
1695 +
1696 + # Add some CMake-files to KMEXTRACTONLY.
1697 + # Note that this actually doesn't include KMEXTRA handling.
1698 + # In those cases you should care to add the relevant files to KMEXTRACTONLY
1699 + case ${KMNAME} in
1700 + kde-baseapps)
1701 + KMEXTRACTONLY+="
1702 + CTestConfig.cmake
1703 + config-apps.h.cmake
1704 + ConfigureChecks.cmake"
1705 + ;;
1706 + kde-runtime)
1707 + KMEXTRACTONLY+="
1708 + cmake/modules/
1709 + CTestConfig.cmake
1710 + config-runtime.h.cmake"
1711 + ;;
1712 + kde-workspace)
1713 + KMEXTRACTONLY+="
1714 + cmake/modules/
1715 + config-unix.h.cmake
1716 + ConfigureChecks.cmake
1717 + config-workspace.h.cmake
1718 + config-X11.h.cmake
1719 + startkde.cmake
1720 + KDE4WorkspaceConfig.cmake.in"
1721 + ;;
1722 + kdepim)
1723 + if [[ ${PN} != libkdepim ]]; then
1724 + KMEXTRACTONLY+="
1725 + libkdepim/"
1726 + fi
1727 + KMEXTRACTONLY+="
1728 + config-enterprise.h.cmake
1729 + kleopatra/ConfigureChecks.cmake
1730 + CTestCustom.cmake
1731 + kdepim-version.h.cmake
1732 + kdepim-version.h"
1733 + if use_if_iuse kontact; then
1734 + KMEXTRA+="
1735 + kontact/plugins/${PLUGINNAME:-${PN}}/"
1736 + fi
1737 + ;;
1738 + esac
1739 +
1740 + debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME}: KMEXTRACTONLY ${KMEXTRACTONLY}"
1741 +}
1742 +
1743 +_list_needed_subdirectories() {
1744 + local i j kmextra kmextra_expanded kmmodule_expanded kmcompileonly_expanded extractlist
1745 +
1746 + # We expand KMEXTRA by adding CMakeLists.txt files
1747 + kmextra="${KMEXTRA}"
1748 + [[ ${1} != fatal ]] && kmextra+=" ${KMEXTRA_NONFATAL}"
1749 + for i in ${kmextra}; do
1750 + kmextra_expanded+=" ${i}"
1751 + j=$(dirname ${i})
1752 + while [[ ${j} != "." ]]; do
1753 + kmextra_expanded+=" ${j}/CMakeLists.txt";
1754 + j=$(dirname ${j})
1755 + done
1756 + done
1757 +
1758 + # Expand KMMODULE
1759 + if [[ -n ${KMMODULE} ]]; then
1760 + kmmodule_expanded="${KMMODULE}"
1761 + j=$(dirname ${KMMODULE})
1762 + while [[ ${j} != "." ]]; do
1763 + kmmodule_expanded+=" ${j}/CMakeLists.txt";
1764 + j=$(dirname ${j})
1765 + done
1766 + fi
1767 +
1768 + # Expand KMCOMPILEONLY
1769 + for i in ${KMCOMPILEONLY}; do
1770 + kmcompileonly_expanded+=" ${i}"
1771 + j=$(dirname ${i})
1772 + while [[ ${j} != "." ]]; do
1773 + kmcompileonly_expanded+=" ${j}/CMakeLists.txt";
1774 + j=$(dirname ${j})
1775 + done
1776 + done
1777 +
1778 + debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmextra_expanded: ${kmextra_expanded}"
1779 + debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmmodule_expanded: ${kmmodule_expanded}"
1780 + debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmcompileonly_expanded: ${kmcompileonly_expanded}"
1781 +
1782 + # Create final list of stuff to extract
1783 + # We append topdir only when specified (usually for tarballs)
1784 + for i in ${kmmodule_expanded} ${kmextra_expanded} ${kmcompileonly_expanded} \
1785 + ${KMEXTRACTONLY}
1786 + do
1787 + extractlist+=" ${topdir}${i}"
1788 + done
1789 +
1790 + echo ${extractlist}
1791 +}
1792 +
1793 +# @FUNCTION: kde4-meta_src_prepare
1794 +# @DESCRIPTION:
1795 +# Meta-package build system configuration handling - commenting out targets, etc..
1796 +kde4-meta_src_prepare() {
1797 + debug-print-function ${FUNCNAME} "$@"
1798 +
1799 + kde4-meta_change_cmakelists
1800 + kde4-base_src_prepare
1801 +}
1802 +
1803 +# @FUNCTION: _change_cmakelists_parent_dirs
1804 +# @DESCRIPTION:
1805 +# Adjust CMakeLists.txt to shadow subdirectories
1806 +# that are not required for the build.
1807 +_change_cmakelists_parent_dirs() {
1808 + debug-print-function ${FUNCNAME} "$@"
1809 +
1810 + local _olddir _dir
1811 + _dir="${S}"/${1}
1812 + until [[ ${_dir} == ${S} ]]; do
1813 + _olddir=$(basename "${_dir}")
1814 + _dir=$(dirname "${_dir}")
1815 + debug-print "${LINENO}: processing ${_dir} CMakeLists.txt searching for ${_olddir}"
1816 + if [[ -f ${_dir}/CMakeLists.txt ]]; then
1817 + sed -e "/add_subdirectory[[:space:]]*([[:space:]]*${_olddir}[[:space:]]*)/s/#DONOTCOMPILE //g" \
1818 + -e "/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*${_olddir}[[:space:]]*)/s/#DONOTCOMPILE //g" \
1819 + -i ${_dir}/CMakeLists.txt || die "${LINENO}: died in ${FUNCNAME} while processing ${_dir}"
1820 + fi
1821 + done
1822 +}
1823 +
1824 +# @FUNCTION: kde4-meta_change_cmakelists
1825 +# @DESCRIPTION:
1826 +# Adjust CMakeLists.txt to comply to our splitting.
1827 +kde4-meta_change_cmakelists() {
1828 + debug-print-function ${FUNCNAME} "$@"
1829 +
1830 + pushd "${S}" > /dev/null || die
1831 +
1832 + comment_all_add_subdirectory ./
1833 +
1834 + # Restore "add_subdirectory( cmake )" in ${S}/CMakeLists.txt
1835 + if [[ -f CMakeLists.txt ]]; then
1836 + sed -e '/add_subdirectory[[:space:]]*([[:space:]]*cmake[[:space:]]*)/s/^#DONOTCOMPILE //' \
1837 + -e '/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*cmake[[:space:]]*)/s/^#DONOTCOMPILE //' \
1838 + -i CMakeLists.txt || die "${LINENO}: cmake sed died"
1839 + fi
1840 +
1841 + # Restore "add_subdirectory( ${ ..." (this is done in kdesdk)
1842 + if [[ -f CMakeLists.txt ]]; then
1843 + sed -e '/add_subdirectory[[:space:]]*([[:space:]]*\${/s/^#DONOTCOMPILE //' \
1844 + -e '/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*\${/s/^#DONOTCOMPILE //' \
1845 + -i CMakeLists.txt || die "${LINENO}: cmake sed died"
1846 + fi
1847 +
1848 + if [[ -z ${KMNOMODULE} ]]; then
1849 + # Restore "add_subdirectory" in $KMMODULE subdirectories
1850 + find "${S}"/${KMMODULE} -name CMakeLists.txt -print0 | \
1851 + xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \
1852 + die "${LINENO}: died in KMMODULE section"
1853 + _change_cmakelists_parent_dirs ${KMMODULE}
1854 + fi
1855 +
1856 + local i
1857 +
1858 + # KMEXTRACTONLY section - Some ebuilds need to comment out some subdirs in KMMODULE and they use KMEXTRACTONLY
1859 + for i in ${KMEXTRACTONLY}; do
1860 + if [[ -d ${i} && -f ${i}/../CMakeLists.txt ]]; then
1861 + sed -e "/([[:space:]]*$(basename $i)[[:space:]]*)/s/^/#DONOTCOMPILE /" \
1862 + -i ${i}/../CMakeLists.txt || \
1863 + die "${LINENO}: sed died while working in the KMEXTRACTONLY section while processing ${i}"
1864 + fi
1865 + done
1866 +
1867 + # KMCOMPILEONLY
1868 + for i in ${KMCOMPILEONLY}; do
1869 + debug-print "${LINENO}: KMCOMPILEONLY, processing ${i}"
1870 + # Uncomment "add_subdirectory" instructions inside $KMCOMPILEONLY, then comment "install" instructions.
1871 + find "${S}"/${i} -name CMakeLists.txt -print0 | \
1872 + xargs -0 sed -i \
1873 + -e 's/^#DONOTCOMPILE //g' \
1874 + -e '/install(.*)/I{s/^/#DONOTINSTALL /;}' \
1875 + -e '/^install(/,/)/I{s/^/#DONOTINSTALL /;}' \
1876 + -e '/kde4_install_icons(.*)/I{s/^/#DONOTINSTALL /;}' || \
1877 + die "${LINENO}: sed died in the KMCOMPILEONLY section while processing ${i}"
1878 + _change_cmakelists_parent_dirs ${i}
1879 + done
1880 +
1881 + # KMEXTRA section
1882 + for i in ${KMEXTRA}; do
1883 + debug-print "${LINENO}: KMEXTRA section, processing ${i}"
1884 + find "${S}"/${i} -name CMakeLists.txt -print0 | \
1885 + xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \
1886 + die "${LINENO}: sed died uncommenting add_subdirectory instructions in KMEXTRA section while processing ${i}"
1887 + _change_cmakelists_parent_dirs ${i}
1888 + done
1889 + # KMEXTRA_NONFATAL section
1890 + for i in ${KMEXTRA_NONFATAL}; do
1891 + if [[ -d "${S}"/${i} ]]; then
1892 + find "${S}"/${i} -name CMakeLists.txt -print0 | \
1893 + xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \
1894 + die "${LINENO}: sed died uncommenting add_subdirectory instructions in KMEXTRA section while processing ${i}"
1895 + _change_cmakelists_parent_dirs ${i}
1896 + fi
1897 + done
1898 +
1899 + case ${KMNAME} in
1900 + kde-workspace)
1901 + # COLLISION PROTECT section
1902 + # Install the startkde script just once, as a part of kde-plasma/kdebase-startkde,
1903 + # not as a part of every package.
1904 + if [[ ${PN} != kdebase-startkde && -f CMakeLists.txt ]]; then
1905 + # The startkde script moved to kdebase-workspace for KDE4 versions > 3.93.0.
1906 + sed -e '/startkde/s/^/#DONOTINSTALL /' \
1907 + -i CMakeLists.txt || die "${LINENO}: sed died in the kdebase-startkde collision prevention section"
1908 + fi
1909 + # Remove workspace target prefix in order to get direct linking to workspace libs
1910 + sed -e '/set(KDE4WORKSPACE_TARGET_PREFIX/s/^/#OVERRIDE /' \
1911 + -i CMakeLists.txt || die "${LINENO}: sed died in KDE4WORKSPACE_TARGET_PREFIX removal section"
1912 + # Strip EXPORT feature section from workspace for KDE4 versions > 4.1.82
1913 + if [[ ${PN} != libkworkspace ]]; then
1914 + sed -e '/install(FILES ${CMAKE_CURRENT_BINARY_DIR}\/KDE4WorkspaceConfig.cmake/,/^[[:space:]]*FILE KDE4WorkspaceLibraryTargets.cmake )[[:space:]]*^/d' \
1915 + -i CMakeLists.txt || die "${LINENO}: sed died in kde-workspace strip config install and fix EXPORT section"
1916 + fi
1917 + # <KDE/4.11
1918 + if [[ ${PN} != plasma-workspace ]]; then
1919 + sed -e '/KActivities/s/REQUIRED//' \
1920 + -i CMakeLists.txt || die "${LINENO}: sed died in kde-workspace dep reduction section"
1921 + fi
1922 + sed -e '/QImageBlitz/s/REQUIRED//' \
1923 + -i CMakeLists.txt || die "${LINENO}: sed died in kde-workspace dep reduction section 2"
1924 +
1925 + # >=KDE/4.11
1926 + sed -e 's/TYPE REQUIRED/TYPE OPTIONAL/' -e 's/XCB REQUIRED/XCB/' -e 's/X11 REQUIRED/X11/' \
1927 + -e 's/message(FATAL_ERROR/message(/' -i CMakeLists.txt \
1928 + || die "${LINENO}: sed died in kde-workspace dep reduction section"
1929 + if [[ "${PN}" != "kwin" ]]; then
1930 + sed -i -e "/^ macro_log_feature(OPENGL_OR_ES_FOUND/s/TRUE/FALSE/" \
1931 + "${S}"/CMakeLists.txt || die "${LINENO}: sed died removing kde-workspace opengl dependency"
1932 + fi
1933 + ;;
1934 + kde-runtime)
1935 + sed -e 's/TYPE REQUIRED/TYPE OPTIONAL/' -e '/LibGcrypt/s/REQUIRED//' -i CMakeLists.txt \
1936 + || die "${LINENO}: sed died in kde-runtime dep reduction section"
1937 +
1938 + # COLLISION PROTECT section
1939 + # Only install the kde4 script as part of kde-base/kdebase-data
1940 + if [[ ${PN} != kdebase-data && -f CMakeLists.txt ]]; then
1941 + sed -e '/^install(PROGRAMS[[:space:]]*[^[:space:]]*\/kde4[[:space:]]/s/^/#DONOTINSTALL /' \
1942 + -i CMakeLists.txt || die "Sed to exclude bin/kde4 failed"
1943 + fi
1944 + ;;
1945 + kdenetwork)
1946 + # Disable hardcoded kdepimlibs check
1947 + sed -e 's/find_package(KdepimLibs REQUIRED)/macro_optional_find_package(KdepimLibs)/' \
1948 + -i CMakeLists.txt || die "failed to disable hardcoded checks"
1949 + ;;
1950 + kdepim)
1951 + # Disable hardcoded checks
1952 + sed -r -e 's/TYPE REQUIRED/TYPE OPTIONAL/' -e '/find_package\(KdepimLibs/s/REQUIRED//' \
1953 + -e '/find_package\((KdepimLibs|Boost|QGpgme|Akonadi|ZLIB|Strigi|SharedDesktopOntologies|Soprano|Nepomuk)/{/macro_optional_/!s/find/macro_optional_&/}' \
1954 + -e '/macro_log_feature\((Boost|QGPGME|Akonadi|ZLIB|STRIGI|SHAREDDESKTOPONTOLOGIES|Soprano|Nepomuk)_FOUND/s/ TRUE / FALSE /' \
1955 + -e 's/if[[:space:]]*([[:space:]]*BUILD_.*)[[:space:]]*/if(1) # &/' \
1956 + -e 's/if[[:space:]]*([[:space:]]*[[:alnum:]]*_FOUND[[:space:]]*)[[:space:]]*$/if(1) # &/' \
1957 + -i CMakeLists.txt || die "failed to disable hardcoded checks"
1958 + # Disable broken or redundant build logic
1959 + if use_if_iuse kontact || [[ ${PN} = kontact ]]; then
1960 + sed -e 's/if[[:space:]]*([[:space:]]*BUILD_.*)[[:space:]]*$/if(1) # &/' \
1961 + -e 's/if[[:space:]]*([[:space:]]*[[:alnum:]]*_FOUND[[:space:]]*)[[:space:]]*$/if(1) # &/' \
1962 + -i kontact/plugins/CMakeLists.txt || die 'failed to override build logic'
1963 + fi
1964 + case ${PV} in
1965 + 4.4*)
1966 + case ${PN} in
1967 + kalarm|kmailcvt|kontact|korganizer|korn)
1968 + sed -n -e '/qt4_generate_dbus_interface(.*org\.kde\.kmail\.\(kmail\|mailcomposer\)\.xml/p' \
1969 + -e '/add_custom_target(kmail_xml /,/)/p' \
1970 + -i kmail/CMakeLists.txt || die "uncommenting xml failed"
1971 + _change_cmakelists_parent_dirs kmail
1972 + ;;
1973 + esac
1974 + ;;
1975 + esac
1976 + ;;
1977 + esac
1978 +
1979 + popd > /dev/null || die
1980 +}
1981 +
1982 +# @FUNCTION: kde4-meta_src_configure
1983 +# @DESCRIPTION:
1984 +# Currently just calls its equivalent in kde4-base.eclass(5). Use this one in split
1985 +# ebuilds.
1986 +kde4-meta_src_configure() {
1987 + debug-print-function ${FUNCNAME} "$@"
1988 +
1989 + kde4-base_src_configure
1990 +}
1991 +
1992 +# @FUNCTION: kde4-meta_src_compile
1993 +# @DESCRIPTION:
1994 +# General function for compiling split KDE4 applications.
1995 +# Overrides kde4-base_src_compile.
1996 +kde4-meta_src_compile() {
1997 + debug-print-function ${FUNCNAME} "$@"
1998 +
1999 + kde4-base_src_compile "$@"
2000 +}
2001 +
2002 +# @FUNCTION: kde4-meta_src_test
2003 +# @DESCRIPTION:
2004 +# Currently just calls its equivalent in kde4-base.eclass(5) if
2005 +# I_KNOW_WHAT_I_AM_DOING is set. Use this in split ebuilds.
2006 +kde4-meta_src_test() {
2007 + debug-print-function ${FUNCNAME} "$@"
2008 +
2009 + if [[ $I_KNOW_WHAT_I_AM_DOING ]]; then
2010 + kde4-base_src_test
2011 + else
2012 + einfo "Tests disabled"
2013 + fi
2014 +}
2015 +
2016 +# @FUNCTION: kde4-meta_src_install
2017 +# @DESCRIPTION:
2018 +# Function for installing KDE4 split applications.
2019 +kde4-meta_src_install() {
2020 + debug-print-function ${FUNCNAME} "$@"
2021 +
2022 + # Search ${S}/${KMMODULE} and install common documentation files found
2023 + local doc
2024 + for doc in "${S}/${KMMODULE}"/{AUTHORS,CHANGELOG,ChangeLog*,README*,NEWS,TODO,HACKING}; do
2025 + [[ -f "${doc}" ]] && [[ -s "${doc}" ]] && dodoc "${doc}"
2026 + done
2027 +
2028 + kde4-base_src_install
2029 +}
2030 +
2031 +# @FUNCTION: kde4-meta_pkg_preinst
2032 +# @DESCRIPTION:
2033 +# Invoke its equivalent in kde4-base.eclass.
2034 +kde4-meta_pkg_preinst() {
2035 + debug-print-function ${FUNCNAME} "$@"
2036 +
2037 + kde4-base_pkg_preinst
2038 +}
2039 +
2040 +# @FUNCTION: kde4-meta_pkg_postinst
2041 +# @DESCRIPTION:
2042 +# Invoke kbuildsycoca4.
2043 +kde4-meta_pkg_postinst() {
2044 + debug-print-function ${FUNCNAME} "$@"
2045 +
2046 + kde4-base_pkg_postinst
2047 +}
2048 +
2049 +# @FUNCTION: kde4-meta_pkg_postrm
2050 +# @DESCRIPTION:
2051 +# Currently just calls its equivalent in kde4-base.eclass(5). Use this in split
2052 +# ebuilds.
2053 +kde4-meta_pkg_postrm() {
2054 + debug-print-function ${FUNCNAME} "$@"
2055 +
2056 + kde4-base_pkg_postrm
2057 +}
2058 +
2059 +fi