summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Chvatal <scarabeus@gentoo.org>2011-03-16 16:10:21 +0000
committerTomas Chvatal <scarabeus@gentoo.org>2011-03-16 16:10:21 +0000
commit805df4a1f2d80b288506f7c80b0a155e2197c9b1 (patch)
tree7cedfeb211b8b0d7c2c4c16818b4cf2082c145d5 /eclass/xorg-2.eclass
parentTry to fix broken inherits... (diff)
downloadgentoo-2-805df4a1f2d80b288506f7c80b0a155e2197c9b1.tar.gz
gentoo-2-805df4a1f2d80b288506f7c80b0a155e2197c9b1.tar.bz2
gentoo-2-805df4a1f2d80b288506f7c80b0a155e2197c9b1.zip
Fix IUSE handling for both dri and doc useflag. Current logic was not working at all. Preserve namespace for all eclass variables that are to be set in ebuilds.
Diffstat (limited to 'eclass/xorg-2.eclass')
-rw-r--r--eclass/xorg-2.eclass131
1 files changed, 86 insertions, 45 deletions
diff --git a/eclass/xorg-2.eclass b/eclass/xorg-2.eclass
index 42cab0a6c302..e6602ebf9fa1 100644
--- a/eclass/xorg-2.eclass
+++ b/eclass/xorg-2.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/xorg-2.eclass,v 1.30 2011/03/16 09:29:42 scarabeus Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/xorg-2.eclass,v 1.31 2011/03/16 16:10:21 scarabeus Exp $
#
# @ECLASS: xorg-2.eclass
# @MAINTAINER:
@@ -58,41 +58,44 @@ HOMEPAGE="http://xorg.freedesktop.org/"
# before inheriting this eclass.
: ${XORG_EAUTORECONF:="no"}
-# @ECLASS-VARIABLE: BASE_INDIVIDUAL_URI
+# @ECLASS-VARIABLE: XORG_BASE_INDIVIDUAL_URI
# @DESCRIPTION:
# Set up SRC_URI for individual modular releases. If set to an empty
# string, no SRC_URI will be provided by the eclass.
-: ${BASE_INDIVIDUAL_URI="http://xorg.freedesktop.org/releases/individual"}
+: ${XORG_BASE_INDIVIDUAL_URI="http://xorg.freedesktop.org/releases/individual"}
-# @ECLASS-VARIABLE: MODULE
+# @ECLASS-VARIABLE: XORG_MODULE
# @DESCRIPTION:
# The subdirectory to download source from. Possible settings are app,
# doc, data, util, driver, font, lib, proto, xserver. Set above the
# inherit to override the default autoconfigured module.
-if [[ -z ${MODULE} ]]; then
+if [[ -z ${XORG_MODULE} ]]; then
case ${CATEGORY} in
- app-doc) MODULE=doc/ ;;
- media-fonts) MODULE=font/ ;;
- x11-apps|x11-wm) MODULE=app/ ;;
- x11-misc|x11-themes) MODULE=util/ ;;
- x11-base) MODULE=xserver/ ;;
- x11-drivers) MODULE=driver/ ;;
- x11-proto) MODULE=proto/ ;;
- x11-libs) MODULE=lib/ ;;
- *) MODULE= ;;
+ app-doc) XORG_MODULE=doc/ ;;
+ media-fonts) XORG_MODULE=font/ ;;
+ x11-apps|x11-wm) XORG_MODULE=app/ ;;
+ x11-misc|x11-themes) XORG_MODULE=util/ ;;
+ x11-base) XORG_MODULE=xserver/ ;;
+ x11-drivers) XORG_MODULE=driver/ ;;
+ x11-proto) XORG_MODULE=proto/ ;;
+ x11-libs) XORG_MODULE=lib/ ;;
+ *) XORG_MODULE= ;;
esac
fi
-# @ECLASS-VARIABLE: PACKAGE_NAME
+# backcompat, remove when everything in main tree fixed
+[[ -n ${MODULE} ]] && XORG_MODULE=${MODULE} && ewarn "Your ebuild is using MODULE variable, please migrate to XORG_MODULE to preserve namespace."
+
+# @ECLASS-VARIABLE: XORG_PACKAGE_NAME
# @DESCRIPTION:
# For git checkout the git repository might differ from package name.
# This variable can be used for proper directory specification
-: ${PACKAGE_NAME:=${PN}}
+: ${XORG_PACKAGE_NAME:=${PN}}
if [[ -n ${GIT_ECLASS} ]]; then
- EGIT_REPO_URI="git://anongit.freedesktop.org/git/xorg/${MODULE}${PACKAGE_NAME}"
-elif [[ -n ${BASE_INDIVIDUAL_URI} ]]; then
- SRC_URI="${BASE_INDIVIDUAL_URI}/${MODULE}${P}.tar.bz2"
+ EGIT_REPO_URI="git://anongit.freedesktop.org/git/xorg/${XORG_MODULE}${PACKAGE_NAME}"
+elif [[ -n ${XORG_BASE_INDIVIDUAL_URI} ]]; then
+ SRC_URI="${XORG_BASE_INDIVIDUAL_URI}/${XORG_MODULE}${P}.tar.bz2"
fi
: ${SLOT:=0}
@@ -177,18 +180,39 @@ fi
DEPEND+=" >=dev-util/pkgconfig-0.23"
-# Check deps on drivers
-if has dri ${IUSE//+}; then
- COMMON_DEPEND+=" dri? (
- x11-base/xorg-server[-minimal]
- x11-libs/libdrm
- )"
- DEPEND+=" dri? (
- x11-proto/xf86driproto
- x11-proto/glproto
- x11-proto/dri2proto
- )"
-fi
+# @ECLASS-VARIABLE: XORG_DRI
+# @DESCRIPTION:
+# Possible values are "always" or the value of the useflag DRI capabilities
+# are required for. Default value is "no"
+#
+# Eg. XORG_DRI="opengl" will pull all dri dependant deps for opengl useflag
+: ${XORG_DRI:="no"}
+
+DRI_COMMON_DEPEND="
+ x11-base/xorg-server[-minimal]
+ x11-libs/libdrm
+"
+DRI_DEPEND="
+ x11-proto/xf86driproto
+ x11-proto/glproto
+ x11-proto/dri2proto
+"
+case ${XORG_DRI} in
+ no)
+ ;;
+ always)
+ COMMON_DEPEND+=" ${DRI_COMMON_DEPEND}"
+ DEPEND+=" ${DRI_DEPEND}"
+ ;;
+ *)
+ COMMON_DEPEND+=" ${XORG_DRI}? ( ${DRI_COMMON_DEPEND} )"
+ DEPEND+=" ${XORG_DRI}? ( ${DRI_DEPEND} )"
+ IUSE="${XORG_DRI}"
+ ;;
+esac
+unset DRI_DEPEND
+unset DRI_COMMONDEPEND
+
if [[ -n "${DRIVER}" ]]; then
COMMON_DEPEND+="
x11-base/xorg-server[xorg]
@@ -210,20 +234,36 @@ if [[ -n "${DRIVER}" && ${PN} == xf86-video-* ]]; then
"
fi
-# Add deps on documentation
-# Most docbooks use dtd version 4.2 and 4.3 add more when found
-if has doc ${IUSE//+}; then
- DEPEND+="
- doc? (
- app-text/asciidoc
- app-text/xmlto
- app-doc/doxygen
- app-text/docbook-xml-dtd:4.1
- app-text/docbook-xml-dtd:4.2
- app-text/docbook-xml-dtd:4.3
- )
- "
-fi
+# @ECLASS-VARIABLE: XORG_DOC
+# @DESCRIPTION:
+# Possible values are "always" or the value of the useflag doc packages
+# are required for. Default value is "no"
+#
+# Eg. XORG_DOC="manual" will pull all doc dependant deps for manual useflag
+: ${XORG_DOC:="no"}
+
+DOC_DEPEND="
+ doc? (
+ app-text/asciidoc
+ app-text/xmlto
+ app-doc/doxygen
+ app-text/docbook-xml-dtd:4.1
+ app-text/docbook-xml-dtd:4.2
+ app-text/docbook-xml-dtd:4.3
+ )
+"
+case ${XORG_DOC} in
+ no)
+ ;;
+ always)
+ DEPEND+="${DOC_DEPEND}"
+ ;;
+ *)
+ DEPEND+="${XORG_DOC}? ( ${DOC_DEPEND} )"
+ IUSE="${XORG_DOC}"
+ ;;
+esac
+unset DOC_DEPEND
DEPEND+=" ${COMMON_DEPEND}"
RDEPEND+=" ${COMMON_DEPEND}"
@@ -231,6 +271,7 @@ unset COMMON_DEPEND
debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: DEPEND=${DEPEND}"
debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: RDEPEND=${RDEPEND}"
+debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: PDEPEND=${PDEPEND}"
# @FUNCTION: xorg-2_pkg_setup
# @DESCRIPTION: