| 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.84 2011/01/28 05:05:13 tampakrap 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 |
| … | |
… | |
| 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 |
16 | # @ECLASS-VARIABLE: VIRTUALX_REQUIRED |
| 17 | # @DESCRIPTION: |
17 | # @DESCRIPTION: |
| 18 | # Do we need an X server? Valid values are "always", "optional", and "manual". |
18 | # For proper description see virtualx.eclass manpage. |
| 19 | # "tests" is a synonym for "optional". While virtualx.eclass supports in principle |
19 | # Here we redefine default value to be manual, if your package needs virtualx |
| 20 | # also the use of an X server during other ebuild phases, we only use it in |
20 | # for tests you should proceed with setting VIRTUALX_REQUIRED=test. |
| 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} |
21 | : ${VIRTUALX_REQUIRED:=manual} |
| 28 | |
22 | |
| 29 | inherit kde4-functions base virtualx eutils |
23 | inherit kde4-functions base virtualx eutils |
| 30 | |
24 | |
| 31 | get_build_type |
25 | get_build_type |
| … | |
… | |
| 838 | # Override this value, set in kde4-base_src_configure() |
832 | # Override this value, set in kde4-base_src_configure() |
| 839 | mycmakeargs+=(-DKDE4_BUILD_TESTS=ON) |
833 | mycmakeargs+=(-DKDE4_BUILD_TESTS=ON) |
| 840 | cmake-utils_src_configure |
834 | cmake-utils_src_configure |
| 841 | kde4-base_src_compile |
835 | kde4-base_src_compile |
| 842 | |
836 | |
| 843 | if [[ ${VIRTUALX_REQUIRED} == always ]] || |
837 | # When run as normal user during ebuild development with the ebuild command, the |
| 844 | ( [[ ${VIRTUALX_REQUIRED} != manual ]] && use test ); then |
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 |
| 845 | |
842 | |
| 846 | if [[ ${maketype} ]]; then |
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 |
| 847 | # surprise- we are already INSIDE virtualmake!!! |
846 | # surprise- we are already INSIDE virtualmake!!! |
| 848 | ewarn "QA Notice: This version of kde4-base.eclass includes the virtualx functionality." |
847 | debug-print "QA Notice: This version of kde4-base.eclass includes the virtualx functionality." |
| 849 | ewarn " You may NOT set maketype or call virtualmake from the ebuild. Applying workaround." |
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." |
| 850 | cmake-utils_src_test |
851 | cmake-utils_src_test |
| 851 | else |
852 | else |
| 852 | export maketype="cmake-utils_src_test" |
853 | VIRTUALX_COMMAND="cmake-utils_src_test" virtualmake |
| 853 | virtualmake |
|
|
| 854 | fi |
854 | fi |
| 855 | else |
855 | else |
| 856 | cmake-utils_src_test |
856 | cmake-utils_src_test |
| 857 | fi |
857 | fi |
| 858 | } |
858 | } |