| 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.5 2005/08/15 00:33:31 spyderous Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/x-modular.eclass,v 1.14 2005/10/20 00:35:21 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. |
| … | |
… | |
| 17 | # Directory prefix to use for everything |
17 | # Directory prefix to use for everything |
| 18 | XDIR="/usr" |
18 | XDIR="/usr" |
| 19 | |
19 | |
| 20 | IUSE="" |
20 | IUSE="" |
| 21 | HOMEPAGE="http://xorg.freedesktop.org/" |
21 | HOMEPAGE="http://xorg.freedesktop.org/" |
| 22 | SRC_URI="http://xorg.freedesktop.org/X11R7.0-RC0/everything/${P}.tar.bz2" |
22 | SRC_URI="http://xorg.freedesktop.org/releases/X11R7.0-RC1/everything/${P}.tar.bz2 |
|
|
23 | http://xorg.freedesktop.org/releases/X11R7.0-RC0/everything/${P}.tar.bz2" |
| 23 | LICENSE="X11" |
24 | LICENSE="X11" |
| 24 | SLOT="0" |
25 | SLOT="0" |
| 25 | |
26 | |
| 26 | # Set up shared dependencies |
27 | # Set up shared dependencies |
| 27 | if [ -n "${SNAPSHOT}" ]; then |
28 | if [ -n "${SNAPSHOT}" ]; then |
| … | |
… | |
| 32 | >=sys-devel/libtool-1.5 |
33 | >=sys-devel/libtool-1.5 |
| 33 | >=sys-devel/m4-1.4" |
34 | >=sys-devel/m4-1.4" |
| 34 | fi |
35 | fi |
| 35 | |
36 | |
| 36 | # If we're a font package, but not the font.alias one |
37 | # If we're a font package, but not the font.alias one |
| 37 | if [[ "${PN/#font}" != "${PN}" ]] && [[ "${PN}" != "font-alias" ]]; then |
38 | if [[ "${PN/#font-}" != "${PN}" ]] && [[ "${PN}" != "font-alias" ]]; then |
| 38 | # Activate font code in the rest of the eclass |
39 | # Activate font code in the rest of the eclass |
| 39 | FONT="yes" |
40 | FONT="yes" |
| 40 | |
41 | |
| 41 | RDEPEND="${RDEPEND} |
42 | RDEPEND="${RDEPEND} |
| 42 | media-fonts/encodings" |
43 | media-fonts/encodings" |
| 43 | PDEPEND="${PDEPEND} |
44 | PDEPEND="${PDEPEND} |
| 44 | media-fonts/font-alias" |
45 | media-fonts/font-alias" |
| 45 | fi |
46 | fi |
| 46 | |
47 | |
|
|
48 | # If we're a driver package |
|
|
49 | if [[ "${PN/#xf86-video}" != "${PN}" ]] || [[ "${PN/#xf86-input}" != "${PN}" ]]; then |
|
|
50 | # Don't build static driver modules |
|
|
51 | DRIVER_OPTIONS="--disable-static" |
|
|
52 | fi |
|
|
53 | |
| 47 | DEPEND="${DEPEND} |
54 | DEPEND="${DEPEND} |
| 48 | dev-util/pkgconfig |
55 | >=dev-util/pkgconfig-0.18 |
| 49 | x11-misc/util-macros" |
56 | x11-misc/util-macros" |
| 50 | |
57 | |
| 51 | RDEPEND="${RDEPEND}" |
58 | RDEPEND="${RDEPEND} |
| 52 | # Shouldn't be necessary once we're in a standard location |
59 | !<x11-base/xorg-x11-7" |
|
|
60 | # Provides virtual/x11 for temporary use until packages are ported |
| 53 | # x11-base/x11-env" |
61 | # x11-base/x11-env" |
| 54 | # FIXME: Uncomment once it's in portage |
|
|
| 55 | # !x11-base/xorg-x11" |
|
|
| 56 | |
62 | |
| 57 | x-modular_unpack_source() { |
63 | x-modular_unpack_source() { |
| 58 | unpack ${A} |
64 | unpack ${A} |
| 59 | cd ${S} |
65 | cd ${S} |
| 60 | } |
66 | } |
| … | |
… | |
| 88 | then |
94 | then |
| 89 | # If possible, generate configure if it doesn't exist |
95 | # If possible, generate configure if it doesn't exist |
| 90 | if [ -f "${S}/configure.ac" ] |
96 | if [ -f "${S}/configure.ac" ] |
| 91 | then |
97 | then |
| 92 | einfo "Running autoreconf..." |
98 | einfo "Running autoreconf..." |
| 93 | autoreconf -v --install |
99 | autoreconf -v --force --install |
| 94 | fi |
100 | fi |
| 95 | fi |
101 | fi |
| 96 | |
102 | |
| 97 | } |
103 | } |
| 98 | |
104 | |
| … | |
… | |
| 100 | x-modular_unpack_source |
106 | x-modular_unpack_source |
| 101 | x-modular_patch_source |
107 | x-modular_patch_source |
| 102 | x-modular_reconf_source |
108 | x-modular_reconf_source |
| 103 | } |
109 | } |
| 104 | |
110 | |
| 105 | x-modular_src_compile() { |
111 | x-modular_src_configure() { |
| 106 | # If prefix isn't set here, .pc files cause problems |
112 | # If prefix isn't set here, .pc files cause problems |
| 107 | if [ -x ./configure ]; then |
113 | if [ -x ./configure ]; then |
| 108 | econf --prefix=${XDIR} \ |
114 | econf --prefix=${XDIR} \ |
| 109 | --datadir=${XDIR}/share \ |
115 | --datadir=${XDIR}/share \ |
|
|
116 | ${DRIVER_OPTIONS} \ |
| 110 | ${CONFIGURE_OPTIONS} |
117 | ${CONFIGURE_OPTIONS} |
| 111 | fi |
118 | fi |
|
|
119 | } |
|
|
120 | |
|
|
121 | x-modular_src_make() { |
| 112 | emake || die "emake failed" |
122 | emake || die "emake failed" |
|
|
123 | } |
|
|
124 | |
|
|
125 | x-modular_src_compile() { |
|
|
126 | x-modular_src_configure |
|
|
127 | x-modular_src_make |
| 113 | } |
128 | } |
| 114 | |
129 | |
| 115 | x-modular_src_install() { |
130 | x-modular_src_install() { |
| 116 | # Install everything to ${XDIR} |
131 | # Install everything to ${XDIR} |
| 117 | make \ |
132 | make \ |
| … | |
… | |
| 119 | install |
134 | install |
| 120 | # Shouldn't be necessary in XDIR=/usr |
135 | # Shouldn't be necessary in XDIR=/usr |
| 121 | # einstall forces datadir, so we need to re-force it |
136 | # einstall forces datadir, so we need to re-force it |
| 122 | # datadir=${XDIR}/share \ |
137 | # datadir=${XDIR}/share \ |
| 123 | # mandir=${XDIR}/share/man \ |
138 | # mandir=${XDIR}/share/man \ |
|
|
139 | |
|
|
140 | # Don't install libtool archives for server modules |
|
|
141 | if [[ -e ${D}/usr/lib/xorg/modules ]]; then |
|
|
142 | find ${D}/usr/lib/xorg/modules -name '*.la' \ |
|
|
143 | | xargs rm -f |
|
|
144 | fi |
| 124 | } |
145 | } |
| 125 | |
146 | |
| 126 | x-modular_pkg_preinst() { |
147 | x-modular_pkg_preinst() { |
| 127 | if [[ -n "${FONT}" ]]; then |
148 | if [[ -n "${FONT}" ]]; then |
| 128 | discover_font_dirs |
149 | discover_font_dirs |