/[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.20
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.20 2005/11/11 05:29:41 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 libtool
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/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"
24LICENSE="X11" 25LICENSE="X11"
25SLOT="0" 26SLOT="0"
26 27
27# Set up shared dependencies 28# Set up shared dependencies
28if [ -n "${SNAPSHOT}" ]; then 29if [ -n "${SNAPSHOT}" ]; then
32 >=sys-devel/automake-1.7 33 >=sys-devel/automake-1.7
33 >=sys-devel/libtool-1.5 34 >=sys-devel/libtool-1.5
34 >=sys-devel/m4-1.4" 35 >=sys-devel/m4-1.4"
35fi 36fi
36 37
38# If we're a font package, but not the font.alias one
39if [[ "${PN/#font-}" != "${PN}" ]] && [[ "${PN}" != "font-alias" ]]; then
40 # Activate font code in the rest of the eclass
41 FONT="yes"
42
43 RDEPEND="${RDEPEND}
44 media-fonts/encodings"
45 PDEPEND="${PDEPEND}
46 media-fonts/font-alias"
47fi
48
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
37DEPEND="${DEPEND} 55DEPEND="${DEPEND}
38 dev-util/pkgconfig 56 >=dev-util/pkgconfig-0.18
39 x11-misc/util-macros" 57 >=x11-misc/util-macros-0.99.0_p20051007"
40 58
41RDEPEND="${RDEPEND}" 59RDEPEND="${RDEPEND}
42# Shouldn't be necessary once we're in a standard location 60 !<x11-base/xorg-x11-7.0.0_rc0"
61# Provides virtual/x11 for temporary use until packages are ported
43# x11-base/x11-env" 62# x11-base/x11-env"
44# FIXME: Uncomment once it's in portage
45# !x11-base/xorg-x11"
46 63
47x-modular_unpack_source() { 64x-modular_unpack_source() {
48 unpack ${A} 65 unpack ${A}
49 cd ${S} 66 cd ${S}
67
68 # Joshua Baergen - October 23, 2005
69 # Fix shared lib issues on MIPS, FBSD, etc etc
70 elibtoolize
50} 71}
51 72
52x-modular_patch_source() { 73x-modular_patch_source() {
53 # Use standardized names and locations with bulk patching 74 # Use standardized names and locations with bulk patching
54 # Patch directory is ${WORKDIR}/patch 75 # Patch directory is ${WORKDIR}/patch
78 then 99 then
79 # If possible, generate configure if it doesn't exist 100 # If possible, generate configure if it doesn't exist
80 if [ -f "${S}/configure.ac" ] 101 if [ -f "${S}/configure.ac" ]
81 then 102 then
82 einfo "Running autoreconf..." 103 einfo "Running autoreconf..."
83 autoreconf -v --install 104 autoreconf -v --force --install
84 fi 105 fi
85 fi 106 fi
86 107
87} 108}
88 109
90 x-modular_unpack_source 111 x-modular_unpack_source
91 x-modular_patch_source 112 x-modular_patch_source
92 x-modular_reconf_source 113 x-modular_reconf_source
93} 114}
94 115
95x-modular_src_compile() { 116x-modular_src_configure() {
96 # If prefix isn't set here, .pc files cause problems 117 # If prefix isn't set here, .pc files cause problems
97 if [ -x ./configure ]; then 118 if [ -x ./configure ]; then
98 econf --prefix=${XDIR} \ 119 econf --prefix=${XDIR} \
99 --datadir=${XDIR}/share \ 120 --datadir=${XDIR}/share \
121 ${DRIVER_OPTIONS} \
100 ${CONFIGURE_OPTIONS} 122 ${CONFIGURE_OPTIONS}
101 fi 123 fi
124}
125
126x-modular_src_make() {
102 emake || die "emake failed" 127 emake || die "emake failed"
128}
129
130x-modular_src_compile() {
131 x-modular_src_configure
132 x-modular_src_make
103} 133}
104 134
105x-modular_src_install() { 135x-modular_src_install() {
106 # Install everything to ${XDIR} 136 # Install everything to ${XDIR}
107 make \ 137 make \
109 install 139 install
110# Shouldn't be necessary in XDIR=/usr 140# Shouldn't be necessary in XDIR=/usr
111# einstall forces datadir, so we need to re-force it 141# einstall forces datadir, so we need to re-force it
112# datadir=${XDIR}/share \ 142# datadir=${XDIR}/share \
113# mandir=${XDIR}/share/man \ 143# mandir=${XDIR}/share/man \
144
145 # Don't install libtool archives for server modules
146 if [[ -e ${D}/usr/lib/xorg/modules ]]; then
147 find ${D}/usr/lib/xorg/modules -name '*.la' \
148 | xargs rm -f
149 fi
150}
151
152x-modular_pkg_preinst() {
153 if [[ -n "${FONT}" ]]; then
154 discover_font_dirs
155 fi
114} 156}
115 157
116x-modular_pkg_postinst() { 158x-modular_pkg_postinst() {
117 if [[ -n "${FONT}" ]]; then 159 if [[ -n "${FONT}" ]]; then
118 setup_fonts 160 setup_fonts
128 170
129 create_fonts_scale 171 create_fonts_scale
130 create_fonts_dir 172 create_fonts_dir
131 fix_font_permissions 173 fix_font_permissions
132 create_font_cache 174 create_font_cache
175}
176
177discover_font_dirs() {
178 pushd ${IMAGE}/usr/share/fonts
179 FONT_DIRS="$(find . -maxdepth 1 -mindepth 1 -type d)"
180 FONT_DIRS="$(echo ${FONT_DIRS} | sed -e 's:./::g')"
181 popd
133} 182}
134 183
135create_fonts_scale() { 184create_fonts_scale() {
136 ebegin "Creating fonts.scale files" 185 ebegin "Creating fonts.scale files"
137 local x 186 local x

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

  ViewVC Help
Powered by ViewVC 1.1.20