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.77 2010/11/24 23:54:55 dilfridge Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/kde4-base.eclass,v 1.78 2010/12/02 21:49:54 alexxy 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 | # Do we need an X server? Valid values are "always", "optional", and "manual". |
|
|
19 | # "tests" is a synonym for "optional". While virtualx.eclass supports in principle |
|
|
20 | # also the use of an X server during other ebuild phases, we only use it in |
|
|
21 | # src_test here. Most likely you'll want to set "optional", which introduces the |
|
|
22 | # use-flag "test" (if not already present), adds dependencies conditional on that |
|
|
23 | # use-flag, and automatically runs (only) the ebuild test phase with a virtual X server |
|
|
24 | # present. This makes things a lot more comfortable than the bare virtualx eclass. |
|
|
25 | |
|
|
26 | # In case the variable is not set in the ebuild, let virtualx eclass not do anything |
|
|
27 | : ${VIRTUALX_REQUIRED:=manual} |
|
|
28 | |
16 | inherit kde4-functions base eutils |
29 | inherit kde4-functions base virtualx eutils |
17 | |
30 | |
18 | get_build_type |
31 | get_build_type |
19 | if [[ ${BUILD_TYPE} = live ]]; then |
32 | if [[ ${BUILD_TYPE} = live ]]; then |
20 | if [[ ${KDEBASE} = kdevelop ]]; then |
33 | if [[ ${KDEBASE} = kdevelop ]]; then |
21 | inherit git |
34 | inherit git |
… | |
… | |
111 | EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare ${export_fns} pkg_postinst pkg_postrm |
124 | EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare ${export_fns} pkg_postinst pkg_postrm |
112 | |
125 | |
113 | unset buildsystem_eclass |
126 | unset buildsystem_eclass |
114 | unset export_fns |
127 | unset export_fns |
115 | |
128 | |
|
|
129 | # @ECLASS-VARIABLE: DECLARATIVE_REQUIRED |
|
|
130 | # @DESCRIPTION: |
|
|
131 | # Is qt-declarative required? Possible values are 'always', 'optional' and 'never'. |
|
|
132 | # This variable must be set before inheriting any eclasses. Defaults to 'never'. |
|
|
133 | DECLARATIVE_REQUIRED="${DECLARATIVE_REQUIRED:-never}" |
|
|
134 | |
|
|
135 | # @ECLASS-VARIABLE: QTHELP_REQUIRED |
|
|
136 | # @DESCRIPTION: |
|
|
137 | # Is qt-assistant required? Possible values are 'always', 'optional' and 'never'. |
|
|
138 | # This variable must be set before inheriting any eclasses. Defaults to 'never'. |
|
|
139 | QTHELP_REQUIRED="${QTHELP_REQUIRED:-never}" |
|
|
140 | |
116 | # @ECLASS-VARIABLE: OPENGL_REQUIRED |
141 | # @ECLASS-VARIABLE: OPENGL_REQUIRED |
117 | # @DESCRIPTION: |
142 | # @DESCRIPTION: |
118 | # Is qt-opengl required? Possible values are 'always', 'optional' and 'never'. |
143 | # Is qt-opengl required? Possible values are 'always', 'optional' and 'never'. |
119 | # This variable must be set before inheriting any eclasses. Defaults to 'never'. |
144 | # This variable must be set before inheriting any eclasses. Defaults to 'never'. |
120 | OPENGL_REQUIRED="${OPENGL_REQUIRED:-never}" |
145 | OPENGL_REQUIRED="${OPENGL_REQUIRED:-never}" |
… | |
… | |
190 | esac |
215 | esac |
191 | |
216 | |
192 | # @ECLASS-VARIABLE: QT_MINIMAL |
217 | # @ECLASS-VARIABLE: QT_MINIMAL |
193 | # @DESCRIPTION: |
218 | # @DESCRIPTION: |
194 | # Determine version of qt we enforce as minimal for the package. 4.4.0 4.5.1... |
219 | # 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 |
220 | # 4.6.0 for 4.4, 4.6.3 for 4.5, and 4.7.0 for 4.6 and later |
|
|
221 | if slot_is_at_least 4.6 "${KDE_MINIMAL}"; then |
|
|
222 | QT_MINIMAL="${QT_MINIMAL:-4.7.0}" |
196 | if slot_is_at_least 4.5 "${KDE_MINIMAL}"; then |
223 | elif slot_is_at_least 4.5 "${KDE_MINIMAL}"; then |
197 | QT_MINIMAL="${QT_MINIMAL:-4.6.3}" |
224 | QT_MINIMAL="${QT_MINIMAL:-4.6.3}" |
198 | else |
225 | else |
199 | QT_MINIMAL="${QT_MINIMAL:-4.6.0}" |
226 | QT_MINIMAL="${QT_MINIMAL:-4.6.0}" |
200 | fi |
227 | fi |
|
|
228 | |
|
|
229 | # Declarative dependencies |
|
|
230 | qtdeclarativedepend=" |
|
|
231 | >=x11-libs/qt-declarative-${QT_MINIMAL}:4 |
|
|
232 | " |
|
|
233 | case ${DECLARATIVE_REQUIRED} in |
|
|
234 | always) |
|
|
235 | COMMONDEPEND+=" ${qtdeclarativedepend}" |
|
|
236 | ;; |
|
|
237 | optional) |
|
|
238 | IUSE+=" declarative" |
|
|
239 | COMMONDEPEND+=" declarative? ( ${qtdeclarativedepend} )" |
|
|
240 | ;; |
|
|
241 | *) ;; |
|
|
242 | esac |
|
|
243 | unset qtdeclarativedepend |
|
|
244 | |
|
|
245 | # QtHelp dependencies |
|
|
246 | qthelpdepend=" |
|
|
247 | >=x11-libs/qt-assistant-${QT_MINIMAL}:4 |
|
|
248 | " |
|
|
249 | case ${QTHELP_REQUIRED} in |
|
|
250 | always) |
|
|
251 | COMMONDEPEND+=" ${qthelpdepend}" |
|
|
252 | ;; |
|
|
253 | optional) |
|
|
254 | IUSE+=" qthelp" |
|
|
255 | COMMONDEPEND+=" qthelp? ( ${qthelpdepend} )" |
|
|
256 | ;; |
|
|
257 | esac |
|
|
258 | unset qthelpdepend |
201 | |
259 | |
202 | # OpenGL dependencies |
260 | # OpenGL dependencies |
203 | qtopengldepend=" |
261 | qtopengldepend=" |
204 | >=x11-libs/qt-opengl-${QT_MINIMAL}:4 |
262 | >=x11-libs/qt-opengl-${QT_MINIMAL}:4 |
205 | " |
263 | " |
… | |
… | |
452 | if [[ -z ${KMNOMODULE} ]] && [[ -z ${KMMODULE} ]]; then |
510 | if [[ -z ${KMNOMODULE} ]] && [[ -z ${KMMODULE} ]]; then |
453 | KMMODULE="${PN}" |
511 | KMMODULE="${PN}" |
454 | fi |
512 | fi |
455 | case ${KDEBASE} in |
513 | case ${KDEBASE} in |
456 | kdevelop) |
514 | kdevelop) |
457 | EGIT_REPO_URI="git://gitorious.org/${KMNAME}/${KMMODULE}.git" |
515 | EGIT_REPO_URI="git://git.kde.org/${KMMODULE}" |
458 | ;; |
516 | ;; |
459 | esac |
517 | esac |
460 | fi |
518 | fi |
461 | ;; |
519 | ;; |
462 | *) |
520 | *) |
… | |
… | |
654 | # Inject library dependencies |
712 | # Inject library dependencies |
655 | if [[ -n ${KMLOADLIBS} ]] ; then |
713 | if [[ -n ${KMLOADLIBS} ]] ; then |
656 | load_library_dependencies |
714 | load_library_dependencies |
657 | fi |
715 | fi |
658 | |
716 | |
|
|
717 | # Replace KDE4Workspace library targets |
|
|
718 | find "${S}" -name CMakeLists.txt \ |
|
|
719 | -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_TASKMANAGER_(LIBRARY|LIBS)\}/taskmanager/g' {} + \ |
|
|
720 | -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_KWORKSPACE_(LIBRARY|LIBS)\}/kworkspace/g' {} + \ |
|
|
721 | -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_SOLIDCONTROLIFACES_(LIBRARY|LIBS)\}/solidcontrolifaces/g' {} + \ |
|
|
722 | -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_SOLIDCONTROL_(LIBRARY|LIBS)\}/solidcontrol/g' {} + \ |
|
|
723 | -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_PROCESSUI_(LIBRARY|LIBS)\}/processui/g' {} + \ |
|
|
724 | -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_LSOFUI_(LIBRARY|LIBS)\}/lsofui/g' {} + \ |
|
|
725 | -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_PLASMACLOCK_(LIBRARY|LIBS)\}/plasmaclock/g' {} + \ |
|
|
726 | -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_NEPOMUKQUERYCLIENT_(LIBRARY|LIBS)\}/nepomukqueryclient/g' {} + \ |
|
|
727 | -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_NEPOMUKQUERY_(LIBRARY|LIBS)\}/nepomukquery/g' {} + \ |
|
|
728 | -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_KSCREENSAVER_(LIBRARY|LIBS)\}/kscreensaver/g' {} + \ |
|
|
729 | -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_WEATHERION_(LIBRARY|LIBS)\}/weather_ion/g' {} + \ |
|
|
730 | -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_KWINEFFECTS_(LIBRARY|LIBS)\}/kwineffects/g' {} + \ |
|
|
731 | -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_KDECORATIONS_(LIBRARY|LIBS)\}/kdecorations/g' {} + \ |
|
|
732 | -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_KSGRD_(LIBRARY|LIBS)\}/ksgrd/g' {} + \ |
|
|
733 | -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_KEPHAL_(LIBRARY|LIBS)\}/kephal/g' {} + \ |
|
|
734 | || die 'failed to replace KDE4Workspace library targets' |
|
|
735 | |
659 | # Hack for manuals relying on outdated DTD, only outside kde-base/koffice/... |
736 | # Hack for manuals relying on outdated DTD, only outside kde-base/koffice/... |
660 | if [ -z ${KDEBASE} ]; then |
737 | if [[ -z ${KDEBASE} ]]; then |
661 | find "${S}" -name "*.docbook" \ |
738 | find "${S}" -name "*.docbook" \ |
662 | -exec sed -i -r \ |
739 | -exec sed -i -r \ |
663 | -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' {} + \ |
740 | -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' {} + \ |
664 | || die 'failed to fix DocBook variant version' |
741 | || die 'failed to fix DocBook variant version' |
665 | fi |
742 | fi |
… | |
… | |
753 | # Override this value, set in kde4-base_src_configure() |
830 | # Override this value, set in kde4-base_src_configure() |
754 | mycmakeargs+=(-DKDE4_BUILD_TESTS=ON) |
831 | mycmakeargs+=(-DKDE4_BUILD_TESTS=ON) |
755 | cmake-utils_src_configure |
832 | cmake-utils_src_configure |
756 | kde4-base_src_compile |
833 | kde4-base_src_compile |
757 | |
834 | |
|
|
835 | if [[ ${VIRTUALX_REQUIRED} == always ]] || |
|
|
836 | ( [[ ${VIRTUALX_REQUIRED} != manual ]] && use test ); then |
|
|
837 | |
|
|
838 | if [[ ${maketype} ]]; then |
|
|
839 | # surprise- we are already INSIDE virtualmake!!! |
|
|
840 | ewarn "QA Notice: This version of kde4-base.eclass includes the virtualx functionality." |
|
|
841 | ewarn " You may NOT set maketype or call virtualmake from the ebuild. Applying workaround." |
|
|
842 | cmake-utils_src_test |
|
|
843 | else |
|
|
844 | export maketype="cmake-utils_src_test" |
|
|
845 | virtualmake |
|
|
846 | fi |
|
|
847 | else |
758 | cmake-utils_src_test |
848 | cmake-utils_src_test |
|
|
849 | fi |
759 | } |
850 | } |
760 | |
851 | |
761 | # @FUNCTION: kde4-base_src_install |
852 | # @FUNCTION: kde4-base_src_install |
762 | # @DESCRIPTION: |
853 | # @DESCRIPTION: |
763 | # Function for installing KDE4 applications. |
854 | # Function for installing KDE4 applications. |