| 1 | # Copyright 1999-2004 Gentoo Foundation |
1 | # Copyright 1999-2004 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.16 2004/06/25 00:39:48 vapier Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/virtualx.eclass,v 1.17 2004/08/22 17:48:59 swegener Exp $ |
| 4 | # |
4 | # |
| 5 | # Author: Martin Schlemmer <azarah@gentoo.org> |
5 | # Author: Martin Schlemmer <azarah@gentoo.org> |
| 6 | # |
6 | # |
| 7 | # This eclass can be used for packages that needs a working X environment to build |
7 | # This eclass can be used for packages that needs a working X environment to build |
| 8 | |
8 | |
| … | |
… | |
| 39 | # on the same display (most cases this is :0 ), so make sure |
39 | # on the same display (most cases this is :0 ), so make sure |
| 40 | # Xvfb is started, else bump the display number |
40 | # Xvfb is started, else bump the display number |
| 41 | # |
41 | # |
| 42 | # Azarah - 5 May 2002 |
42 | # Azarah - 5 May 2002 |
| 43 | # |
43 | # |
|
|
44 | # Changed the mode from 800x600x32 to 800x600x24 because the mfb |
|
|
45 | # support has been dropped in Xvfb in the xorg-x11 pre-releases. |
|
|
46 | # For now only depths up to 24-bit are supported. |
|
|
47 | # |
|
|
48 | # Sven Wegener <swegener@gentoo.org> - 22 Aug 2004 |
|
|
49 | # |
| 44 | /usr/X11R6/bin/Xvfb :${XDISPLAY} -screen 0 800x600x32 &>/dev/null & |
50 | /usr/X11R6/bin/Xvfb :${XDISPLAY} -screen 0 800x600x24 &>/dev/null & |
| 45 | sleep 2 |
51 | sleep 2 |
| 46 | |
52 | |
| 47 | local start=${XDISPLAY} |
53 | local start=${XDISPLAY} |
| 48 | while [ ! -f /tmp/.X${XDISPLAY}-lock ] |
54 | while [ ! -f /tmp/.X${XDISPLAY}-lock ] |
| 49 | do |
55 | do |
| … | |
… | |
| 51 | if [ $((${XDISPLAY} - ${start})) -gt 15 ]; then |
57 | if [ $((${XDISPLAY} - ${start})) -gt 15 ]; then |
| 52 | |
58 | |
| 53 | eerror "" |
59 | eerror "" |
| 54 | eerror "Unable to start Xvfb." |
60 | eerror "Unable to start Xvfb." |
| 55 | eerror "" |
61 | eerror "" |
| 56 | eerror "'/usr/X11R6/bin/Xvfb :${XDISPLAY} -screen 0 800x600x32' returns:" |
62 | eerror "'/usr/X11R6/bin/Xvfb :${XDISPLAY} -screen 0 800x600x24' returns:" |
| 57 | eerror "" |
63 | eerror "" |
| 58 | /usr/X11R6/bin/Xvfb :${XDISPLAY} -screen 0 800x600x32 |
64 | /usr/X11R6/bin/Xvfb :${XDISPLAY} -screen 0 800x600x24 |
| 59 | eerror "" |
65 | eerror "" |
| 60 | eerror "If possible, correct the above error and try your emerge again." |
66 | eerror "If possible, correct the above error and try your emerge again." |
| 61 | eerror "" |
67 | eerror "" |
| 62 | die |
68 | die |
| 63 | fi |
69 | fi |
| 64 | |
70 | |
| 65 | XDISPLAY=$((${XDISPLAY}+1)) |
71 | XDISPLAY=$((${XDISPLAY}+1)) |
| 66 | /usr/X11R6/bin/Xvfb :${XDISPLAY} -screen 0 800x600x32 &>/dev/null & |
72 | /usr/X11R6/bin/Xvfb :${XDISPLAY} -screen 0 800x600x24 &>/dev/null & |
| 67 | sleep 2 |
73 | sleep 2 |
| 68 | done |
74 | done |
| 69 | |
75 | |
| 70 | # Now enable SANDBOX again if needed. |
76 | # Now enable SANDBOX again if needed. |
| 71 | export SANDBOX_DISABLED="${OLD_SANDBOX_DISABLED}" |
77 | export SANDBOX_DISABLED="${OLD_SANDBOX_DISABLED}" |