* [gentoo-dev] RFC: fox.eclass update
@ 2008-10-12 12:41 Matti Bickel
2008-10-13 10:56 ` Petteri Räty
0 siblings, 1 reply; 26+ messages in thread
From: Matti Bickel @ 2008-10-12 12:41 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1.1: Type: text/plain, Size: 599 bytes --]
Hi folks,
While fixing bug #240060 I touched fox.eclass.
In the process, I updated the eclass to
* use versionator
* cut support for fox-1.0 (loong outdated)
* cut support for fox-1.5
* use eautomake instead of =automake-1.4*
* use emake instead of make
* use elog instead of einfo
* apply more variable quoting
I'm sure, I missed one or the other issue. That's why I'm posting it
here for public review. If you have requests or comments to make, please
reply to this thread.
--
Regards, Matti Bickel
Signed/Encrypted email preferred (key 4849EC6C)
[-- Attachment #1.2: fox-proposed.eclass --]
[-- Type: text/plain, Size: 5795 bytes --]
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/eclass/fox.eclass,v 1.7 2007/01/15 20:27:06 mabi Exp $
# fox eclass
#
# This eclass allows building SLOT-able FOX Toolkit installations
# (x11-libs/fox: headers, libs, and docs), which are by design
# parallel-installable, while installing only one version of the utils
# (dev-util/reswrap) and apps (app-editors/adie, sci-calculators/calculator,
# x11-misc/pathfinder, and x11-misc/shutterbug).
#
# Version numbering follows the kernel-style odd-even minor version
# designation. Even-number minor versions are API stable, which patch
# releases aimed mostly at the library; apps generally won't need to be
# bumped for a patch release.
#
# Odd-number versions are development branches with their own SLOT and
# are API unstable; changes are made to the apps, and likely need to be
# bumped together with the library.
#
# Here are sample [R]DEPENDs for the fox apps
# 1.4: '=x11-libs/fox-1.4*'
# 1.5: '~x11-libs/fox-${PV}'
# 1.6: '=x11-libs/fox-${FOXVER}*'
#
# Some concepts borrowed from gst-plugins and gtk-sharp-component eclasses
inherit autotools eutils libtool versionator
FOX_PV="${FOX_PV:-${PV}}"
FOXVER=$(get_version_component_range 1-2)
FOXVER_SUFFIX="-${FOXVER}"
DESCRIPTION="C++ based Toolkit for developing Graphical User Interfaces easily and effectively"
HOMEPAGE="http://www.fox-toolkit.org/"
SRC_URI="http://www.fox-toolkit.org/ftp/fox-${FOX_PV}.tar.gz"
IUSE="debug doc profile"
FOX_APPS="adie calculator pathfinder shutterbug chart"
if [ "${PN}" != fox ] ; then
FOX_COMPONENT="${FOX_COMPONENT:-${PN}}"
fi
if [ "${PN}" != reswrap ] ; then
RESWRAP_DEP="dev-util/reswrap"
fi
DEPEND="${RESWRAP_DEP}
doc? ( app-doc/doxygen )
>=sys-devel/automake-1.4
>=sys-apps/sed-4"
S="${WORKDIR}/fox-${FOX_PV}"
fox_src_unpack() {
unpack ${A}
cd "${S}"
ebegin "Fixing configure"
# Respect system CXXFLAGS
sed -i -e 's:CXXFLAGS=""::' configure.in || die "sed configure.in error"
touch aclocal.m4
sed -i -e 's:CXXFLAGS=""::' configure || die "sed configure error"
eend
ebegin "Fixing Makefiles"
# don't build apps from top-level (i.e. x11-libs/fox)
# utils == reswrap
for d in ${FOX_APPS} utils windows ; do
sed -i -e "s:${d}::" Makefile.am || die "sed Makefile.am error"
done
# use the installed reswrap for everything else
for d in ${FOX_APPS} tests ; do
sed -i -e 's:$(top_builddir)/utils/reswrap:reswrap:' \
${d}/Makefile.am || die "sed ${d}/Makefile.am error"
done
# use the installed headers and library for apps
for d in ${FOX_APPS} ; do
if version_is_at_least "1.6.34" ${PV}; then
sed -i \
-e "s:-I\$(top_srcdir)/include -I\$(top_builddir)/include:-I\$(includedir)/fox${FOXVER_SUFFIX}:" \
-e 's:$(top_builddir)/src/libFOX:-lFOX:' \
-e 's:\.la::' \
${d}/Makefile.am || die "sed ${d}/Makefile.am error"
else
sed -i \
-e "s:-I\$(top_srcdir)/include -I\$(top_builddir)/include:-I\$(includedir)/fox${FOXVER_SUFFIX}:" \
-e 's:../src/libFOX:-lFOX:' \
-e 's:\.la::' \
${d}/Makefile.am || die "sed ${d}/Makefile.am error"
fi
done
eend
ebegin "Running automake"
eautomake || die "automake error"
eend
#elibtoolize
}
fox_src_compile() {
local myconf
use debug && myconf="${myconf} --enable-debug" \
|| myconf="${myconf} --enable-release"
econf \
${FOXCONF} \
${myconf} \
$(use_with profile profiling) \
|| die "configure error"
cd "${S}/${FOX_COMPONENT}"
emake || die "compile error"
# build class reference docs (FOXVER >= 1.2)
if use doc && [ -z "${FOX_COMPONENT}" ] ; then
cd "${S}/doc"
emake docs || die "doxygen error"
fi
}
fox_src_install () {
cd "${S}/${FOX_COMPONENT}"
emake install \
DESTDIR="${D}" \
htmldir=/usr/share/doc/${PF}/html \
artdir=/usr/share/doc/${PF}/html/art \
screenshotsdir=/usr/share/doc/${PF}/html/screenshots \
|| die "install error"
# create desktop menu items for apps
case ${FOX_COMPONENT} in
adie)
newicon big_gif.gif adie.gif
make_desktop_entry adie "Adie Text Editor" adie.gif
;;
calculator)
newicon bigcalc.gif foxcalc.gif
make_desktop_entry calculator "FOX Calculator" foxcalc.gif
;;
pathfinder)
newicon iconpath.gif pathfinder.gif
make_desktop_entry PathFinder "PathFinder" pathfinder.gif "FileManager"
;;
shutterbug)
doicon shutterbug.gif
make_desktop_entry shutterbug "ShutterBug" shutterbug.gif "Graphics"
;;
esac
for doc in ADDITIONS AUTHORS LICENSE_ADDENDUM README TRACING ; do
[ -f $doc ] && dodoc $doc
done
# remove documentation if USE=-doc
if ( ! use doc ) && [ -d "${D}"/usr/share/doc/${PF}/html ] ; then
rm -fr "${D}"/usr/share/doc/${PF}/html
fi
# install class reference docs (FOXVER >= 1.2) if USE=doc
if use doc && [ -z "${FOX_COMPONENT}" ] ; then
dohtml -r "${S}"/doc/ref
fi
# slot fox-config where present (FOXVER >= 1.2)
if [ -f "${D}"/usr/bin/fox-config ] ; then
mv "${D}"/usr/bin/fox-config "${D}"/usr/bin/fox-${FOXVER}-config
fi
}
fox_pkg_postinst() {
if [ -z "${FOX_COMPONENT}" ] ; then
elog "Multiple versions of the FOX Toolkit library may now be installed"
elog "in parallel SLOTs on the same system."
elog
elog "The reswrap utility and the applications included in the FOX Toolkit"
elog "(adie, calculator, pathfinder, shutterbug) are now available as"
elog "separate ebuilds."
echo
elog "The fox-config script has been installed as fox-${FOXVER}-config."
elog "The fox-wrapper package is used to direct calls to fox-config"
elog "to the correct versioned script, based on the WANT_FOX variable."
elog "For example:"
elog
elog " WANT_FOX=\"${FOXVER}\" fox-config <options>"
elog
fi
}
EXPORT_FUNCTIONS src_unpack src_compile src_install pkg_postinst
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] RFC: fox.eclass update
2008-10-12 12:41 [gentoo-dev] RFC: fox.eclass update Matti Bickel
@ 2008-10-13 10:56 ` Petteri Räty
2008-10-13 17:20 ` Donnie Berkholz
0 siblings, 1 reply; 26+ messages in thread
From: Petteri Räty @ 2008-10-13 10:56 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 645 bytes --]
Matti Bickel kirjoitti:
> Hi folks,
>
> While fixing bug #240060 I touched fox.eclass.
> In the process, I updated the eclass to
> * use versionator
> * cut support for fox-1.0 (loong outdated)
> * cut support for fox-1.5
> * use eautomake instead of =automake-1.4*
> * use emake instead of make
> * use elog instead of einfo
> * apply more variable quoting
>
> I'm sure, I missed one or the other issue. That's why I'm posting it
> here for public review. If you have requests or comments to make, please
> reply to this thread.
>
Could you also send a diff next time.
Regards,
Petteri
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 260 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] RFC: fox.eclass update
2008-10-13 10:56 ` Petteri Räty
@ 2008-10-13 17:20 ` Donnie Berkholz
2008-10-13 18:28 ` Matti Bickel
0 siblings, 1 reply; 26+ messages in thread
From: Donnie Berkholz @ 2008-10-13 17:20 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 314 bytes --]
On 13:56 Mon 13 Oct , Petteri Räty wrote:
> Could you also send a diff next time.
Or this time, even. +1 on that.
One easy thing to do is move what comments exist to the eclass-manpages
format.
--
Thanks,
Donnie
Donnie Berkholz
Developer, Gentoo Linux
Blog: http://dberkholz.wordpress.com
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] RFC: fox.eclass update
2008-10-13 17:20 ` Donnie Berkholz
@ 2008-10-13 18:28 ` Matti Bickel
2008-10-14 13:20 ` Bo Ørsted Andresen
0 siblings, 1 reply; 26+ messages in thread
From: Matti Bickel @ 2008-10-13 18:28 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1.1: Type: text/plain, Size: 446 bytes --]
Donnie Berkholz <dberkholz@gentoo.org> wrote:
> On 13:56 Mon 13 Oct , Petteri Räty wrote:
> > Could you also send a diff next time.
>
> Or this time, even. +1 on that.
Here you are. It's attached.
> One easy thing to do is move what comments exist to the eclass-manpages
> format.
I also included some eclass-manpage foo now, thanks for the hint.
--
Regards, Matti Bickel
Signed/Encrypted email preferred (key 4849EC6C)
[-- Attachment #1.2: fox.eclass.patch --]
[-- Type: text/plain, Size: 7370 bytes --]
--- gentoo-x86/eclass/fox.eclass 2008-10-12 14:31:36.000000000 +0200
+++ fox-proposed.eclass 2008-10-13 20:27:05.000000000 +0200
@@ -1,8 +1,12 @@
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/fox.eclass,v 1.8 2008/10/12 12:31:36 mabi Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/fox.eclass,v 1.7 2007/01/15 20:27:06 mabi Exp $
-# fox eclass
+# @ECLASS: fox.eclass
+# @MAINTAINER: mabi@gentoo.org
+# @BLURB: Common build and install functions for fox-related apps and library
+# @DESCRIPTION: Used by the x11-libs/fox library and all applications that come
+# with the upstream source tarball.
#
# This eclass allows building SLOT-able FOX Toolkit installations
# (x11-libs/fox: headers, libs, and docs), which are by design
@@ -19,26 +23,18 @@
# are API unstable; changes are made to the apps, and likely need to be
# bumped together with the library.
#
-# Here are sample [R]DEPENDs for the fox apps
-# fox versions that do not use this eclass are blocked in INCOMPAT_DEP below
-# 1.0: '=x11-libs/fox-1.0*'
-# 1.2: '=x11-libs/fox-1.2*'
+# Some concepts borrowed from gst-plugins and gtk-sharp-component eclasses
+#
+# @EXAMPLE: Here are sample [R]DEPENDs for the fox apps
# 1.4: '=x11-libs/fox-1.4*'
# 1.5: '~x11-libs/fox-${PV}'
# 1.6: '=x11-libs/fox-${FOXVER}*'
-#
-# Some concepts borrowed from gst-plugins and gtk-sharp-component eclasses
-
-inherit eutils libtool versionator
+inherit autotools eutils libtool versionator
FOX_PV="${FOX_PV:-${PV}}"
-PVP=(${FOX_PV//[-\._]/ })
-FOXVER="${PVP[0]}.${PVP[1]}"
-
-if [ "${FOXVER}" != "1.0" ] ; then
- FOXVER_SUFFIX="-${FOXVER}"
-fi
+FOXVER=$(get_version_component_range 1-2)
+FOXVER_SUFFIX="-${FOXVER}"
DESCRIPTION="C++ based Toolkit for developing Graphical User Interfaces easily and effectively"
HOMEPAGE="http://www.fox-toolkit.org/"
@@ -46,44 +42,28 @@
IUSE="debug doc profile"
-# from fox-1.0
-FOX_APPS="adie calculator pathfinder"
-# from fox-1.2+
-if [ "${FOXVER}" != "1.0" ] ; then
- FOX_APPS="${FOX_APPS} shutterbug"
- FOX_CHART="chart"
-fi
+# @ECLASS-VARIABLE: FOX_APPS
+# @DESCRIPTION: all applications that come with the fox toolkit source
+FOX_APPS="adie calculator pathfinder shutterbug chart"
if [ "${PN}" != fox ] ; then
FOX_COMPONENT="${FOX_COMPONENT:-${PN}}"
fi
-if [ "${FOXVER}" != "1.0" ] && [ -z "${FOX_COMPONENT}" ] ; then
- DOXYGEN_DEP="doc? ( app-doc/doxygen )"
-fi
-
if [ "${PN}" != reswrap ] ; then
RESWRAP_DEP="dev-util/reswrap"
fi
-# These versions are not compatible with new fox layout
-# and will cause collissions - we need to block them
-INCOMPAT_DEP="!<x11-libs/fox-1.0.53
- !=x11-libs/fox-1.2.4
- !~x11-libs/fox-1.2.6
- !=x11-libs/fox-1.4.11"
-
-DEPEND="${INCOMPAT_DEP}
- ${DOXYGEN_DEP}
- ${RESWRAP_DEP}
- =sys-devel/automake-1.4*
+DEPEND="${RESWRAP_DEP}
+ doc? ( app-doc/doxygen )
+ >=sys-devel/automake-1.4
>=sys-apps/sed-4"
S="${WORKDIR}/fox-${FOX_PV}"
fox_src_unpack() {
unpack ${A}
- cd ${S}
+ cd "${S}"
ebegin "Fixing configure"
@@ -103,14 +83,14 @@
done
# use the installed reswrap for everything else
- for d in ${FOX_APPS} ${FOX_CHART} tests ; do
+ for d in ${FOX_APPS} tests ; do
sed -i -e 's:$(top_builddir)/utils/reswrap:reswrap:' \
${d}/Makefile.am || die "sed ${d}/Makefile.am error"
done
# use the installed headers and library for apps
for d in ${FOX_APPS} ; do
- if version_is_at_least "1.6.34" ${PV} ; then
+ if version_is_at_least "1.6.34" ${PV}; then
sed -i \
-e "s:-I\$(top_srcdir)/include -I\$(top_builddir)/include:-I\$(includedir)/fox${FOXVER_SUFFIX}:" \
-e 's:$(top_builddir)/src/libFOX:-lFOX:' \
@@ -124,19 +104,13 @@
${d}/Makefile.am || die "sed ${d}/Makefile.am error"
fi
done
-
- # Upstream often has trouble with version number transitions
- if [ "${FOXVER}" == "1.5" ] ; then
- sed -i -e 's:1.4:1.5:g' chart/Makefile.am
- fi
-
eend
ebegin "Running automake"
- automake-1.4 -a -c || die "automake error"
+ eautomake || die "automake error"
eend
- elibtoolize
+ #elibtoolize
}
fox_src_compile() {
@@ -150,21 +124,21 @@
$(use_with profile profiling) \
|| die "configure error"
- cd ${S}/${FOX_COMPONENT}
+ cd "${S}/${FOX_COMPONENT}"
emake || die "compile error"
# build class reference docs (FOXVER >= 1.2)
- if use doc && [ "${FOXVER}" != "1.0" ] && [ -z "${FOX_COMPONENT}" ] ; then
- cd ${S}/doc
- make docs || die "doxygen error"
+ if use doc && [ -z "${FOX_COMPONENT}" ] ; then
+ cd "${S}/doc"
+ emake docs || die "doxygen error"
fi
}
fox_src_install () {
- cd ${S}/${FOX_COMPONENT}
+ cd "${S}/${FOX_COMPONENT}"
- make install \
- DESTDIR=${D} \
+ emake install \
+ DESTDIR="${D}" \
htmldir=/usr/share/doc/${PF}/html \
artdir=/usr/share/doc/${PF}/html/art \
screenshotsdir=/usr/share/doc/${PF}/html/screenshots \
@@ -195,41 +169,37 @@
done
# remove documentation if USE=-doc
- if ( ! use doc ) && [ -d ${D}/usr/share/doc/${PF}/html ] ; then
- rm -fr ${D}/usr/share/doc/${PF}/html
+ if ( ! use doc ) && [ -d "${D}"/usr/share/doc/${PF}/html ] ; then
+ rm -fr "${D}"/usr/share/doc/${PF}/html
fi
# install class reference docs (FOXVER >= 1.2) if USE=doc
- if use doc && [ "${FOXVER}" != "1.0" ] && [ -z "${FOX_COMPONENT}" ] ; then
- dohtml -r ${S}/doc/ref
+ if use doc && [ -z "${FOX_COMPONENT}" ] ; then
+ dohtml -r "${S}"/doc/ref
fi
# slot fox-config where present (FOXVER >= 1.2)
- if [ -f ${D}/usr/bin/fox-config ] ; then
- mv ${D}/usr/bin/fox-config ${D}/usr/bin/fox-${FOXVER}-config
+ if [ -f "${D}"/usr/bin/fox-config ] ; then
+ mv "${D}"/usr/bin/fox-config "${D}"/usr/bin/fox-${FOXVER}-config
fi
}
fox_pkg_postinst() {
if [ -z "${FOX_COMPONENT}" ] ; then
+ elog "Multiple versions of the FOX Toolkit library may now be installed"
+ elog "in parallel SLOTs on the same system."
+ elog
+ elog "The reswrap utility and the applications included in the FOX Toolkit"
+ elog "(adie, calculator, pathfinder, shutterbug) are now available as"
+ elog "separate ebuilds."
echo
- einfo "Multiple versions of the FOX Toolkit library may now be installed"
- einfo "in parallel SLOTs on the same system."
- einfo
- einfo "The reswrap utility and the applications included in the FOX Toolkit"
- einfo "(adie, calculator, pathfinder, shutterbug) are now available as"
- einfo "separate ebuilds."
- echo
- if [ "${FOXVER}" != "1.0" ] ; then
- einfo "The fox-config script has been installed as fox-${FOXVER}-config."
- einfo "The fox-wrapper package is used to direct calls to fox-config"
- einfo "to the correct versioned script, based on the WANT_FOX variable."
- einfo "For example:"
- einfo
- einfo " WANT_FOX=\"${FOXVER}\" fox-config <options>"
- einfo
- epause
- fi
+ elog "The fox-config script has been installed as fox-${FOXVER}-config."
+ elog "The fox-wrapper package is used to direct calls to fox-config"
+ elog "to the correct versioned script, based on the WANT_FOX variable."
+ elog "For example:"
+ elog
+ elog " WANT_FOX=\"${FOXVER}\" fox-config <options>"
+ elog
fi
}
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] RFC: fox.eclass update
2008-10-13 18:28 ` Matti Bickel
@ 2008-10-14 13:20 ` Bo Ørsted Andresen
2009-02-08 22:06 ` Matti Bickel
0 siblings, 1 reply; 26+ messages in thread
From: Bo Ørsted Andresen @ 2008-10-14 13:20 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 476 bytes --]
> --- gentoo-x86/eclass/fox.eclass 2008-10-12 14:31:36.000000000 +0200
> +++ fox-proposed.eclass 2008-10-13 20:27:05.000000000 +0200
> [...]
> -inherit eutils libtool versionator
>
> +inherit autotools eutils libtool versionator
You should probably be setting WANT_AUTO* before inheriting autotools.
> [...]
> + if ( ! use doc ) && [ -d "${D}"/usr/share/doc/${PF}/html ] ; then
Get rid of the pointless subshell.
if use !doc && ...
--
Bo Andresen
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] RFC: fox.eclass update
2008-10-14 13:20 ` Bo Ørsted Andresen
@ 2009-02-08 22:06 ` Matti Bickel
2009-02-09 15:01 ` Peter Volkov
0 siblings, 1 reply; 26+ messages in thread
From: Matti Bickel @ 2009-02-08 22:06 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1.1: Type: text/plain, Size: 247 bytes --]
Hi,
shame on me, here i'm wondering why noone replies...
Sorry, i failed to send the updated patch o.O
Here's the patch again w/ your suggestions included.
--
Regards, Matti Bickel
Signed/Encrypted email preferred (key 4849EC6C)
[-- Attachment #1.2: fox.eclass.patch --]
[-- Type: text/plain, Size: 7446 bytes --]
--- /usr/portage/eclass/fox.eclass 2008-10-12 14:36:35.000000000 +0200
+++ fox-proposed.eclass 2009-02-08 19:35:49.000000000 +0100
@@ -1,8 +1,12 @@
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/fox.eclass,v 1.8 2008/10/12 12:31:36 mabi Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/fox.eclass,v 1.7 2007/01/15 20:27:06 mabi Exp $
-# fox eclass
+# @ECLASS: fox.eclass
+# @MAINTAINER: mabi@gentoo.org
+# @BLURB: Common build and install functions for fox-related apps and library
+# @DESCRIPTION: Used by the x11-libs/fox library and all applications that come
+# with the upstream source tarball.
#
# This eclass allows building SLOT-able FOX Toolkit installations
# (x11-libs/fox: headers, libs, and docs), which are by design
@@ -19,26 +23,22 @@
# are API unstable; changes are made to the apps, and likely need to be
# bumped together with the library.
#
-# Here are sample [R]DEPENDs for the fox apps
-# fox versions that do not use this eclass are blocked in INCOMPAT_DEP below
-# 1.0: '=x11-libs/fox-1.0*'
-# 1.2: '=x11-libs/fox-1.2*'
+# Some concepts borrowed from gst-plugins and gtk-sharp-component eclasses
+#
+# @EXAMPLE: Here are sample [R]DEPENDs for the fox apps
# 1.4: '=x11-libs/fox-1.4*'
# 1.5: '~x11-libs/fox-${PV}'
# 1.6: '=x11-libs/fox-${FOXVER}*'
-#
-# Some concepts borrowed from gst-plugins and gtk-sharp-component eclasses
-inherit eutils libtool versionator
+# could probably be lower
+WANT_AUTOCONF="latest"
+WANT_AUTOMAKE="latest"
+inherit autotools eutils libtool versionator
FOX_PV="${FOX_PV:-${PV}}"
-PVP=(${FOX_PV//[-\._]/ })
-FOXVER="${PVP[0]}.${PVP[1]}"
-
-if [ "${FOXVER}" != "1.0" ] ; then
- FOXVER_SUFFIX="-${FOXVER}"
-fi
+FOXVER=$(get_version_component_range 1-2)
+FOXVER_SUFFIX="-${FOXVER}"
DESCRIPTION="C++ based Toolkit for developing Graphical User Interfaces easily and effectively"
HOMEPAGE="http://www.fox-toolkit.org/"
@@ -46,44 +46,28 @@
IUSE="debug doc profile"
-# from fox-1.0
-FOX_APPS="adie calculator pathfinder"
-# from fox-1.2+
-if [ "${FOXVER}" != "1.0" ] ; then
- FOX_APPS="${FOX_APPS} shutterbug"
- FOX_CHART="chart"
-fi
+# @ECLASS-VARIABLE: FOX_APPS
+# @DESCRIPTION: all applications that come with the fox toolkit source
+FOX_APPS="adie calculator pathfinder shutterbug chart"
if [ "${PN}" != fox ] ; then
FOX_COMPONENT="${FOX_COMPONENT:-${PN}}"
fi
-if [ "${FOXVER}" != "1.0" ] && [ -z "${FOX_COMPONENT}" ] ; then
- DOXYGEN_DEP="doc? ( app-doc/doxygen )"
-fi
-
if [ "${PN}" != reswrap ] ; then
RESWRAP_DEP="dev-util/reswrap"
fi
-# These versions are not compatible with new fox layout
-# and will cause collissions - we need to block them
-INCOMPAT_DEP="!<x11-libs/fox-1.0.53
- !=x11-libs/fox-1.2.4
- !~x11-libs/fox-1.2.6
- !=x11-libs/fox-1.4.11"
-
-DEPEND="${INCOMPAT_DEP}
- ${DOXYGEN_DEP}
- ${RESWRAP_DEP}
- =sys-devel/automake-1.4*
+DEPEND="${RESWRAP_DEP}
+ doc? ( app-doc/doxygen )
+ >=sys-devel/automake-1.4
>=sys-apps/sed-4"
S="${WORKDIR}/fox-${FOX_PV}"
fox_src_unpack() {
unpack ${A}
- cd ${S}
+ cd "${S}"
ebegin "Fixing configure"
@@ -103,14 +87,14 @@
done
# use the installed reswrap for everything else
- for d in ${FOX_APPS} ${FOX_CHART} tests ; do
+ for d in ${FOX_APPS} tests ; do
sed -i -e 's:$(top_builddir)/utils/reswrap:reswrap:' \
${d}/Makefile.am || die "sed ${d}/Makefile.am error"
done
# use the installed headers and library for apps
for d in ${FOX_APPS} ; do
- if version_is_at_least "1.6.34" ${PV} ; then
+ if version_is_at_least "1.6.34" ${PV}; then
sed -i \
-e "s:-I\$(top_srcdir)/include -I\$(top_builddir)/include:-I\$(includedir)/fox${FOXVER_SUFFIX}:" \
-e 's:$(top_builddir)/src/libFOX:-lFOX:' \
@@ -124,19 +108,13 @@
${d}/Makefile.am || die "sed ${d}/Makefile.am error"
fi
done
-
- # Upstream often has trouble with version number transitions
- if [ "${FOXVER}" == "1.5" ] ; then
- sed -i -e 's:1.4:1.5:g' chart/Makefile.am
- fi
-
eend
ebegin "Running automake"
- automake-1.4 -a -c || die "automake error"
+ eautomake || die "automake error"
eend
- elibtoolize
+ #elibtoolize
}
fox_src_compile() {
@@ -150,21 +128,21 @@
$(use_with profile profiling) \
|| die "configure error"
- cd ${S}/${FOX_COMPONENT}
+ cd "${S}/${FOX_COMPONENT}"
emake || die "compile error"
# build class reference docs (FOXVER >= 1.2)
- if use doc && [ "${FOXVER}" != "1.0" ] && [ -z "${FOX_COMPONENT}" ] ; then
- cd ${S}/doc
- make docs || die "doxygen error"
+ if use doc && [ -z "${FOX_COMPONENT}" ] ; then
+ cd "${S}/doc"
+ emake docs || die "doxygen error"
fi
}
fox_src_install () {
- cd ${S}/${FOX_COMPONENT}
+ cd "${S}/${FOX_COMPONENT}"
- make install \
- DESTDIR=${D} \
+ emake install \
+ DESTDIR="${D}" \
htmldir=/usr/share/doc/${PF}/html \
artdir=/usr/share/doc/${PF}/html/art \
screenshotsdir=/usr/share/doc/${PF}/html/screenshots \
@@ -195,41 +173,37 @@
done
# remove documentation if USE=-doc
- if ( ! use doc ) && [ -d ${D}/usr/share/doc/${PF}/html ] ; then
- rm -fr ${D}/usr/share/doc/${PF}/html
+ if ! use doc && [ -d "${D}"/usr/share/doc/${PF}/html ] ; then
+ rm -fr "${D}"/usr/share/doc/${PF}/html
fi
# install class reference docs (FOXVER >= 1.2) if USE=doc
- if use doc && [ "${FOXVER}" != "1.0" ] && [ -z "${FOX_COMPONENT}" ] ; then
- dohtml -r ${S}/doc/ref
+ if use doc && [ -z "${FOX_COMPONENT}" ] ; then
+ dohtml -r "${S}"/doc/ref
fi
# slot fox-config where present (FOXVER >= 1.2)
- if [ -f ${D}/usr/bin/fox-config ] ; then
- mv ${D}/usr/bin/fox-config ${D}/usr/bin/fox-${FOXVER}-config
+ if [ -f "${D}"/usr/bin/fox-config ] ; then
+ mv "${D}"/usr/bin/fox-config "${D}"/usr/bin/fox-${FOXVER}-config
fi
}
fox_pkg_postinst() {
if [ -z "${FOX_COMPONENT}" ] ; then
+ elog "Multiple versions of the FOX Toolkit library may now be installed"
+ elog "in parallel SLOTs on the same system."
+ elog
+ elog "The reswrap utility and the applications included in the FOX Toolkit"
+ elog "(adie, calculator, pathfinder, shutterbug) are now available as"
+ elog "separate ebuilds."
echo
- einfo "Multiple versions of the FOX Toolkit library may now be installed"
- einfo "in parallel SLOTs on the same system."
- einfo
- einfo "The reswrap utility and the applications included in the FOX Toolkit"
- einfo "(adie, calculator, pathfinder, shutterbug) are now available as"
- einfo "separate ebuilds."
- echo
- if [ "${FOXVER}" != "1.0" ] ; then
- einfo "The fox-config script has been installed as fox-${FOXVER}-config."
- einfo "The fox-wrapper package is used to direct calls to fox-config"
- einfo "to the correct versioned script, based on the WANT_FOX variable."
- einfo "For example:"
- einfo
- einfo " WANT_FOX=\"${FOXVER}\" fox-config <options>"
- einfo
- epause
- fi
+ elog "The fox-config script has been installed as fox-${FOXVER}-config."
+ elog "The fox-wrapper package is used to direct calls to fox-config"
+ elog "to the correct versioned script, based on the WANT_FOX variable."
+ elog "For example:"
+ elog
+ elog " WANT_FOX=\"${FOXVER}\" fox-config <options>"
+ elog
fi
}
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] RFC: fox.eclass update
2009-02-08 22:06 ` Matti Bickel
@ 2009-02-09 15:01 ` Peter Volkov
2009-02-09 18:22 ` Matti Bickel
0 siblings, 1 reply; 26+ messages in thread
From: Peter Volkov @ 2009-02-09 15:01 UTC (permalink / raw
To: gentoo-dev
В Вск, 08/02/2009 в 23:06 +0100, Matti Bickel пишет:
> +# could probably be lower
> +WANT_AUTOCONF="latest"
> +WANT_AUTOMAKE="latest"
These are defaults. You don't need to specify them.
> + eautomake || die "automake error"
eautomake dies on its own. You don't need || die here.
--
Peter.
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] RFC: fox.eclass update
2009-02-09 15:01 ` Peter Volkov
@ 2009-02-09 18:22 ` Matti Bickel
2009-02-10 5:10 ` Nirbheek Chauhan
0 siblings, 1 reply; 26+ messages in thread
From: Matti Bickel @ 2009-02-09 18:22 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1.1: Type: text/plain, Size: 626 bytes --]
Peter Volkov <pva@gentoo.org> wrote:
> В Вск, 08/02/2009 в 23:06 +0100, Matti Bickel пишет:
> > +# could probably be lower
> > +WANT_AUTOCONF="latest"
> > +WANT_AUTOMAKE="latest"
>
> These are defaults. You don't need to specify them.
>
> > + eautomake || die "automake error"
>
> eautomake dies on its own. You don't need || die here.
Thanks for the comments, WANT_AUTO* was specified to make some previous
commenter happy, but removed now ;)
Where was that 'which functions || die on their own' table, anyway?
--
Regards, Matti Bickel
Signed/Encrypted email preferred (key 4849EC6C)
[-- Attachment #1.2: fox.eclass.patch --]
[-- Type: text/plain, Size: 7344 bytes --]
--- /usr/portage/eclass/fox.eclass 2008-10-12 14:36:35.000000000 +0200
+++ fox-proposed.eclass 2009-02-09 19:21:03.000000000 +0100
@@ -1,8 +1,12 @@
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/fox.eclass,v 1.8 2008/10/12 12:31:36 mabi Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/fox.eclass,v 1.7 2007/01/15 20:27:06 mabi Exp $
-# fox eclass
+# @ECLASS: fox.eclass
+# @MAINTAINER: mabi@gentoo.org
+# @BLURB: Common build and install functions for fox-related apps and library
+# @DESCRIPTION: Used by the x11-libs/fox library and all applications that come
+# with the upstream source tarball.
#
# This eclass allows building SLOT-able FOX Toolkit installations
# (x11-libs/fox: headers, libs, and docs), which are by design
@@ -19,26 +23,18 @@
# are API unstable; changes are made to the apps, and likely need to be
# bumped together with the library.
#
-# Here are sample [R]DEPENDs for the fox apps
-# fox versions that do not use this eclass are blocked in INCOMPAT_DEP below
-# 1.0: '=x11-libs/fox-1.0*'
-# 1.2: '=x11-libs/fox-1.2*'
+# Some concepts borrowed from gst-plugins and gtk-sharp-component eclasses
+#
+# @EXAMPLE: Here are sample [R]DEPENDs for the fox apps
# 1.4: '=x11-libs/fox-1.4*'
# 1.5: '~x11-libs/fox-${PV}'
# 1.6: '=x11-libs/fox-${FOXVER}*'
-#
-# Some concepts borrowed from gst-plugins and gtk-sharp-component eclasses
-
-inherit eutils libtool versionator
+inherit autotools eutils libtool versionator
FOX_PV="${FOX_PV:-${PV}}"
-PVP=(${FOX_PV//[-\._]/ })
-FOXVER="${PVP[0]}.${PVP[1]}"
-
-if [ "${FOXVER}" != "1.0" ] ; then
- FOXVER_SUFFIX="-${FOXVER}"
-fi
+FOXVER=$(get_version_component_range 1-2)
+FOXVER_SUFFIX="-${FOXVER}"
DESCRIPTION="C++ based Toolkit for developing Graphical User Interfaces easily and effectively"
HOMEPAGE="http://www.fox-toolkit.org/"
@@ -46,44 +42,28 @@
IUSE="debug doc profile"
-# from fox-1.0
-FOX_APPS="adie calculator pathfinder"
-# from fox-1.2+
-if [ "${FOXVER}" != "1.0" ] ; then
- FOX_APPS="${FOX_APPS} shutterbug"
- FOX_CHART="chart"
-fi
+# @ECLASS-VARIABLE: FOX_APPS
+# @DESCRIPTION: all applications that come with the fox toolkit source
+FOX_APPS="adie calculator pathfinder shutterbug chart"
if [ "${PN}" != fox ] ; then
FOX_COMPONENT="${FOX_COMPONENT:-${PN}}"
fi
-if [ "${FOXVER}" != "1.0" ] && [ -z "${FOX_COMPONENT}" ] ; then
- DOXYGEN_DEP="doc? ( app-doc/doxygen )"
-fi
-
if [ "${PN}" != reswrap ] ; then
RESWRAP_DEP="dev-util/reswrap"
fi
-# These versions are not compatible with new fox layout
-# and will cause collissions - we need to block them
-INCOMPAT_DEP="!<x11-libs/fox-1.0.53
- !=x11-libs/fox-1.2.4
- !~x11-libs/fox-1.2.6
- !=x11-libs/fox-1.4.11"
-
-DEPEND="${INCOMPAT_DEP}
- ${DOXYGEN_DEP}
- ${RESWRAP_DEP}
- =sys-devel/automake-1.4*
+DEPEND="${RESWRAP_DEP}
+ doc? ( app-doc/doxygen )
+ >=sys-devel/automake-1.4
>=sys-apps/sed-4"
S="${WORKDIR}/fox-${FOX_PV}"
fox_src_unpack() {
unpack ${A}
- cd ${S}
+ cd "${S}"
ebegin "Fixing configure"
@@ -103,14 +83,14 @@
done
# use the installed reswrap for everything else
- for d in ${FOX_APPS} ${FOX_CHART} tests ; do
+ for d in ${FOX_APPS} tests ; do
sed -i -e 's:$(top_builddir)/utils/reswrap:reswrap:' \
${d}/Makefile.am || die "sed ${d}/Makefile.am error"
done
# use the installed headers and library for apps
for d in ${FOX_APPS} ; do
- if version_is_at_least "1.6.34" ${PV} ; then
+ if version_is_at_least "1.6.34" ${PV}; then
sed -i \
-e "s:-I\$(top_srcdir)/include -I\$(top_builddir)/include:-I\$(includedir)/fox${FOXVER_SUFFIX}:" \
-e 's:$(top_builddir)/src/libFOX:-lFOX:' \
@@ -124,19 +104,13 @@
${d}/Makefile.am || die "sed ${d}/Makefile.am error"
fi
done
-
- # Upstream often has trouble with version number transitions
- if [ "${FOXVER}" == "1.5" ] ; then
- sed -i -e 's:1.4:1.5:g' chart/Makefile.am
- fi
-
eend
ebegin "Running automake"
- automake-1.4 -a -c || die "automake error"
+ eautomake
eend
- elibtoolize
+ #elibtoolize
}
fox_src_compile() {
@@ -150,21 +124,21 @@
$(use_with profile profiling) \
|| die "configure error"
- cd ${S}/${FOX_COMPONENT}
+ cd "${S}/${FOX_COMPONENT}"
emake || die "compile error"
# build class reference docs (FOXVER >= 1.2)
- if use doc && [ "${FOXVER}" != "1.0" ] && [ -z "${FOX_COMPONENT}" ] ; then
- cd ${S}/doc
- make docs || die "doxygen error"
+ if use doc && [ -z "${FOX_COMPONENT}" ] ; then
+ cd "${S}/doc"
+ emake docs || die "doxygen error"
fi
}
fox_src_install () {
- cd ${S}/${FOX_COMPONENT}
+ cd "${S}/${FOX_COMPONENT}"
- make install \
- DESTDIR=${D} \
+ emake install \
+ DESTDIR="${D}" \
htmldir=/usr/share/doc/${PF}/html \
artdir=/usr/share/doc/${PF}/html/art \
screenshotsdir=/usr/share/doc/${PF}/html/screenshots \
@@ -195,41 +169,37 @@
done
# remove documentation if USE=-doc
- if ( ! use doc ) && [ -d ${D}/usr/share/doc/${PF}/html ] ; then
- rm -fr ${D}/usr/share/doc/${PF}/html
+ if ! use doc && [ -d "${D}"/usr/share/doc/${PF}/html ] ; then
+ rm -fr "${D}"/usr/share/doc/${PF}/html
fi
# install class reference docs (FOXVER >= 1.2) if USE=doc
- if use doc && [ "${FOXVER}" != "1.0" ] && [ -z "${FOX_COMPONENT}" ] ; then
- dohtml -r ${S}/doc/ref
+ if use doc && [ -z "${FOX_COMPONENT}" ] ; then
+ dohtml -r "${S}"/doc/ref
fi
# slot fox-config where present (FOXVER >= 1.2)
- if [ -f ${D}/usr/bin/fox-config ] ; then
- mv ${D}/usr/bin/fox-config ${D}/usr/bin/fox-${FOXVER}-config
+ if [ -f "${D}"/usr/bin/fox-config ] ; then
+ mv "${D}"/usr/bin/fox-config "${D}"/usr/bin/fox-${FOXVER}-config
fi
}
fox_pkg_postinst() {
if [ -z "${FOX_COMPONENT}" ] ; then
+ elog "Multiple versions of the FOX Toolkit library may now be installed"
+ elog "in parallel SLOTs on the same system."
+ elog
+ elog "The reswrap utility and the applications included in the FOX Toolkit"
+ elog "(adie, calculator, pathfinder, shutterbug) are now available as"
+ elog "separate ebuilds."
echo
- einfo "Multiple versions of the FOX Toolkit library may now be installed"
- einfo "in parallel SLOTs on the same system."
- einfo
- einfo "The reswrap utility and the applications included in the FOX Toolkit"
- einfo "(adie, calculator, pathfinder, shutterbug) are now available as"
- einfo "separate ebuilds."
- echo
- if [ "${FOXVER}" != "1.0" ] ; then
- einfo "The fox-config script has been installed as fox-${FOXVER}-config."
- einfo "The fox-wrapper package is used to direct calls to fox-config"
- einfo "to the correct versioned script, based on the WANT_FOX variable."
- einfo "For example:"
- einfo
- einfo " WANT_FOX=\"${FOXVER}\" fox-config <options>"
- einfo
- epause
- fi
+ elog "The fox-config script has been installed as fox-${FOXVER}-config."
+ elog "The fox-wrapper package is used to direct calls to fox-config"
+ elog "to the correct versioned script, based on the WANT_FOX variable."
+ elog "For example:"
+ elog
+ elog " WANT_FOX=\"${FOXVER}\" fox-config <options>"
+ elog
fi
}
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] RFC: fox.eclass update
2009-02-09 18:22 ` Matti Bickel
@ 2009-02-10 5:10 ` Nirbheek Chauhan
0 siblings, 0 replies; 26+ messages in thread
From: Nirbheek Chauhan @ 2009-02-10 5:10 UTC (permalink / raw
To: gentoo-dev
On Mon, Feb 9, 2009 at 11:52 PM, Matti Bickel <mabi@gentoo.org> wrote:
>> eautomake dies on its own. You don't need || die here.
>
> Thanks for the comments, WANT_AUTO* was specified to make some previous
> commenter happy, but removed now ;)
>
> Where was that 'which functions || die on their own' table, anyway?
ls /usr/lib/portage/bin/ -- that'll give you a list of functions which
don't die on their own
--
~Nirbheek Chauhan
^ permalink raw reply [flat|nested] 26+ messages in thread
* [gentoo-dev] RFC: fox.eclass update
@ 2010-09-16 13:31 Matti Bickel
2010-09-16 13:39 ` Tomáš Chvátal
2010-09-16 14:24 ` Matti Bickel
0 siblings, 2 replies; 26+ messages in thread
From: Matti Bickel @ 2010-09-16 13:31 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 453 bytes --]
Hi folks,
The fox eclass accumulated a lot of cruft over the years. Specifically,
it includes quite a bit of code to support versions loong gone from our
tree. The only officially supported versions now are 1.6 and 1.7.
Thus, I've edited it a bit. Main points are EAPI2 phase support and a
lot of variable quoting.
Posting this for review as the diff is rather largish and I'm known to
have the usual typo in it ;)
Comments welcome.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] RFC: fox.eclass update
2010-09-16 13:31 Matti Bickel
@ 2010-09-16 13:39 ` Tomáš Chvátal
2010-09-16 14:24 ` Matti Bickel
1 sibling, 0 replies; 26+ messages in thread
From: Tomáš Chvátal @ 2010-09-16 13:39 UTC (permalink / raw
To: gentoo-dev
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Dne 16.9.2010 15:31, Matti Bickel napsal(a):
> Posting this for review as the diff is rather largish and I'm known to
> have the usual typo in it ;)
Your mail lacks the attachment :)
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkySHgQACgkQHB6c3gNBRYfX/wCfapaZNILD7SQrYfgAZXDGZXA8
+xwAoKex7dx+cm90t+XcEjQmns/AtWb5
=b9z+
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] RFC: fox.eclass update
2010-09-16 13:31 Matti Bickel
2010-09-16 13:39 ` Tomáš Chvátal
@ 2010-09-16 14:24 ` Matti Bickel
2010-09-16 14:41 ` Jeremy Olexa
2010-09-16 18:32 ` Peter Volkov
1 sibling, 2 replies; 26+ messages in thread
From: Matti Bickel @ 2010-09-16 14:24 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1.1: Type: text/plain, Size: 83 bytes --]
On 09/16/2010 03:31 PM, Matti Bickel wrote:
--
Now complete with attachments :)
[-- Attachment #1.2: fox.eclass --]
[-- Type: text/plain, Size: 5866 bytes --]
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/eclass/fox.eclass,v 1.8 2008/10/12 12:31:36 mabi Exp $
# fox eclass
#
# This eclass allows building SLOT-able FOX Toolkit installations
# (x11-libs/fox: headers, libs, and docs), which are by design
# parallel-installable, while installing only one version of the utils
# (dev-util/reswrap) and apps (app-editors/adie, sci-calculators/calculator,
# x11-misc/pathfinder, and x11-misc/shutterbug).
#
# Version numbering follows the kernel-style odd-even minor version
# designation. Even-number minor versions are API stable, which patch
# releases aimed mostly at the library; apps generally won't need to be
# bumped for a patch release.
#
# Odd-number versions are development branches with their own SLOT and
# are API unstable; changes are made to the apps, and likely need to be
# bumped together with the library.
#
# Here are sample [R]DEPENDs for the fox apps
# 1.6: 'x11-libs/fox:1.6'
# 1.7: '~x11-libs/fox-${PV}'
#
# EAPI phase trickery borrowed from enlightenment.eclass
inherit autotools versionator
FOX_EXPF="src_unpack src_compile src_install pkg_postinst"
case "${EAPI:-0}" in
2|3|4) FOX_EXPF+=" src_prepare src_configure" ;;
*) ;;
esac
EXPORT_FUNCTIONS ${FOX_EXPF}
FOX_PV="${FOX_PV:-${PV}}"
FOXVER=`get_version_component_range 1-2 ${FOX_PV}`
FOX_APPS="adie calculator pathfinder shutterbug"
FOX_CHART="chart"
DESCRIPTION="C++ based Toolkit for developing Graphical User Interfaces easily and effectively"
HOMEPAGE="http://www.fox-toolkit.org/"
SRC_URI="http://www.fox-toolkit.org/ftp/fox-${FOX_PV}.tar.gz"
IUSE="debug doc profile"
if [ "${PN}" != fox ] ; then
FOX_COMPONENT="${FOX_COMPONENT:-${PN}}"
fi
if [ -z "${FOX_COMPONENT}" ] ; then
DOXYGEN_DEP="doc? ( app-doc/doxygen )"
fi
if [ "${PN}" != reswrap ] ; then
RESWRAP_DEP="dev-util/reswrap"
fi
DEPEND="${DOXYGEN_DEP}
${RESWRAP_DEP}
=sys-devel/automake-1.4*
>=sys-apps/sed-4"
S="${WORKDIR}/fox-${FOX_PV}"
fox_src_unpack() {
unpack ${A}
cd "${S}"
hasq src_prepare ${FOX_EXPF} || fox_src_prepare
}
fox_src_prepare() {
# fox changed from configure.in to configure.am in 1.6.38
local confFile="configure.ac"
[[ -r "configure.in" ]] && confFile="configure.in"
# Respect system CXXFLAGS
sed -i -e 's:CXXFLAGS=""::' $confFile || die "sed ${confFile} error"
# don't build apps from top-level (i.e. x11-libs/fox)
# utils == reswrap
for d in ${FOX_APPS} utils windows ; do
sed -i -e "s:${d}::" Makefile.am || die "sed Makefile.am error"
done
# use the installed reswrap for everything else
for d in ${FOX_APPS} ${FOX_CHART} tests ; do
sed -i -e 's:$(top_builddir)/utils/reswrap:reswrap:' \
${d}/Makefile.am || die "sed ${d}/Makefile.am error"
done
# use the installed headers and library for apps
for d in ${FOX_APPS} ; do
sed -i \
-e "s:-I\$(top_srcdir)/include -I\$(top_builddir)/include:-I\$(includedir)/fox-${FOXVER}:" \
-e 's:$(top_builddir)/src/libFOX:-lFOX:' \
-e 's:\.la::' \
${d}/Makefile.am || die "sed ${d}/Makefile.am error"
done
eautoreconf
}
fox_src_configure() {
local myconf
use debug && myconf="${myconf} --enable-debug" \
|| myconf="${myconf} --enable-release"
econf \
${FOXCONF} \
${myconf} \
$(use_with profile profiling) \
|| die "configure error"
}
fox_src_compile() {
hasq src_configure ${FOX_EXPF} || fox_src_configure
cd "${S}/${FOX_COMPONENT}"
emake || die "compile error"
# build class reference docs (FOXVER >= 1.2)
if use doc && [ -z "${FOX_COMPONENT}" ] ; then
cd "${S}/doc"
make docs || die "doxygen error"
fi
}
fox_src_install() {
cd "${S}/${FOX_COMPONENT}"
emake install \
DESTDIR="${D}" \
htmldir=/usr/share/doc/${PF}/html \
artdir=/usr/share/doc/${PF}/html/art \
screenshotsdir=/usr/share/doc/${PF}/html/screenshots \
|| die "install error"
# create desktop menu items for apps
case ${FOX_COMPONENT} in
adie)
newicon big_gif.gif adie.gif
make_desktop_entry adie "Adie Text Editor" adie.gif
;;
calculator)
newicon bigcalc.gif foxcalc.gif
make_desktop_entry calculator "FOX Calculator" foxcalc.gif
;;
pathfinder)
newicon iconpath.gif pathfinder.gif
make_desktop_entry PathFinder "PathFinder" pathfinder.gif "FileManager"
;;
shutterbug)
doicon shutterbug.gif
make_desktop_entry shutterbug "ShutterBug" shutterbug.gif "Graphics"
;;
esac
for doc in ADDITIONS AUTHORS LICENSE_ADDENDUM README TRACING ; do
[ -f $doc ] && dodoc $doc
done
# remove documentation if USE=-doc
if ( ! use doc ) && [ -d "${D}/usr/share/doc/${PF}/html" ] ; then
rm -fr "${D}/usr/share/doc/${PF}/html"
fi
# install class reference docs if USE=doc
if use doc && [ -z "${FOX_COMPONENT}" ] ; then
dohtml -r "${S}/doc/ref"
fi
# slot fox-config
if [ -f "${D}/usr/bin/fox-config" ] ; then
mv "${D}/usr/bin/fox-config" "${D}/usr/bin/fox-${FOXVER}-config"
fi
}
fox_pkg_postinst() {
if [ -z "${FOX_COMPONENT}" ] ; then
echo
einfo "Multiple versions of the FOX Toolkit library may now be installed"
einfo "in parallel SLOTs on the same system."
einfo
einfo "The reswrap utility and the applications included in the FOX Toolkit"
einfo "(adie, calculator, pathfinder, shutterbug) are now available as"
einfo "separate ebuilds."
echo
einfo "The fox-config script has been installed as fox-${FOXVER}-config."
einfo "The fox-wrapper package is used to direct calls to fox-config"
einfo "to the correct versioned script, based on the WANT_FOX variable."
einfo "For example:"
einfo
einfo " WANT_FOX=\"${FOXVER}\" fox-config <options>"
einfo
epause
fi
}
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.3: fox.eclass.diff --]
[-- Type: text/x-patch; name="fox.eclass.diff", Size: 7119 bytes --]
--- /usr/portage/eclass/fox.eclass 2008-10-12 14:36:35.000000000 +0200
+++ fox.eclass 2010-09-15 22:55:45.000000000 +0200
@@ -20,25 +20,26 @@
# bumped together with the library.
#
# Here are sample [R]DEPENDs for the fox apps
-# fox versions that do not use this eclass are blocked in INCOMPAT_DEP below
-# 1.0: '=x11-libs/fox-1.0*'
-# 1.2: '=x11-libs/fox-1.2*'
-# 1.4: '=x11-libs/fox-1.4*'
-# 1.5: '~x11-libs/fox-${PV}'
-# 1.6: '=x11-libs/fox-${FOXVER}*'
+# 1.6: 'x11-libs/fox:1.6'
+# 1.7: '~x11-libs/fox-${PV}'
#
-# Some concepts borrowed from gst-plugins and gtk-sharp-component eclasses
+# EAPI phase trickery borrowed from enlightenment.eclass
-inherit eutils libtool versionator
+inherit autotools versionator
+FOX_EXPF="src_unpack src_compile src_install pkg_postinst"
+case "${EAPI:-0}" in
+ 2|3|4) FOX_EXPF+=" src_prepare src_configure" ;;
+ *) ;;
+esac
+EXPORT_FUNCTIONS ${FOX_EXPF}
+
FOX_PV="${FOX_PV:-${PV}}"
-PVP=(${FOX_PV//[-\._]/ })
-FOXVER="${PVP[0]}.${PVP[1]}"
+FOXVER=`get_version_component_range 1-2 ${FOX_PV}`
-if [ "${FOXVER}" != "1.0" ] ; then
- FOXVER_SUFFIX="-${FOXVER}"
-fi
+FOX_APPS="adie calculator pathfinder shutterbug"
+FOX_CHART="chart"
DESCRIPTION="C++ based Toolkit for developing Graphical User Interfaces easily and effectively"
HOMEPAGE="http://www.fox-toolkit.org/"
@@ -46,19 +47,11 @@
IUSE="debug doc profile"
-# from fox-1.0
-FOX_APPS="adie calculator pathfinder"
-# from fox-1.2+
-if [ "${FOXVER}" != "1.0" ] ; then
- FOX_APPS="${FOX_APPS} shutterbug"
- FOX_CHART="chart"
-fi
-
if [ "${PN}" != fox ] ; then
FOX_COMPONENT="${FOX_COMPONENT:-${PN}}"
fi
-if [ "${FOXVER}" != "1.0" ] && [ -z "${FOX_COMPONENT}" ] ; then
+if [ -z "${FOX_COMPONENT}" ] ; then
DOXYGEN_DEP="doc? ( app-doc/doxygen )"
fi
@@ -66,15 +59,7 @@
RESWRAP_DEP="dev-util/reswrap"
fi
-# These versions are not compatible with new fox layout
-# and will cause collissions - we need to block them
-INCOMPAT_DEP="!<x11-libs/fox-1.0.53
- !=x11-libs/fox-1.2.4
- !~x11-libs/fox-1.2.6
- !=x11-libs/fox-1.4.11"
-
-DEPEND="${INCOMPAT_DEP}
- ${DOXYGEN_DEP}
+DEPEND="${DOXYGEN_DEP}
${RESWRAP_DEP}
=sys-devel/automake-1.4*
>=sys-apps/sed-4"
@@ -83,18 +68,18 @@
fox_src_unpack() {
unpack ${A}
- cd ${S}
-
- ebegin "Fixing configure"
+ cd "${S}"
- # Respect system CXXFLAGS
- sed -i -e 's:CXXFLAGS=""::' configure.in || die "sed configure.in error"
- touch aclocal.m4
- sed -i -e 's:CXXFLAGS=""::' configure || die "sed configure error"
+ hasq src_prepare ${FOX_EXPF} || fox_src_prepare
+}
- eend
+fox_src_prepare() {
+ # fox changed from configure.in to configure.am in 1.6.38
+ local confFile="configure.ac"
+ [[ -r "configure.in" ]] && confFile="configure.in"
- ebegin "Fixing Makefiles"
+ # Respect system CXXFLAGS
+ sed -i -e 's:CXXFLAGS=""::' $confFile || die "sed ${confFile} error"
# don't build apps from top-level (i.e. x11-libs/fox)
# utils == reswrap
@@ -110,36 +95,17 @@
# use the installed headers and library for apps
for d in ${FOX_APPS} ; do
- if version_is_at_least "1.6.34" ${PV} ; then
- sed -i \
- -e "s:-I\$(top_srcdir)/include -I\$(top_builddir)/include:-I\$(includedir)/fox${FOXVER_SUFFIX}:" \
- -e 's:$(top_builddir)/src/libFOX:-lFOX:' \
- -e 's:\.la::' \
- ${d}/Makefile.am || die "sed ${d}/Makefile.am error"
- else
- sed -i \
- -e "s:-I\$(top_srcdir)/include -I\$(top_builddir)/include:-I\$(includedir)/fox${FOXVER_SUFFIX}:" \
- -e 's:../src/libFOX:-lFOX:' \
- -e 's:\.la::' \
- ${d}/Makefile.am || die "sed ${d}/Makefile.am error"
- fi
+ sed -i \
+ -e "s:-I\$(top_srcdir)/include -I\$(top_builddir)/include:-I\$(includedir)/fox-${FOXVER}:" \
+ -e 's:$(top_builddir)/src/libFOX:-lFOX:' \
+ -e 's:\.la::' \
+ ${d}/Makefile.am || die "sed ${d}/Makefile.am error"
done
- # Upstream often has trouble with version number transitions
- if [ "${FOXVER}" == "1.5" ] ; then
- sed -i -e 's:1.4:1.5:g' chart/Makefile.am
- fi
-
- eend
-
- ebegin "Running automake"
- automake-1.4 -a -c || die "automake error"
- eend
-
- elibtoolize
+ eautoreconf
}
-fox_src_compile() {
+fox_src_configure() {
local myconf
use debug && myconf="${myconf} --enable-debug" \
|| myconf="${myconf} --enable-release"
@@ -149,22 +115,27 @@
${myconf} \
$(use_with profile profiling) \
|| die "configure error"
+}
+
- cd ${S}/${FOX_COMPONENT}
+fox_src_compile() {
+ hasq src_configure ${FOX_EXPF} || fox_src_configure
+
+ cd "${S}/${FOX_COMPONENT}"
emake || die "compile error"
# build class reference docs (FOXVER >= 1.2)
- if use doc && [ "${FOXVER}" != "1.0" ] && [ -z "${FOX_COMPONENT}" ] ; then
- cd ${S}/doc
+ if use doc && [ -z "${FOX_COMPONENT}" ] ; then
+ cd "${S}/doc"
make docs || die "doxygen error"
fi
}
-fox_src_install () {
- cd ${S}/${FOX_COMPONENT}
+fox_src_install() {
+ cd "${S}/${FOX_COMPONENT}"
- make install \
- DESTDIR=${D} \
+ emake install \
+ DESTDIR="${D}" \
htmldir=/usr/share/doc/${PF}/html \
artdir=/usr/share/doc/${PF}/html/art \
screenshotsdir=/usr/share/doc/${PF}/html/screenshots \
@@ -195,18 +166,18 @@
done
# remove documentation if USE=-doc
- if ( ! use doc ) && [ -d ${D}/usr/share/doc/${PF}/html ] ; then
- rm -fr ${D}/usr/share/doc/${PF}/html
+ if ( ! use doc ) && [ -d "${D}/usr/share/doc/${PF}/html" ] ; then
+ rm -fr "${D}/usr/share/doc/${PF}/html"
fi
- # install class reference docs (FOXVER >= 1.2) if USE=doc
- if use doc && [ "${FOXVER}" != "1.0" ] && [ -z "${FOX_COMPONENT}" ] ; then
- dohtml -r ${S}/doc/ref
+ # install class reference docs if USE=doc
+ if use doc && [ -z "${FOX_COMPONENT}" ] ; then
+ dohtml -r "${S}/doc/ref"
fi
- # slot fox-config where present (FOXVER >= 1.2)
- if [ -f ${D}/usr/bin/fox-config ] ; then
- mv ${D}/usr/bin/fox-config ${D}/usr/bin/fox-${FOXVER}-config
+ # slot fox-config
+ if [ -f "${D}/usr/bin/fox-config" ] ; then
+ mv "${D}/usr/bin/fox-config" "${D}/usr/bin/fox-${FOXVER}-config"
fi
}
@@ -220,17 +191,13 @@
einfo "(adie, calculator, pathfinder, shutterbug) are now available as"
einfo "separate ebuilds."
echo
- if [ "${FOXVER}" != "1.0" ] ; then
- einfo "The fox-config script has been installed as fox-${FOXVER}-config."
- einfo "The fox-wrapper package is used to direct calls to fox-config"
- einfo "to the correct versioned script, based on the WANT_FOX variable."
- einfo "For example:"
- einfo
- einfo " WANT_FOX=\"${FOXVER}\" fox-config <options>"
- einfo
- epause
- fi
+ einfo "The fox-config script has been installed as fox-${FOXVER}-config."
+ einfo "The fox-wrapper package is used to direct calls to fox-config"
+ einfo "to the correct versioned script, based on the WANT_FOX variable."
+ einfo "For example:"
+ einfo
+ einfo " WANT_FOX=\"${FOXVER}\" fox-config <options>"
+ einfo
+ epause
fi
}
-
-EXPORT_FUNCTIONS src_unpack src_compile src_install pkg_postinst
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] RFC: fox.eclass update
2010-09-16 14:24 ` Matti Bickel
@ 2010-09-16 14:41 ` Jeremy Olexa
2010-09-16 15:44 ` Jeroen Roovers
2010-09-16 16:48 ` Matti Bickel
2010-09-16 18:32 ` Peter Volkov
1 sibling, 2 replies; 26+ messages in thread
From: Jeremy Olexa @ 2010-09-16 14:41 UTC (permalink / raw
To: gentoo-dev
On Thu, 16 Sep 2010 16:24:18 +0200, Matti Bickel <mabi@gentoo.org>
wrote:
> On 09/16/2010 03:31 PM, Matti Bickel wrote:
> --
> Now complete with attachments :)
Hey Matti, few quick things.
* Can you add eclass-manpages documentation?
* econf doesn't need to "|| die"
* What is the mysterious FOXCONF variable in econf for? (could just be
documented? or removed?)
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] RFC: fox.eclass update
2010-09-16 14:41 ` Jeremy Olexa
@ 2010-09-16 15:44 ` Jeroen Roovers
2010-09-16 17:38 ` Peter Volkov
2010-09-16 16:48 ` Matti Bickel
1 sibling, 1 reply; 26+ messages in thread
From: Jeroen Roovers @ 2010-09-16 15:44 UTC (permalink / raw
To: gentoo-dev
On Thu, 16 Sep 2010 09:41:30 -0500
Jeremy Olexa <darkside@gentoo.org> wrote:
> * econf doesn't need to "|| die"
Is that a novelty change? Most of the tree still does econf || die ...
jer
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] RFC: fox.eclass update
2010-09-16 14:41 ` Jeremy Olexa
2010-09-16 15:44 ` Jeroen Roovers
@ 2010-09-16 16:48 ` Matti Bickel
1 sibling, 0 replies; 26+ messages in thread
From: Matti Bickel @ 2010-09-16 16:48 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1.1: Type: text/plain, Size: 188 bytes --]
On 09/16/2010 04:41 PM, Jeremy Olexa wrote:
> Hey Matti, few quick things.
Thanks, all done. FOXCONF is now documented (though not set by default).
Updated diff and eclass attached.
[-- Attachment #1.2: fox.eclass --]
[-- Type: text/plain, Size: 6168 bytes --]
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
# @ECLASS: fox.eclass
# @MAINTAINER:
# mabi@gentoo.org
# @BLURB: Functionality required the FOX Toolkit and it's applications
# @DESCRIPTION:
# This eclass allows building SLOT-able FOX Toolkit installations
# (x11-libs/fox: headers, libs, and docs), which are by design
# parallel-installable, while installing only one version of the utils
# (dev-util/reswrap) and apps (app-editors/adie, sci-calculators/calculator,
# x11-misc/pathfinder, and x11-misc/shutterbug).
#
# Version numbering follows the kernel-style odd-even minor version
# designation. Even-number minor versions are API stable, which patch
# releases aimed mostly at the library; apps generally won't need to be
# bumped for a patch release.
#
# Odd-number versions are development branches with their own SLOT and
# are API unstable; changes are made to the apps, and likely need to be
# bumped together with the library.
#
# Here are sample [R]DEPENDs for the fox apps
# 1.6: 'x11-libs/fox:1.6'
# 1.7: '~x11-libs/fox-${PV}'
#
# EAPI phase trickery borrowed from enlightenment.eclass
inherit autotools versionator
FOX_EXPF="src_unpack src_compile src_install pkg_postinst"
case "${EAPI:-0}" in
2|3|4) FOX_EXPF+=" src_prepare src_configure" ;;
*) ;;
esac
EXPORT_FUNCTIONS ${FOX_EXPF}
# @ECLASS-VARIABLE: FOX_PV
# @DESCRIPTION:
# The version of the FOX Toolkit provided or required by the package
FOX_PV="${FOX_PV:-${PV}}"
# @ECLASS-VARIABLE: FOXVER
# @INTERNAL
# @DESCRIPTION:
# The major.minor version of FOX_PV, usually acts as $SLOT and is used in
# building the applications
FOXVER=`get_version_component_range 1-2 ${FOX_PV}`
# @ECLASS-VARIABLE: FOX_APPS
# @INTERNAL
# @DESCRIPTION:
# The applications originally packaged in the FOX Toolkit
FOX_APPS="adie calculator pathfinder shutterbug"
FOX_CHART="chart"
# @ECLASS-VARIABLE: FOXCONF
# @DEFAULT_UNSET
# @DESCRIPTION:
# Set this to add additional configuration options during src_configure
DESCRIPTION="C++ based Toolkit for developing Graphical User Interfaces easily and effectively"
HOMEPAGE="http://www.fox-toolkit.org/"
SRC_URI="http://www.fox-toolkit.org/ftp/fox-${FOX_PV}.tar.gz"
IUSE="debug doc profile"
if [ "${PN}" != fox ] ; then
FOX_COMPONENT="${FOX_COMPONENT:-${PN}}"
fi
if [ -z "${FOX_COMPONENT}" ] ; then
DOXYGEN_DEP="doc? ( app-doc/doxygen )"
fi
if [ "${PN}" != reswrap ] ; then
RESWRAP_DEP="dev-util/reswrap"
fi
DEPEND="${DOXYGEN_DEP}
${RESWRAP_DEP}
=sys-devel/automake-1.4*
>=sys-apps/sed-4"
S="${WORKDIR}/fox-${FOX_PV}"
fox_src_unpack() {
unpack ${A}
cd "${S}"
hasq src_prepare ${FOX_EXPF} || fox_src_prepare
}
fox_src_prepare() {
# fox changed from configure.in to configure.am in 1.6.38
local confFile="configure.ac"
[[ -r "configure.in" ]] && confFile="configure.in"
# Respect system CXXFLAGS
sed -i -e 's:CXXFLAGS=""::' $confFile || die "sed ${confFile} error"
# don't build apps from top-level (i.e. x11-libs/fox)
# utils == reswrap
for d in ${FOX_APPS} utils windows ; do
sed -i -e "s:${d}::" Makefile.am || die "sed Makefile.am error"
done
# use the installed reswrap for everything else
for d in ${FOX_APPS} ${FOX_CHART} tests ; do
sed -i -e 's:$(top_builddir)/utils/reswrap:reswrap:' \
${d}/Makefile.am || die "sed ${d}/Makefile.am error"
done
# use the installed headers and library for apps
for d in ${FOX_APPS} ; do
sed -i \
-e "s:-I\$(top_srcdir)/include -I\$(top_builddir)/include:-I\$(includedir)/fox-${FOXVER}:" \
-e 's:$(top_builddir)/src/libFOX:-lFOX:' \
-e 's:\.la::' \
${d}/Makefile.am || die "sed ${d}/Makefile.am error"
done
eautoreconf
}
fox_src_configure() {
use debug && FOXCONF+=" --enable-debug" \
|| FOXCONF+=" --enable-release"
econf ${FOXCONF} \
$(use_with profile profiling)
}
fox_src_compile() {
hasq src_configure ${FOX_EXPF} || fox_src_configure
cd "${S}/${FOX_COMPONENT}"
emake || die "compile error"
# build class reference docs (FOXVER >= 1.2)
if use doc && [ -z "${FOX_COMPONENT}" ] ; then
cd "${S}/doc"
make docs || die "doxygen error"
fi
}
fox_src_install() {
cd "${S}/${FOX_COMPONENT}"
emake install \
DESTDIR="${D}" \
htmldir=/usr/share/doc/${PF}/html \
artdir=/usr/share/doc/${PF}/html/art \
screenshotsdir=/usr/share/doc/${PF}/html/screenshots \
|| die "install error"
# create desktop menu items for apps
case ${FOX_COMPONENT} in
adie)
newicon big_gif.gif adie.gif
make_desktop_entry adie "Adie Text Editor" adie.gif
;;
calculator)
newicon bigcalc.gif foxcalc.gif
make_desktop_entry calculator "FOX Calculator" foxcalc.gif
;;
pathfinder)
newicon iconpath.gif pathfinder.gif
make_desktop_entry PathFinder "PathFinder" pathfinder.gif "FileManager"
;;
shutterbug)
doicon shutterbug.gif
make_desktop_entry shutterbug "ShutterBug" shutterbug.gif "Graphics"
;;
esac
for doc in ADDITIONS AUTHORS LICENSE_ADDENDUM README TRACING ; do
[ -f $doc ] && dodoc $doc
done
# remove documentation if USE=-doc
if ( ! use doc ) && [ -d "${D}/usr/share/doc/${PF}/html" ] ; then
rm -fr "${D}/usr/share/doc/${PF}/html"
fi
# install class reference docs if USE=doc
if use doc && [ -z "${FOX_COMPONENT}" ] ; then
dohtml -r "${S}/doc/ref"
fi
# slot fox-config
if [ -f "${D}/usr/bin/fox-config" ] ; then
mv "${D}/usr/bin/fox-config" "${D}/usr/bin/fox-${FOXVER}-config"
fi
}
fox_pkg_postinst() {
if [ -z "${FOX_COMPONENT}" ] ; then
echo
einfo "Multiple versions of the FOX Toolkit library may now be installed"
einfo "in parallel SLOTs on the same system."
einfo
einfo "The reswrap utility and the applications included in the FOX Toolkit"
einfo "(adie, calculator, pathfinder, shutterbug) are now available as"
einfo "separate ebuilds."
echo
einfo "The fox-config script has been installed as fox-${FOXVER}-config."
einfo "The fox-wrapper package is used to direct calls to fox-config"
einfo "to the correct versioned script, based on the WANT_FOX variable."
einfo "For example:"
einfo
einfo " WANT_FOX=\"${FOXVER}\" fox-config <options>"
einfo
epause
fi
}
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.3: fox.eclass.diff --]
[-- Type: text/x-patch; name="fox.eclass.diff", Size: 8406 bytes --]
--- fox.eclass.old 2010-09-16 18:41:36.000000000 +0200
+++ fox.eclass 2010-09-16 18:45:57.000000000 +0200
@@ -1,9 +1,12 @@
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/fox.eclass,v 1.8 2008/10/12 12:31:36 mabi Exp $
+# $Header: $
-# fox eclass
-#
+# @ECLASS: fox.eclass
+# @MAINTAINER:
+# mabi@gentoo.org
+# @BLURB: Functionality required the FOX Toolkit and it's applications
+# @DESCRIPTION:
# This eclass allows building SLOT-able FOX Toolkit installations
# (x11-libs/fox: headers, libs, and docs), which are by design
# parallel-installable, while installing only one version of the utils
@@ -20,25 +23,44 @@
# bumped together with the library.
#
# Here are sample [R]DEPENDs for the fox apps
-# fox versions that do not use this eclass are blocked in INCOMPAT_DEP below
-# 1.0: '=x11-libs/fox-1.0*'
-# 1.2: '=x11-libs/fox-1.2*'
-# 1.4: '=x11-libs/fox-1.4*'
-# 1.5: '~x11-libs/fox-${PV}'
-# 1.6: '=x11-libs/fox-${FOXVER}*'
+# 1.6: 'x11-libs/fox:1.6'
+# 1.7: '~x11-libs/fox-${PV}'
#
-# Some concepts borrowed from gst-plugins and gtk-sharp-component eclasses
+# EAPI phase trickery borrowed from enlightenment.eclass
+
+inherit autotools versionator
-inherit eutils libtool versionator
+FOX_EXPF="src_unpack src_compile src_install pkg_postinst"
+case "${EAPI:-0}" in
+ 2|3|4) FOX_EXPF+=" src_prepare src_configure" ;;
+ *) ;;
+esac
+EXPORT_FUNCTIONS ${FOX_EXPF}
+# @ECLASS-VARIABLE: FOX_PV
+# @DESCRIPTION:
+# The version of the FOX Toolkit provided or required by the package
FOX_PV="${FOX_PV:-${PV}}"
-PVP=(${FOX_PV//[-\._]/ })
-FOXVER="${PVP[0]}.${PVP[1]}"
-if [ "${FOXVER}" != "1.0" ] ; then
- FOXVER_SUFFIX="-${FOXVER}"
-fi
+# @ECLASS-VARIABLE: FOXVER
+# @INTERNAL
+# @DESCRIPTION:
+# The major.minor version of FOX_PV, usually acts as $SLOT and is used in
+# building the applications
+FOXVER=`get_version_component_range 1-2 ${FOX_PV}`
+
+# @ECLASS-VARIABLE: FOX_APPS
+# @INTERNAL
+# @DESCRIPTION:
+# The applications originally packaged in the FOX Toolkit
+FOX_APPS="adie calculator pathfinder shutterbug"
+FOX_CHART="chart"
+
+# @ECLASS-VARIABLE: FOXCONF
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Set this to add additional configuration options during src_configure
DESCRIPTION="C++ based Toolkit for developing Graphical User Interfaces easily and effectively"
HOMEPAGE="http://www.fox-toolkit.org/"
@@ -46,19 +68,11 @@
IUSE="debug doc profile"
-# from fox-1.0
-FOX_APPS="adie calculator pathfinder"
-# from fox-1.2+
-if [ "${FOXVER}" != "1.0" ] ; then
- FOX_APPS="${FOX_APPS} shutterbug"
- FOX_CHART="chart"
-fi
-
if [ "${PN}" != fox ] ; then
FOX_COMPONENT="${FOX_COMPONENT:-${PN}}"
fi
-if [ "${FOXVER}" != "1.0" ] && [ -z "${FOX_COMPONENT}" ] ; then
+if [ -z "${FOX_COMPONENT}" ] ; then
DOXYGEN_DEP="doc? ( app-doc/doxygen )"
fi
@@ -66,15 +80,7 @@
RESWRAP_DEP="dev-util/reswrap"
fi
-# These versions are not compatible with new fox layout
-# and will cause collissions - we need to block them
-INCOMPAT_DEP="!<x11-libs/fox-1.0.53
- !=x11-libs/fox-1.2.4
- !~x11-libs/fox-1.2.6
- !=x11-libs/fox-1.4.11"
-
-DEPEND="${INCOMPAT_DEP}
- ${DOXYGEN_DEP}
+DEPEND="${DOXYGEN_DEP}
${RESWRAP_DEP}
=sys-devel/automake-1.4*
>=sys-apps/sed-4"
@@ -83,18 +89,18 @@
fox_src_unpack() {
unpack ${A}
- cd ${S}
-
- ebegin "Fixing configure"
+ cd "${S}"
- # Respect system CXXFLAGS
- sed -i -e 's:CXXFLAGS=""::' configure.in || die "sed configure.in error"
- touch aclocal.m4
- sed -i -e 's:CXXFLAGS=""::' configure || die "sed configure error"
+ hasq src_prepare ${FOX_EXPF} || fox_src_prepare
+}
- eend
+fox_src_prepare() {
+ # fox changed from configure.in to configure.am in 1.6.38
+ local confFile="configure.ac"
+ [[ -r "configure.in" ]] && confFile="configure.in"
- ebegin "Fixing Makefiles"
+ # Respect system CXXFLAGS
+ sed -i -e 's:CXXFLAGS=""::' $confFile || die "sed ${confFile} error"
# don't build apps from top-level (i.e. x11-libs/fox)
# utils == reswrap
@@ -110,61 +116,43 @@
# use the installed headers and library for apps
for d in ${FOX_APPS} ; do
- if version_is_at_least "1.6.34" ${PV} ; then
- sed -i \
- -e "s:-I\$(top_srcdir)/include -I\$(top_builddir)/include:-I\$(includedir)/fox${FOXVER_SUFFIX}:" \
- -e 's:$(top_builddir)/src/libFOX:-lFOX:' \
- -e 's:\.la::' \
- ${d}/Makefile.am || die "sed ${d}/Makefile.am error"
- else
- sed -i \
- -e "s:-I\$(top_srcdir)/include -I\$(top_builddir)/include:-I\$(includedir)/fox${FOXVER_SUFFIX}:" \
- -e 's:../src/libFOX:-lFOX:' \
- -e 's:\.la::' \
- ${d}/Makefile.am || die "sed ${d}/Makefile.am error"
- fi
+ sed -i \
+ -e "s:-I\$(top_srcdir)/include -I\$(top_builddir)/include:-I\$(includedir)/fox-${FOXVER}:" \
+ -e 's:$(top_builddir)/src/libFOX:-lFOX:' \
+ -e 's:\.la::' \
+ ${d}/Makefile.am || die "sed ${d}/Makefile.am error"
done
- # Upstream often has trouble with version number transitions
- if [ "${FOXVER}" == "1.5" ] ; then
- sed -i -e 's:1.4:1.5:g' chart/Makefile.am
- fi
-
- eend
+ eautoreconf
+}
- ebegin "Running automake"
- automake-1.4 -a -c || die "automake error"
- eend
+fox_src_configure() {
+ use debug && FOXCONF+=" --enable-debug" \
+ || FOXCONF+=" --enable-release"
- elibtoolize
+ econf ${FOXCONF} \
+ $(use_with profile profiling)
}
+
fox_src_compile() {
- local myconf
- use debug && myconf="${myconf} --enable-debug" \
- || myconf="${myconf} --enable-release"
-
- econf \
- ${FOXCONF} \
- ${myconf} \
- $(use_with profile profiling) \
- || die "configure error"
+ hasq src_configure ${FOX_EXPF} || fox_src_configure
- cd ${S}/${FOX_COMPONENT}
+ cd "${S}/${FOX_COMPONENT}"
emake || die "compile error"
# build class reference docs (FOXVER >= 1.2)
- if use doc && [ "${FOXVER}" != "1.0" ] && [ -z "${FOX_COMPONENT}" ] ; then
- cd ${S}/doc
+ if use doc && [ -z "${FOX_COMPONENT}" ] ; then
+ cd "${S}/doc"
make docs || die "doxygen error"
fi
}
-fox_src_install () {
- cd ${S}/${FOX_COMPONENT}
+fox_src_install() {
+ cd "${S}/${FOX_COMPONENT}"
- make install \
- DESTDIR=${D} \
+ emake install \
+ DESTDIR="${D}" \
htmldir=/usr/share/doc/${PF}/html \
artdir=/usr/share/doc/${PF}/html/art \
screenshotsdir=/usr/share/doc/${PF}/html/screenshots \
@@ -195,18 +183,18 @@
done
# remove documentation if USE=-doc
- if ( ! use doc ) && [ -d ${D}/usr/share/doc/${PF}/html ] ; then
- rm -fr ${D}/usr/share/doc/${PF}/html
+ if ( ! use doc ) && [ -d "${D}/usr/share/doc/${PF}/html" ] ; then
+ rm -fr "${D}/usr/share/doc/${PF}/html"
fi
- # install class reference docs (FOXVER >= 1.2) if USE=doc
- if use doc && [ "${FOXVER}" != "1.0" ] && [ -z "${FOX_COMPONENT}" ] ; then
- dohtml -r ${S}/doc/ref
+ # install class reference docs if USE=doc
+ if use doc && [ -z "${FOX_COMPONENT}" ] ; then
+ dohtml -r "${S}/doc/ref"
fi
- # slot fox-config where present (FOXVER >= 1.2)
- if [ -f ${D}/usr/bin/fox-config ] ; then
- mv ${D}/usr/bin/fox-config ${D}/usr/bin/fox-${FOXVER}-config
+ # slot fox-config
+ if [ -f "${D}/usr/bin/fox-config" ] ; then
+ mv "${D}/usr/bin/fox-config" "${D}/usr/bin/fox-${FOXVER}-config"
fi
}
@@ -220,17 +208,13 @@
einfo "(adie, calculator, pathfinder, shutterbug) are now available as"
einfo "separate ebuilds."
echo
- if [ "${FOXVER}" != "1.0" ] ; then
- einfo "The fox-config script has been installed as fox-${FOXVER}-config."
- einfo "The fox-wrapper package is used to direct calls to fox-config"
- einfo "to the correct versioned script, based on the WANT_FOX variable."
- einfo "For example:"
- einfo
- einfo " WANT_FOX=\"${FOXVER}\" fox-config <options>"
- einfo
- epause
- fi
+ einfo "The fox-config script has been installed as fox-${FOXVER}-config."
+ einfo "The fox-wrapper package is used to direct calls to fox-config"
+ einfo "to the correct versioned script, based on the WANT_FOX variable."
+ einfo "For example:"
+ einfo
+ einfo " WANT_FOX=\"${FOXVER}\" fox-config <options>"
+ einfo
+ epause
fi
}
-
-EXPORT_FUNCTIONS src_unpack src_compile src_install pkg_postinst
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] RFC: fox.eclass update
2010-09-16 15:44 ` Jeroen Roovers
@ 2010-09-16 17:38 ` Peter Volkov
0 siblings, 0 replies; 26+ messages in thread
From: Peter Volkov @ 2010-09-16 17:38 UTC (permalink / raw
To: gentoo-dev
В Чтв, 16/09/2010 в 17:44 +0200, Jeroen Roovers пишет:
> On Thu, 16 Sep 2010 09:41:30 -0500
> Jeremy Olexa <darkside@gentoo.org> wrote:
>
> > * econf doesn't need to "|| die"
>
> Is that a novelty change? Most of the tree still does econf || die ...
econf is function that dies on its own.
But still there is one case where || die after econf can be useful -
very-very long list of econf options you have to edit rather frequently.
econf \
parameter1 \
parameter2 \
... \
parameterN || die
In case || die is absent and developer forgot '\' at the end of line
portage will not abort build: econf with shortened list of options will
succeed and next most probably absent command `parameterk parameter$((k
+1)) ... parameterN` will have no || die at the end. In general case ||
die after econf is redundant and should be dropped.
--
Peter.
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] RFC: fox.eclass update
2010-09-16 14:24 ` Matti Bickel
2010-09-16 14:41 ` Jeremy Olexa
@ 2010-09-16 18:32 ` Peter Volkov
2010-09-16 18:51 ` Matti Bickel
2010-09-17 8:15 ` Michael Haubenwallner
1 sibling, 2 replies; 26+ messages in thread
From: Peter Volkov @ 2010-09-16 18:32 UTC (permalink / raw
To: gentoo-dev
В Чтв, 16/09/2010 в 16:24 +0200, Matti Bickel пишет:
> +FOXVER=`get_version_component_range 1-2 ${FOX_PV}`
It's better to prefer $() style over ``:
http://mywiki.wooledge.org/BashFAQ/082
> if [ "${PN}" != fox ] ; then
> FOX_COMPONENT="${FOX_COMPONENT:-${PN}}"
> fi
>
> -if [ "${FOXVER}" != "1.0" ] && [ -z "${FOX_COMPONENT}" ] ; then
> +if [ -z "${FOX_COMPONENT}" ] ; then
> DOXYGEN_DEP="doc? ( app-doc/doxygen )"
> fi
It's better to use [[ ]] and avoid quotes since ebuilds are bash
scripts.
> - elibtoolize
> + eautoreconf
Hm, is this change necessary?
> + if ( ! use doc ) && [ -d "${D}/usr/share/doc/${PF}/html" ] ;
> then
Subshell looks redundant here.
> + epause
It's better to avoid epause as it makes build slower at the same time
it's most probable that nobody is looking on the screen at the moment[1]
and portage will print all elog messages at the end of the build in any
case.
[1] while emerge output is one of those things one can observe for ages
(like water, fire and others working) still it's possible no one
thoughtfully staring at the screen...
--
Peter.
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] RFC: fox.eclass update
2010-09-16 18:32 ` Peter Volkov
@ 2010-09-16 18:51 ` Matti Bickel
2010-09-16 19:29 ` Mike Frysinger
2010-09-17 8:15 ` Michael Haubenwallner
1 sibling, 1 reply; 26+ messages in thread
From: Matti Bickel @ 2010-09-16 18:51 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1.1: Type: text/plain, Size: 717 bytes --]
On 09/16/2010 08:32 PM, Peter Volkov wrote:
> В Чтв, 16/09/2010 в 16:24 +0200, Matti Bickel пишет:
>> +FOXVER=`get_version_component_range 1-2 ${FOX_PV}`
>
> It's better to prefer $() style over ``:
> http://mywiki.wooledge.org/BashFAQ/082
Hmm, I prefer Backticks personally, as I like to conserve space whenever
possible. But for consistency with the rest of the tree, I changed that
to $() in the diff.
>> - elibtoolize
>> + eautoreconf
>
> Hm, is this change necessary?
I might be missing something here, but the change in recent fox versions
to configure.ac instead of configure.in forces a run of autoconf, afaik.
Thanks for the comments, updated eclass attached.
[-- Attachment #1.2: fox.eclass --]
[-- Type: text/plain, Size: 6156 bytes --]
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
# @ECLASS: fox.eclass
# @MAINTAINER:
# mabi@gentoo.org
# @BLURB: Functionality required the FOX Toolkit and it's applications
# @DESCRIPTION:
# This eclass allows building SLOT-able FOX Toolkit installations
# (x11-libs/fox: headers, libs, and docs), which are by design
# parallel-installable, while installing only one version of the utils
# (dev-util/reswrap) and apps (app-editors/adie, sci-calculators/calculator,
# x11-misc/pathfinder, and x11-misc/shutterbug).
#
# Version numbering follows the kernel-style odd-even minor version
# designation. Even-number minor versions are API stable, which patch
# releases aimed mostly at the library; apps generally won't need to be
# bumped for a patch release.
#
# Odd-number versions are development branches with their own SLOT and
# are API unstable; changes are made to the apps, and likely need to be
# bumped together with the library.
#
# Here are sample [R]DEPENDs for the fox apps
# 1.6: 'x11-libs/fox:1.6'
# 1.7: '~x11-libs/fox-${PV}'
#
# EAPI phase trickery borrowed from enlightenment.eclass
inherit autotools versionator
FOX_EXPF="src_unpack src_compile src_install pkg_postinst"
case "${EAPI:-0}" in
2|3|4) FOX_EXPF+=" src_prepare src_configure" ;;
*) ;;
esac
EXPORT_FUNCTIONS ${FOX_EXPF}
# @ECLASS-VARIABLE: FOX_PV
# @DESCRIPTION:
# The version of the FOX Toolkit provided or required by the package
FOX_PV="${FOX_PV:-${PV}}"
# @ECLASS-VARIABLE: FOXVER
# @INTERNAL
# @DESCRIPTION:
# The major.minor version of FOX_PV, usually acts as $SLOT and is used in
# building the applications
FOXVER=$(get_version_component_range 1-2 ${FOX_PV})
# @ECLASS-VARIABLE: FOX_APPS
# @INTERNAL
# @DESCRIPTION:
# The applications originally packaged in the FOX Toolkit
FOX_APPS="adie calculator pathfinder shutterbug"
FOX_CHART="chart"
# @ECLASS-VARIABLE: FOXCONF
# @DEFAULT_UNSET
# @DESCRIPTION:
# Set this to add additional configuration options during src_configure
DESCRIPTION="C++ based Toolkit for developing Graphical User Interfaces easily and effectively"
HOMEPAGE="http://www.fox-toolkit.org/"
SRC_URI="http://www.fox-toolkit.org/ftp/fox-${FOX_PV}.tar.gz"
IUSE="debug doc profile"
if [[ ${PN} != fox ]] ; then
FOX_COMPONENT="${FOX_COMPONENT:-${PN}}"
fi
if [[ -z ${FOX_COMPONENT} ]] ; then
DOXYGEN_DEP="doc? ( app-doc/doxygen )"
fi
if [[ ${PN} != reswrap ]] ; then
RESWRAP_DEP="dev-util/reswrap"
fi
DEPEND="${DOXYGEN_DEP}
${RESWRAP_DEP}
=sys-devel/automake-1.4*
>=sys-apps/sed-4"
S="${WORKDIR}/fox-${FOX_PV}"
fox_src_unpack() {
unpack ${A}
cd "${S}"
hasq src_prepare ${FOX_EXPF} || fox_src_prepare
}
fox_src_prepare() {
# fox changed from configure.in to configure.am in 1.6.38
local confFile="configure.ac"
[[ -r "configure.in" ]] && confFile="configure.in"
# Respect system CXXFLAGS
sed -i -e 's:CXXFLAGS=""::' $confFile || die "sed ${confFile} error"
# don't build apps from top-level (i.e. x11-libs/fox)
# utils == reswrap
for d in ${FOX_APPS} utils windows ; do
sed -i -e "s:${d}::" Makefile.am || die "sed Makefile.am error"
done
# use the installed reswrap for everything else
for d in ${FOX_APPS} ${FOX_CHART} tests ; do
sed -i -e 's:$(top_builddir)/utils/reswrap:reswrap:' \
${d}/Makefile.am || die "sed ${d}/Makefile.am error"
done
# use the installed headers and library for apps
for d in ${FOX_APPS} ; do
sed -i \
-e "s:-I\$(top_srcdir)/include -I\$(top_builddir)/include:-I\$(includedir)/fox-${FOXVER}:" \
-e 's:$(top_builddir)/src/libFOX:-lFOX:' \
-e 's:\.la::' \
${d}/Makefile.am || die "sed ${d}/Makefile.am error"
done
eautoreconf
}
fox_src_configure() {
use debug && FOXCONF+=" --enable-debug" \
|| FOXCONF+=" --enable-release"
econf ${FOXCONF} \
$(use_with profile profiling)
}
fox_src_compile() {
hasq src_configure ${FOX_EXPF} || fox_src_configure
cd "${S}/${FOX_COMPONENT}"
emake || die "compile error"
# build class reference docs (FOXVER >= 1.2)
if use doc && [[ -z ${FOX_COMPONENT} ]] ; then
cd "${S}/doc"
make docs || die "doxygen error"
fi
}
fox_src_install() {
cd "${S}/${FOX_COMPONENT}"
emake install \
DESTDIR="${D}" \
htmldir=/usr/share/doc/${PF}/html \
artdir=/usr/share/doc/${PF}/html/art \
screenshotsdir=/usr/share/doc/${PF}/html/screenshots \
|| die "install error"
# create desktop menu items for apps
case ${FOX_COMPONENT} in
adie)
newicon big_gif.gif adie.gif
make_desktop_entry adie "Adie Text Editor" adie.gif
;;
calculator)
newicon bigcalc.gif foxcalc.gif
make_desktop_entry calculator "FOX Calculator" foxcalc.gif
;;
pathfinder)
newicon iconpath.gif pathfinder.gif
make_desktop_entry PathFinder "PathFinder" pathfinder.gif "FileManager"
;;
shutterbug)
doicon shutterbug.gif
make_desktop_entry shutterbug "ShutterBug" shutterbug.gif "Graphics"
;;
esac
for doc in ADDITIONS AUTHORS LICENSE_ADDENDUM README TRACING ; do
[ -f $doc ] && dodoc $doc
done
# remove documentation if USE=-doc
if ! use doc && [[ -d ${D}/usr/share/doc/${PF}/html ]] ; then
rm -fr "${D}/usr/share/doc/${PF}/html"
fi
# install class reference docs if USE=doc
if use doc && [[ -z ${FOX_COMPONENT} ]] ; then
dohtml -r "${S}/doc/ref"
fi
# slot fox-config
if [[ -f ${D}/usr/bin/fox-config ]] ; then
mv "${D}/usr/bin/fox-config" "${D}/usr/bin/fox-${FOXVER}-config"
fi
}
fox_pkg_postinst() {
if [ -z "${FOX_COMPONENT}" ] ; then
echo
einfo "Multiple versions of the FOX Toolkit library may now be installed"
einfo "in parallel SLOTs on the same system."
einfo
einfo "The reswrap utility and the applications included in the FOX Toolkit"
einfo "(adie, calculator, pathfinder, shutterbug) are now available as"
einfo "separate ebuilds."
echo
einfo "The fox-config script has been installed as fox-${FOXVER}-config."
einfo "The fox-wrapper package is used to direct calls to fox-config"
einfo "to the correct versioned script, based on the WANT_FOX variable."
einfo "For example:"
einfo
einfo " WANT_FOX=\"${FOXVER}\" fox-config <options>"
einfo
fi
}
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.3: fox.eclass.diff --]
[-- Type: text/x-patch; name="fox.eclass.diff", Size: 8473 bytes --]
--- fox.eclass.old 2010-09-16 18:41:36.000000000 +0200
+++ fox.eclass 2010-09-16 20:51:09.000000000 +0200
@@ -1,9 +1,12 @@
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/fox.eclass,v 1.8 2008/10/12 12:31:36 mabi Exp $
+# $Header: $
-# fox eclass
-#
+# @ECLASS: fox.eclass
+# @MAINTAINER:
+# mabi@gentoo.org
+# @BLURB: Functionality required the FOX Toolkit and it's applications
+# @DESCRIPTION:
# This eclass allows building SLOT-able FOX Toolkit installations
# (x11-libs/fox: headers, libs, and docs), which are by design
# parallel-installable, while installing only one version of the utils
@@ -20,25 +23,44 @@
# bumped together with the library.
#
# Here are sample [R]DEPENDs for the fox apps
-# fox versions that do not use this eclass are blocked in INCOMPAT_DEP below
-# 1.0: '=x11-libs/fox-1.0*'
-# 1.2: '=x11-libs/fox-1.2*'
-# 1.4: '=x11-libs/fox-1.4*'
-# 1.5: '~x11-libs/fox-${PV}'
-# 1.6: '=x11-libs/fox-${FOXVER}*'
+# 1.6: 'x11-libs/fox:1.6'
+# 1.7: '~x11-libs/fox-${PV}'
#
-# Some concepts borrowed from gst-plugins and gtk-sharp-component eclasses
+# EAPI phase trickery borrowed from enlightenment.eclass
+
+inherit autotools versionator
-inherit eutils libtool versionator
+FOX_EXPF="src_unpack src_compile src_install pkg_postinst"
+case "${EAPI:-0}" in
+ 2|3|4) FOX_EXPF+=" src_prepare src_configure" ;;
+ *) ;;
+esac
+EXPORT_FUNCTIONS ${FOX_EXPF}
+# @ECLASS-VARIABLE: FOX_PV
+# @DESCRIPTION:
+# The version of the FOX Toolkit provided or required by the package
FOX_PV="${FOX_PV:-${PV}}"
-PVP=(${FOX_PV//[-\._]/ })
-FOXVER="${PVP[0]}.${PVP[1]}"
-if [ "${FOXVER}" != "1.0" ] ; then
- FOXVER_SUFFIX="-${FOXVER}"
-fi
+# @ECLASS-VARIABLE: FOXVER
+# @INTERNAL
+# @DESCRIPTION:
+# The major.minor version of FOX_PV, usually acts as $SLOT and is used in
+# building the applications
+FOXVER=$(get_version_component_range 1-2 ${FOX_PV})
+
+# @ECLASS-VARIABLE: FOX_APPS
+# @INTERNAL
+# @DESCRIPTION:
+# The applications originally packaged in the FOX Toolkit
+FOX_APPS="adie calculator pathfinder shutterbug"
+FOX_CHART="chart"
+
+# @ECLASS-VARIABLE: FOXCONF
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Set this to add additional configuration options during src_configure
DESCRIPTION="C++ based Toolkit for developing Graphical User Interfaces easily and effectively"
HOMEPAGE="http://www.fox-toolkit.org/"
@@ -46,35 +68,19 @@
IUSE="debug doc profile"
-# from fox-1.0
-FOX_APPS="adie calculator pathfinder"
-# from fox-1.2+
-if [ "${FOXVER}" != "1.0" ] ; then
- FOX_APPS="${FOX_APPS} shutterbug"
- FOX_CHART="chart"
-fi
-
-if [ "${PN}" != fox ] ; then
+if [[ ${PN} != fox ]] ; then
FOX_COMPONENT="${FOX_COMPONENT:-${PN}}"
fi
-if [ "${FOXVER}" != "1.0" ] && [ -z "${FOX_COMPONENT}" ] ; then
+if [[ -z ${FOX_COMPONENT} ]] ; then
DOXYGEN_DEP="doc? ( app-doc/doxygen )"
fi
-if [ "${PN}" != reswrap ] ; then
+if [[ ${PN} != reswrap ]] ; then
RESWRAP_DEP="dev-util/reswrap"
fi
-# These versions are not compatible with new fox layout
-# and will cause collissions - we need to block them
-INCOMPAT_DEP="!<x11-libs/fox-1.0.53
- !=x11-libs/fox-1.2.4
- !~x11-libs/fox-1.2.6
- !=x11-libs/fox-1.4.11"
-
-DEPEND="${INCOMPAT_DEP}
- ${DOXYGEN_DEP}
+DEPEND="${DOXYGEN_DEP}
${RESWRAP_DEP}
=sys-devel/automake-1.4*
>=sys-apps/sed-4"
@@ -83,18 +89,18 @@
fox_src_unpack() {
unpack ${A}
- cd ${S}
-
- ebegin "Fixing configure"
+ cd "${S}"
- # Respect system CXXFLAGS
- sed -i -e 's:CXXFLAGS=""::' configure.in || die "sed configure.in error"
- touch aclocal.m4
- sed -i -e 's:CXXFLAGS=""::' configure || die "sed configure error"
+ hasq src_prepare ${FOX_EXPF} || fox_src_prepare
+}
- eend
+fox_src_prepare() {
+ # fox changed from configure.in to configure.am in 1.6.38
+ local confFile="configure.ac"
+ [[ -r "configure.in" ]] && confFile="configure.in"
- ebegin "Fixing Makefiles"
+ # Respect system CXXFLAGS
+ sed -i -e 's:CXXFLAGS=""::' $confFile || die "sed ${confFile} error"
# don't build apps from top-level (i.e. x11-libs/fox)
# utils == reswrap
@@ -110,61 +116,43 @@
# use the installed headers and library for apps
for d in ${FOX_APPS} ; do
- if version_is_at_least "1.6.34" ${PV} ; then
- sed -i \
- -e "s:-I\$(top_srcdir)/include -I\$(top_builddir)/include:-I\$(includedir)/fox${FOXVER_SUFFIX}:" \
- -e 's:$(top_builddir)/src/libFOX:-lFOX:' \
- -e 's:\.la::' \
- ${d}/Makefile.am || die "sed ${d}/Makefile.am error"
- else
- sed -i \
- -e "s:-I\$(top_srcdir)/include -I\$(top_builddir)/include:-I\$(includedir)/fox${FOXVER_SUFFIX}:" \
- -e 's:../src/libFOX:-lFOX:' \
- -e 's:\.la::' \
- ${d}/Makefile.am || die "sed ${d}/Makefile.am error"
- fi
+ sed -i \
+ -e "s:-I\$(top_srcdir)/include -I\$(top_builddir)/include:-I\$(includedir)/fox-${FOXVER}:" \
+ -e 's:$(top_builddir)/src/libFOX:-lFOX:' \
+ -e 's:\.la::' \
+ ${d}/Makefile.am || die "sed ${d}/Makefile.am error"
done
- # Upstream often has trouble with version number transitions
- if [ "${FOXVER}" == "1.5" ] ; then
- sed -i -e 's:1.4:1.5:g' chart/Makefile.am
- fi
-
- eend
+ eautoreconf
+}
- ebegin "Running automake"
- automake-1.4 -a -c || die "automake error"
- eend
+fox_src_configure() {
+ use debug && FOXCONF+=" --enable-debug" \
+ || FOXCONF+=" --enable-release"
- elibtoolize
+ econf ${FOXCONF} \
+ $(use_with profile profiling)
}
+
fox_src_compile() {
- local myconf
- use debug && myconf="${myconf} --enable-debug" \
- || myconf="${myconf} --enable-release"
-
- econf \
- ${FOXCONF} \
- ${myconf} \
- $(use_with profile profiling) \
- || die "configure error"
+ hasq src_configure ${FOX_EXPF} || fox_src_configure
- cd ${S}/${FOX_COMPONENT}
+ cd "${S}/${FOX_COMPONENT}"
emake || die "compile error"
# build class reference docs (FOXVER >= 1.2)
- if use doc && [ "${FOXVER}" != "1.0" ] && [ -z "${FOX_COMPONENT}" ] ; then
- cd ${S}/doc
+ if use doc && [[ -z ${FOX_COMPONENT} ]] ; then
+ cd "${S}/doc"
make docs || die "doxygen error"
fi
}
-fox_src_install () {
- cd ${S}/${FOX_COMPONENT}
+fox_src_install() {
+ cd "${S}/${FOX_COMPONENT}"
- make install \
- DESTDIR=${D} \
+ emake install \
+ DESTDIR="${D}" \
htmldir=/usr/share/doc/${PF}/html \
artdir=/usr/share/doc/${PF}/html/art \
screenshotsdir=/usr/share/doc/${PF}/html/screenshots \
@@ -195,18 +183,18 @@
done
# remove documentation if USE=-doc
- if ( ! use doc ) && [ -d ${D}/usr/share/doc/${PF}/html ] ; then
- rm -fr ${D}/usr/share/doc/${PF}/html
+ if ! use doc && [[ -d ${D}/usr/share/doc/${PF}/html ]] ; then
+ rm -fr "${D}/usr/share/doc/${PF}/html"
fi
- # install class reference docs (FOXVER >= 1.2) if USE=doc
- if use doc && [ "${FOXVER}" != "1.0" ] && [ -z "${FOX_COMPONENT}" ] ; then
- dohtml -r ${S}/doc/ref
+ # install class reference docs if USE=doc
+ if use doc && [[ -z ${FOX_COMPONENT} ]] ; then
+ dohtml -r "${S}/doc/ref"
fi
- # slot fox-config where present (FOXVER >= 1.2)
- if [ -f ${D}/usr/bin/fox-config ] ; then
- mv ${D}/usr/bin/fox-config ${D}/usr/bin/fox-${FOXVER}-config
+ # slot fox-config
+ if [[ -f ${D}/usr/bin/fox-config ]] ; then
+ mv "${D}/usr/bin/fox-config" "${D}/usr/bin/fox-${FOXVER}-config"
fi
}
@@ -220,17 +208,12 @@
einfo "(adie, calculator, pathfinder, shutterbug) are now available as"
einfo "separate ebuilds."
echo
- if [ "${FOXVER}" != "1.0" ] ; then
- einfo "The fox-config script has been installed as fox-${FOXVER}-config."
- einfo "The fox-wrapper package is used to direct calls to fox-config"
- einfo "to the correct versioned script, based on the WANT_FOX variable."
- einfo "For example:"
- einfo
- einfo " WANT_FOX=\"${FOXVER}\" fox-config <options>"
- einfo
- epause
- fi
+ einfo "The fox-config script has been installed as fox-${FOXVER}-config."
+ einfo "The fox-wrapper package is used to direct calls to fox-config"
+ einfo "to the correct versioned script, based on the WANT_FOX variable."
+ einfo "For example:"
+ einfo
+ einfo " WANT_FOX=\"${FOXVER}\" fox-config <options>"
+ einfo
fi
}
-
-EXPORT_FUNCTIONS src_unpack src_compile src_install pkg_postinst
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] RFC: fox.eclass update
2010-09-16 18:51 ` Matti Bickel
@ 2010-09-16 19:29 ` Mike Frysinger
2010-09-16 19:41 ` Peter Volkov
2010-09-16 20:24 ` Matti Bickel
0 siblings, 2 replies; 26+ messages in thread
From: Mike Frysinger @ 2010-09-16 19:29 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: Text/Plain, Size: 1045 bytes --]
On Thursday, September 16, 2010 14:51:39 Matti Bickel wrote:
> +# 1.6: 'x11-libs/fox:1.6'
> +# 1.7: '~x11-libs/fox-${PV}'
first line is using a tab while second is spaces. both should be tabs.
> FOX_PV="${FOX_PV:-${PV}}"
while you're here, i'd change to:
: ${FOX_PV:=${PV}}
> for d in ${FOX_APPS} ; do
your prepare func should declare 'd' as local
> + if use doc && [[ -z ${FOX_COMPONENT} ]] ; then
> + cd "${S}/doc"
> make docs || die "doxygen error"
> fi
should be `emake`, and better to use -C "${S}"/doc so that you dont change
$PWD on people
> + if ! use doc && [[ -d ${D}/usr/share/doc/${PF}/html ]] ; then
> + rm -fr "${D}/usr/share/doc/${PF}/html"
> fi
you dont really need the -d check as the -f option to rm will keep it from
warning on missing dirs
use doc || rm -rf "${D}"/usr/share/doc/${PF}/html
> + if [[ -f ${D}/usr/bin/fox-config ]] ; then
> + mv "${D}/usr/bin/fox-config" "${D}/usr/bin/fox-${FOXVER}-config"
> fi
seems like you would want || die here
-mike
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] RFC: fox.eclass update
2010-09-16 19:29 ` Mike Frysinger
@ 2010-09-16 19:41 ` Peter Volkov
2010-09-16 22:34 ` Mike Frysinger
2010-09-16 20:24 ` Matti Bickel
1 sibling, 1 reply; 26+ messages in thread
From: Peter Volkov @ 2010-09-16 19:41 UTC (permalink / raw
To: gentoo-dev
В Чтв, 16/09/2010 в 15:29 -0400, Mike Frysinger пишет:
>
> > FOX_PV="${FOX_PV:-${PV}}"
>
> while you're here, i'd change to:
> : ${FOX_PV:=${PV}}
Why? This looks less readable...
--
Peter.
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] RFC: fox.eclass update
2010-09-16 19:29 ` Mike Frysinger
2010-09-16 19:41 ` Peter Volkov
@ 2010-09-16 20:24 ` Matti Bickel
2010-09-16 22:33 ` Mike Frysinger
1 sibling, 1 reply; 26+ messages in thread
From: Matti Bickel @ 2010-09-16 20:24 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 271 bytes --]
On 09/16/2010 09:29 PM, Mike Frysinger wrote:
>> + if [[ -f ${D}/usr/bin/fox-config ]] ; then
>> + mv "${D}/usr/bin/fox-config" "${D}/usr/bin/fox-${FOXVER}-config"
>> fi
>
> seems like you would want || die here
Why? I can't imagine how that could fail.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] RFC: fox.eclass update
2010-09-16 20:24 ` Matti Bickel
@ 2010-09-16 22:33 ` Mike Frysinger
0 siblings, 0 replies; 26+ messages in thread
From: Mike Frysinger @ 2010-09-16 22:33 UTC (permalink / raw
To: gentoo-dev; +Cc: Matti Bickel
[-- Attachment #1: Type: Text/Plain, Size: 400 bytes --]
On Thursday, September 16, 2010 16:24:14 Matti Bickel wrote:
> On 09/16/2010 09:29 PM, Mike Frysinger wrote:
> >> + if [[ -f ${D}/usr/bin/fox-config ]] ; then
> >> + mv "${D}/usr/bin/fox-config" "${D}/usr/bin/fox-${FOXVER}-config"
> >>
> >> fi
> >
> > seems like you would want || die here
>
> Why? I can't imagine how that could fail.
then the `die` should never be called
-mike
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] RFC: fox.eclass update
2010-09-16 19:41 ` Peter Volkov
@ 2010-09-16 22:34 ` Mike Frysinger
2010-09-17 5:06 ` Peter Volkov
0 siblings, 1 reply; 26+ messages in thread
From: Mike Frysinger @ 2010-09-16 22:34 UTC (permalink / raw
To: gentoo-dev; +Cc: Peter Volkov
[-- Attachment #1: Type: Text/Plain, Size: 323 bytes --]
On Thursday, September 16, 2010 15:41:27 Peter Volkov wrote:
> В Чтв, 16/09/2010 в 15:29 -0400, Mike Frysinger пишет:
> > > FOX_PV="${FOX_PV:-${PV}}"
> >
> > while you're here, i'd change to:
> > : ${FOX_PV:=${PV}}
>
> Why? This looks less readable...
only because your eyes arent tuned to it
-mike
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] RFC: fox.eclass update
2010-09-16 22:34 ` Mike Frysinger
@ 2010-09-17 5:06 ` Peter Volkov
2010-09-17 5:24 ` Mike Frysinger
0 siblings, 1 reply; 26+ messages in thread
From: Peter Volkov @ 2010-09-17 5:06 UTC (permalink / raw
To: gentoo-dev
В Чтв, 16/09/2010 в 18:34 -0400, Mike Frysinger пишет:
> On Thursday, September 16, 2010 15:41:27 Peter Volkov wrote:
> > В Чтв, 16/09/2010 в 15:29 -0400, Mike Frysinger пишет:
> > > > FOX_PV="${FOX_PV:-${PV}}"
> > >
> > > while you're here, i'd change to:
> > > : ${FOX_PV:=${PV}}
> >
> > Why? This looks less readable...
>
> only because your eyes arent tuned to it
Instead of explicit variable assignment (what was intended) you suggest
to call `:` command and implicitly assign variable with bash parameter
expansion...
--
Peter.
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] RFC: fox.eclass update
2010-09-17 5:06 ` Peter Volkov
@ 2010-09-17 5:24 ` Mike Frysinger
0 siblings, 0 replies; 26+ messages in thread
From: Mike Frysinger @ 2010-09-17 5:24 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: Text/Plain, Size: 813 bytes --]
On Friday, September 17, 2010 01:06:19 Peter Volkov wrote:
> В Чтв, 16/09/2010 в 18:34 -0400, Mike Frysinger пишет:
> > On Thursday, September 16, 2010 15:41:27 Peter Volkov wrote:
> > > В Чтв, 16/09/2010 в 15:29 -0400, Mike Frysinger пишет:
> > > > > FOX_PV="${FOX_PV:-${PV}}"
> > > >
> > > > while you're here, i'd change to:
> > > > : ${FOX_PV:=${PV}}
> > >
> > > Why? This looks less readable...
> >
> > only because your eyes arent tuned to it
>
> Instead of explicit variable assignment (what was intended) you suggest
> to call `:` command and implicitly assign variable with bash parameter
> expansion...
what exactly is your point ? there is no performance difference. my style
suggestion however is significantly more compact and has no redundancy.
-mike
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] RFC: fox.eclass update
2010-09-16 18:32 ` Peter Volkov
2010-09-16 18:51 ` Matti Bickel
@ 2010-09-17 8:15 ` Michael Haubenwallner
1 sibling, 0 replies; 26+ messages in thread
From: Michael Haubenwallner @ 2010-09-17 8:15 UTC (permalink / raw
To: gentoo-dev
Must admit that I have no idea of what "fox" is at all, but:
On 09/16/2010 08:32 PM, Peter Volkov wrote:
> В Чтв, 16/09/2010 в 16:24 +0200, Matti Bickel пишет:
>> - elibtoolize
>> + eautoreconf
>
> Hm, is this change necessary?
The obvious reason for eautoreconf here is:
fox_src_prepare() updates configure.{ac,in} and Makefile.am's just before.
The non-obvious reason is:
Ebuilds may have to patch these files too for random (usually prefix) platforms.
Iff not eautoreconf but elibtoolize were done here, the ebuild would have to do the
eautoreconf itself, which doesn't work right now[1] when elibtoolize was called before.
[1] http://bugs.gentoo.org/show_bug.cgi?id=232820
/haubi/
--
Michael Haubenwallner
Gentoo on a different level
^ permalink raw reply [flat|nested] 26+ messages in thread
end of thread, other threads:[~2010-09-17 9:06 UTC | newest]
Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-12 12:41 [gentoo-dev] RFC: fox.eclass update Matti Bickel
2008-10-13 10:56 ` Petteri Räty
2008-10-13 17:20 ` Donnie Berkholz
2008-10-13 18:28 ` Matti Bickel
2008-10-14 13:20 ` Bo Ørsted Andresen
2009-02-08 22:06 ` Matti Bickel
2009-02-09 15:01 ` Peter Volkov
2009-02-09 18:22 ` Matti Bickel
2009-02-10 5:10 ` Nirbheek Chauhan
-- strict thread matches above, loose matches on Subject: below --
2010-09-16 13:31 Matti Bickel
2010-09-16 13:39 ` Tomáš Chvátal
2010-09-16 14:24 ` Matti Bickel
2010-09-16 14:41 ` Jeremy Olexa
2010-09-16 15:44 ` Jeroen Roovers
2010-09-16 17:38 ` Peter Volkov
2010-09-16 16:48 ` Matti Bickel
2010-09-16 18:32 ` Peter Volkov
2010-09-16 18:51 ` Matti Bickel
2010-09-16 19:29 ` Mike Frysinger
2010-09-16 19:41 ` Peter Volkov
2010-09-16 22:34 ` Mike Frysinger
2010-09-17 5:06 ` Peter Volkov
2010-09-17 5:24 ` Mike Frysinger
2010-09-16 20:24 ` Matti Bickel
2010-09-16 22:33 ` Mike Frysinger
2010-09-17 8:15 ` Michael Haubenwallner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox