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 )"
26 >=dev-libs/libsigc++-2.2.2:2
28 !libressl? ( dev-libs/openssl:0= )
29 libressl? ( dev-libs/libressl:= )
36 "${FILESDIR}/${PN}-0001-Fix-the-DH-parameters-generation-with-OpenSSL-1.1.patch"
37 "${FILESDIR}/${PN}-openssl-1.1-part2.patch"
38 "${FILESDIR}/${PN}-openssl-1.1-part3.patch"
39 "${FILESDIR}/${PN}-0.13.7-kqueue-configure.patch"
40 "${FILESDIR}/${PN}-0.13.7-execinfo-configure.patch"
50 local disable_instrumentation
51 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
52 $(tc-getCC) ${CFLAGS} -o /dev/null -x c "${T}/sync_add_and_fetch.c" >/dev/null 2>&1
53 if [[ $? -ne 0 ]]; then
54 disable_instrumentation="--disable-instrumentation"
57 # configure needs bash or script bombs out on some null shift, bug #291229
58 CONFIG_SHELL=${BASH} econf \
61 $(use_enable ssl openssl) \
62 ${disable_instrumentation} \
63 --with-posix-fallocate \
64 --with-zlib="${EROOT%/}/usr/"
70 find "${D}" -name '*.la' -delete