/[gentoo-x86]/eclass/virtualx.eclass
Gentoo

Diff of /eclass/virtualx.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.32 Revision 1.33
1# Copyright 1999-2009 Gentoo Foundation 1# Copyright 1999-2009 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.32 2009/10/21 23:59:51 abcd Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/virtualx.eclass,v 1.33 2009/12/21 17:27:28 abcd 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
42 ;; 42 ;;
43esac 43esac
44 44
45DESCRIPTION="Based on the $ECLASS eclass" 45DESCRIPTION="Based on the $ECLASS eclass"
46 46
47#
48# Brian Harring <ferringb@gentoo.org> 11/04/2004
49# do not disable the sandbox during the depend phase.
50# ebuilds shouldn't touch the fs during depend phase, nor screw with the sandbox.
51#
52if [[ ${EBUILD_PHASE/depend} == "${EBUILD_PHASE}" ]] ; then
53 [[ -z ${SANDBOX_DISABLED} ]] && export SANDBOX_DISABLED="0" || :
54fi
55
56virtualmake() { 47virtualmake() {
57 local retval=0 48 local retval=0
58 local OLD_SANDBOX_DISABLED="${SANDBOX_DISABLED}" 49 local OLD_SANDBOX_ON="${SANDBOX_ON}"
59 local XVFB=$(type -p Xvfb) 50 local XVFB=$(type -p Xvfb)
60 local XHOST=$(type -p xhost) 51 local XHOST=$(type -p xhost)
61 52
62 # If $DISPLAY is not set, or xhost cannot connect to an X 53 # If $DISPLAY is not set, or xhost cannot connect to an X
63 # display, then do the Xvfb hack. 54 # display, then do the Xvfb hack.
68 # compiling without the X display 59 # compiling without the X display
69 60
70 einfo "Scanning for an open DISPLAY to start Xvfb ..." 61 einfo "Scanning for an open DISPLAY to start Xvfb ..."
71 62
72 # We really do not want SANDBOX enabled here 63 # We really do not want SANDBOX enabled here
73 export SANDBOX_DISABLED="1" 64 export SANDBOX_ON="0"
74 65
75 local i=0 66 local i=0
76 XDISPLAY=$(i=0; while [[ -f /tmp/.X${i}-lock ]] ; do ((i++));done; echo ${i}) 67 XDISPLAY=$(i=0; while [[ -f /tmp/.X${i}-lock ]] ; do ((i++));done; echo ${i})
77 68
78 # If we are in a chrooted environment, and there is already a 69 # If we are in a chrooted environment, and there is already a
117 ${XVFB} :${XDISPLAY} -fp built-ins -screen 0 800x600x24 &>/dev/null & 108 ${XVFB} :${XDISPLAY} -fp built-ins -screen 0 800x600x24 &>/dev/null &
118 sleep 2 109 sleep 2
119 done 110 done
120 111
121 # Now enable SANDBOX again if needed. 112 # Now enable SANDBOX again if needed.
122 export SANDBOX_DISABLED="${OLD_SANDBOX_DISABLED}" 113 export SANDBOX_ON="${OLD_SANDBOX_ON}"
123 114
124 einfo "Starting Xvfb on \$DISPLAY=${XDISPLAY} ..." 115 einfo "Starting Xvfb on \$DISPLAY=${XDISPLAY} ..."
125 116
126 export DISPLAY=:${XDISPLAY} 117 export DISPLAY=:${XDISPLAY}
127 #Do not break on error, but setup $retval, as we need 118 #Do not break on error, but setup $retval, as we need

Legend:
Removed from v.1.32  
changed lines
  Added in v.1.33

  ViewVC Help
Powered by ViewVC 1.1.20