| 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.21 2005/11/15 03:05:06 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. |
| … | |
… | |
| 10 | # If the ebuild installs fonts, set FONT="yes" at the top and set FONT_DIRS to |
10 | # If the ebuild installs fonts, set FONT="yes" at the top and set FONT_DIRS to |
| 11 | # the subdirectories within /usr/share/fonts to which it installs fonts. |
11 | # the subdirectories within /usr/share/fonts to which it installs fonts. |
| 12 | |
12 | |
| 13 | EXPORT_FUNCTIONS src_unpack src_compile src_install pkg_preinst pkg_postinst |
13 | EXPORT_FUNCTIONS src_unpack src_compile src_install pkg_preinst pkg_postinst |
| 14 | |
14 | |
| 15 | inherit eutils |
15 | inherit eutils libtool |
| 16 | |
16 | |
| 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-RC2/everything/${P}.tar.bz2 |
|
|
23 | http://xorg.freedesktop.org/releases/X11R7.0-RC1/everything/${P}.tar.bz2 |
|
|
24 | http://xorg.freedesktop.org/releases/X11R7.0-RC0/everything/${P}.tar.bz2" |
| 23 | LICENSE="X11" |
25 | LICENSE="X11" |
| 24 | SLOT="0" |
26 | SLOT="0" |
| 25 | |
27 | |
| 26 | # Set up shared dependencies |
28 | # Set up shared dependencies |
| 27 | if [ -n "${SNAPSHOT}" ]; then |
29 | if [ -n "${SNAPSHOT}" ]; then |
| … | |
… | |
| 32 | >=sys-devel/libtool-1.5 |
34 | >=sys-devel/libtool-1.5 |
| 33 | >=sys-devel/m4-1.4" |
35 | >=sys-devel/m4-1.4" |
| 34 | fi |
36 | fi |
| 35 | |
37 | |
| 36 | # If we're a font package, but not the font.alias one |
38 | # If we're a font package, but not the font.alias one |
| 37 | if [[ "${PN/#font}" != "${PN}" ]] && [[ "${PN}" != "font-alias" ]]; then |
39 | if [[ "${PN/#font-}" != "${PN}" ]] && [[ "${PN}" != "font-alias" ]]; then |
| 38 | # Activate font code in the rest of the eclass |
40 | # Activate font code in the rest of the eclass |
| 39 | FONT="yes" |
41 | FONT="yes" |
| 40 | |
42 | |
| 41 | RDEPEND="${RDEPEND} |
43 | RDEPEND="${RDEPEND} |
| 42 | media-fonts/encodings" |
44 | media-fonts/encodings" |
| 43 | PDEPEND="${PDEPEND} |
45 | PDEPEND="${PDEPEND} |
| 44 | media-fonts/font-alias" |
46 | media-fonts/font-alias" |
| 45 | fi |
47 | fi |
| 46 | |
48 | |
|
|
49 | # If we're a driver package |
|
|
50 | if [[ "${PN/#xf86-video}" != "${PN}" ]] || [[ "${PN/#xf86-input}" != "${PN}" ]]; then |
|
|
51 | # Don't build static driver modules |
|
|
52 | DRIVER_OPTIONS="--disable-static" |
|
|
53 | fi |
|
|
54 | |
| 47 | DEPEND="${DEPEND} |
55 | DEPEND="${DEPEND} |
| 48 | dev-util/pkgconfig |
56 | >=dev-util/pkgconfig-0.18 |
| 49 | x11-misc/util-macros" |
57 | >=x11-misc/util-macros-0.99.0_p20051007" |
| 50 | |
58 | |
|
|
59 | # >=sys-apps/man-1.6b-r2 required to look in [0-8]x/ directories |
| 51 | RDEPEND="${RDEPEND}" |
60 | RDEPEND="${RDEPEND} |
| 52 | # Shouldn't be necessary once we're in a standard location |
61 | !<x11-base/xorg-x11-7.0.0_rc0 |
|
|
62 | >=sys-apps/man-1.6b-r2" |
|
|
63 | # Provides virtual/x11 for temporary use until packages are ported |
| 53 | # x11-base/x11-env" |
64 | # x11-base/x11-env" |
| 54 | # FIXME: Uncomment once it's in portage |
|
|
| 55 | # !x11-base/xorg-x11" |
|
|
| 56 | |
65 | |
| 57 | x-modular_unpack_source() { |
66 | x-modular_unpack_source() { |
| 58 | unpack ${A} |
67 | unpack ${A} |
| 59 | cd ${S} |
68 | cd ${S} |
|
|
69 | |
|
|
70 | # Joshua Baergen - October 23, 2005 |
|
|
71 | # Fix shared lib issues on MIPS, FBSD, etc etc |
|
|
72 | elibtoolize |
| 60 | } |
73 | } |
| 61 | |
74 | |
| 62 | x-modular_patch_source() { |
75 | x-modular_patch_source() { |
| 63 | # Use standardized names and locations with bulk patching |
76 | # Use standardized names and locations with bulk patching |
| 64 | # Patch directory is ${WORKDIR}/patch |
77 | # Patch directory is ${WORKDIR}/patch |
| … | |
… | |
| 88 | then |
101 | then |
| 89 | # If possible, generate configure if it doesn't exist |
102 | # If possible, generate configure if it doesn't exist |
| 90 | if [ -f "${S}/configure.ac" ] |
103 | if [ -f "${S}/configure.ac" ] |
| 91 | then |
104 | then |
| 92 | einfo "Running autoreconf..." |
105 | einfo "Running autoreconf..." |
| 93 | autoreconf -v --install |
106 | autoreconf -v --force --install |
| 94 | fi |
107 | fi |
| 95 | fi |
108 | fi |
| 96 | |
109 | |
| 97 | } |
110 | } |
| 98 | |
111 | |
| … | |
… | |
| 100 | x-modular_unpack_source |
113 | x-modular_unpack_source |
| 101 | x-modular_patch_source |
114 | x-modular_patch_source |
| 102 | x-modular_reconf_source |
115 | x-modular_reconf_source |
| 103 | } |
116 | } |
| 104 | |
117 | |
| 105 | x-modular_src_compile() { |
118 | x-modular_src_configure() { |
| 106 | # If prefix isn't set here, .pc files cause problems |
119 | # If prefix isn't set here, .pc files cause problems |
| 107 | if [ -x ./configure ]; then |
120 | if [ -x ./configure ]; then |
| 108 | econf --prefix=${XDIR} \ |
121 | econf --prefix=${XDIR} \ |
| 109 | --datadir=${XDIR}/share \ |
122 | --datadir=${XDIR}/share \ |
|
|
123 | ${DRIVER_OPTIONS} \ |
| 110 | ${CONFIGURE_OPTIONS} |
124 | ${CONFIGURE_OPTIONS} |
| 111 | fi |
125 | fi |
|
|
126 | } |
|
|
127 | |
|
|
128 | x-modular_src_make() { |
| 112 | emake || die "emake failed" |
129 | emake || die "emake failed" |
|
|
130 | } |
|
|
131 | |
|
|
132 | x-modular_src_compile() { |
|
|
133 | x-modular_src_configure |
|
|
134 | x-modular_src_make |
| 113 | } |
135 | } |
| 114 | |
136 | |
| 115 | x-modular_src_install() { |
137 | x-modular_src_install() { |
| 116 | # Install everything to ${XDIR} |
138 | # Install everything to ${XDIR} |
| 117 | make \ |
139 | make \ |
| … | |
… | |
| 119 | install |
141 | install |
| 120 | # Shouldn't be necessary in XDIR=/usr |
142 | # Shouldn't be necessary in XDIR=/usr |
| 121 | # einstall forces datadir, so we need to re-force it |
143 | # einstall forces datadir, so we need to re-force it |
| 122 | # datadir=${XDIR}/share \ |
144 | # datadir=${XDIR}/share \ |
| 123 | # mandir=${XDIR}/share/man \ |
145 | # mandir=${XDIR}/share/man \ |
|
|
146 | |
|
|
147 | # Don't install libtool archives for server modules |
|
|
148 | if [[ -e ${D}/usr/lib/xorg/modules ]]; then |
|
|
149 | find ${D}/usr/lib/xorg/modules -name '*.la' \ |
|
|
150 | | xargs rm -f |
|
|
151 | fi |
| 124 | } |
152 | } |
| 125 | |
153 | |
| 126 | x-modular_pkg_preinst() { |
154 | x-modular_pkg_preinst() { |
| 127 | if [[ -n "${FONT}" ]]; then |
155 | if [[ -n "${FONT}" ]]; then |
| 128 | discover_font_dirs |
156 | discover_font_dirs |