/[gentoo-x86]/eclass/fox.eclass
Gentoo

Contents of /eclass/fox.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (hide annotations) (download)
Wed Jul 6 20:23:20 2005 UTC (8 years, 9 months ago) by agriffis
Branch: MAIN
Changes since 1.2: +1 -2 lines
Remove ECLASS= and INHERITED= which haven't been necessary for a long time now

1 rphillips 1.1 # Copyright 1999-2005 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 agriffis 1.3 # $Header: /var/cvsroot/gentoo-x86/eclass/fox.eclass,v 1.2 2005/07/06 20:20:03 agriffis Exp $
4 rphillips 1.1
5     # fox eclass
6     #
7     # This eclass allows building SLOT-able FOX Toolkit installations
8     # (x11-libs/fox: headers, libs, and docs), which are by design
9     # parallel-installable, while installing only one version of the utils
10     # (dev-util/reswrap) and apps (app-editors/adie, sci-calculators/calculator,
11     # x11-misc/pathfinder, and x11-misc/shutterbug).
12     #
13     # Version numbering follows the kernel-style odd-even minor version
14     # designation. Even-number minor versions are API stable, which patch
15     # releases aimed mostly at the library; apps generally won't need to be
16     # bumped for a patch release.
17     #
18     # Odd-number versions are development branches with their own SLOT and
19     # are API unstable; changes are made to the apps, and likely need to be
20     # bumped together with the library.
21     #
22     # Here are sample [R]DEPENDs for the fox apps, based on the first versions
23     # in each branch to use this eclass:
24     # 1.0: '>=x11-libs/fox-1.0.53 <x11-libs/fox-1.1'
25     # 1.2: '>=x11-libs/fox-1.2.15 <x11-libs/fox-1.3'
26     # 1.4: '>=x11-libs/fox-1.4.12 <x11-libs/fox-1.5'
27     # 1.5: '~x11-libs/fox-${PV}'
28     # 1.6: '=x11-libs/fox-${FOXVER}*'
29     #
30     # Some concepts borrowed from gst-plugins and gtk-sharp-component eclasses
31    
32     inherit eutils libtool
33    
34    
35     FOX_PV="${FOX_PV:-${PV}}"
36     PVP=(${FOX_PV//[-\._]/ })
37     FOXVER="${PVP[0]}.${PVP[1]}"
38    
39     if [ "${FOXVER}" != "1.0" ] ; then
40     FOXVER_SUFFIX="-${FOXVER}"
41     fi
42    
43     DESCRIPTION="C++ based Toolkit for developing Graphical User Interfaces easily and effectively"
44     HOMEPAGE="http://www.fox-toolkit.org/"
45     SRC_URI="http://www.fox-toolkit.org/ftp/fox-${FOX_PV}.tar.gz"
46    
47     IUSE="debug doc profile"
48    
49     # from fox-1.0
50     FOX_APPS="adie calculator pathfinder"
51     # from fox-1.2+
52     if [ "${FOXVER}" != "1.0" ] ; then
53     FOX_APPS="${FOX_APPS} shutterbug"
54     FOX_CHART="chart"
55     fi
56    
57     if [ "${PN}" != fox ] ; then
58     FOX_COMPONENT="${FOX_COMPONENT:-${PN}}"
59     fi
60    
61     if use doc && [ "${FOXVER}" != "1.0" ] && [ -z "${FOX_COMPONENT}" ] ; then
62     DOXYGEN_DEP="app-doc/doxygen"
63     fi
64    
65     if [ "${PN}" != reswrap ] ; then
66     RESWRAP_DEP="dev-util/reswrap"
67     fi
68    
69     DEPEND="${RDEPEND}
70     ${DOXYGEN_DEP}
71     ${RESWRAP_DEP}
72     =sys-devel/automake-1.4*
73     >=sys-apps/sed-4"
74    
75     S="${WORKDIR}/fox-${FOX_PV}"
76    
77     fox_src_unpack() {
78     unpack ${A}
79     cd ${S}
80    
81     ebegin "Fixing configure"
82    
83     # Respect system CXXFLAGS
84     sed -i -e 's:CXXFLAGS=""::' configure.in || die "sed configure.in error"
85     touch aclocal.m4
86     sed -i -e 's:CXXFLAGS=""::' configure || die "sed configure error"
87    
88     eend
89    
90     ebegin "Fixing Makefiles"
91    
92     # don't build apps from top-level (i.e. x11-libs/fox)
93     # utils == reswrap
94     for d in ${FOX_APPS} utils windows ; do
95     sed -i -e "s:${d}::" Makefile.am || die "sed Makefile.am error"
96     done
97    
98     # use the installed reswrap for everything else
99     for d in ${FOX_APPS} ${FOX_CHART} tests ; do
100     sed -i -e 's:$(top_builddir)/utils/reswrap:reswrap:' \
101     ${d}/Makefile.am || die "sed ${d}/Makefile.am error"
102     done
103    
104     # use the installed headers and library for apps
105     for d in ${FOX_APPS} ; do
106     sed -i \
107     -e "s:-I\$(top_srcdir)/include -I\$(top_builddir)/include:-I\$(includedir)/fox${FOXVER_SUFFIX}:" \
108     -e 's:../src/libFOX:-lFOX:' \
109     -e 's:\.la::' \
110     ${d}/Makefile.am || die "sed ${d}/Makefile.am error"
111     done
112    
113     # Upstream often has trouble with version number transitions
114     if [ "${FOXVER}" == "1.5" ] ; then
115     sed -i -e 's:1.4:1.5:g' chart/Makefile.am
116     fi
117    
118     eend
119    
120     ebegin "Running automake"
121     automake-1.4 -a -c || die "automake error"
122     eend
123    
124     elibtoolize
125     }
126    
127     fox_src_compile() {
128     local myconf
129     use debug && myconf="${myconf} --enable-debug" \
130     || myconf="${myconf} --enable-release"
131    
132     econf \
133     ${FOXCONF} \
134     ${myconf} \
135     $(use_with profile profiling) \
136     || die "configure error"
137    
138     cd ${S}/${FOX_COMPONENT}
139     emake || die "compile error"
140    
141     # build class reference docs (FOXVER >= 1.2)
142     if use doc && [ "${FOXVER}" != "1.0" ] && [ -z "${FOX_COMPONENT}" ] ; then
143     cd ${S}/doc
144     make docs || die "doxygen error"
145     fi
146     }
147    
148     fox_src_install () {
149     cd ${S}/${FOX_COMPONENT}
150    
151     make install \
152     DESTDIR=${D} \
153     htmldir=/usr/share/doc/${PF}/html \
154     artdir=/usr/share/doc/${PF}/html/art \
155     screenshotsdir=/usr/share/doc/${PF}/html/screenshots \
156     || die "install error"
157    
158     # create desktop menu items for apps
159     case ${FOX_COMPONENT} in
160     adie)
161     newicon big_gif.gif adie.gif
162     make_desktop_entry adie "Adie Text Editor" adie.gif
163     ;;
164     calculator)
165     newicon bigcalc.gif foxcalc.gif
166     make_desktop_entry calculator "FOX Calculator" foxcalc.gif
167     ;;
168     pathfinder)
169     newicon iconpath.gif pathfinder.gif
170     make_desktop_entry PathFinder "PathFinder" pathfinder.gif "FileManager"
171     ;;
172     shutterbug)
173     doicon shutterbug.gif
174     make_desktop_entry shutterbug "ShutterBug" shutterbug.gif "Graphics"
175     ;;
176     esac
177    
178     for doc in ADDITIONS AUTHORS LICENSE_ADDENDUM README TRACING ; do
179     [ -f $doc ] && dodoc $doc
180     done
181    
182     # remove documentation if USE=-doc
183     if ( ! use doc ) && [ -d ${D}/usr/share/doc/${PF}/html ] ; then
184     rm -fr ${D}/usr/share/doc/${PF}/html
185     fi
186    
187     # install class reference docs (FOXVER >= 1.2) if USE=doc
188     if use doc && [ "${FOXVER}" != "1.0" ] && [ -z "${FOX_COMPONENT}" ] ; then
189     dohtml -r ${S}/doc/ref
190     fi
191    
192     # slot fox-config where present (FOXVER >= 1.2)
193     if [ -f ${D}/usr/bin/fox-config ] ; then
194     mv ${D}/usr/bin/fox-config ${D}/usr/bin/fox-${FOXVER}-config
195     fi
196     }
197    
198     fox_pkg_postinst() {
199     if [ -z "${FOX_COMPONENT}" ] ; then
200     echo
201     einfo "Multiple versions of the FOX Toolkit library may now be installed"
202     einfo "in parallel SLOTs on the same system."
203     einfo
204     einfo "The reswrap utility and the applications included in the FOX Toolkit"
205     einfo "(adie, calculator, pathfinder, shutterbug) are now available as"
206     einfo "separate ebuilds."
207     echo
208     if [ "${FOXVER}" != "1.0" ] ; then
209     einfo "The fox-config script has been installed as fox-${FOXVER}-config."
210     einfo "The fox-wrapper package is used to direct calls to fox-config"
211     einfo "to the correct versioned script, based on the WANT_FOX variable."
212     einfo "For example:"
213     einfo
214     einfo " WANT_FOX=\"${FOXVER}\" fox-config <options>"
215     einfo
216     epause
217     fi
218     fi
219     }
220    
221     EXPORT_FUNCTIONS src_unpack src_compile src_install pkg_postinst

  ViewVC Help
Powered by ViewVC 1.1.20