2016-02-07 01:53:34 +01:00
|
|
|
# Copyright 1999-2016 Gentoo Foundation
|
2014-03-18 11:00:56 +01:00
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
2015-08-21 16:02:53 +02:00
|
|
|
# $Id$
|
2014-03-18 11:00:56 +01:00
|
|
|
|
|
|
|
EAPI="5"
|
|
|
|
|
2016-02-07 01:53:34 +01:00
|
|
|
inherit multilib toolchain-funcs linux-info scons-utils
|
2014-03-18 11:00:56 +01:00
|
|
|
|
|
|
|
if [[ ${PV} = "9999" ]] ; then
|
|
|
|
EGIT_REPO_URI="git://swift.im/swift"
|
|
|
|
inherit git-r3
|
|
|
|
KEYWORDS=""
|
|
|
|
else
|
|
|
|
RESTRICT="mirror"
|
|
|
|
SRC_URI="http://swift.im/downloads/releases/${P}/${P}.tar.gz"
|
|
|
|
KEYWORDS="~amd64 ~x86"
|
|
|
|
fi
|
|
|
|
|
|
|
|
DESCRIPTION="Your friendly chat client"
|
|
|
|
HOMEPAGE="http://swift.im/"
|
|
|
|
|
|
|
|
LICENSE="GPL-3"
|
|
|
|
SLOT="0"
|
2016-02-07 01:53:34 +01:00
|
|
|
IUSE="debug doc examples +expat qt5 ssl static-libs zeroconf"
|
2014-03-18 11:00:56 +01:00
|
|
|
|
|
|
|
RDEPEND="
|
2015-01-25 21:10:38 +01:00
|
|
|
dev-libs/boost:=
|
2014-03-18 11:00:56 +01:00
|
|
|
expat? ( dev-libs/expat )
|
|
|
|
!expat? ( dev-libs/libxml2 )
|
|
|
|
ssl? ( dev-libs/openssl )
|
|
|
|
zeroconf? ( net-dns/avahi )
|
2016-02-07 01:53:34 +01:00
|
|
|
dev-lang/lua
|
2014-03-18 11:00:56 +01:00
|
|
|
net-dns/libidn
|
2016-01-21 00:06:37 +01:00
|
|
|
net-dns/unbound
|
|
|
|
net-libs/ldns
|
|
|
|
net-libs/libnatpmp
|
|
|
|
net-libs/miniupnpc
|
2014-03-18 11:00:56 +01:00
|
|
|
sys-libs/zlib
|
2016-02-07 01:53:34 +01:00
|
|
|
qt5? (
|
2014-03-18 11:00:56 +01:00
|
|
|
x11-libs/libXScrnSaver
|
2016-02-07 01:53:34 +01:00
|
|
|
dev-qt/qtgui:5
|
|
|
|
dev-qt/qtwebkit:5
|
|
|
|
dev-qt/qtwidgets:5
|
|
|
|
dev-qt/qtmultimedia:5
|
|
|
|
dev-qt/qtx11extras:5
|
2014-03-18 11:00:56 +01:00
|
|
|
)
|
|
|
|
"
|
|
|
|
DEPEND="${RDEPEND}
|
|
|
|
doc? (
|
|
|
|
>=app-text/docbook-xsl-stylesheets-1.75
|
|
|
|
>=app-text/docbook-xml-dtd-4.5
|
|
|
|
dev-libs/libxslt
|
|
|
|
)
|
|
|
|
"
|
2016-02-07 15:09:02 +01:00
|
|
|
LANGS="ca de es fr gl he hu nl pl ru sk sv"
|
|
|
|
for X in ${LANGS} ; do
|
|
|
|
IUSE="${IUSE} linguas_${X}"
|
|
|
|
done
|
|
|
|
|
2014-03-18 11:00:56 +01:00
|
|
|
scons_targets=()
|
|
|
|
set_scons_targets() {
|
|
|
|
scons_targets=( Swiften )
|
2016-02-07 01:53:34 +01:00
|
|
|
use qt5 && scons_targets+=( Swift )
|
2014-03-18 11:00:56 +01:00
|
|
|
use zeroconf && scons_targets+=( Slimber )
|
|
|
|
use examples && scons_targets+=(
|
|
|
|
Documentation/SwiftenDevelopersGuide/Examples
|
|
|
|
Limber
|
|
|
|
Sluift
|
|
|
|
Swiften/Config
|
|
|
|
Swiften/Examples
|
|
|
|
Swiften/QA
|
|
|
|
SwifTools
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
scons_vars=()
|
|
|
|
set_scons_vars() {
|
|
|
|
scons_vars=(
|
|
|
|
V=1
|
|
|
|
allow_warnings=1
|
|
|
|
cc="$(tc-getCC)"
|
|
|
|
cxx="$(tc-getCXX)"
|
|
|
|
ccflags="${CXXFLAGS}"
|
|
|
|
linkflags="${LDFLAGS}"
|
|
|
|
qt="${S}/local-qt"
|
|
|
|
openssl="${EPREFIX}/usr"
|
|
|
|
docbook_xsl="${EPREFIX}/usr/share/sgml/docbook/xsl-stylesheets"
|
|
|
|
docbook_xml="${EPREFIX}/usr/share/sgml/docbook/xml-dtd-4.5"
|
|
|
|
$(use_scons debug)
|
|
|
|
$(use !static-libs && use_scons !static-libs swiften_dll)
|
|
|
|
$(use_scons ssl openssl)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
src_prepare() {
|
|
|
|
mkdir local-qt
|
2016-02-07 01:53:34 +01:00
|
|
|
ln -s "${EPREFIX}"/usr/$(get_libdir)/qt5 local-qt/lib || die
|
|
|
|
ln -s "${EPREFIX}"/usr/include/qt5 local-qt/include || die
|
2014-03-18 11:00:56 +01:00
|
|
|
|
|
|
|
cd 3rdParty || die
|
2016-02-07 01:53:34 +01:00
|
|
|
# TODO CppUnit
|
|
|
|
rm -r Boost DocBook Expat LCov Ldns LibIDN Lua LibMiniUPnPc LibNATPMP OpenSSL SCons SQLite Unbound ZLib || die
|
2014-03-18 11:00:56 +01:00
|
|
|
cd .. || die
|
|
|
|
|
|
|
|
for x in ${LANGS}; do
|
|
|
|
if use !linguas_${x}; then
|
|
|
|
rm -f Swift/Translations/swift_${x}.ts || die
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# Richard H. <chain@rpgfiction.net> (2012-03-29): SCons ignores us,
|
|
|
|
# just delete unneeded stuff!
|
|
|
|
if use !zeroconf; then
|
|
|
|
rm -rf Slumber || die
|
|
|
|
fi
|
|
|
|
|
|
|
|
if use !examples; then
|
|
|
|
rm -rf Documentation/SwiftenDevelopersGuide/Examples \
|
2014-03-19 04:59:10 +01:00
|
|
|
Limber \
|
|
|
|
Slimber \
|
|
|
|
Sluift \
|
|
|
|
Swiften/Examples \
|
2016-02-07 01:53:34 +01:00
|
|
|
Swiften/QA || die
|
2014-03-18 11:00:56 +01:00
|
|
|
fi
|
|
|
|
|
2016-02-07 01:53:34 +01:00
|
|
|
if use !qt5; then
|
2014-03-18 11:00:56 +01:00
|
|
|
rm -rf Swift || die
|
|
|
|
fi
|
|
|
|
|
|
|
|
sed -i BuildTools/SCons/Tools/qt4.py \
|
|
|
|
-e "s/linux2/linux${KV_MAJOR}/" \
|
|
|
|
|| die
|
|
|
|
}
|
|
|
|
|
|
|
|
src_compile() {
|
|
|
|
set_scons_targets
|
|
|
|
set_scons_vars
|
|
|
|
|
|
|
|
escons "${scons_vars[@]}" "${scons_targets[@]}"
|
|
|
|
}
|
|
|
|
|
|
|
|
src_test() {
|
|
|
|
set_scons_targets
|
|
|
|
set_scons_vars
|
|
|
|
|
|
|
|
escons "${scons_vars[@]}" test=unit QA
|
|
|
|
}
|
|
|
|
|
|
|
|
src_install() {
|
|
|
|
set_scons_targets
|
|
|
|
set_scons_vars
|
|
|
|
|
|
|
|
escons "${scons_vars[@]}" SWIFT_INSTALLDIR="${D}/usr" SWIFTEN_INSTALLDIR="${D}/usr" "${D}" "${scons_targets[@]}"
|
|
|
|
|
|
|
|
if use zeroconf ; then
|
|
|
|
newbin Slimber/Qt/slimber slimber-qt
|
|
|
|
newbin Slimber/CLI/slimber slimber-cli
|
|
|
|
fi
|
|
|
|
|
|
|
|
if use examples ; then
|
|
|
|
for i in EchoBot{1,2,3,4,5,6} EchoComponent ; do
|
|
|
|
newbin "Documentation/SwiftenDevelopersGuide/Examples/EchoBot/${i}" "${PN}-${i}"
|
|
|
|
done
|
|
|
|
|
|
|
|
dobin Limber/limber
|
|
|
|
dobin Sluift/sluift
|
|
|
|
dobin Swiften/Config/swiften-config
|
|
|
|
|
|
|
|
for i in BenchTool ConnectivityTest LinkLocalTool ParserTester SendFile SendMessage ; do
|
|
|
|
newbin "Swiften/Examples/${i}/${i}" "${PN}-${i}"
|
|
|
|
done
|
|
|
|
newbin Swiften/Examples/SendFile/ReceiveFile "${PN}-ReceiveFile"
|
|
|
|
use zeroconf && dobin Swiften/Examples/LinkLocalTool/LinkLocalTool
|
|
|
|
|
|
|
|
for i in ClientTest NetworkTest StorageTest TLSTest ; do
|
|
|
|
newbin "Swiften/QA/${i}/${i}" "${PN}-${i}"
|
|
|
|
done
|
|
|
|
|
|
|
|
newbin SwifTools/Idle/IdleQuerierTest/IdleQuerierTest ${PN}-IdleQuerierTest
|
|
|
|
fi
|
|
|
|
|
|
|
|
use doc && dohtml "Documentation/SwiftenDevelopersGuide/Swiften Developers Guide.html"
|
|
|
|
}
|