| 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.10 2005/09/04 15:15:37 swegener 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. |
| … | |
… | |
| 42 | media-fonts/encodings" |
42 | media-fonts/encodings" |
| 43 | PDEPEND="${PDEPEND} |
43 | PDEPEND="${PDEPEND} |
| 44 | media-fonts/font-alias" |
44 | media-fonts/font-alias" |
| 45 | fi |
45 | fi |
| 46 | |
46 | |
|
|
47 | # If we're a driver package |
|
|
48 | if [[ "${PN/#xf86-video}" != "${PN}" || "${PN/#xf86-input}" != "${PN}" ]] |
|
|
49 | 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 |
| 49 | x11-misc/util-macros" |
56 | x11-misc/util-macros" |
| 50 | |
57 | |
| 51 | RDEPEND="${RDEPEND}" |
58 | RDEPEND="${RDEPEND}" |
| … | |
… | |
| 88 | then |
95 | then |
| 89 | # If possible, generate configure if it doesn't exist |
96 | # If possible, generate configure if it doesn't exist |
| 90 | if [ -f "${S}/configure.ac" ] |
97 | if [ -f "${S}/configure.ac" ] |
| 91 | then |
98 | then |
| 92 | einfo "Running autoreconf..." |
99 | einfo "Running autoreconf..." |
| 93 | autoreconf -v --install |
100 | autoreconf -v --force --install |
| 94 | fi |
101 | fi |
| 95 | fi |
102 | fi |
| 96 | |
103 | |
| 97 | } |
104 | } |
| 98 | |
105 | |
| … | |
… | |
| 100 | x-modular_unpack_source |
107 | x-modular_unpack_source |
| 101 | x-modular_patch_source |
108 | x-modular_patch_source |
| 102 | x-modular_reconf_source |
109 | x-modular_reconf_source |
| 103 | } |
110 | } |
| 104 | |
111 | |
| 105 | x-modular_src_compile() { |
112 | x-modular_src_configure() { |
| 106 | # If prefix isn't set here, .pc files cause problems |
113 | # If prefix isn't set here, .pc files cause problems |
| 107 | if [ -x ./configure ]; then |
114 | if [ -x ./configure ]; then |
| 108 | econf --prefix=${XDIR} \ |
115 | econf --prefix=${XDIR} \ |
| 109 | --datadir=${XDIR}/share \ |
116 | --datadir=${XDIR}/share \ |
|
|
117 | ${DRIVER_OPTIONS} \ |
| 110 | ${CONFIGURE_OPTIONS} |
118 | ${CONFIGURE_OPTIONS} |
| 111 | fi |
119 | fi |
|
|
120 | } |
|
|
121 | |
|
|
122 | x-modular_src_make() { |
| 112 | emake || die "emake failed" |
123 | emake || die "emake failed" |
|
|
124 | } |
|
|
125 | |
|
|
126 | x-modular_src_compile() { |
|
|
127 | x-modular_src_configure |
|
|
128 | x-modular_src_make |
| 113 | } |
129 | } |
| 114 | |
130 | |
| 115 | x-modular_src_install() { |
131 | x-modular_src_install() { |
| 116 | # Install everything to ${XDIR} |
132 | # Install everything to ${XDIR} |
| 117 | make \ |
133 | make \ |
| … | |
… | |
| 119 | install |
135 | install |
| 120 | # Shouldn't be necessary in XDIR=/usr |
136 | # Shouldn't be necessary in XDIR=/usr |
| 121 | # einstall forces datadir, so we need to re-force it |
137 | # einstall forces datadir, so we need to re-force it |
| 122 | # datadir=${XDIR}/share \ |
138 | # datadir=${XDIR}/share \ |
| 123 | # mandir=${XDIR}/share/man \ |
139 | # mandir=${XDIR}/share/man \ |
|
|
140 | |
|
|
141 | # Don't install libtool archives for server modules |
|
|
142 | if [[ -e ${D}/usr/lib/xorg/modules ]]; then |
|
|
143 | find ${D}/usr/lib/xorg/modules -name '*.la' \ |
|
|
144 | | xargs rm -f |
|
|
145 | fi |
| 124 | } |
146 | } |
| 125 | |
147 | |
| 126 | x-modular_pkg_preinst() { |
148 | x-modular_pkg_preinst() { |
| 127 | if [[ -n "${FONT}" ]]; then |
149 | if [[ -n "${FONT}" ]]; then |
| 128 | discover_font_dirs |
150 | discover_font_dirs |