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

Diff of /eclass/fox.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.6 Revision 1.17
1# Copyright 1999-2005 Gentoo Foundation 1# Copyright 1999-2012 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/fox.eclass,v 1.6 2006/10/30 22:14:18 mabi Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/fox.eclass,v 1.17 2012/09/27 16:35:41 axs Exp $
4 4
5# fox eclass 5# @ECLASS: fox.eclass
6# 6# @MAINTAINER:
7# mabi@gentoo.org
8# @BLURB: Functionality required the FOX Toolkit and it's applications
9# @DESCRIPTION:
7# This eclass allows building SLOT-able FOX Toolkit installations 10# This eclass allows building SLOT-able FOX Toolkit installations
8# (x11-libs/fox: headers, libs, and docs), which are by design 11# (x11-libs/fox: headers, libs, and docs), which are by design
9# parallel-installable, while installing only one version of the utils 12# parallel-installable, while installing only one version of the utils
10# (dev-util/reswrap) and apps (app-editors/adie, sci-calculators/calculator, 13# (dev-util/reswrap) and apps (app-editors/adie, sci-calculators/calculator,
11# x11-misc/pathfinder, and x11-misc/shutterbug). 14# x11-misc/pathfinder, and x11-misc/shutterbug).
18# Odd-number versions are development branches with their own SLOT and 21# 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 22# are API unstable; changes are made to the apps, and likely need to be
20# bumped together with the library. 23# bumped together with the library.
21# 24#
22# Here are sample [R]DEPENDs for the fox apps 25# Here are sample [R]DEPENDs for the fox apps
23# fox versions that do not use this eclass are blocked in INCOMPAT_DEP below
24# 1.0: '=x11-libs/fox-1.0*' 26# 1.6: 'x11-libs/fox:1.6'
25# 1.2: '=x11-libs/fox-1.2*'
26# 1.4: '=x11-libs/fox-1.4*'
27# 1.5: '~x11-libs/fox-${PV}' 27# 1.7: '~x11-libs/fox-${PV}'
28# 1.6: '=x11-libs/fox-${FOXVER}*'
29# 28#
30# Some concepts borrowed from gst-plugins and gtk-sharp-component eclasses 29# EAPI phase trickery borrowed from enlightenment.eclass
31 30
32inherit eutils libtool 31inherit autotools versionator
33 32
34 33
35FOX_PV="${FOX_PV:-${PV}}" 34FOX_EXPF="src_unpack src_compile src_install pkg_postinst"
36PVP=(${FOX_PV//[-\._]/ }) 35case "${EAPI:-0}" in
37FOXVER="${PVP[0]}.${PVP[1]}" 36 2|3|4|5) FOX_EXPF+=" src_prepare src_configure" ;;
37 *) ;;
38esac
39EXPORT_FUNCTIONS ${FOX_EXPF}
38 40
39if [ "${FOXVER}" != "1.0" ] ; then 41# @ECLASS-VARIABLE: FOX_PV
40 FOXVER_SUFFIX="-${FOXVER}" 42# @DESCRIPTION:
41fi 43# The version of the FOX Toolkit provided or required by the package
44: ${FOX_PV:=${PV}}
45
46# @ECLASS-VARIABLE: FOXVER
47# @INTERNAL
48# @DESCRIPTION:
49# The major.minor version of FOX_PV, usually acts as $SLOT and is used in
50# building the applications
51FOXVER=$(get_version_component_range 1-2 ${FOX_PV})
52
53# @ECLASS-VARIABLE: FOX_APPS
54# @INTERNAL
55# @DESCRIPTION:
56# The applications originally packaged in the FOX Toolkit
57FOX_APPS="adie calculator pathfinder shutterbug"
58
59# @ECLASS-VARIABLE: FOXCONF
60# @DEFAULT_UNSET
61# @DESCRIPTION:
62# Set this to add additional configuration options during src_configure
42 63
43DESCRIPTION="C++ based Toolkit for developing Graphical User Interfaces easily and effectively" 64DESCRIPTION="C++ based Toolkit for developing Graphical User Interfaces easily and effectively"
44HOMEPAGE="http://www.fox-toolkit.org/" 65HOMEPAGE="http://www.fox-toolkit.org/"
45SRC_URI="http://www.fox-toolkit.org/ftp/fox-${FOX_PV}.tar.gz" 66SRC_URI="ftp://ftp.fox-toolkit.org/pub/fox-${FOX_PV}.tar.gz"
46 67
47IUSE="debug doc profile" 68IUSE="debug doc profile"
48 69
49# from fox-1.0
50FOX_APPS="adie calculator pathfinder"
51# from fox-1.2+
52if [ "${FOXVER}" != "1.0" ] ; then
53 FOX_APPS="${FOX_APPS} shutterbug"
54 FOX_CHART="chart"
55fi
56
57if [ "${PN}" != fox ] ; then 70if [[ ${PN} != fox ]] ; then
58 FOX_COMPONENT="${FOX_COMPONENT:-${PN}}" 71 FOX_COMPONENT="${FOX_COMPONENT:-${PN}}"
59fi 72fi
60 73
61if use doc && [ "${FOXVER}" != "1.0" ] && [ -z "${FOX_COMPONENT}" ] ; then 74if [[ -z ${FOX_COMPONENT} ]] ; then
62 DOXYGEN_DEP="app-doc/doxygen" 75 DOXYGEN_DEP="doc? ( app-doc/doxygen )"
63fi 76fi
64 77
65if [ "${PN}" != reswrap ] ; then 78if [[ ${PN} != reswrap ]] ; then
66 RESWRAP_DEP="dev-util/reswrap" 79 RESWRAP_DEP="dev-util/reswrap"
67fi 80fi
68 81
69# These versions are not compatible with new fox layout
70# and will cause collissions - we need to block them
71INCOMPAT_DEP="!<x11-libs/fox-1.0.53
72 !=x11-libs/fox-1.2.4
73 !~x11-libs/fox-1.2.6
74 !=x11-libs/fox-1.4.11"
75
76DEPEND="${INCOMPAT_DEP}
77 ${DOXYGEN_DEP} 82DEPEND="${DOXYGEN_DEP}
78 ${RESWRAP_DEP} 83 ${RESWRAP_DEP}
79 =sys-devel/automake-1.4*
80 >=sys-apps/sed-4" 84 >=sys-apps/sed-4"
81 85
82S="${WORKDIR}/fox-${FOX_PV}" 86S="${WORKDIR}/fox-${FOX_PV}"
83 87
84fox_src_unpack() { 88fox_src_unpack() {
85 unpack ${A} 89 unpack ${A}
86 cd ${S} 90 cd "${S}"
87 91
88 ebegin "Fixing configure" 92 has src_prepare ${FOX_EXPF} || fox_src_prepare
93}
94
95fox_src_prepare() {
96 # fox changed from configure.in to configure.am in 1.6.38
97 local confFile="configure.ac"
98 [[ -r "configure.in" ]] && confFile="configure.in"
89 99
90 # Respect system CXXFLAGS 100 # Respect system CXXFLAGS
91 sed -i -e 's:CXXFLAGS=""::' configure.in || die "sed configure.in error"
92 touch aclocal.m4
93 sed -i -e 's:CXXFLAGS=""::' configure || die "sed configure error" 101 sed -i -e 's:CXXFLAGS=""::' $confFile || die "sed ${confFile} error"
94 102
95 eend 103 # don't strip binaries
96 104 sed -i -e '/LDFLAGS="-s ${LDFLAGS}"/d' $confFile || die "sed ${confFile} error"
97 ebegin "Fixing Makefiles"
98 105
99 # don't build apps from top-level (i.e. x11-libs/fox) 106 # don't build apps from top-level (i.e. x11-libs/fox)
100 # utils == reswrap 107 # utils == reswrap
108 local d
101 for d in ${FOX_APPS} utils windows ; do 109 for d in ${FOX_APPS} utils windows ; do
102 sed -i -e "s:${d}::" Makefile.am || die "sed Makefile.am error" 110 sed -i -e "s:${d}::" Makefile.am || die "sed Makefile.am error"
103 done 111 done
104 112
105 # use the installed reswrap for everything else 113 # use the installed reswrap for everything else
106 for d in ${FOX_APPS} ${FOX_CHART} tests ; do 114 for d in ${FOX_APPS} chart controlpanel tests ; do
115 [[ -d ${d} ]] &&
107 sed -i -e 's:$(top_builddir)/utils/reswrap:reswrap:' \ 116 (sed -i -e 's:$(top_builddir)/utils/reswrap:reswrap:' \
108 ${d}/Makefile.am || die "sed ${d}/Makefile.am error" 117 ${d}/Makefile.am || die "sed ${d}/Makefile.am error")
109 done 118 done
110 119
111 # use the installed headers and library for apps 120 # use the installed headers and library for apps
112 for d in ${FOX_APPS} ; do 121 for d in ${FOX_APPS} ; do
113 sed -i \ 122 sed -i \
114 -e "s:-I\$(top_srcdir)/include -I\$(top_builddir)/include:-I\$(includedir)/fox${FOXVER_SUFFIX}:" \ 123 -e "s:-I\$(top_srcdir)/include -I\$(top_builddir)/include:-I\$(includedir)/fox-${FOXVER}:" \
115 -e 's:../src/libFOX:-lFOX:' \ 124 -e 's:$(top_builddir)/src/libFOX:-lFOX:' \
125 -e 's:$(top_builddir)/lib/libFOX:-lFOX:' \
116 -e 's:\.la::' \ 126 -e 's:\.la::' \
117 ${d}/Makefile.am || die "sed ${d}/Makefile.am error" 127 ${d}/Makefile.am || die "sed ${d}/Makefile.am error"
118 done 128 done
119 129
120 # Upstream often has trouble with version number transitions 130 eautoreconf
121 if [ "${FOXVER}" == "1.5" ] ; then
122 sed -i -e 's:1.4:1.5:g' chart/Makefile.am
123 fi
124
125 eend
126
127 ebegin "Running automake"
128 automake-1.4 -a -c || die "automake error"
129 eend
130
131 elibtoolize
132} 131}
132
133fox_src_configure() {
134 use debug && FOXCONF+=" --enable-debug" \
135 || FOXCONF+=" --enable-release"
136
137 econf ${FOXCONF} \
138 $(use_with profile profiling)
139}
140
133 141
134fox_src_compile() { 142fox_src_compile() {
135 local myconf 143 has src_configure ${FOX_EXPF} || fox_src_configure
136 use debug && myconf="${myconf} --enable-debug" \
137 || myconf="${myconf} --enable-release"
138 144
139 econf \
140 ${FOXCONF} \
141 ${myconf} \
142 $(use_with profile profiling) \
143 || die "configure error"
144
145 cd ${S}/${FOX_COMPONENT} 145 cd "${S}/${FOX_COMPONENT}"
146 emake || die "compile error" 146 emake || die "compile error"
147 147
148 # build class reference docs (FOXVER >= 1.2) 148 # build class reference docs (FOXVER >= 1.2)
149 if use doc && [ "${FOXVER}" != "1.0" ] && [ -z "${FOX_COMPONENT}" ] ; then 149 if use doc && [[ -z ${FOX_COMPONENT} ]] ; then
150 cd ${S}/doc
151 make docs || die "doxygen error" 150 emake -C "${S}"/doc docs || die "doxygen error"
152 fi 151 fi
153} 152}
154 153
155fox_src_install () { 154fox_src_install() {
156 cd ${S}/${FOX_COMPONENT} 155 cd "${S}/${FOX_COMPONENT}"
157 156
158 make install \ 157 emake install \
159 DESTDIR=${D} \ 158 DESTDIR="${D}" \
160 htmldir=/usr/share/doc/${PF}/html \ 159 htmldir=/usr/share/doc/${PF}/html \
161 artdir=/usr/share/doc/${PF}/html/art \ 160 artdir=/usr/share/doc/${PF}/html/art \
162 screenshotsdir=/usr/share/doc/${PF}/html/screenshots \ 161 screenshotsdir=/usr/share/doc/${PF}/html/screenshots \
163 || die "install error" 162 || die "install error"
164 163
185 for doc in ADDITIONS AUTHORS LICENSE_ADDENDUM README TRACING ; do 184 for doc in ADDITIONS AUTHORS LICENSE_ADDENDUM README TRACING ; do
186 [ -f $doc ] && dodoc $doc 185 [ -f $doc ] && dodoc $doc
187 done 186 done
188 187
189 # remove documentation if USE=-doc 188 # remove documentation if USE=-doc
190 if ( ! use doc ) && [ -d ${D}/usr/share/doc/${PF}/html ] ; then
191 rm -fr ${D}/usr/share/doc/${PF}/html 189 use doc || rm -fr "${D}/usr/share/doc/${PF}/html"
192 fi
193 190
194 # install class reference docs (FOXVER >= 1.2) if USE=doc 191 # install class reference docs if USE=doc
195 if use doc && [ "${FOXVER}" != "1.0" ] && [ -z "${FOX_COMPONENT}" ] ; then 192 if use doc && [[ -z ${FOX_COMPONENT} ]] ; then
196 dohtml -r ${S}/doc/ref 193 dohtml -r "${S}/doc/ref"
197 fi 194 fi
198 195
199 # slot fox-config where present (FOXVER >= 1.2) 196 # slot fox-config
200 if [ -f ${D}/usr/bin/fox-config ] ; then 197 if [[ -f ${D}/usr/bin/fox-config ]] ; then
201 mv ${D}/usr/bin/fox-config ${D}/usr/bin/fox-${FOXVER}-config 198 mv "${D}/usr/bin/fox-config" "${D}/usr/bin/fox-${FOXVER}-config" \
199 || die "failed to install fox-config"
202 fi 200 fi
203} 201}
204 202
205fox_pkg_postinst() { 203fox_pkg_postinst() {
206 if [ -z "${FOX_COMPONENT}" ] ; then 204 if [ -z "${FOX_COMPONENT}" ] ; then
210 einfo 208 einfo
211 einfo "The reswrap utility and the applications included in the FOX Toolkit" 209 einfo "The reswrap utility and the applications included in the FOX Toolkit"
212 einfo "(adie, calculator, pathfinder, shutterbug) are now available as" 210 einfo "(adie, calculator, pathfinder, shutterbug) are now available as"
213 einfo "separate ebuilds." 211 einfo "separate ebuilds."
214 echo 212 echo
215 if [ "${FOXVER}" != "1.0" ] ; then 213
214 if version_is_at_least "1.7.25"; then
215 einfo "Fox versions after 1.7.25 ships a pkg-config file called fox17.pc"
216 einfo "instead of the previous fox-config tool."
217 einfo "You now get all info via pkg-config:"
218 einfo
219 einfo "pkg-config fox17 --libs (etc.)"
220 else
216 einfo "The fox-config script has been installed as fox-${FOXVER}-config." 221 einfo "The fox-config script has been installed as fox-${FOXVER}-config."
217 einfo "The fox-wrapper package is used to direct calls to fox-config" 222 einfo "The fox-wrapper package is used to direct calls to fox-config"
218 einfo "to the correct versioned script, based on the WANT_FOX variable." 223 einfo "to the correct versioned script, based on the WANT_FOX variable."
219 einfo "For example:" 224 einfo "For example:"
220 einfo 225 einfo
221 einfo " WANT_FOX=\"${FOXVER}\" fox-config <options>" 226 einfo " WANT_FOX=\"${FOXVER}\" fox-config <options>"
222 einfo
223 epause
224 fi 227 fi
228 einfo
225 fi 229 fi
226} 230}
227
228EXPORT_FUNCTIONS src_unpack src_compile src_install pkg_postinst

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.17

  ViewVC Help
Powered by ViewVC 1.1.20