FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo Development

 
 
LinkBack Thread Tools
 
Old 09-16-2010, 01:39 PM
Tomáš Chvátal
 
Default RFC: fox.eclass update

-----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-----
 
Old 09-16-2010, 02:24 PM
Matti Bickel
 
Default RFC: fox.eclass update

On 09/16/2010 03:31 PM, Matti Bickel wrote:
--
Now complete with attachments
# 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
}
 
Old 09-16-2010, 02:41 PM
Jeremy Olexa
 
Default RFC: fox.eclass update

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?)
 
Old 09-16-2010, 03:44 PM
Jeroen Roovers
 
Default RFC: fox.eclass update

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
 
Old 09-16-2010, 04:48 PM
Matti Bickel
 
Default RFC: fox.eclass update

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.
# 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
}
 
Old 09-16-2010, 05:09 PM
Jeremy Olexa
 
Default RFC: fox.eclass update

On Thu, 16 Sep 2010 17:44:00 +0200, Jeroen Roovers <jer@gentoo.org>
wrote:
> 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 ...

It is just extra (not needed) code. econf() has died by itself since
BEFORE 2005. git blame shows this commit:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;f=bin/ebuild.sh;h=d9fc4acc572c6647a4f27b838d35d27d805d19 0e

which is a migration commit into svn from cvs (without history) in
2005. So novelty or not, whatever, not needed. (Besides the numerous
threads about 'which helpers die by themself and not' - its easy to read
the code, esp bash)
-Jeremy
 
Old 09-16-2010, 05:38 PM
Peter Volkov
 
Default RFC: fox.eclass update

В Чтв, 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.
 
Old 09-16-2010, 06:32 PM
Peter Volkov
 
Default RFC: fox.eclass update

В Чтв, 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.
 
Old 09-16-2010, 06:51 PM
Matti Bickel
 
Default RFC: fox.eclass update

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.
# 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
}
 
Old 09-16-2010, 07:29 PM
Mike Frysinger
 
Default RFC: fox.eclass update

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
 

Thread Tools




All times are GMT. The time now is 05:25 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org