/[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.2 Revision 1.6
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.2 2005/08/11 06:19:16 spyderous Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/x-modular.eclass,v 1.6 2005/08/21 04:56:53 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.
9# 9#
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
13EXPORT_FUNCTIONS src_unpack src_compile src_install pkg_postinst 13EXPORT_FUNCTIONS src_unpack src_compile src_install pkg_preinst pkg_postinst
14 14
15inherit eutils 15inherit eutils
16 16
17# Directory prefix to use for everything 17# Directory prefix to use for everything
18# Change to /usr/X11R6 once it's standard
19XDIR="/usr" 18XDIR="/usr"
20 19
21IUSE="" 20IUSE=""
22HOMEPAGE="http://xorg.freedesktop.org/" 21HOMEPAGE="http://xorg.freedesktop.org/"
23SRC_URI="http://xorg.freedesktop.org/X11R7.0-RC0/everything/${P}.tar.bz2" 22SRC_URI="http://xorg.freedesktop.org/X11R7.0-RC0/everything/${P}.tar.bz2"
30 DEPEND="${DEPEND} 29 DEPEND="${DEPEND}
31 >=sys-devel/autoconf-2.57 30 >=sys-devel/autoconf-2.57
32 >=sys-devel/automake-1.7 31 >=sys-devel/automake-1.7
33 >=sys-devel/libtool-1.5 32 >=sys-devel/libtool-1.5
34 >=sys-devel/m4-1.4" 33 >=sys-devel/m4-1.4"
34fi
35
36# If we're a font package, but not the font.alias one
37if [[ "${PN/#font}" != "${PN}" ]] && [[ "${PN}" != "font-alias" ]]; then
38 # Activate font code in the rest of the eclass
39 FONT="yes"
40
41 RDEPEND="${RDEPEND}
42 media-fonts/encodings"
43 PDEPEND="${PDEPEND}
44 media-fonts/font-alias"
35fi 45fi
36 46
37DEPEND="${DEPEND} 47DEPEND="${DEPEND}
38 dev-util/pkgconfig 48 dev-util/pkgconfig
39 x11-misc/util-macros" 49 x11-misc/util-macros"
90 x-modular_unpack_source 100 x-modular_unpack_source
91 x-modular_patch_source 101 x-modular_patch_source
92 x-modular_reconf_source 102 x-modular_reconf_source
93} 103}
94 104
95x-modular_src_compile() { 105x-modular_src_configure() {
96 # If prefix isn't set here, .pc files cause problems 106 # If prefix isn't set here, .pc files cause problems
97 if [ -x ./configure ]; then 107 if [ -x ./configure ]; then
98 econf --prefix=${XDIR} \ 108 econf --prefix=${XDIR} \
99 --datadir=${XDIR}/share \ 109 --datadir=${XDIR}/share \
100 ${CONFIGURE_OPTIONS} 110 ${CONFIGURE_OPTIONS}
101 fi 111 fi
112}
113
114x-modular_src_make() {
102 emake || die "emake failed" 115 emake || die "emake failed"
116}
117
118x-modular_src_compile() {
119 x-modular_src_configure
120 x-modular_src_make
103} 121}
104 122
105x-modular_src_install() { 123x-modular_src_install() {
106 # Install everything to ${XDIR} 124 # Install everything to ${XDIR}
107 make \ 125 make \
111# einstall forces datadir, so we need to re-force it 129# einstall forces datadir, so we need to re-force it
112# datadir=${XDIR}/share \ 130# datadir=${XDIR}/share \
113# mandir=${XDIR}/share/man \ 131# mandir=${XDIR}/share/man \
114} 132}
115 133
134x-modular_pkg_preinst() {
135 if [[ -n "${FONT}" ]]; then
136 discover_font_dirs
137 fi
138}
139
116x-modular_pkg_postinst() { 140x-modular_pkg_postinst() {
117 if [[ -n "${FONT}" ]]; then 141 if [[ -n "${FONT}" ]]; then
118 setup_fonts 142 setup_fonts
119 fi 143 fi
120} 144}
128 152
129 create_fonts_scale 153 create_fonts_scale
130 create_fonts_dir 154 create_fonts_dir
131 fix_font_permissions 155 fix_font_permissions
132 create_font_cache 156 create_font_cache
157}
158
159discover_font_dirs() {
160 pushd ${IMAGE}/usr/share/fonts
161 FONT_DIRS="$(find . -maxdepth 1 -mindepth 1 -type d)"
162 FONT_DIRS="$(echo ${FONT_DIRS} | sed -e 's:./::g')"
163 popd
133} 164}
134 165
135create_fonts_scale() { 166create_fonts_scale() {
136 ebegin "Creating fonts.scale files" 167 ebegin "Creating fonts.scale files"
137 local x 168 local x

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.6

  ViewVC Help
Powered by ViewVC 1.1.20