/[gentoo-x86]/eclass/xorg-2.eclass
Gentoo

Diff of /eclass/xorg-2.eclass

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

Revision 1.35 Revision 1.44
1# Copyright 1999-2010 Gentoo Foundation 1# Copyright 1999-2010 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/xorg-2.eclass,v 1.35 2011/03/17 22:40:20 scarabeus Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/xorg-2.eclass,v 1.44 2011/05/14 16:27:50 scarabeus Exp $
4# 4#
5# @ECLASS: xorg-2.eclass 5# @ECLASS: xorg-2.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# x11@gentoo.org 7# x11@gentoo.org
8# @BLURB: Reduces code duplication in the modularized X11 ebuilds. 8# @BLURB: Reduces code duplication in the modularized X11 ebuilds.
20# Author: Tomáš Chvátal <scarabeus@gentoo.org> 20# Author: Tomáš Chvátal <scarabeus@gentoo.org>
21# Author: Donnie Berkholz <dberkholz@gentoo.org> 21# Author: Donnie Berkholz <dberkholz@gentoo.org>
22 22
23GIT_ECLASS="" 23GIT_ECLASS=""
24if [[ ${PV} == *9999* ]]; then 24if [[ ${PV} == *9999* ]]; then
25 GIT_ECLASS="git" 25 GIT_ECLASS="git-2"
26 XORG_EAUTORECONF="yes" 26 XORG_EAUTORECONF="yes"
27fi 27fi
28 28
29# If we're a font package, but not the font.alias one 29# If we're a font package, but not the font.alias one
30FONT_ECLASS="" 30FONT_ECLASS=""
41 ${FONT_ECLASS} ${GIT_ECLASS} 41 ${FONT_ECLASS} ${GIT_ECLASS}
42 42
43EXPORTED_FUNCTIONS="src_unpack src_compile src_install pkg_postinst pkg_postrm" 43EXPORTED_FUNCTIONS="src_unpack src_compile src_install pkg_postinst pkg_postrm"
44case "${EAPI:-0}" in 44case "${EAPI:-0}" in
45 3|4) EXPORTED_FUNCTIONS="${EXPORTED_FUNCTIONS} src_prepare src_configure" ;; 45 3|4) EXPORTED_FUNCTIONS="${EXPORTED_FUNCTIONS} src_prepare src_configure" ;;
46 *) die "EAPI-UNSUPPORTED" ;; 46 *) die "EAPI=${EAPI} is not supported" ;;
47esac 47esac
48 48
49# exports must be ALWAYS after inherit 49# exports must be ALWAYS after inherit
50EXPORT_FUNCTIONS ${EXPORTED_FUNCTIONS} 50EXPORT_FUNCTIONS ${EXPORTED_FUNCTIONS}
51 51
81 x11-libs) XORG_MODULE=lib/ ;; 81 x11-libs) XORG_MODULE=lib/ ;;
82 *) XORG_MODULE= ;; 82 *) XORG_MODULE= ;;
83 esac 83 esac
84fi 84fi
85 85
86# backcompat, remove when everything in main tree fixed
87[[ -n ${MODULE} ]] && XORG_MODULE=${MODULE} && ewarn "Your ebuild is using MODULE variable, please migrate to XORG_MODULE to preserve namespace."
88
89# @ECLASS-VARIABLE: XORG_PACKAGE_NAME 86# @ECLASS-VARIABLE: XORG_PACKAGE_NAME
90# @DESCRIPTION: 87# @DESCRIPTION:
91# For git checkout the git repository might differ from package name. 88# For git checkout the git repository might differ from package name.
92# This variable can be used for proper directory specification 89# This variable can be used for proper directory specification
93: ${XORG_PACKAGE_NAME:=${PN}} 90: ${XORG_PACKAGE_NAME:=${PN}}
94 91
95if [[ -n ${GIT_ECLASS} ]]; then 92if [[ -n ${GIT_ECLASS} ]]; then
96 EGIT_REPO_URI="git://anongit.freedesktop.org/git/xorg/${XORG_MODULE}${XORG_PACKAGE_NAME}" 93 : ${EGIT_REPO_URI:="git://anongit.freedesktop.org/git/xorg/${XORG_MODULE}${XORG_PACKAGE_NAME}"}
97elif [[ -n ${XORG_BASE_INDIVIDUAL_URI} ]]; then 94elif [[ -n ${XORG_BASE_INDIVIDUAL_URI} ]]; then
98 SRC_URI="${XORG_BASE_INDIVIDUAL_URI}/${XORG_MODULE}${P}.tar.bz2" 95 SRC_URI="${XORG_BASE_INDIVIDUAL_URI}/${XORG_MODULE}${P}.tar.bz2"
99fi 96fi
100 97
101: ${SLOT:=0} 98: ${SLOT:=0}
110XORG_EAUTORECONF_ARCHES="x86-interix ppc-aix x86-winnt" 107XORG_EAUTORECONF_ARCHES="x86-interix ppc-aix x86-winnt"
111EAUTORECONF_DEPEND+=" 108EAUTORECONF_DEPEND+="
112 >=sys-devel/libtool-2.2.6a 109 >=sys-devel/libtool-2.2.6a
113 sys-devel/m4" 110 sys-devel/m4"
114if [[ ${PN} != util-macros ]] ; then 111if [[ ${PN} != util-macros ]] ; then
115 EAUTORECONF_DEPEND+=" >=x11-misc/util-macros-1.12.0" 112 EAUTORECONF_DEPEND+=" >=x11-misc/util-macros-1.13.0"
116 # Required even by xorg-server 113 # Required even by xorg-server
117 [[ ${PN} == "font-util" ]] || EAUTORECONF_DEPEND+=" >=media-fonts/font-util-1.2.0" 114 [[ ${PN} == "font-util" ]] || EAUTORECONF_DEPEND+=" >=media-fonts/font-util-1.2.0"
118fi 115fi
119WANT_AUTOCONF="latest" 116WANT_AUTOCONF="latest"
120WANT_AUTOMAKE="latest" 117WANT_AUTOMAKE="latest"
205 DEPEND+=" ${DRI_DEPEND}" 202 DEPEND+=" ${DRI_DEPEND}"
206 ;; 203 ;;
207 *) 204 *)
208 COMMON_DEPEND+=" ${XORG_DRI}? ( ${DRI_COMMON_DEPEND} )" 205 COMMON_DEPEND+=" ${XORG_DRI}? ( ${DRI_COMMON_DEPEND} )"
209 DEPEND+=" ${XORG_DRI}? ( ${DRI_DEPEND} )" 206 DEPEND+=" ${XORG_DRI}? ( ${DRI_DEPEND} )"
210 IUSE="${XORG_DRI}" 207 IUSE+=" ${XORG_DRI}"
211 ;; 208 ;;
212esac 209esac
213unset DRI_DEPEND 210unset DRI_DEPEND
214unset DRI_COMMONDEPEND 211unset DRI_COMMONDEPEND
215 212
216if [[ -n "${DRIVER}" ]]; then 213if [[ -n "${DRIVER}" ]]; then
217 COMMON_DEPEND+=" 214 COMMON_DEPEND+="
218 x11-base/xorg-server[xorg] 215 x11-base/xorg-server[xorg]
216 "
217fi
218if [[ -n "${DRIVER}" && ${PN} == xf86-input-* ]]; then
219 DEPEND+="
220 x11-proto/inputproto
221 x11-proto/kbproto
222 x11-proto/xproto
219 " 223 "
220fi 224fi
221if [[ -n "${DRIVER}" && ${PN} == xf86-video-* ]]; then 225if [[ -n "${DRIVER}" && ${PN} == xf86-video-* ]]; then
222 COMMON_DEPEND+=" 226 COMMON_DEPEND+="
223 x11-libs/libpciaccess 227 x11-libs/libpciaccess
258 always) 262 always)
259 DEPEND+=" ${DOC_DEPEND}" 263 DEPEND+=" ${DOC_DEPEND}"
260 ;; 264 ;;
261 *) 265 *)
262 DEPEND+=" ${XORG_DOC}? ( ${DOC_DEPEND} )" 266 DEPEND+=" ${XORG_DOC}? ( ${DOC_DEPEND} )"
263 IUSE="${XORG_DOC}" 267 IUSE+=" ${XORG_DOC}"
264 ;; 268 ;;
265esac 269esac
266unset DOC_DEPEND 270unset DOC_DEPEND
267 271
268DEPEND+=" ${COMMON_DEPEND}" 272DEPEND+=" ${COMMON_DEPEND}"
287# Simply unpack source code. 291# Simply unpack source code.
288xorg-2_src_unpack() { 292xorg-2_src_unpack() {
289 debug-print-function ${FUNCNAME} "$@" 293 debug-print-function ${FUNCNAME} "$@"
290 294
291 if [[ -n ${GIT_ECLASS} ]]; then 295 if [[ -n ${GIT_ECLASS} ]]; then
292 git_src_unpack 296 git-2_src_unpack
293 else 297 else
294 unpack ${A} 298 unpack ${A}
295 fi 299 fi
296 300
297 [[ -n ${FONT_OPTIONS} ]] && einfo "Detected font directory: ${FONT_DIR}" 301 [[ -n ${FONT_OPTIONS} ]] && einfo "Detected font directory: ${FONT_DIR}"
334# @DESCRIPTION: 338# @DESCRIPTION:
335# Prepare a package after unpacking, performing all X-related tasks. 339# Prepare a package after unpacking, performing all X-related tasks.
336xorg-2_src_prepare() { 340xorg-2_src_prepare() {
337 debug-print-function ${FUNCNAME} "$@" 341 debug-print-function ${FUNCNAME} "$@"
338 342
339 [[ -n ${GIT_ECLASS} ]] && git_src_prepare
340 xorg-2_patch_source 343 xorg-2_patch_source
341 xorg-2_reconf_source 344 xorg-2_reconf_source
342} 345}
343 346
344# @FUNCTION: xorg-2_font_configure 347# @FUNCTION: xorg-2_font_configure
399xorg-2_src_configure() { 402xorg-2_src_configure() {
400 debug-print-function ${FUNCNAME} "$@" 403 debug-print-function ${FUNCNAME} "$@"
401 404
402 xorg-2_flags_setup 405 xorg-2_flags_setup
403 406
404 # @VARIABLE: CONFIGURE_OPTIONS 407 # @VARIABLE: XORG_CONFIGURE_OPTIONS
405 # @DESCRIPTION: 408 # @DESCRIPTION:
406 # Any options to pass to configure 409 # Array of an additional options to pass to configure.
407 # @DEFAULT_UNSET 410 # @DEFAULT_UNSET
408 CONFIGURE_OPTIONS=${CONFIGURE_OPTIONS:=""} 411 if [[ $(declare -p XORG_CONFIGURE_OPTIONS 2>&-) != "declare -a"* ]]; then
412 # fallback to CONFIGURE_OPTIONS, deprecated.
413 [[ -n "${CONFIGURE_OPTIONS}" ]] && \
414 ewarn "QA: CONFIGURE_OPTIONS are deprecated. Please migrate to XORG_CONFIGURE_OPTIONS to preserve namespace."
415 local xorgconfadd=(${CONFIGURE_OPTIONS})
416 else
417 local xorgconfadd=("${XORG_CONFIGURE_OPTIONS[@]}")
418 fi
409 419
410 [[ -n "${FONT}" ]] && xorg-2_font_configure 420 [[ -n "${FONT}" ]] && xorg-2_font_configure
411 local myeconfargs=( 421 local myeconfargs=(
412 --disable-dependency-tracking 422 --disable-dependency-tracking
413 ${CONFIGURE_OPTIONS}
414 ${FONT_OPTIONS} 423 ${FONT_OPTIONS}
424 "${xorgconfadd[@]}"
415 ) 425 )
416 426
417 autotools-utils_src_configure "$@" 427 autotools-utils_src_configure "$@"
418} 428}
419 429

Legend:
Removed from v.1.35  
changed lines
  Added in v.1.44

  ViewVC Help
Powered by ViewVC 1.1.20