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

Contents of /eclass/fox.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations) (download)
Wed Jul 6 20:20:03 2005 UTC (9 years ago) by agriffis
Branch: MAIN
Changes since 1.1: +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.2 # $Header: /var/cvsroot/gentoo-x86/eclass/fox.eclass,v 1.1 2005/05/07 19:16:27 rphillips 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     INHERITED="$INHERITED $ECLASS"
35    
36     FOX_PV="${FOX_PV:-${PV}}"
37     PVP=(${FOX_PV//[-\._]/ })
38     FOXVER="${PVP[0]}.${PVP[1]}"
39    
40     if [ "${FOXVER}" != "1.0" ] ; then
41     FOXVER_SUFFIX="-${FOXVER}"
42     fi
43    
44     DESCRIPTION="C++ based Toolkit for developing Graphical User Interfaces easily and effectively"
45     HOMEPAGE="http://www.fox-toolkit.org/"
46     SRC_URI="http://www.fox-toolkit.org/ftp/fox-${FOX_PV}.tar.gz"
47    
48     IUSE="debug doc profile"
49    
50     # from fox-1.0
51     FOX_APPS="adie calculator pathfinder"
52     # from fox-1.2+
53     if [ "${FOXVER}" != "1.0" ] ; then
54     FOX_APPS="${FOX_APPS} shutterbug"
55     FOX_CHART="chart"
56     fi
57    
58     if [ "${PN}" != fox ] ; then
59     FOX_COMPONENT="${FOX_COMPONENT:-${PN}}"
60     fi
61    
62     if use doc && [ "${FOXVER}" != "1.0" ] && [ -z "${FOX_COMPONENT}" ] ; then
63     DOXYGEN_DEP="app-doc/doxygen"
64     fi
65    
66     if [ "${PN}" != reswrap ] ; then
67     RESWRAP_DEP="dev-util/reswrap"
68     fi
69    
70     DEPEND="${RDEPEND}
71     ${DOXYGEN_DEP}
72     ${RESWRAP_DEP}
73     =sys-devel/automake-1.4*
74     >=sys-apps/sed-4"
75    
76     S="${WORKDIR}/fox-${FOX_PV}"
77    
78     fox_src_unpack() {
79     unpack ${A}
80     cd ${S}
81    
82     ebegin "Fixing configure"
83    
84     # Respect system CXXFLAGS
85     sed -i -e 's:CXXFLAGS=""::' configure.in || die "sed configure.in error"
86     touch aclocal.m4
87     sed -i -e 's:CXXFLAGS=""::' configure || die "sed configure error"
88    
89     eend
90    
91     ebegin "Fixing Makefiles"
92    
93     # don't build apps from top-level (i.e. x11-libs/fox)
94     # utils == reswrap
95     for d in ${FOX_APPS} utils windows ; do
96     sed -i -e "s:${d}::" Makefile.am || die "sed Makefile.am error"
97     done
98    
99     # use the installed reswrap for everything else
100     for d in ${FOX_APPS} ${FOX_CHART} tests ; do
101     sed -i -e 's:$(top_builddir)/utils/reswrap:reswrap:' \
102     ${d}/Makefile.am || die "sed ${d}/Makefile.am error"
103     done
104    
105     # use the installed headers and library for apps
106     for d in ${FOX_APPS} ; do
107     sed -i \
108     -e "s:-I\$(top_srcdir)/include -I\$(top_builddir)/include:-I\$(includedir)/fox${FOXVER_SUFFIX}:" \
109     -e 's:../src/libFOX:-lFOX:' \
110     -e 's:\.la::' \
111     ${d}/Makefile.am || die "sed ${d}/Makefile.am error"
112     done
113    
114     # Upstream often has trouble with version number transitions
115     if [ "${FOXVER}" == "1.5" ] ; then
116     sed -i -e 's:1.4:1.5:g' chart/Makefile.am
117     fi
118    
119     eend
120    
121     ebegin "Running automake"
122     automake-1.4 -a -c || die "automake error"
123     eend
124    
125     elibtoolize
126     }
127    
128     fox_src_compile() {
129     local myconf
130     use debug && myconf="${myconf} --enable-debug" \
131     || myconf="${myconf} --enable-release"
132    
133     econf \
134     ${FOXCONF} \
135     ${myconf} \
136     $(use_with profile profiling) \
137     || die "configure error"
138    
139     cd ${S}/${FOX_COMPONENT}
140     emake || die "compile error"
141    
142     # build class reference docs (FOXVER >= 1.2)
143     if use doc && [ "${FOXVER}" != "1.0" ] && [ -z "${FOX_COMPONENT}" ] ; then
144     cd ${S}/doc
145     make docs || die "doxygen error"
146     fi
147     }
148    
149     fox_src_install () {
150     cd ${S}/${FOX_COMPONENT}
151    
152     make install \
153     DESTDIR=${D} \
154     htmldir=/usr/share/doc/${PF}/html \
155     artdir=/usr/share/doc/${PF}/html/art \
156     screenshotsdir=/usr/share/doc/${PF}/html/screenshots \
157     || die "install error"
158    
159     # create desktop menu items for apps
160     case ${FOX_COMPONENT} in
161     adie)
162     newicon big_gif.gif adie.gif
163     make_desktop_entry adie "Adie Text Editor" adie.gif
164     ;;
165     calculator)
166     newicon bigcalc.gif foxcalc.gif
167     make_desktop_entry calculator "FOX Calculator" foxcalc.gif
168     ;;
169     pathfinder)
170     newicon iconpath.gif pathfinder.gif
171     make_desktop_entry PathFinder "PathFinder" pathfinder.gif "FileManager"
172     ;;
173     shutterbug)
174     doicon shutterbug.gif
175     make_desktop_entry shutterbug "ShutterBug" shutterbug.gif "Graphics"
176     ;;
177     esac
178    
179     for doc in ADDITIONS AUTHORS LICENSE_ADDENDUM README TRACING ; do
180     [ -f $doc ] && dodoc $doc
181     done
182    
183     # remove documentation if USE=-doc
184     if ( ! use doc ) && [ -d ${D}/usr/share/doc/${PF}/html ] ; then
185     rm -fr ${D}/usr/share/doc/${PF}/html
186     fi
187    
188     # install class reference docs (FOXVER >= 1.2) if USE=doc
189     if use doc && [ "${FOXVER}" != "1.0" ] && [ -z "${FOX_COMPONENT}" ] ; then
190     dohtml -r ${S}/doc/ref
191     fi
192    
193     # slot fox-config where present (FOXVER >= 1.2)
194     if [ -f ${D}/usr/bin/fox-config ] ; then
195     mv ${D}/usr/bin/fox-config ${D}/usr/bin/fox-${FOXVER}-config
196     fi
197     }
198    
199     fox_pkg_postinst() {
200     if [ -z "${FOX_COMPONENT}" ] ; then
201     echo
202     einfo "Multiple versions of the FOX Toolkit library may now be installed"
203     einfo "in parallel SLOTs on the same system."
204     einfo
205     einfo "The reswrap utility and the applications included in the FOX Toolkit"
206     einfo "(adie, calculator, pathfinder, shutterbug) are now available as"
207     einfo "separate ebuilds."
208     echo
209     if [ "${FOXVER}" != "1.0" ] ; then
210     einfo "The fox-config script has been installed as fox-${FOXVER}-config."
211     einfo "The fox-wrapper package is used to direct calls to fox-config"
212     einfo "to the correct versioned script, based on the WANT_FOX variable."
213     einfo "For example:"
214     einfo
215     einfo " WANT_FOX=\"${FOXVER}\" fox-config <options>"
216     einfo
217     epause
218     fi
219     fi
220     }
221    
222     EXPORT_FUNCTIONS src_unpack src_compile src_install pkg_postinst

  ViewVC Help
Powered by ViewVC 1.1.20