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

Contents of /eclass/fox.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Sat May 7 19:16:27 2005 UTC (9 years, 5 months ago) by rphillips
Branch: MAIN
added fox eclass by Yaakov Selkowitz

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

  ViewVC Help
Powered by ViewVC 1.1.20