| 1 |
mabi |
1.16 |
# Copyright 1999-2012 Gentoo Foundation |
| 2 |
rphillips |
1.1 |
# Distributed under the terms of the GNU General Public License v2 |
| 3 |
axs |
1.17 |
# $Header: /var/cvsroot/gentoo-x86/eclass/fox.eclass,v 1.16 2012/08/13 15:54:08 mabi Exp $ |
| 4 |
rphillips |
1.1 |
|
| 5 |
mabi |
1.9 |
# @ECLASS: fox.eclass |
| 6 |
|
|
# @MAINTAINER: |
| 7 |
|
|
# mabi@gentoo.org |
| 8 |
|
|
# @BLURB: Functionality required the FOX Toolkit and it's applications |
| 9 |
|
|
# @DESCRIPTION: |
| 10 |
swegener |
1.4 |
# This eclass allows building SLOT-able FOX Toolkit installations |
| 11 |
|
|
# (x11-libs/fox: headers, libs, and docs), which are by design |
| 12 |
|
|
# parallel-installable, while installing only one version of the utils |
| 13 |
rphillips |
1.1 |
# (dev-util/reswrap) and apps (app-editors/adie, sci-calculators/calculator, |
| 14 |
|
|
# x11-misc/pathfinder, and x11-misc/shutterbug). |
| 15 |
|
|
# |
| 16 |
|
|
# Version numbering follows the kernel-style odd-even minor version |
| 17 |
swegener |
1.4 |
# designation. Even-number minor versions are API stable, which patch |
| 18 |
|
|
# releases aimed mostly at the library; apps generally won't need to be |
| 19 |
rphillips |
1.1 |
# bumped for a patch release. |
| 20 |
|
|
# |
| 21 |
swegener |
1.4 |
# Odd-number versions are development branches with their own SLOT and |
| 22 |
|
|
# are API unstable; changes are made to the apps, and likely need to be |
| 23 |
rphillips |
1.1 |
# bumped together with the library. |
| 24 |
|
|
# |
| 25 |
mabi |
1.6 |
# Here are sample [R]DEPENDs for the fox apps |
| 26 |
mabi |
1.9 |
# 1.6: 'x11-libs/fox:1.6' |
| 27 |
|
|
# 1.7: '~x11-libs/fox-${PV}' |
| 28 |
rphillips |
1.1 |
# |
| 29 |
mabi |
1.9 |
# EAPI phase trickery borrowed from enlightenment.eclass |
| 30 |
rphillips |
1.1 |
|
| 31 |
mabi |
1.9 |
inherit autotools versionator |
| 32 |
rphillips |
1.1 |
|
| 33 |
|
|
|
| 34 |
mabi |
1.9 |
FOX_EXPF="src_unpack src_compile src_install pkg_postinst" |
| 35 |
|
|
case "${EAPI:-0}" in |
| 36 |
axs |
1.17 |
2|3|4|5) FOX_EXPF+=" src_prepare src_configure" ;; |
| 37 |
mabi |
1.9 |
*) ;; |
| 38 |
|
|
esac |
| 39 |
|
|
EXPORT_FUNCTIONS ${FOX_EXPF} |
| 40 |
|
|
|
| 41 |
|
|
# @ECLASS-VARIABLE: FOX_PV |
| 42 |
|
|
# @DESCRIPTION: |
| 43 |
|
|
# The version of the FOX Toolkit provided or required by the package |
| 44 |
|
|
: ${FOX_PV:=${PV}} |
| 45 |
|
|
|
| 46 |
|
|
# @ECLASS-VARIABLE: FOXVER |
| 47 |
|
|
# @INTERNAL |
| 48 |
|
|
# @DESCRIPTION: |
| 49 |
|
|
# The major.minor version of FOX_PV, usually acts as $SLOT and is used in |
| 50 |
|
|
# building the applications |
| 51 |
|
|
FOXVER=$(get_version_component_range 1-2 ${FOX_PV}) |
| 52 |
|
|
|
| 53 |
|
|
# @ECLASS-VARIABLE: FOX_APPS |
| 54 |
|
|
# @INTERNAL |
| 55 |
|
|
# @DESCRIPTION: |
| 56 |
|
|
# The applications originally packaged in the FOX Toolkit |
| 57 |
|
|
FOX_APPS="adie calculator pathfinder shutterbug" |
| 58 |
|
|
|
| 59 |
|
|
# @ECLASS-VARIABLE: FOXCONF |
| 60 |
|
|
# @DEFAULT_UNSET |
| 61 |
|
|
# @DESCRIPTION: |
| 62 |
|
|
# Set this to add additional configuration options during src_configure |
| 63 |
rphillips |
1.1 |
|
| 64 |
|
|
DESCRIPTION="C++ based Toolkit for developing Graphical User Interfaces easily and effectively" |
| 65 |
|
|
HOMEPAGE="http://www.fox-toolkit.org/" |
| 66 |
bicatali |
1.13 |
SRC_URI="ftp://ftp.fox-toolkit.org/pub/fox-${FOX_PV}.tar.gz" |
| 67 |
rphillips |
1.1 |
|
| 68 |
|
|
IUSE="debug doc profile" |
| 69 |
|
|
|
| 70 |
mabi |
1.9 |
if [[ ${PN} != fox ]] ; then |
| 71 |
rphillips |
1.1 |
FOX_COMPONENT="${FOX_COMPONENT:-${PN}}" |
| 72 |
|
|
fi |
| 73 |
|
|
|
| 74 |
mabi |
1.9 |
if [[ -z ${FOX_COMPONENT} ]] ; then |
| 75 |
mabi |
1.7 |
DOXYGEN_DEP="doc? ( app-doc/doxygen )" |
| 76 |
rphillips |
1.1 |
fi |
| 77 |
|
|
|
| 78 |
mabi |
1.9 |
if [[ ${PN} != reswrap ]] ; then |
| 79 |
rphillips |
1.1 |
RESWRAP_DEP="dev-util/reswrap" |
| 80 |
|
|
fi |
| 81 |
|
|
|
| 82 |
mabi |
1.9 |
DEPEND="${DOXYGEN_DEP} |
| 83 |
rphillips |
1.1 |
${RESWRAP_DEP} |
| 84 |
|
|
>=sys-apps/sed-4" |
| 85 |
|
|
|
| 86 |
|
|
S="${WORKDIR}/fox-${FOX_PV}" |
| 87 |
|
|
|
| 88 |
|
|
fox_src_unpack() { |
| 89 |
|
|
unpack ${A} |
| 90 |
mabi |
1.9 |
cd "${S}" |
| 91 |
|
|
|
| 92 |
ssuominen |
1.12 |
has src_prepare ${FOX_EXPF} || fox_src_prepare |
| 93 |
mabi |
1.9 |
} |
| 94 |
rphillips |
1.1 |
|
| 95 |
mabi |
1.9 |
fox_src_prepare() { |
| 96 |
|
|
# fox changed from configure.in to configure.am in 1.6.38 |
| 97 |
|
|
local confFile="configure.ac" |
| 98 |
|
|
[[ -r "configure.in" ]] && confFile="configure.in" |
| 99 |
rphillips |
1.1 |
|
| 100 |
|
|
# Respect system CXXFLAGS |
| 101 |
mabi |
1.9 |
sed -i -e 's:CXXFLAGS=""::' $confFile || die "sed ${confFile} error" |
| 102 |
rphillips |
1.1 |
|
| 103 |
mabi |
1.10 |
# don't strip binaries |
| 104 |
|
|
sed -i -e '/LDFLAGS="-s ${LDFLAGS}"/d' $confFile || die "sed ${confFile} error" |
| 105 |
|
|
|
| 106 |
rphillips |
1.1 |
# don't build apps from top-level (i.e. x11-libs/fox) |
| 107 |
|
|
# utils == reswrap |
| 108 |
mabi |
1.9 |
local d |
| 109 |
rphillips |
1.1 |
for d in ${FOX_APPS} utils windows ; do |
| 110 |
|
|
sed -i -e "s:${d}::" Makefile.am || die "sed Makefile.am error" |
| 111 |
|
|
done |
| 112 |
|
|
|
| 113 |
|
|
# use the installed reswrap for everything else |
| 114 |
mabi |
1.10 |
for d in ${FOX_APPS} chart controlpanel tests ; do |
| 115 |
|
|
[[ -d ${d} ]] && |
| 116 |
|
|
(sed -i -e 's:$(top_builddir)/utils/reswrap:reswrap:' \ |
| 117 |
|
|
${d}/Makefile.am || die "sed ${d}/Makefile.am error") |
| 118 |
rphillips |
1.1 |
done |
| 119 |
|
|
|
| 120 |
|
|
# use the installed headers and library for apps |
| 121 |
|
|
for d in ${FOX_APPS} ; do |
| 122 |
mabi |
1.9 |
sed -i \ |
| 123 |
|
|
-e "s:-I\$(top_srcdir)/include -I\$(top_builddir)/include:-I\$(includedir)/fox-${FOXVER}:" \ |
| 124 |
|
|
-e 's:$(top_builddir)/src/libFOX:-lFOX:' \ |
| 125 |
mabi |
1.15 |
-e 's:$(top_builddir)/lib/libFOX:-lFOX:' \ |
| 126 |
mabi |
1.9 |
-e 's:\.la::' \ |
| 127 |
|
|
${d}/Makefile.am || die "sed ${d}/Makefile.am error" |
| 128 |
rphillips |
1.1 |
done |
| 129 |
|
|
|
| 130 |
mabi |
1.9 |
eautoreconf |
| 131 |
|
|
} |
| 132 |
rphillips |
1.1 |
|
| 133 |
mabi |
1.9 |
fox_src_configure() { |
| 134 |
|
|
use debug && FOXCONF+=" --enable-debug" \ |
| 135 |
|
|
|| FOXCONF+=" --enable-release" |
| 136 |
rphillips |
1.1 |
|
| 137 |
mabi |
1.9 |
econf ${FOXCONF} \ |
| 138 |
flameeyes |
1.11 |
$(use_with profile profiling) |
| 139 |
mabi |
1.9 |
} |
| 140 |
rphillips |
1.1 |
|
| 141 |
|
|
|
| 142 |
|
|
fox_src_compile() { |
| 143 |
ssuominen |
1.12 |
has src_configure ${FOX_EXPF} || fox_src_configure |
| 144 |
rphillips |
1.1 |
|
| 145 |
mabi |
1.9 |
cd "${S}/${FOX_COMPONENT}" |
| 146 |
rphillips |
1.1 |
emake || die "compile error" |
| 147 |
|
|
|
| 148 |
|
|
# build class reference docs (FOXVER >= 1.2) |
| 149 |
mabi |
1.9 |
if use doc && [[ -z ${FOX_COMPONENT} ]] ; then |
| 150 |
|
|
emake -C "${S}"/doc docs || die "doxygen error" |
| 151 |
rphillips |
1.1 |
fi |
| 152 |
|
|
} |
| 153 |
|
|
|
| 154 |
mabi |
1.9 |
fox_src_install() { |
| 155 |
|
|
cd "${S}/${FOX_COMPONENT}" |
| 156 |
rphillips |
1.1 |
|
| 157 |
mabi |
1.9 |
emake install \ |
| 158 |
|
|
DESTDIR="${D}" \ |
| 159 |
rphillips |
1.1 |
htmldir=/usr/share/doc/${PF}/html \ |
| 160 |
|
|
artdir=/usr/share/doc/${PF}/html/art \ |
| 161 |
|
|
screenshotsdir=/usr/share/doc/${PF}/html/screenshots \ |
| 162 |
|
|
|| die "install error" |
| 163 |
|
|
|
| 164 |
|
|
# create desktop menu items for apps |
| 165 |
|
|
case ${FOX_COMPONENT} in |
| 166 |
|
|
adie) |
| 167 |
|
|
newicon big_gif.gif adie.gif |
| 168 |
|
|
make_desktop_entry adie "Adie Text Editor" adie.gif |
| 169 |
|
|
;; |
| 170 |
|
|
calculator) |
| 171 |
|
|
newicon bigcalc.gif foxcalc.gif |
| 172 |
|
|
make_desktop_entry calculator "FOX Calculator" foxcalc.gif |
| 173 |
|
|
;; |
| 174 |
|
|
pathfinder) |
| 175 |
|
|
newicon iconpath.gif pathfinder.gif |
| 176 |
|
|
make_desktop_entry PathFinder "PathFinder" pathfinder.gif "FileManager" |
| 177 |
|
|
;; |
| 178 |
|
|
shutterbug) |
| 179 |
|
|
doicon shutterbug.gif |
| 180 |
|
|
make_desktop_entry shutterbug "ShutterBug" shutterbug.gif "Graphics" |
| 181 |
|
|
;; |
| 182 |
|
|
esac |
| 183 |
|
|
|
| 184 |
|
|
for doc in ADDITIONS AUTHORS LICENSE_ADDENDUM README TRACING ; do |
| 185 |
|
|
[ -f $doc ] && dodoc $doc |
| 186 |
|
|
done |
| 187 |
|
|
|
| 188 |
|
|
# remove documentation if USE=-doc |
| 189 |
mabi |
1.9 |
use doc || rm -fr "${D}/usr/share/doc/${PF}/html" |
| 190 |
rphillips |
1.1 |
|
| 191 |
mabi |
1.9 |
# install class reference docs if USE=doc |
| 192 |
|
|
if use doc && [[ -z ${FOX_COMPONENT} ]] ; then |
| 193 |
|
|
dohtml -r "${S}/doc/ref" |
| 194 |
rphillips |
1.1 |
fi |
| 195 |
|
|
|
| 196 |
mabi |
1.9 |
# slot fox-config |
| 197 |
|
|
if [[ -f ${D}/usr/bin/fox-config ]] ; then |
| 198 |
|
|
mv "${D}/usr/bin/fox-config" "${D}/usr/bin/fox-${FOXVER}-config" \ |
| 199 |
|
|
|| die "failed to install fox-config" |
| 200 |
rphillips |
1.1 |
fi |
| 201 |
|
|
} |
| 202 |
|
|
|
| 203 |
|
|
fox_pkg_postinst() { |
| 204 |
swegener |
1.4 |
if [ -z "${FOX_COMPONENT}" ] ; then |
| 205 |
rphillips |
1.1 |
echo |
| 206 |
|
|
einfo "Multiple versions of the FOX Toolkit library may now be installed" |
| 207 |
|
|
einfo "in parallel SLOTs on the same system." |
| 208 |
|
|
einfo |
| 209 |
|
|
einfo "The reswrap utility and the applications included in the FOX Toolkit" |
| 210 |
|
|
einfo "(adie, calculator, pathfinder, shutterbug) are now available as" |
| 211 |
|
|
einfo "separate ebuilds." |
| 212 |
|
|
echo |
| 213 |
mabi |
1.16 |
|
| 214 |
|
|
if version_is_at_least "1.7.25"; then |
| 215 |
|
|
einfo "Fox versions after 1.7.25 ships a pkg-config file called fox17.pc" |
| 216 |
|
|
einfo "instead of the previous fox-config tool." |
| 217 |
|
|
einfo "You now get all info via pkg-config:" |
| 218 |
|
|
einfo |
| 219 |
|
|
einfo "pkg-config fox17 --libs (etc.)" |
| 220 |
|
|
else |
| 221 |
|
|
einfo "The fox-config script has been installed as fox-${FOXVER}-config." |
| 222 |
|
|
einfo "The fox-wrapper package is used to direct calls to fox-config" |
| 223 |
|
|
einfo "to the correct versioned script, based on the WANT_FOX variable." |
| 224 |
|
|
einfo "For example:" |
| 225 |
|
|
einfo |
| 226 |
|
|
einfo " WANT_FOX=\"${FOXVER}\" fox-config <options>" |
| 227 |
|
|
fi |
| 228 |
mabi |
1.9 |
einfo |
| 229 |
rphillips |
1.1 |
fi |
| 230 |
|
|
} |