| 1 | # Copyright 1999-2005 Gentoo Foundation |
1 | # Copyright 1999-2005 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/x-modular.eclass,v 1.92 2008/02/22 05:10:03 dberkholz Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/x-modular.eclass,v 1.99 2008/05/27 18:42:33 dberkholz Exp $ |
| 4 | # |
4 | # |
| 5 | # @ECLASS: x-modular.eclass |
5 | # @ECLASS: x-modular.eclass |
| 6 | # @MAINTAINER: |
6 | # @MAINTAINER: |
| 7 | # Donnie Berkholz <dberkholz@gentoo.org>, x11@gentoo.org |
7 | # Donnie Berkholz <dberkholz@gentoo.org>, x11@gentoo.org |
| 8 | # @BLURB: Reduces code duplication in the modularized X11 ebuilds. |
8 | # @BLURB: Reduces code duplication in the modularized X11 ebuilds. |
| … | |
… | |
| 24 | # recently tested. You may need to uncomment the setting of datadir and |
24 | # recently tested. You may need to uncomment the setting of datadir and |
| 25 | # mandir in x-modular_src_install() or add it back in if it's no longer |
25 | # mandir in x-modular_src_install() or add it back in if it's no longer |
| 26 | # there. You may also want to change the SLOT. |
26 | # there. You may also want to change the SLOT. |
| 27 | XDIR="/usr" |
27 | XDIR="/usr" |
| 28 | |
28 | |
| 29 | if [[ -z "${XDPVER}" ]]; then |
|
|
| 30 | # @ECLASS-VARIABLE: XDPVER |
|
|
| 31 | # @DESCRIPTION: |
|
|
| 32 | # Set up default patchset version(s) if necessary for driver patches. If |
|
|
| 33 | # you want to change the auto-application of the driver patchset or |
|
|
| 34 | # prevent it from applying, edit XDPVER in the ebuild. Set it to -1 to |
|
|
| 35 | # prevent patch application or positive integers for that patch version. |
|
|
| 36 | # Set before inheriting this eclass. |
|
|
| 37 | XDPVER="1" |
|
|
| 38 | fi |
|
|
| 39 | |
|
|
| 40 | IUSE="" |
29 | IUSE="" |
| 41 | HOMEPAGE="http://xorg.freedesktop.org/" |
30 | HOMEPAGE="http://xorg.freedesktop.org/" |
| 42 | |
31 | |
|
|
32 | if [[ -z ${SNAPSHOT} ]]; then |
| 43 | # @ECLASS-VARIABLE: SNAPSHOT |
33 | # @ECLASS-VARIABLE: SNAPSHOT |
| 44 | # @DESCRIPTION: |
34 | # @DESCRIPTION: |
| 45 | # If set to 'yes' and configure.ac exists, eautoreconf will run. Set |
35 | # If set to 'yes' and configure.ac exists, eautoreconf will run. Set |
| 46 | # before inheriting this eclass. |
36 | # before inheriting this eclass. |
| 47 | SNAPSHOT="no" |
37 | SNAPSHOT="no" |
|
|
38 | fi |
| 48 | |
39 | |
| 49 | if [[ ${PV} = 9999* ]]; then |
40 | if [[ ${PV} = 9999* ]]; then |
| 50 | GIT_ECLASS="git" |
41 | GIT_ECLASS="git" |
| 51 | SNAPSHOT="yes" |
42 | SNAPSHOT="yes" |
| 52 | SRC_URI="" |
43 | SRC_URI="" |
| 53 | fi |
44 | fi |
| 54 | |
45 | |
| 55 | # Set up SRC_URI for individual modular releases |
46 | # Set up SRC_URI for individual modular releases |
| 56 | BASE_INDIVIDUAL_URI="http://xorg.freedesktop.org/releases/individual" |
47 | BASE_INDIVIDUAL_URI="http://xorg.freedesktop.org/releases/individual" |
|
|
48 | if [[ -z ${MODULE} ]]; then |
|
|
49 | # @ECLASS-VARIABLE: MODULE |
|
|
50 | # @DESCRIPTION: |
|
|
51 | # The subdirectory to download source from. Possible settings are app, |
|
|
52 | # doc, data, util, driver, font, lib, proto, xserver. Set above the |
|
|
53 | # inherit to override the default autoconfigured module. |
|
|
54 | MODULE="" |
| 57 | if [[ ${CATEGORY} = x11-apps ]] || [[ ${CATEGORY} = x11-wm ]]; then |
55 | if [[ ${CATEGORY} = x11-apps ]] || [[ ${CATEGORY} = x11-wm ]]; then |
| 58 | MODULE="app" |
56 | MODULE="app" |
| 59 | elif [[ ${CATEGORY} = app-doc ]]; then |
57 | elif [[ ${CATEGORY} = app-doc ]]; then |
| 60 | MODULE="doc" |
58 | MODULE="doc" |
| 61 | # x11-misc contains data and util, x11-themes contains data |
59 | # x11-misc contains data and util, x11-themes contains data |
| 62 | elif [[ ${CATEGORY} = x11-misc ]] || [[ ${CATEGORY} = x11-themes ]]; then |
60 | elif [[ ${CATEGORY} = x11-misc ]] || [[ ${CATEGORY} = x11-themes ]]; then |
| 63 | if [[ ${PN} == xbitmaps || ${PN} == xcursor-themes || ${PN} == xkbdata ]]; then |
61 | if [[ ${PN} == xbitmaps || ${PN} == xcursor-themes || ${PN} == xkbdata ]]; then |
| 64 | MODULE="data" |
62 | MODULE="data" |
| 65 | else |
63 | else |
| 66 | MODULE="data" |
64 | MODULE="util" |
| 67 | fi |
65 | fi |
| 68 | elif [[ ${CATEGORY} = x11-drivers ]]; then |
66 | elif [[ ${CATEGORY} = x11-drivers ]]; then |
| 69 | MODULE="driver" |
67 | MODULE="driver" |
| 70 | elif [[ ${CATEGORY} = media-fonts ]]; then |
68 | elif [[ ${CATEGORY} = media-fonts ]]; then |
| 71 | MODULE="font" |
69 | MODULE="font" |
| 72 | elif [[ ${CATEGORY} = x11-libs ]]; then |
70 | elif [[ ${CATEGORY} = x11-libs ]]; then |
| 73 | MODULE="lib" |
71 | MODULE="lib" |
| 74 | elif [[ ${CATEGORY} = x11-proto ]]; then |
72 | elif [[ ${CATEGORY} = x11-proto ]]; then |
| 75 | MODULE="proto" |
73 | MODULE="proto" |
| 76 | elif [[ ${CATEGORY} = x11-base ]]; then |
74 | elif [[ ${CATEGORY} = x11-base ]]; then |
| 77 | MODULE="xserver" |
75 | MODULE="xserver" |
|
|
76 | fi |
| 78 | fi |
77 | fi |
| 79 | |
78 | |
| 80 | if [[ -n ${GIT_ECLASS} ]]; then |
79 | if [[ -n ${GIT_ECLASS} ]]; then |
| 81 | EGIT_REPO_URI="git://anongit.freedesktop.org/git/xorg/${MODULE}/${PN}" |
80 | EGIT_REPO_URI="git://anongit.freedesktop.org/git/xorg/${MODULE}/${PN}" |
| 82 | else |
81 | else |
| … | |
… | |
| 141 | |
140 | |
| 142 | # Set up configure option |
141 | # Set up configure option |
| 143 | FONT_OPTIONS="--with-fontdir=\"/usr/share/fonts/${FONT_DIR}\"" |
142 | FONT_OPTIONS="--with-fontdir=\"/usr/share/fonts/${FONT_DIR}\"" |
| 144 | |
143 | |
| 145 | if [[ -n "${FONT}" ]]; then |
144 | if [[ -n "${FONT}" ]]; then |
| 146 | if [[ ${PN##*-} = misc ]] || [[ ${PN##*-} = 75dpi ]] || [[ ${PN##*-} = 100dpi ]]; then |
145 | if [[ ${PN##*-} = misc ]] || [[ ${PN##*-} = 75dpi ]] || [[ ${PN##*-} = 100dpi ]] || [[ ${PN##*-} = cyrillic ]]; then |
| 147 | IUSE="${IUSE} nls" |
146 | IUSE="${IUSE} nls" |
| 148 | fi |
147 | fi |
| 149 | fi |
148 | fi |
| 150 | fi |
149 | fi |
| 151 | |
150 | |
| 152 | # If we're a driver package |
151 | # If we're a driver package |
| 153 | if [[ "${PN/#xf86-video}" != "${PN}" ]] || [[ "${PN/#xf86-input}" != "${PN}" ]]; then |
152 | if [[ "${PN/#xf86-video}" != "${PN}" ]] || [[ "${PN/#xf86-input}" != "${PN}" ]]; then |
| 154 | # Enable driver code in the rest of the eclass |
153 | # Enable driver code in the rest of the eclass |
| 155 | DRIVER="yes" |
154 | DRIVER="yes" |
| 156 | |
|
|
| 157 | if [[ ${XDPVER} != -1 ]]; then |
|
|
| 158 | # Add driver patchset to SRC_URI |
|
|
| 159 | SRC_URI="${SRC_URI} |
|
|
| 160 | mirror://gentoo/x11-driver-patches-${XDPVER}.tar.bz2" |
|
|
| 161 | fi |
|
|
| 162 | fi |
155 | fi |
| 163 | |
156 | |
| 164 | # Debugging -- ignore packages that can't be built with debugging |
157 | # Debugging -- ignore packages that can't be built with debugging |
| 165 | if [[ -z "${FONT}" ]] \ |
158 | if [[ -z "${FONT}" ]] \ |
| 166 | && [[ "${CATEGORY/app-doc}" = "${CATEGORY}" ]] \ |
159 | && [[ "${CATEGORY/app-doc}" = "${CATEGORY}" ]] \ |
| … | |
… | |
| 265 | # See epatch() in eutils.eclass for more documentation |
258 | # See epatch() in eutils.eclass for more documentation |
| 266 | if [[ -z "${EPATCH_SUFFIX}" ]] ; then |
259 | if [[ -z "${EPATCH_SUFFIX}" ]] ; then |
| 267 | EPATCH_SUFFIX="patch" |
260 | EPATCH_SUFFIX="patch" |
| 268 | fi |
261 | fi |
| 269 | |
262 | |
| 270 | # If this is a driver package we need to fix man page install location. |
|
|
| 271 | # Running autoreconf will use the patched util-macros to make the |
|
|
| 272 | # change for us, so we only need to patch if it is not going to run. |
|
|
| 273 | if [[ -n "${DRIVER}" ]] && [[ "${SNAPSHOT}" != "yes" ]]\ |
|
|
| 274 | && [[ ${XDPVER} != -1 ]]; then |
|
|
| 275 | PATCHES="${PATCHES} ${DISTDIR}/x11-driver-patches-${XDPVER}.tar.bz2" |
|
|
| 276 | fi |
|
|
| 277 | |
|
|
| 278 | # @VARIABLE: PATCHES |
263 | # @VARIABLE: PATCHES |
| 279 | # @DESCRIPTION: |
264 | # @DESCRIPTION: |
| 280 | # If you have any patches to apply, set PATCHES to their locations and epatch |
265 | # If you have any patches to apply, set PATCHES to their locations and epatch |
| 281 | # will apply them. It also handles epatch-style bulk patches, if you know how to |
266 | # will apply them. It also handles epatch-style bulk patches, if you know how to |
| 282 | # use them and set the correct variables. If you don't, read eutils.eclass. |
267 | # use them and set the correct variables. If you don't, read eutils.eclass. |
|
|
268 | if [[ ${#PATCHES[@]} -gt 1 ]]; then |
|
|
269 | for x in "${PATCHES[@]}"; do |
|
|
270 | epatch "${x}" |
|
|
271 | done |
| 283 | if [[ -n "${PATCHES}" ]] ; then |
272 | elif [[ -n "${PATCHES}" ]]; then |
| 284 | for PATCH in ${PATCHES} |
273 | for x in ${PATCHES}; do |
| 285 | do |
|
|
| 286 | epatch ${PATCH} |
274 | epatch "${x}" |
| 287 | done |
275 | done |
| 288 | # For non-default directory bulk patching |
276 | # For non-default directory bulk patching |
| 289 | elif [[ -n "${PATCH_LOC}" ]] ; then |
277 | elif [[ -n "${PATCH_LOC}" ]] ; then |
| 290 | epatch ${PATCH_LOC} |
278 | epatch ${PATCH_LOC} |
| 291 | # For standard bulk patching |
279 | # For standard bulk patching |
| … | |
… | |
| 379 | x-modular_debug_setup |
367 | x-modular_debug_setup |
| 380 | |
368 | |
| 381 | # @VARIABLE: CONFIGURE_OPTIONS |
369 | # @VARIABLE: CONFIGURE_OPTIONS |
| 382 | # @DESCRIPTION: |
370 | # @DESCRIPTION: |
| 383 | # Any options to pass to configure |
371 | # Any options to pass to configure |
| 384 | [[ -n ${CONFIGURE_OPTIONTS} ]] |
372 | [[ -n ${CONFIGURE_OPTIONS} ]] |
| 385 | |
373 | |
| 386 | # If prefix isn't set here, .pc files cause problems |
374 | # If prefix isn't set here, .pc files cause problems |
| 387 | if [[ -x ${ECONF_SOURCE:-.}/configure ]]; then |
375 | if [[ -x ${ECONF_SOURCE:-.}/configure ]]; then |
| 388 | econf --prefix=${XDIR} \ |
376 | econf --prefix=${XDIR} \ |
| 389 | --datadir=${XDIR}/share \ |
377 | --datadir=${XDIR}/share \ |