/[gentoo-x86]/eclass/x-modular.eclass
Gentoo

Diff of /eclass/x-modular.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.47 Revision 1.52
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.47 2006/03/09 20:39:30 spyderous Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/x-modular.eclass,v 1.52 2006/04/03 23:49:32 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
28EXPORT_FUNCTIONS src_unpack src_compile src_install pkg_preinst pkg_postinst pkg_postrm 28EXPORT_FUNCTIONS src_unpack src_compile src_install pkg_preinst pkg_postinst pkg_postrm
29 29
30inherit eutils libtool toolchain-funcs flag-o-matic 30inherit eutils libtool toolchain-funcs flag-o-matic autotools
31 31
32# Directory prefix to use for everything 32# Directory prefix to use for everything
33XDIR="/usr" 33XDIR="/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"
92fi 92fi
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
95if [[ "${PN/#font-}" != "${PN}" ]] \ 95if [[ "${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
218 if [[ "${SNAPSHOT}" = "yes" ]] 219 if [[ "${SNAPSHOT}" = "yes" ]]
219 then 220 then
220 # If possible, generate configure if it doesn't exist 221 # If possible, generate configure if it doesn't exist
221 if [ -f "${S}/configure.ac" ] 222 if [ -f "${S}/configure.ac" ]
222 then 223 then
223 einfo "Running autoreconf..." 224 eautoreconf
224 autoreconf -v --force --install
225 fi 225 fi
226 fi 226 fi
227 227
228} 228}
229 229
230x-modular_src_unpack() { 230x-modular_src_unpack() {
231 if [[ ${PN:0:11} = "xorg-server" ]] || [[ -n "${DRIVER}" ]]; then 231 if [[ ${PN:0:11} = "xorg-server" ]] || [[ -n "${DRIVER}" ]]; then
232 if gcc-specs-now; then 232 if gcc-specs-now; then
233 msg="Do not emerge ${PN} without vanilla gcc specs!" 233 msg="${PN} does not work with hardened gcc specs. Switch to vanilla gcc specs to emerge ${PN}."
234 eerror "$msg" 234 eerror "$msg"
235 die "$msg" 235 die "$msg"
236 fi 236 fi
237 fi 237 fi
238 238
312# Shouldn't be necessary in XDIR=/usr 312# Shouldn't be necessary in XDIR=/usr
313# einstall forces datadir, so we need to re-force it 313# einstall forces datadir, so we need to re-force it
314# datadir=${XDIR}/share \ 314# datadir=${XDIR}/share \
315# mandir=${XDIR}/share/man \ 315# mandir=${XDIR}/share/man \
316 316
317 # Make sure docs get compressed
318 prepalldocs
319
317 # Don't install libtool archives for server modules 320 # Don't install libtool archives for server modules
318 if [[ -e ${D}/usr/lib/xorg/modules ]]; then 321 if [[ -e ${D}/usr/lib/xorg/modules ]]; then
319 find ${D}/usr/lib/xorg/modules -name '*.la' \ 322 find ${D}/usr/lib/xorg/modules -name '*.la' \
320 | xargs rm -f 323 | xargs rm -f
324 fi
325
326 # Don't install overlapping fonts.* files
327 # Generate them instead when possible
328 if [[ -n "${FONT}" ]]; then
329 remove_font_metadata
321 fi 330 fi
322} 331}
323 332
324x-modular_pkg_preinst() { 333x-modular_pkg_preinst() {
325 if [[ -n "${FONT}" ]]; then 334 if [[ -n "${FONT}" ]]; then
383 392
384 create_fonts_scale 393 create_fonts_scale
385 create_fonts_dir 394 create_fonts_dir
386 fix_font_permissions 395 fix_font_permissions
387 create_font_cache 396 create_font_cache
397}
398
399remove_font_metadata() {
400 local DIR
401 for DIR in ${FONT_DIR}; do
402 if [[ "${DIR}" != "Speedo" ]] && \
403 [[ "${DIR}" != "CID" ]] ; then
404 # Delete font metadata files
405 # fonts.scale, fonts.dir, fonts.cache-1
406 rm -f ${D}/usr/share/fonts/${DIR}/fonts.{scale,dir,cache-1}
407 fi
408 done
388} 409}
389 410
390discover_font_dirs() { 411discover_font_dirs() {
391 pushd ${IMAGE}/usr/share/fonts 412 pushd ${IMAGE}/usr/share/fonts
392 FONT_DIRS="$(find . -maxdepth 1 -mindepth 1 -type d)" 413 FONT_DIRS="$(find . -maxdepth 1 -mindepth 1 -type d)"

Legend:
Removed from v.1.47  
changed lines
  Added in v.1.52

  ViewVC Help
Powered by ViewVC 1.1.20