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

Contents of /eclass/x-modular.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Mon Aug 8 02:57:50 2005 UTC (8 years, 11 months ago) by spyderous
Branch: MAIN
Eclass for modular X ebuilds.

1 spyderous 1.1 # Copyright 1999-2005 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3     # $Header: $
4     #
5     # Author: Donnie Berkholz <spyderous@gentoo.org>
6     #
7     # This eclass is designed to reduce code duplication in the modularized X11
8     # ebuilds.
9    
10     EXPORT_FUNCTIONS src_unpack src_compile src_install
11    
12     inherit eutils
13    
14     # Directory prefix to use for everything
15     # Change to /usr/X11R6 once it's standard
16     XDIR="/usr"
17    
18     IUSE=""
19     HOMEPAGE="http://xorg.freedesktop.org/"
20     SRC_URI="http://xorg.freedesktop.org/X11R7.0-RC0/everything/${P}.tar.bz2"
21     LICENSE="X11"
22     SLOT="0"
23    
24     # Set up shared dependencies
25     if [ -n "${SNAPSHOT}" ]; then
26     # FIXME: What's the minimal libtool version supporting arbitrary versioning?
27     DEPEND="${DEPEND}
28     >=sys-devel/autoconf-2.57
29     >=sys-devel/automake-1.7
30     >=sys-devel/libtool-1.5
31     >=sys-devel/m4-1.4"
32     fi
33    
34     DEPEND="${DEPEND}
35     dev-util/pkgconfig
36     x11-misc/util-macros"
37    
38     RDEPEND="${RDEPEND}"
39     # Shouldn't be necessary once we're in a standard location
40     # x11-base/x11-env"
41     # FIXME: Uncomment once it's in portage
42     # !x11-base/xorg-x11"
43    
44     x-modular_unpack_source() {
45     unpack ${A}
46     cd ${S}
47     }
48    
49     x-modular_patch_source() {
50     # Use standardized names and locations with bulk patching
51     # Patch directory is ${WORKDIR}/patch
52     # See epatch() in eutils.eclass for more documentation
53     if [ -z "${EPATCH_SUFFIX}" ] ; then
54     EPATCH_SUFFIX="patch"
55     fi
56    
57     # For specific list of patches
58     if [ -n "${PATCHES}" ] ; then
59     for PATCH in ${PATCHES}
60     do
61     epatch ${PATCH}
62     done
63     # For non-default directory bulk patching
64     elif [ -n "${PATCH_LOC}" ] ; then
65     epatch ${PATCH_LOC}
66     # For standard bulk patching
67     elif [ -d "${EPATCH_SOURCE}" ] ; then
68     epatch
69     fi
70     }
71    
72     x-modular_reconf_source() {
73     # Run autoreconf for CVS snapshots only
74     if [ "${SNAPSHOT}" = "yes" ]
75     then
76     # If possible, generate configure if it doesn't exist
77     if [ -f "${S}/configure.ac" ]
78     then
79     einfo "Running autoreconf..."
80     autoreconf -v --install
81     fi
82     fi
83    
84     }
85    
86     x-modular_src_unpack() {
87     x-modular_unpack_source
88     x-modular_patch_source
89     x-modular_reconf_source
90     }
91    
92     x-modular_src_compile() {
93     # If prefix isn't set here, .pc files cause problems
94     if [ -x ./configure ]; then
95     econf --prefix=${XDIR} \
96     --datadir=${XDIR}/share \
97     ${CONFIGURE_OPTIONS}
98     fi
99     emake || die "emake failed"
100     }
101    
102     x-modular_src_install() {
103     # Install everything to ${XDIR}
104     make \
105     DESTDIR="${D}" \
106     install
107     # Shouldn't be necessary in XDIR=/usr
108     # einstall forces datadir, so we need to re-force it
109     # datadir=${XDIR}/share \
110     # mandir=${XDIR}/share/man \
111     }

  ViewVC Help
Powered by ViewVC 1.1.20