| 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.35 2005/12/23 08:28:00 spyderous Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/x-modular.eclass,v 1.41 2006/02/01 02:04:54 spyderous Exp $ |
| 4 | # |
4 | # |
| 5 | # Author: Donnie Berkholz <spyderous@gentoo.org> |
5 | # Author: Donnie Berkholz <spyderous@gentoo.org> |
| 6 | # |
6 | # |
| 7 | # This eclass is designed to reduce code duplication in the modularized X11 |
7 | # This eclass is designed to reduce code duplication in the modularized X11 |
| 8 | # ebuilds. |
8 | # ebuilds. |
| … | |
… | |
| 25 | # |
25 | # |
| 26 | # Pretty much everything else should be automatic. |
26 | # Pretty much everything else should be automatic. |
| 27 | |
27 | |
| 28 | EXPORT_FUNCTIONS src_unpack src_compile src_install pkg_preinst pkg_postinst pkg_postrm |
28 | EXPORT_FUNCTIONS src_unpack src_compile src_install pkg_preinst pkg_postinst pkg_postrm |
| 29 | |
29 | |
| 30 | inherit eutils libtool toolchain-funcs |
30 | inherit eutils libtool toolchain-funcs flag-o-matic |
| 31 | |
31 | |
| 32 | # Directory prefix to use for everything |
32 | # Directory prefix to use for everything |
| 33 | XDIR="/usr" |
33 | XDIR="/usr" |
| 34 | |
34 | |
| 35 | # Set up default patchset version(s) if necessary |
35 | # Set up default patchset version(s) if necessary |
| … | |
… | |
| 44 | http://xorg.freedesktop.org/releases/X11R7.0-RC4/everything/${P}.tar.bz2 |
44 | http://xorg.freedesktop.org/releases/X11R7.0-RC4/everything/${P}.tar.bz2 |
| 45 | http://xorg.freedesktop.org/releases/X11R7.0-RC3/everything/${P}.tar.bz2 |
45 | http://xorg.freedesktop.org/releases/X11R7.0-RC3/everything/${P}.tar.bz2 |
| 46 | http://xorg.freedesktop.org/releases/X11R7.0-RC2/everything/${P}.tar.bz2 |
46 | http://xorg.freedesktop.org/releases/X11R7.0-RC2/everything/${P}.tar.bz2 |
| 47 | http://xorg.freedesktop.org/releases/X11R7.0-RC1/everything/${P}.tar.bz2 |
47 | http://xorg.freedesktop.org/releases/X11R7.0-RC1/everything/${P}.tar.bz2 |
| 48 | http://xorg.freedesktop.org/releases/X11R7.0-RC0/everything/${P}.tar.bz2" |
48 | http://xorg.freedesktop.org/releases/X11R7.0-RC0/everything/${P}.tar.bz2" |
| 49 | LICENSE="X11" |
|
|
| 50 | SLOT="0" |
49 | SLOT="0" |
|
|
50 | |
|
|
51 | # Set the license for the package. This can be overridden by setting |
|
|
52 | # LICENSE after the inherit. |
|
|
53 | LICENSE=${PN} |
| 51 | |
54 | |
| 52 | # Set up shared dependencies |
55 | # Set up shared dependencies |
| 53 | if [[ -n "${SNAPSHOT}" ]]; then |
56 | if [[ -n "${SNAPSHOT}" ]]; then |
| 54 | # FIXME: What's the minimal libtool version supporting arbitrary versioning? |
57 | # FIXME: What's the minimal libtool version supporting arbitrary versioning? |
| 55 | DEPEND="${DEPEND} |
58 | DEPEND="${DEPEND} |
| … | |
… | |
| 65 | && [[ "${PN}" != "font-util" ]]; then |
68 | && [[ "${PN}" != "font-util" ]]; then |
| 66 | # Activate font code in the rest of the eclass |
69 | # Activate font code in the rest of the eclass |
| 67 | FONT="yes" |
70 | FONT="yes" |
| 68 | |
71 | |
| 69 | RDEPEND="${RDEPEND} |
72 | RDEPEND="${RDEPEND} |
| 70 | media-fonts/encodings" |
73 | media-fonts/encodings |
| 71 | DEPEND="${DEPEND} |
|
|
| 72 | x11-apps/mkfontscale |
74 | x11-apps/mkfontscale |
| 73 | x11-apps/mkfontdir" |
75 | x11-apps/mkfontdir" |
| 74 | PDEPEND="${PDEPEND} |
76 | PDEPEND="${PDEPEND} |
| 75 | media-fonts/font-alias" |
77 | media-fonts/font-alias" |
| 76 | |
78 | |
| … | |
… | |
| 99 | fi |
101 | fi |
| 100 | fi |
102 | fi |
| 101 | |
103 | |
| 102 | # If we're a driver package |
104 | # If we're a driver package |
| 103 | if [[ "${PN/#xf86-video}" != "${PN}" ]] || [[ "${PN/#xf86-input}" != "${PN}" ]]; then |
105 | if [[ "${PN/#xf86-video}" != "${PN}" ]] || [[ "${PN/#xf86-input}" != "${PN}" ]]; then |
| 104 | # Don't build static driver modules |
|
|
| 105 | DRIVER_OPTIONS="--disable-static" |
|
|
| 106 | |
|
|
| 107 | # Enable driver code in the rest of the eclass |
106 | # Enable driver code in the rest of the eclass |
| 108 | DRIVER="yes" |
107 | DRIVER="yes" |
| 109 | |
108 | |
| 110 | # Add driver patchset to SRC_URI |
109 | # Add driver patchset to SRC_URI |
| 111 | SRC_URI="${SRC_URI} |
110 | SRC_URI="${SRC_URI} |
| 112 | http://dev.gentoo.org/~joshuabaergen/distfiles/x11-driver-patches-${XDPVER}.tar.bz2" |
111 | http://dev.gentoo.org/~joshuabaergen/distfiles/x11-driver-patches-${XDPVER}.tar.bz2" |
| 113 | fi |
112 | fi |
| 114 | |
113 | |
|
|
114 | # Debugging -- ignore packages that can't be built with debugging |
|
|
115 | if [[ -z "${FONT}" ]] \ |
|
|
116 | || [[ "${PN/app-doc}" != "${PN}" ]] \ |
|
|
117 | || [[ "${PN/x11-proto}" != "${PN}" ]] \ |
|
|
118 | || [[ "${PN/util-macros}" != "${PN}" ]] \ |
|
|
119 | || [[ "${PN/xbitmaps}" != "${PN}" ]] \ |
|
|
120 | || [[ "${PN/xkbdata}" != "${PN}" ]] \ |
|
|
121 | || [[ "${PN/xorg-cf-files}" != "${PN}" ]] \ |
|
|
122 | || [[ "${PN/xcursor}" != "${PN}" ]] \ |
|
|
123 | ; then |
|
|
124 | DEBUGGABLE="yes" |
|
|
125 | IUSE="${IUSE} debug" |
|
|
126 | if use debug; then |
|
|
127 | RESTRICT="${RESTRICT} nostrip" |
|
|
128 | fi |
|
|
129 | fi |
|
|
130 | |
| 115 | DEPEND="${DEPEND} |
131 | DEPEND="${DEPEND} |
| 116 | >=dev-util/pkgconfig-0.18 |
132 | >=dev-util/pkgconfig-0.18" |
|
|
133 | |
|
|
134 | if [[ "${PN/util-macros}" != "${PN}" ]]; then |
|
|
135 | DEPEND="${DEPEND} |
| 117 | >=x11-misc/util-macros-0.99.2" |
136 | >=x11-misc/util-macros-0.99.2" |
|
|
137 | fi |
| 118 | |
138 | |
| 119 | # >=sys-apps/man-1.6b-r2 required to look in [0-8]x/ directories |
139 | # >=sys-apps/man-1.6b-r2 required to look in [0-8]x/ directories |
| 120 | RDEPEND="${RDEPEND} |
140 | RDEPEND="${RDEPEND} |
| 121 | !<=x11-base/xorg-x11-6.9 |
141 | !<=x11-base/xorg-x11-6.9 |
| 122 | >=sys-apps/man-1.6b-r2" |
142 | >=sys-apps/man-1.6b-r2" |
| … | |
… | |
| 219 | --disable-koi8-r" |
239 | --disable-koi8-r" |
| 220 | fi |
240 | fi |
| 221 | fi |
241 | fi |
| 222 | } |
242 | } |
| 223 | |
243 | |
|
|
244 | x-modular_debug_setup() { |
|
|
245 | if [[ -n "${DEBUGGABLE}" ]]; then |
|
|
246 | if use debug; then |
|
|
247 | strip-flags |
|
|
248 | append-flags -ggdb |
|
|
249 | fi |
|
|
250 | fi |
|
|
251 | } |
|
|
252 | |
| 224 | x-modular_src_configure() { |
253 | x-modular_src_configure() { |
| 225 | x-modular_font_configure |
254 | x-modular_font_configure |
|
|
255 | x-modular_debug_setup |
| 226 | |
256 | |
| 227 | # If prefix isn't set here, .pc files cause problems |
257 | # If prefix isn't set here, .pc files cause problems |
| 228 | if [[ -x ./configure ]]; then |
258 | if [[ -x ./configure ]]; then |
| 229 | econf --prefix=${XDIR} \ |
259 | econf --prefix=${XDIR} \ |
| 230 | --datadir=${XDIR}/share \ |
260 | --datadir=${XDIR}/share \ |