diff options
author | 2015-08-08 13:49:04 -0700 | |
---|---|---|
committer | 2015-08-08 17:38:18 -0700 | |
commit | 56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch) | |
tree | 3f91093cdb475e565ae857f1c5a7fd339e2d781e /eclass/fox.eclass | |
download | gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2 gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip |
proj/gentoo: Initial commit
This commit represents a new era for Gentoo:
Storing the gentoo-x86 tree in Git, as converted from CVS.
This commit is the start of the NEW history.
Any historical data is intended to be grafted onto this point.
Creation process:
1. Take final CVS checkout snapshot
2. Remove ALL ChangeLog* files
3. Transform all Manifests to thin
4. Remove empty Manifests
5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$
5.1. Do not touch files with -kb/-ko keyword flags.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests
X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project
X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration
X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn
X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts
X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration
X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging
X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'eclass/fox.eclass')
-rw-r--r-- | eclass/fox.eclass | 230 |
1 files changed, 230 insertions, 0 deletions
diff --git a/eclass/fox.eclass b/eclass/fox.eclass new file mode 100644 index 000000000000..6ac04c205c15 --- /dev/null +++ b/eclass/fox.eclass @@ -0,0 +1,230 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +# @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|5) 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:=${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" + +# @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="ftp://ftp.fox-toolkit.org/pub/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-apps/sed-4" + +S="${WORKDIR}/fox-${FOX_PV}" + +fox_src_unpack() { + unpack ${A} + cd "${S}" + + has 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 strip binaries + sed -i -e '/LDFLAGS="-s ${LDFLAGS}"/d' $confFile || die "sed ${confFile} error" + + # don't build apps from top-level (i.e. x11-libs/fox) + # utils == reswrap + local d + 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} chart controlpanel tests ; do + [[ -d ${d} ]] && + (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:$(top_builddir)/lib/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() { + has 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 + emake -C "${S}"/doc 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 + use doc || rm -fr "${D}/usr/share/doc/${PF}/html" + + # 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" \ + || die "failed to install fox-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 + + if version_is_at_least "1.7.25"; then + einfo "Fox versions after 1.7.25 ships a pkg-config file called fox17.pc" + einfo "instead of the previous fox-config tool." + einfo "You now get all info via pkg-config:" + einfo + einfo "pkg-config fox17 --libs (etc.)" + else + 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>" + fi + einfo + fi +} |