| 1 | # Copyright 1999-2010 Gentoo Foundation |
1 | # Copyright 1999-2010 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-base.eclass,v 1.76 2010/10/27 21:24:22 dilfridge Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/kde4-base.eclass,v 1.85 2011/03/16 22:45:30 dilfridge Exp $ |
| 4 | |
4 | |
| 5 | # @ECLASS: kde4-base.eclass |
5 | # @ECLASS: kde4-base.eclass |
| 6 | # @MAINTAINER: |
6 | # @MAINTAINER: |
| 7 | # kde@gentoo.org |
7 | # kde@gentoo.org |
| 8 | # @BLURB: This eclass provides functions for kde 4.X ebuilds |
8 | # @BLURB: This eclass provides functions for kde 4.X ebuilds |
| … | |
… | |
| 11 | # and KDE4 applications. |
11 | # and KDE4 applications. |
| 12 | # |
12 | # |
| 13 | # NOTE: KDE 4 ebuilds by default define EAPI="2", this can be redefined but |
13 | # NOTE: KDE 4 ebuilds by default define EAPI="2", this can be redefined but |
| 14 | # eclass will fail with version older than 2. |
14 | # eclass will fail with version older than 2. |
| 15 | |
15 | |
|
|
16 | # @ECLASS-VARIABLE: VIRTUALX_REQUIRED |
|
|
17 | # @DESCRIPTION: |
|
|
18 | # For proper description see virtualx.eclass manpage. |
|
|
19 | # Here we redefine default value to be manual, if your package needs virtualx |
|
|
20 | # for tests you should proceed with setting VIRTUALX_REQUIRED=test. |
|
|
21 | : ${VIRTUALX_REQUIRED:=manual} |
|
|
22 | |
| 16 | inherit kde4-functions base eutils |
23 | inherit kde4-functions base virtualx eutils |
| 17 | |
24 | |
| 18 | get_build_type |
25 | get_build_type |
| 19 | if [[ ${BUILD_TYPE} = live ]]; then |
26 | if [[ ${BUILD_TYPE} = live ]]; then |
| 20 | if [[ ${KDEBASE} = kdevelop ]]; then |
27 | if [[ ${KDEBASE} = kdevelop ]]; then |
| 21 | inherit git |
28 | inherit git |
| … | |
… | |
| 111 | EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare ${export_fns} pkg_postinst pkg_postrm |
118 | EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare ${export_fns} pkg_postinst pkg_postrm |
| 112 | |
119 | |
| 113 | unset buildsystem_eclass |
120 | unset buildsystem_eclass |
| 114 | unset export_fns |
121 | unset export_fns |
| 115 | |
122 | |
|
|
123 | # @ECLASS-VARIABLE: DECLARATIVE_REQUIRED |
|
|
124 | # @DESCRIPTION: |
|
|
125 | # Is qt-declarative required? Possible values are 'always', 'optional' and 'never'. |
|
|
126 | # This variable must be set before inheriting any eclasses. Defaults to 'never'. |
|
|
127 | DECLARATIVE_REQUIRED="${DECLARATIVE_REQUIRED:-never}" |
|
|
128 | |
|
|
129 | # @ECLASS-VARIABLE: QTHELP_REQUIRED |
|
|
130 | # @DESCRIPTION: |
|
|
131 | # Is qt-assistant required? Possible values are 'always', 'optional' and 'never'. |
|
|
132 | # This variable must be set before inheriting any eclasses. Defaults to 'never'. |
|
|
133 | QTHELP_REQUIRED="${QTHELP_REQUIRED:-never}" |
|
|
134 | |
| 116 | # @ECLASS-VARIABLE: OPENGL_REQUIRED |
135 | # @ECLASS-VARIABLE: OPENGL_REQUIRED |
| 117 | # @DESCRIPTION: |
136 | # @DESCRIPTION: |
| 118 | # Is qt-opengl required? Possible values are 'always', 'optional' and 'never'. |
137 | # Is qt-opengl required? Possible values are 'always', 'optional' and 'never'. |
| 119 | # This variable must be set before inheriting any eclasses. Defaults to 'never'. |
138 | # This variable must be set before inheriting any eclasses. Defaults to 'never'. |
| 120 | OPENGL_REQUIRED="${OPENGL_REQUIRED:-never}" |
139 | OPENGL_REQUIRED="${OPENGL_REQUIRED:-never}" |
| … | |
… | |
| 190 | esac |
209 | esac |
| 191 | |
210 | |
| 192 | # @ECLASS-VARIABLE: QT_MINIMAL |
211 | # @ECLASS-VARIABLE: QT_MINIMAL |
| 193 | # @DESCRIPTION: |
212 | # @DESCRIPTION: |
| 194 | # Determine version of qt we enforce as minimal for the package. 4.4.0 4.5.1... |
213 | # Determine version of qt we enforce as minimal for the package. 4.4.0 4.5.1... |
| 195 | # 4.6.0 for 4.4 and 4.6.3 for 4.5 and later |
214 | # 4.6.0 for 4.4, 4.6.3 for 4.5, and 4.7.0 for 4.6 and later |
|
|
215 | if slot_is_at_least 4.6 "${KDE_MINIMAL}"; then |
|
|
216 | QT_MINIMAL="${QT_MINIMAL:-4.7.0}" |
| 196 | if slot_is_at_least 4.5 "${KDE_MINIMAL}"; then |
217 | elif slot_is_at_least 4.5 "${KDE_MINIMAL}"; then |
| 197 | QT_MINIMAL="${QT_MINIMAL:-4.6.3}" |
218 | QT_MINIMAL="${QT_MINIMAL:-4.6.3}" |
| 198 | else |
219 | else |
| 199 | QT_MINIMAL="${QT_MINIMAL:-4.6.0}" |
220 | QT_MINIMAL="${QT_MINIMAL:-4.6.0}" |
| 200 | fi |
221 | fi |
|
|
222 | |
|
|
223 | # Declarative dependencies |
|
|
224 | qtdeclarativedepend=" |
|
|
225 | >=x11-libs/qt-declarative-${QT_MINIMAL}:4 |
|
|
226 | " |
|
|
227 | case ${DECLARATIVE_REQUIRED} in |
|
|
228 | always) |
|
|
229 | COMMONDEPEND+=" ${qtdeclarativedepend}" |
|
|
230 | ;; |
|
|
231 | optional) |
|
|
232 | IUSE+=" declarative" |
|
|
233 | COMMONDEPEND+=" declarative? ( ${qtdeclarativedepend} )" |
|
|
234 | ;; |
|
|
235 | *) ;; |
|
|
236 | esac |
|
|
237 | unset qtdeclarativedepend |
|
|
238 | |
|
|
239 | # QtHelp dependencies |
|
|
240 | qthelpdepend=" |
|
|
241 | >=x11-libs/qt-assistant-${QT_MINIMAL}:4 |
|
|
242 | " |
|
|
243 | case ${QTHELP_REQUIRED} in |
|
|
244 | always) |
|
|
245 | COMMONDEPEND+=" ${qthelpdepend}" |
|
|
246 | ;; |
|
|
247 | optional) |
|
|
248 | IUSE+=" qthelp" |
|
|
249 | COMMONDEPEND+=" qthelp? ( ${qthelpdepend} )" |
|
|
250 | ;; |
|
|
251 | esac |
|
|
252 | unset qthelpdepend |
| 201 | |
253 | |
| 202 | # OpenGL dependencies |
254 | # OpenGL dependencies |
| 203 | qtopengldepend=" |
255 | qtopengldepend=" |
| 204 | >=x11-libs/qt-opengl-${QT_MINIMAL}:4 |
256 | >=x11-libs/qt-opengl-${QT_MINIMAL}:4 |
| 205 | " |
257 | " |
| … | |
… | |
| 313 | fi |
365 | fi |
| 314 | kdedepend=" |
366 | kdedepend=" |
| 315 | dev-util/automoc |
367 | dev-util/automoc |
| 316 | dev-util/pkgconfig |
368 | dev-util/pkgconfig |
| 317 | !aqua? ( |
369 | !aqua? ( |
| 318 | || ( >=x11-libs/libXtst-1.1.0 <x11-proto/xextproto-7.1.0 ) |
370 | >=x11-libs/libXtst-1.1.0 |
| 319 | x11-proto/xf86vidmodeproto |
371 | x11-proto/xf86vidmodeproto |
| 320 | ) |
372 | ) |
| 321 | " |
373 | " |
| 322 | kderdepend="" |
374 | kderdepend="" |
|
|
375 | |
|
|
376 | if [[ ${PN} != oxygen-icons ]]; then |
|
|
377 | kderdepend+=" $(add_kdebase_dep oxygen-icons)" |
|
|
378 | fi |
| 323 | |
379 | |
| 324 | kdehandbookdepend=" |
380 | kdehandbookdepend=" |
| 325 | app-text/docbook-xml-dtd:4.2 |
381 | app-text/docbook-xml-dtd:4.2 |
| 326 | app-text/docbook-xsl-stylesheets |
382 | app-text/docbook-xsl-stylesheets |
| 327 | " |
383 | " |
| … | |
… | |
| 452 | if [[ -z ${KMNOMODULE} ]] && [[ -z ${KMMODULE} ]]; then |
508 | if [[ -z ${KMNOMODULE} ]] && [[ -z ${KMMODULE} ]]; then |
| 453 | KMMODULE="${PN}" |
509 | KMMODULE="${PN}" |
| 454 | fi |
510 | fi |
| 455 | case ${KDEBASE} in |
511 | case ${KDEBASE} in |
| 456 | kdevelop) |
512 | kdevelop) |
| 457 | EGIT_REPO_URI="git://gitorious.org/${KMNAME}/${KMMODULE}.git" |
513 | EGIT_REPO_URI="git://git.kde.org/${KMMODULE}" |
| 458 | ;; |
514 | ;; |
| 459 | esac |
515 | esac |
| 460 | fi |
516 | fi |
| 461 | ;; |
517 | ;; |
| 462 | *) |
518 | *) |
| … | |
… | |
| 473 | fi |
529 | fi |
| 474 | _kmname_pv="${_kmname}-${PV}" |
530 | _kmname_pv="${_kmname}-${PV}" |
| 475 | case ${KDEBASE} in |
531 | case ${KDEBASE} in |
| 476 | kde-base) |
532 | kde-base) |
| 477 | case ${PV} in |
533 | case ${PV} in |
|
|
534 | 4.5.93) |
|
|
535 | # Only kdepim and kdepim-runtime 4.6beta here |
|
|
536 | SRC_URI="mirror://kde/unstable/kdepim/${PV}/${_kmname}-4.6beta3.tar.bz2" |
|
|
537 | ;; |
| 478 | 4.[456].8[05] | 4.[456].9[023568]) |
538 | 4.[456].8[05] | 4.[456].9[023568]) |
| 479 | # Unstable KDE SC releases |
539 | # Unstable KDE SC releases |
| 480 | SRC_URI="mirror://kde/unstable/${PV}/src/${_kmname_pv}.tar.bz2" |
540 | SRC_URI="mirror://kde/unstable/${PV}/src/${_kmname_pv}.tar.bz2" |
| 481 | ;; |
541 | ;; |
| 482 | 4.4.6 | 4.4.7) |
542 | 4.4.6 | 4.4.7 | 4.4.8 | 4.4.9 | 4.4.10) |
| 483 | # Only kdepim here |
543 | # Only kdepim here |
| 484 | SRC_URI="mirror://kde/stable/kdepim-${PV}/src/${_kmname_pv}.tar.bz2" |
544 | SRC_URI="mirror://kde/stable/kdepim-${PV}/src/${_kmname_pv}.tar.bz2" |
| 485 | ;; |
545 | ;; |
| 486 | *) |
546 | *) |
| 487 | # Stable KDE SC releases |
547 | # Stable KDE SC releases |
| … | |
… | |
| 654 | # Inject library dependencies |
714 | # Inject library dependencies |
| 655 | if [[ -n ${KMLOADLIBS} ]] ; then |
715 | if [[ -n ${KMLOADLIBS} ]] ; then |
| 656 | load_library_dependencies |
716 | load_library_dependencies |
| 657 | fi |
717 | fi |
| 658 | |
718 | |
| 659 | # Hack for manuals relying on outdated DTD |
719 | # Replace KDE4Workspace library targets |
|
|
720 | find "${S}" -name CMakeLists.txt \ |
|
|
721 | -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_TASKMANAGER_(LIBRARY|LIBS)\}/taskmanager/g' {} + \ |
|
|
722 | -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_KWORKSPACE_(LIBRARY|LIBS)\}/kworkspace/g' {} + \ |
|
|
723 | -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_SOLIDCONTROLIFACES_(LIBRARY|LIBS)\}/solidcontrolifaces/g' {} + \ |
|
|
724 | -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_SOLIDCONTROL_(LIBRARY|LIBS)\}/solidcontrol/g' {} + \ |
|
|
725 | -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_PROCESSUI_(LIBRARY|LIBS)\}/processui/g' {} + \ |
|
|
726 | -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_LSOFUI_(LIBRARY|LIBS)\}/lsofui/g' {} + \ |
|
|
727 | -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_PLASMACLOCK_(LIBRARY|LIBS)\}/plasmaclock/g' {} + \ |
|
|
728 | -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_NEPOMUKQUERYCLIENT_(LIBRARY|LIBS)\}/nepomukqueryclient/g' {} + \ |
|
|
729 | -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_NEPOMUKQUERY_(LIBRARY|LIBS)\}/nepomukquery/g' {} + \ |
|
|
730 | -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_KSCREENSAVER_(LIBRARY|LIBS)\}/kscreensaver/g' {} + \ |
|
|
731 | -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_WEATHERION_(LIBRARY|LIBS)\}/weather_ion/g' {} + \ |
|
|
732 | -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_KWINEFFECTS_(LIBRARY|LIBS)\}/kwineffects/g' {} + \ |
|
|
733 | -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_KDECORATIONS_(LIBRARY|LIBS)\}/kdecorations/g' {} + \ |
|
|
734 | -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_KSGRD_(LIBRARY|LIBS)\}/ksgrd/g' {} + \ |
|
|
735 | -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_KEPHAL_(LIBRARY|LIBS)\}/kephal/g' {} + \ |
|
|
736 | || die 'failed to replace KDE4Workspace library targets' |
|
|
737 | |
|
|
738 | # Hack for manuals relying on outdated DTD, only outside kde-base/koffice/... |
|
|
739 | if [[ -z ${KDEBASE} ]]; then |
| 660 | find "${S}" -name "*.docbook" \ |
740 | find "${S}" -name "*.docbook" \ |
| 661 | -exec sed -i -r \ |
741 | -exec sed -i -r \ |
| 662 | -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' {} + \ |
742 | -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' {} + \ |
| 663 | || die 'failed to fix DocBook variant version' |
743 | || die 'failed to fix DocBook variant version' |
|
|
744 | fi |
| 664 | } |
745 | } |
| 665 | |
746 | |
| 666 | # @FUNCTION: kde4-base_src_configure |
747 | # @FUNCTION: kde4-base_src_configure |
| 667 | # @DESCRIPTION: |
748 | # @DESCRIPTION: |
| 668 | # Function for configuring the build of KDE4 applications. |
749 | # Function for configuring the build of KDE4 applications. |
| … | |
… | |
| 751 | # Override this value, set in kde4-base_src_configure() |
832 | # Override this value, set in kde4-base_src_configure() |
| 752 | mycmakeargs+=(-DKDE4_BUILD_TESTS=ON) |
833 | mycmakeargs+=(-DKDE4_BUILD_TESTS=ON) |
| 753 | cmake-utils_src_configure |
834 | cmake-utils_src_configure |
| 754 | kde4-base_src_compile |
835 | kde4-base_src_compile |
| 755 | |
836 | |
|
|
837 | # When run as normal user during ebuild development with the ebuild command, the |
|
|
838 | # kde tests tend to access the session DBUS. This however is not possible in a real |
|
|
839 | # emerge or on the tinderbox. |
|
|
840 | # > make sure it does not happen, so bad tests can be recognized and disabled |
|
|
841 | unset DBUS_SESSION_BUS_ADDRESS |
|
|
842 | |
|
|
843 | if [[ ${VIRTUALX_REQUIRED} == always || ${VIRTUALX_REQUIRED} == test ]]; then |
|
|
844 | # check for sanity if anyone already redefined VIRTUALX_COMMAND from the default |
|
|
845 | if [[ ${VIRTUALX_COMMAND} != "emake" ]]; then |
|
|
846 | # surprise- we are already INSIDE virtualmake!!! |
|
|
847 | debug-print "QA Notice: This version of kde4-base.eclass includes the virtualx functionality." |
|
|
848 | debug-print " You may NOT set VIRTUALX_COMMAND or call virtualmake from the ebuild." |
|
|
849 | debug-print " Setting VIRTUALX_REQUIRED is completely sufficient. See the" |
|
|
850 | debug-print " kde4-base.eclass docs for details... Applying workaround." |
|
|
851 | cmake-utils_src_test |
|
|
852 | else |
|
|
853 | VIRTUALX_COMMAND="cmake-utils_src_test" virtualmake |
|
|
854 | fi |
|
|
855 | else |
| 756 | cmake-utils_src_test |
856 | cmake-utils_src_test |
|
|
857 | fi |
| 757 | } |
858 | } |
| 758 | |
859 | |
| 759 | # @FUNCTION: kde4-base_src_install |
860 | # @FUNCTION: kde4-base_src_install |
| 760 | # @DESCRIPTION: |
861 | # @DESCRIPTION: |
| 761 | # Function for installing KDE4 applications. |
862 | # Function for installing KDE4 applications. |