gentoo/net-im/swift/swift-9999.ebuild

121 lines
2.6 KiB
Bash

# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI="6"
inherit scons-utils toolchain-funcs
if [[ ${PV} = "9999" ]] ; then
EGIT_REPO_URI="git://swift.im/swift"
EGIT_COMMIT="c82f95fd431e702137d5f2e3dda4cf0ae424e837"
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"
IUSE="debug doc +expat gconf icu static-libs test upnp zeroconf"
# TODO: Swiften deps: qt, ldns, unbound. Sluift: lua,
RDEPEND="dev-libs/boost:=
dev-libs/openssl:0
net-dns/libidn
sys-libs/zlib
zeroconf? ( net-dns/avahi )
expat? ( dev-libs/expat )
!expat? ( dev-libs/libxml2 )
gconf? ( gnome-base/gconf dev-libs/glib:2 )
icu? ( dev-libs/icu:= )
upnp? ( net-libs/libnatpmp net-libs/miniupnpc:= )"
DEPEND="${RDEPEND}
doc? (
>=app-text/docbook-xsl-stylesheets-1.75
>=app-text/docbook-xml-dtd-4.5
dev-libs/libxslt
)"
LANGS="ca cs de es fr gl he hu nl pl ru sk sv"
for X in ${LANGS} ; do
IUSE="${IUSE} l10n_${X}"
done
scons_targets=()
set_scons_targets() {
scons_targets=( Swiften )
use zeroconf && scons_targets+=( Slimber )
}
src_prepare() {
# remove all bundled packages to ensure
# consistency of headers and linked libraries
rm -r 3rdParty || die
for x in ${LANGS}; do
if use !l10n_${x}; then
rm Swift/Translations/swift_${x}.ts || die
fi
done
if use !zeroconf; then
rm -r Slimber || die
fi
rm -r Swift || die
eapply_user
}
src_configure() {
MYSCONS=(
cc="$(tc-getCC)"
cxx="$(tc-getCXX)"
ccflags="${CFLAGS}"
cxxflags="${CXXFLAGS}"
link="$(tc-getCXX)"
linkflags="${LDFLAGS}"
ar="$(tc-getAR)"
swiften_dll=$(usex static-libs false true)
zlib_includedir=/usr/include
zlib_libdir=/$(get_libdir)
{boost,libidn,zlib}_bundled_enable=false
icu=$(usex icu true false)
try_avahi=$(usex zeroconf true false)
try_gconf=$(usex gconf true false)
try_expat=$(usex expat true false)
try_libxml=$(usex expat false true)
experimental_ft=$(usex upnp true false)
)
}
src_compile() {
set_scons_targets
escons V=1 "${MYSCONS[@]}" "${scons_targets[@]}"
}
src_test() {
set_scons_targets
escons "${MYSCONS[@]}" test=unit QA
}
src_install() {
set_scons_targets
escons "${MYSCONS[@]}" 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
use doc && dohtml "Documentation/SwiftenDevelopersGuide/Swiften Developers Guide.html"
}