| 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.45 2006/02/15 21:33:15 spyderous Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/x-modular.eclass,v 1.51 2006/04/03 02:03:04 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 flag-o-matic |
30 | inherit eutils libtool toolchain-funcs flag-o-matic autotools |
| 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 |
| … | |
… | |
| 91 | >=sys-devel/m4-1.4" |
91 | >=sys-devel/m4-1.4" |
| 92 | fi |
92 | fi |
| 93 | |
93 | |
| 94 | # If we're a font package, but not the font.alias one |
94 | # If we're a font package, but not the font.alias one |
| 95 | if [[ "${PN/#font-}" != "${PN}" ]] \ |
95 | if [[ "${PN/#font-}" != "${PN}" ]] \ |
|
|
96 | && [[ "${CATEGORY}" = "media-fonts" ]] \ |
| 96 | && [[ "${PN}" != "font-alias" ]] \ |
97 | && [[ "${PN}" != "font-alias" ]] \ |
| 97 | && [[ "${PN}" != "font-util" ]]; then |
98 | && [[ "${PN}" != "font-util" ]]; then |
| 98 | # Activate font code in the rest of the eclass |
99 | # Activate font code in the rest of the eclass |
| 99 | FONT="yes" |
100 | FONT="yes" |
| 100 | |
101 | |
| … | |
… | |
| 151 | || [[ "${PN/xcursor}" != "${PN}" ]] \ |
152 | || [[ "${PN/xcursor}" != "${PN}" ]] \ |
| 152 | ; then |
153 | ; then |
| 153 | DEBUGGABLE="yes" |
154 | DEBUGGABLE="yes" |
| 154 | IUSE="${IUSE} debug" |
155 | IUSE="${IUSE} debug" |
| 155 | if use debug; then |
156 | if use debug; then |
|
|
157 | if ! has splitdebug ${FEATURES}; then |
| 156 | RESTRICT="${RESTRICT} nostrip" |
158 | RESTRICT="${RESTRICT} nostrip" |
|
|
159 | fi |
| 157 | fi |
160 | fi |
| 158 | fi |
161 | fi |
| 159 | |
162 | |
| 160 | DEPEND="${DEPEND} |
163 | DEPEND="${DEPEND} |
| 161 | >=dev-util/pkgconfig-0.18" |
164 | >=dev-util/pkgconfig-0.18" |
| … | |
… | |
| 216 | if [[ "${SNAPSHOT}" = "yes" ]] |
219 | if [[ "${SNAPSHOT}" = "yes" ]] |
| 217 | then |
220 | then |
| 218 | # If possible, generate configure if it doesn't exist |
221 | # If possible, generate configure if it doesn't exist |
| 219 | if [ -f "${S}/configure.ac" ] |
222 | if [ -f "${S}/configure.ac" ] |
| 220 | then |
223 | then |
| 221 | einfo "Running autoreconf..." |
224 | eautoreconf |
| 222 | autoreconf -v --force --install |
|
|
| 223 | fi |
225 | fi |
| 224 | fi |
226 | fi |
| 225 | |
227 | |
| 226 | } |
228 | } |
| 227 | |
229 | |
| 228 | x-modular_src_unpack() { |
230 | x-modular_src_unpack() { |
| 229 | if [[ ${PN:0:11} = "xorg-server" ]] || [[ -n "${DRIVER}" ]]; then |
231 | if [[ ${PN:0:11} = "xorg-server" ]] || [[ -n "${DRIVER}" ]]; then |
| 230 | if gcc-specs-now; then |
232 | if gcc-specs-now; then |
| 231 | msg="Do not emerge ${PN} without vanilla gcc!" |
233 | msg="${PN} does not work with hardened gcc specs. Switch to vanilla gcc specs to emerge ${PN}." |
| 232 | eerror "$msg" |
234 | eerror "$msg" |
| 233 | die "$msg" |
235 | die "$msg" |
| 234 | fi |
236 | fi |
| 235 | fi |
237 | fi |
| 236 | |
238 | |
| … | |
… | |
| 314 | |
316 | |
| 315 | # Don't install libtool archives for server modules |
317 | # Don't install libtool archives for server modules |
| 316 | if [[ -e ${D}/usr/lib/xorg/modules ]]; then |
318 | if [[ -e ${D}/usr/lib/xorg/modules ]]; then |
| 317 | find ${D}/usr/lib/xorg/modules -name '*.la' \ |
319 | find ${D}/usr/lib/xorg/modules -name '*.la' \ |
| 318 | | xargs rm -f |
320 | | xargs rm -f |
|
|
321 | fi |
|
|
322 | |
|
|
323 | # Don't install overlapping fonts.* files |
|
|
324 | # Generate them instead when possible |
|
|
325 | if [[ -n "${FONT}" ]]; then |
|
|
326 | remove_font_metadata |
| 319 | fi |
327 | fi |
| 320 | } |
328 | } |
| 321 | |
329 | |
| 322 | x-modular_pkg_preinst() { |
330 | x-modular_pkg_preinst() { |
| 323 | if [[ -n "${FONT}" ]]; then |
331 | if [[ -n "${FONT}" ]]; then |
| … | |
… | |
| 381 | |
389 | |
| 382 | create_fonts_scale |
390 | create_fonts_scale |
| 383 | create_fonts_dir |
391 | create_fonts_dir |
| 384 | fix_font_permissions |
392 | fix_font_permissions |
| 385 | create_font_cache |
393 | create_font_cache |
|
|
394 | } |
|
|
395 | |
|
|
396 | remove_font_metadata() { |
|
|
397 | local DIR |
|
|
398 | for DIR in ${FONT_DIR}; do |
|
|
399 | if [[ "${DIR}" != "Speedo" ]] && \ |
|
|
400 | [[ "${DIR}" != "CID" ]] ; then |
|
|
401 | # Delete font metadata files |
|
|
402 | # fonts.scale, fonts.dir, fonts.cache-1 |
|
|
403 | rm -f ${D}/usr/share/fonts/${DIR}/fonts.{scale,dir,cache-1} |
|
|
404 | fi |
|
|
405 | done |
| 386 | } |
406 | } |
| 387 | |
407 | |
| 388 | discover_font_dirs() { |
408 | discover_font_dirs() { |
| 389 | pushd ${IMAGE}/usr/share/fonts |
409 | pushd ${IMAGE}/usr/share/fonts |
| 390 | FONT_DIRS="$(find . -maxdepth 1 -mindepth 1 -type d)" |
410 | FONT_DIRS="$(find . -maxdepth 1 -mindepth 1 -type d)" |