Hello lads,
I would like you to review following patches we kept hidden from you in
x11 overlay up till now.
xorg-2:
autotools-utils usage
- out of tree build by default
- killing all .la files
added doc dependencies
- it is same for all pkgs and easier to keep it in eclass
(ebuilds will be updated as bumped, live versions in overlay
are already prepared for this)
updated font disable calls
- with new fonts the disable call is much much easier so we
just need to reflect that
virtualx:
Pretty much add eclass-debug info everywhere and fix formatting.
migrate from export maketype to more reliable VIRTUALX_COMMAND global
variable (can be set anytime).
deprecate Xmake in favor of Xemake -j1 or VIRTUALX_COMMAND=emake -j1
Change the VIRTUALX_REQUIRED and VIRTUALX_USE to be bit saner and merged
into one variable with qa deprecation warnings and fallback in place.
New usage described in eclassdoc pretty well.
So any comments? suggestions?
Cheers
Tom
--- /home/scarab/gentoo/gentoo-x86/eclass/virtualx.eclass 2010-11-12
15:43:12.0 +0100
+++ virtualx.eclass 2011-02-21 20:46:14.0 +0100
@@ -6,113 +6,132 @@
# @ECLASS: virtualx.eclass
# @MAINTAINER:
-# x...@gentoo.org
+# x...@gentoo.org
# @BLURB: This eclass can be used for packages that needs a working X
environment to build.
# @ECLASS-VARIABLE: VIRTUALX_REQUIRED
# @DESCRIPTION:
-# Is a dependency on xorg-server and xhost needed?
-# Valid values are always, optional, and manual.
-# tests is a synonym for optional.
-: ${VIRTUALX_REQUIRED:=optional}
+# Variable specifying the dependency on xorg-server and xhost.
+# Possible special values are always and manual, which specify
+# the dependency to be set unconditionaly or not at all.
+# Any other value is taken as useflag desired to be in control of
+# the dependency (eg. VIRTUALX_REQUIRED=kde will add the dependency
+# into kde? ( ) and add kde into IUSE.
+: ${VIRTUALX_REQUIRED:=test}
-# @ECLASS-VARIABLE: VIRTUALX_USE
+# @ECLASS-VARIABLE: VIRTUALX_DEPEND
# @DESCRIPTION:
-# If VIRTUALX_REQUIRED=optional, what USE flag should control
-# the dependency?
-: ${VIRTUALX_USE:=test}
+# Dep string available for use outside of eclass, in case a more
+# complicated dep is needed.
+# You can specify the variable BEFORE inherit to add more dependencies.
+VIRTUALX_DEPEND=${VIRTUALX_DEPEND}
+ !prefix? ( x11-base/xorg-server[-minimal] )
+ x11-apps/xhost
+
-# @ECLASS-VARIABLE: VIRTUALX_DEPEND
+# @ECLASS-VARIABLE: VIRTUALX_COMMAND
# @DESCRIPTION:
-# Dep string available for use outside of eclass, in case a more
-# complicated dep is needed.
-VIRTUALX_DEPEND=!prefix? ( x11-base/xorg-server )
- x11-apps/xhost
+# Command (or eclass function call) to be run in the X11 environment
+# (within virtualmake function).
+: ${VIRTUALX_COMMAND:=emake}
+
+has ${EAPI:-0} 0 1 die virtualx eclass require EAPI=2 or newer.
case ${VIRTUALX_REQUIRED} in
+ manual)
+ ;;
always)
DEPEND=${VIRTUALX_DEPEND}
RDEPEND=
;;
optional|tests)
+ # deprecated section YAY.
+ ewarn QA: VIRTUALX_REQUIRED=optional and
VIRTUALX_REQUIRED=tests are deprecated.
+ ewarn QA: You can drop the variable definition completely from
ebuild,
+ ewarn QA: because it is default behaviour.
+
+ if [[ -n ${VIRTUALX_USE} ]]; then
+ # so they like to specify the useflag
+ ewarn QA: VIRTUALX_USE variable is deprecated.
+ ewarn QA: Please read eclass manpage to find out how
to use VIRTUALX_REQUIRED
+ ewarn QA: to achieve the same behaviour.
+ fi
+
+ [[ -z ${VIRTUALX_USE} ]] VIRTUALX_USE=test
DEPEND=${VIRTUALX_USE}? ( ${VIRTUALX_DEPEND} )
RDEPEND=
IUSE=${VIRTUALX_USE}
;;
- manual)
- ;;
*)
- eerror Invalid value (${VIRTUALX_REQUIRED}) for
VIRTUALX_REQUIRED
- eerror Valid values are:
- eerror always
- eerror optional (default if unset)
- eerror manual
- die Invalid value (${VIRTUALX_REQUIRED}) for VIRTUALX_REQUIRED
+ DEPEND=${VIRTUALX_REQUIRED}? ( ${VIRTUALX_DEPEND} )
+ RDEPEND=
+ IUSE=${VIRTUALX_REQUIRED}
;;
esac
+# @FUNCTION: virtualmake
+# @DESCRIPTION:
+# Function which attach to running X session or start new Xvfb session
+# where the VIRTUALX_COMMAND variable content gets executed.
virtualmake() {
+ debug-print-function ${FUNCNAME} $@
+
+ local i=0
local retval=0
local OLD_SANDBOX_ON=${SANDBOX_ON}
local XVFB=$(type -p Xvfb)
local XHOST=$(type -p xhost)
+ local xvfbargs=-screen 0 800x600x24
+
+ #