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.40 2011/04/17 20:46:05 scarabeus Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/xorg-2.eclass,v 1.42 2011/05/08 12:20:46 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 | |
23 | GIT_ECLASS="" |
23 | GIT_ECLASS="" |
24 | if [[ ${PV} == *9999* ]]; then |
24 | if [[ ${PV} == *9999* ]]; then |
25 | GIT_ECLASS="git" |
25 | GIT_ECLASS="git-2" |
26 | XORG_EAUTORECONF="yes" |
26 | XORG_EAUTORECONF="yes" |
27 | fi |
27 | fi |
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 |
30 | FONT_ECLASS="" |
30 | FONT_ECLASS="" |
… | |
… | |
80 | x11-proto) XORG_MODULE=proto/ ;; |
80 | x11-proto) XORG_MODULE=proto/ ;; |
81 | x11-libs) XORG_MODULE=lib/ ;; |
81 | x11-libs) XORG_MODULE=lib/ ;; |
82 | *) XORG_MODULE= ;; |
82 | *) XORG_MODULE= ;; |
83 | esac |
83 | esac |
84 | fi |
84 | fi |
85 | |
|
|
86 | # backcompat, remove when everything in main tree fixed |
|
|
87 | [[ -n ${MODULE} ]] && XORG_MODULE=${MODULE} && ewarn "$CATEGORY/$P is using MODULE variable, please migrate to XORG_MODULE to preserve namespace." |
|
|
88 | |
85 | |
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 |
… | |
… | |
217 | COMMON_DEPEND+=" |
214 | COMMON_DEPEND+=" |
218 | x11-base/xorg-server[xorg] |
215 | x11-base/xorg-server[xorg] |
219 | " |
216 | " |
220 | fi |
217 | fi |
221 | if [[ -n "${DRIVER}" && ${PN} == xf86-video-* ]]; then |
218 | if [[ -n "${DRIVER}" && ${PN} == xf86-video-* ]]; then |
|
|
219 | DEPEND+=" |
|
|
220 | x11-proto/inputproto |
|
|
221 | " |
|
|
222 | fi |
|
|
223 | if [[ -n "${DRIVER}" && ${PN} == xf86-video-* ]]; then |
222 | COMMON_DEPEND+=" |
224 | COMMON_DEPEND+=" |
223 | x11-libs/libpciaccess |
225 | x11-libs/libpciaccess |
224 | " |
226 | " |
225 | # we also needs some protos and libs in all cases |
227 | # we also needs some protos and libs in all cases |
226 | DEPEND+=" |
228 | DEPEND+=" |
… | |
… | |
287 | # Simply unpack source code. |
289 | # Simply unpack source code. |
288 | xorg-2_src_unpack() { |
290 | xorg-2_src_unpack() { |
289 | debug-print-function ${FUNCNAME} "$@" |
291 | debug-print-function ${FUNCNAME} "$@" |
290 | |
292 | |
291 | if [[ -n ${GIT_ECLASS} ]]; then |
293 | if [[ -n ${GIT_ECLASS} ]]; then |
292 | git_src_unpack |
294 | git-2_src_unpack |
293 | else |
295 | else |
294 | unpack ${A} |
296 | unpack ${A} |
295 | fi |
297 | fi |
296 | |
298 | |
297 | [[ -n ${FONT_OPTIONS} ]] && einfo "Detected font directory: ${FONT_DIR}" |
299 | [[ -n ${FONT_OPTIONS} ]] && einfo "Detected font directory: ${FONT_DIR}" |
… | |
… | |
334 | # @DESCRIPTION: |
336 | # @DESCRIPTION: |
335 | # Prepare a package after unpacking, performing all X-related tasks. |
337 | # Prepare a package after unpacking, performing all X-related tasks. |
336 | xorg-2_src_prepare() { |
338 | xorg-2_src_prepare() { |
337 | debug-print-function ${FUNCNAME} "$@" |
339 | debug-print-function ${FUNCNAME} "$@" |
338 | |
340 | |
339 | [[ -n ${GIT_ECLASS} ]] && git_src_prepare |
|
|
340 | xorg-2_patch_source |
341 | xorg-2_patch_source |
341 | xorg-2_reconf_source |
342 | xorg-2_reconf_source |
342 | } |
343 | } |
343 | |
344 | |
344 | # @FUNCTION: xorg-2_font_configure |
345 | # @FUNCTION: xorg-2_font_configure |
… | |
… | |
399 | xorg-2_src_configure() { |
400 | xorg-2_src_configure() { |
400 | debug-print-function ${FUNCNAME} "$@" |
401 | debug-print-function ${FUNCNAME} "$@" |
401 | |
402 | |
402 | xorg-2_flags_setup |
403 | xorg-2_flags_setup |
403 | |
404 | |
404 | # @VARIABLE: CONFIGURE_OPTIONS |
405 | # @VARIABLE: XORG_CONFIGURE_OPTIONS |
405 | # @DESCRIPTION: |
406 | # @DESCRIPTION: |
406 | # Any options to pass to configure |
407 | # Array of an additional options to pass to configure. |
407 | # @DEFAULT_UNSET |
408 | # @DEFAULT_UNSET |
408 | CONFIGURE_OPTIONS=${CONFIGURE_OPTIONS:=""} |
409 | if [[ $(declare -p XORG_CONFIGURE_OPTIONS 2>&-) != "declare -a"* ]]; then |
|
|
410 | # fallback to CONFIGURE_OPTIONS, deprecated. |
|
|
411 | [[ -n "${CONFIGURE_OPTIONS}" ]] && \ |
|
|
412 | ewarn "QA: CONFIGURE_OPTIONS are deprecated. Please migrate to XORG_CONFIGURE_OPTIONS to preserve namespace." |
|
|
413 | local xorgconfadd=(${CONFIGURE_OPTIONS}) |
|
|
414 | else |
|
|
415 | local xorgconfadd=("${XORG_CONFIGURE_OPTIONS[@]}") |
|
|
416 | fi |
409 | |
417 | |
410 | [[ -n "${FONT}" ]] && xorg-2_font_configure |
418 | [[ -n "${FONT}" ]] && xorg-2_font_configure |
411 | local myeconfargs=( |
419 | local myeconfargs=( |
412 | --disable-dependency-tracking |
420 | --disable-dependency-tracking |
413 | ${CONFIGURE_OPTIONS} |
|
|
414 | ${FONT_OPTIONS} |
421 | ${FONT_OPTIONS} |
|
|
422 | "${xorgconfadd[@]}" |
415 | ) |
423 | ) |
416 | |
424 | |
417 | autotools-utils_src_configure "$@" |
425 | autotools-utils_src_configure "$@" |
418 | } |
426 | } |
419 | |
427 | |