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

123 lines
2.6 KiB
Bash
Raw Normal View History

2016-04-04 11:35:50 +02:00
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI="6"
inherit scons-utils toolchain-funcs linux-info
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"
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 de es fr gl he hu nl pl ru sk sv"
for X in ${LANGS} ; do
2016-06-23 13:08:16 +02:00
IUSE="${IUSE} l10n_${X}"
2016-04-04 11:35:50 +02:00
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 -rf 3rdparty || die
for x in ${LANGS}; do
2016-06-23 13:08:16 +02:00
if use !l10n_${x}; then
2016-04-04 11:35:50 +02:00
rm -f Swift/Translations/swift_${x}.ts || die
fi
done
if use !zeroconf; then
rm -rf Slumber || die
fi
rm -rf Swift || die
sed -i BuildTools/SCons/Tools/qt4.py \
-e "s/linux2/linux${KV_MAJOR}/" \
|| 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"
}