1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit autotools toolchain-funcs
8 DESCRIPTION="BitTorrent library written in C++ for *nix"
9 HOMEPAGE="https://rakshasa.github.io/rtorrent/"
10 SRC_URI="http://rtorrent.net/downloads/${P}.tar.gz"
14 # The README says that the library ABI is not yet stable and dependencies on
15 # the library should be an explicit, syncronized version until the library
16 # has had more time to mature. Until it matures we should not include a soname
20 KEYWORDS="amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris"
21 IUSE="debug libressl ssl test"
22 RESTRICT="!test? ( test )"
27 !libressl? ( dev-libs/openssl:0= )
28 libressl? ( dev-libs/libressl:= )
33 # cppunit dependency - https://github.com/rakshasa/libtorrent/issues/182
37 local disable_instrumentation
38 echo -e "#include <inttypes.h>\nint main(){ int64_t var = 7; __sync_add_and_fetch(&var, 1); return 0;}" > "${T}/sync_add_and_fetch.c" || die
39 $(tc-getCC) ${CFLAGS} -o /dev/null -x c "${T}/sync_add_and_fetch.c" >/dev/null 2>&1
40 if [[ $? -ne 0 ]]; then
41 disable_instrumentation="--disable-instrumentation"
44 # configure needs bash or script bombs out on some null shift, bug #291229
45 CONFIG_SHELL=${BASH} econf \
48 $(use_enable ssl openssl) \
49 ${disable_instrumentation} \
50 --with-posix-fallocate \
51 --with-zlib="${EROOT%/}/usr/"
57 find "${D}" -name '*.la' -delete