| 1 | # Copyright 1999-2010 Gentoo Foundation |
1 | # Copyright 1999-2011 Gentoo Foundation |
| 2 | # Distributed under the terms of the GNU General Public License v2 |
2 | # Distributed under the terms of the GNU General Public License v2 |
| 3 | # $Header: /var/cvsroot/gentoo-x86/eclass/virtualx.eclass,v 1.39 2011/06/09 21:42:58 mattst88 Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/virtualx.eclass,v 1.40 2011/08/22 04:46:32 vapier Exp $ |
| 4 | |
|
|
| 5 | # Original author: Martin Schlemmer <azarah@gentoo.org> |
|
|
| 6 | |
4 | |
| 7 | # @ECLASS: virtualx.eclass |
5 | # @ECLASS: virtualx.eclass |
| 8 | # @MAINTAINER: |
6 | # @MAINTAINER: |
| 9 | # x11@gentoo.org |
7 | # x11@gentoo.org |
|
|
8 | # @AUTHOR: |
|
|
9 | # Original author: Martin Schlemmer <azarah@gentoo.org> |
| 10 | # @BLURB: This eclass can be used for packages that needs a working X environment to build. |
10 | # @BLURB: This eclass can be used for packages that needs a working X environment to build. |
| 11 | |
11 | |
| 12 | # @ECLASS-VARIABLE: VIRTUALX_REQUIRED |
12 | # @ECLASS-VARIABLE: VIRTUALX_REQUIRED |
| 13 | # @DESCRIPTION: |
13 | # @DESCRIPTION: |
| 14 | # Variable specifying the dependency on xorg-server and xhost. |
14 | # Variable specifying the dependency on xorg-server and xhost. |
| … | |
… | |
| 68 | IUSE="${VIRTUALX_REQUIRED}" |
68 | IUSE="${VIRTUALX_REQUIRED}" |
| 69 | ;; |
69 | ;; |
| 70 | esac |
70 | esac |
| 71 | |
71 | |
| 72 | # @FUNCTION: virtualmake |
72 | # @FUNCTION: virtualmake |
| 73 | # @DESCRIPTION: |
73 | # @DESCRIPTION: |
| 74 | # Function which attach to running X session or start new Xvfb session |
74 | # Function which attach to running X session or start new Xvfb session |
| 75 | # where the VIRTUALX_COMMAND variable content gets executed. |
75 | # where the VIRTUALX_COMMAND variable content gets executed. |
| 76 | virtualmake() { |
76 | virtualmake() { |
| 77 | debug-print-function ${FUNCNAME} "$@" |
77 | debug-print-function ${FUNCNAME} "$@" |
| 78 | |
78 | |
| … | |
… | |
| 162 | |
162 | |
| 163 | return 0 # always return 0, it can be altered by failed kill for Xvfb |
163 | return 0 # always return 0, it can be altered by failed kill for Xvfb |
| 164 | } |
164 | } |
| 165 | |
165 | |
| 166 | # @FUNCTION: Xmake |
166 | # @FUNCTION: Xmake |
| 167 | # @DESCRIPTION: |
167 | # @DESCRIPTION: |
| 168 | # Same as "make", but set up the Xvfb hack if needed. |
168 | # Same as "make", but set up the Xvfb hack if needed. |
| 169 | # Deprecated call. |
169 | # Deprecated call. |
| 170 | Xmake() { |
170 | Xmake() { |
| 171 | debug-print-function ${FUNCNAME} "$@" |
171 | debug-print-function ${FUNCNAME} "$@" |
| 172 | |
172 | |
| … | |
… | |
| 174 | ewarn "QA: rather execute Xemake -j1 if you have issues with parallel make" |
174 | ewarn "QA: rather execute Xemake -j1 if you have issues with parallel make" |
| 175 | VIRTUALX_COMMAND="emake -j1" virtualmake "$@" |
175 | VIRTUALX_COMMAND="emake -j1" virtualmake "$@" |
| 176 | } |
176 | } |
| 177 | |
177 | |
| 178 | # @FUNCTION: Xemake |
178 | # @FUNCTION: Xemake |
| 179 | # @DESCRIPTION: |
179 | # @DESCRIPTION: |
| 180 | # Same as "emake", but set up the Xvfb hack if needed. |
180 | # Same as "emake", but set up the Xvfb hack if needed. |
| 181 | Xemake() { |
181 | Xemake() { |
| 182 | debug-print-function ${FUNCNAME} "$@" |
182 | debug-print-function ${FUNCNAME} "$@" |
| 183 | |
183 | |
| 184 | VIRTUALX_COMMAND="emake" virtualmake "$@" |
184 | VIRTUALX_COMMAND="emake" virtualmake "$@" |
| 185 | } |
185 | } |
| 186 | |
186 | |
| 187 | # @FUNCTION: Xeconf |
187 | # @FUNCTION: Xeconf |
| 188 | # @DESCRIPTION: |
188 | # @DESCRIPTION: |
| 189 | # Same as "econf", but set up the Xvfb hack if needed. |
189 | # Same as "econf", but set up the Xvfb hack if needed. |
| 190 | Xeconf() { |
190 | Xeconf() { |
| 191 | debug-print-function ${FUNCNAME} "$@" |
191 | debug-print-function ${FUNCNAME} "$@" |
| 192 | |
192 | |
| 193 | VIRTUALX_COMMAND="econf" virtualmake "$@" |
193 | VIRTUALX_COMMAND="econf" virtualmake "$@" |
| 194 | } |
194 | } |