/[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.1.1.1 Revision 1.3
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.1.1.1 2005/11/30 09:59:28 chriswhite Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/x-modular.eclass,v 1.3 2005/08/14 23:04:02 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_preinst pkg_postinst 13EXPORT_FUNCTIONS src_unpack src_compile src_install pkg_postinst
14 14
15inherit eutils libtool 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
18XDIR="/usr" 19XDIR="/usr"
19 20
20IUSE="" 21IUSE=""
21HOMEPAGE="http://xorg.freedesktop.org/" 22HOMEPAGE="http://xorg.freedesktop.org/"
22SRC_URI="http://xorg.freedesktop.org/releases/X11R7.0-RC2/everything/${P}.tar.bz2 23SRC_URI="http://xorg.freedesktop.org/X11R7.0-RC0/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"
25LICENSE="X11" 24LICENSE="X11"
26SLOT="0" 25SLOT="0"
27 26
28# Set up shared dependencies 27# Set up shared dependencies
29if [ -n "${SNAPSHOT}" ]; then 28if [ -n "${SNAPSHOT}" ]; then
34 >=sys-devel/libtool-1.5 33 >=sys-devel/libtool-1.5
35 >=sys-devel/m4-1.4" 34 >=sys-devel/m4-1.4"
36fi 35fi
37 36
38# If we're a font package, but not the font.alias one 37# If we're a font package, but not the font.alias one
39if [[ "${PN/#font-}" != "${PN}" ]] && [[ "${PN}" != "font-alias" ]]; then 38if [[ "${PN/#font}" != "${PN}" ]] && [[ "${PN}" != "font-alias" ]]; then
40 # Activate font code in the rest of the eclass
41 FONT="yes"
42
43 RDEPEND="${RDEPEND} 39 RDEPEND="${RDEPEND}
44 media-fonts/encodings" 40 media-fonts/encodings"
45 PDEPEND="${PDEPEND} 41 PDEPEND="${PDEPEND}
46 media-fonts/font-alias" 42 media-fonts/font-alias"
47fi 43fi
48 44
49# If we're a driver package
50if [[ "${PN/#xf86-video}" != "${PN}" ]] || [[ "${PN/#xf86-input}" != "${PN}" ]]; then
51 # Don't build static driver modules
52 DRIVER_OPTIONS="--disable-static"
53fi
54
55DEPEND="${DEPEND} 45DEPEND="${DEPEND}
56 >=dev-util/pkgconfig-0.18 46 dev-util/pkgconfig
57 >=x11-misc/util-macros-0.99.0_p20051007" 47 x11-misc/util-macros"
58 48
59# >=sys-apps/man-1.6b-r2 required to look in [0-8]x/ directories
60RDEPEND="${RDEPEND} 49RDEPEND="${RDEPEND}"
61 !<=x11-base/xorg-x11-6.9 50# Shouldn't be necessary once we're in a standard location
62 >=sys-apps/man-1.6b-r2"
63# Provides virtual/x11 for temporary use until packages are ported
64# x11-base/x11-env" 51# x11-base/x11-env"
52# FIXME: Uncomment once it's in portage
53# !x11-base/xorg-x11"
65 54
66x-modular_unpack_source() { 55x-modular_unpack_source() {
67 unpack ${A} 56 unpack ${A}
68 cd ${S} 57 cd ${S}
69
70 # Joshua Baergen - October 23, 2005
71 # Fix shared lib issues on MIPS, FBSD, etc etc
72 elibtoolize
73} 58}
74 59
75x-modular_patch_source() { 60x-modular_patch_source() {
76 # Use standardized names and locations with bulk patching 61 # Use standardized names and locations with bulk patching
77 # Patch directory is ${WORKDIR}/patch 62 # Patch directory is ${WORKDIR}/patch
101 then 86 then
102 # If possible, generate configure if it doesn't exist 87 # If possible, generate configure if it doesn't exist
103 if [ -f "${S}/configure.ac" ] 88 if [ -f "${S}/configure.ac" ]
104 then 89 then
105 einfo "Running autoreconf..." 90 einfo "Running autoreconf..."
106 autoreconf -v --force --install 91 autoreconf -v --install
107 fi 92 fi
108 fi 93 fi
109 94
110} 95}
111 96
113 x-modular_unpack_source 98 x-modular_unpack_source
114 x-modular_patch_source 99 x-modular_patch_source
115 x-modular_reconf_source 100 x-modular_reconf_source
116} 101}
117 102
118x-modular_src_configure() { 103x-modular_src_compile() {
119 # If prefix isn't set here, .pc files cause problems 104 # If prefix isn't set here, .pc files cause problems
120 if [ -x ./configure ]; then 105 if [ -x ./configure ]; then
121 econf --prefix=${XDIR} \ 106 econf --prefix=${XDIR} \
122 --datadir=${XDIR}/share \ 107 --datadir=${XDIR}/share \
123 ${DRIVER_OPTIONS} \
124 ${CONFIGURE_OPTIONS} 108 ${CONFIGURE_OPTIONS}
125 fi 109 fi
126}
127
128x-modular_src_make() {
129 emake || die "emake failed" 110 emake || die "emake failed"
130}
131
132x-modular_src_compile() {
133 x-modular_src_configure
134 x-modular_src_make
135} 111}
136 112
137x-modular_src_install() { 113x-modular_src_install() {
138 # Install everything to ${XDIR} 114 # Install everything to ${XDIR}
139 make \ 115 make \
141 install 117 install
142# Shouldn't be necessary in XDIR=/usr 118# Shouldn't be necessary in XDIR=/usr
143# einstall forces datadir, so we need to re-force it 119# einstall forces datadir, so we need to re-force it
144# datadir=${XDIR}/share \ 120# datadir=${XDIR}/share \
145# mandir=${XDIR}/share/man \ 121# 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
152}
153
154x-modular_pkg_preinst() {
155 if [[ -n "${FONT}" ]]; then
156 discover_font_dirs
157 fi
158} 122}
159 123
160x-modular_pkg_postinst() { 124x-modular_pkg_postinst() {
161 if [[ -n "${FONT}" ]]; then 125 if [[ -n "${FONT}" ]]; then
162 setup_fonts 126 setup_fonts
172 136
173 create_fonts_scale 137 create_fonts_scale
174 create_fonts_dir 138 create_fonts_dir
175 fix_font_permissions 139 fix_font_permissions
176 create_font_cache 140 create_font_cache
177}
178
179discover_font_dirs() {
180 pushd ${IMAGE}/usr/share/fonts
181 FONT_DIRS="$(find . -maxdepth 1 -mindepth 1 -type d)"
182 FONT_DIRS="$(echo ${FONT_DIRS} | sed -e 's:./::g')"
183 popd
184} 141}
185 142
186create_fonts_scale() { 143create_fonts_scale() {
187 ebegin "Creating fonts.scale files" 144 ebegin "Creating fonts.scale files"
188 local x 145 local x

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.20