net-libs/ldns: Remove py2.7
[gentoo.git] / net-libs / libtorrent / libtorrent-0.13.8.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit autotools toolchain-funcs
7
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"
11
12 LICENSE="GPL-2"
13
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
17 # subslot.
18 SLOT="0"
19
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 )"
23
24 RDEPEND="
25         sys-libs/zlib
26         ssl? (
27                 !libressl? ( dev-libs/openssl:0= )
28                 libressl? ( dev-libs/libressl:= )
29         )"
30 DEPEND="${RDEPEND}
31         virtual/pkgconfig
32         dev-util/cppunit"
33 # cppunit dependency - https://github.com/rakshasa/libtorrent/issues/182
34
35 src_configure() {
36         # bug 518582
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"
42         fi
43
44         # configure needs bash or script bombs out on some null shift, bug #291229
45         CONFIG_SHELL=${BASH} econf \
46                 --enable-aligned \
47                 $(use_enable debug) \
48                 $(use_enable ssl openssl) \
49                 ${disable_instrumentation} \
50                 --with-posix-fallocate \
51                 --with-zlib="${EROOT%/}/usr/"
52 }
53
54 src_install() {
55         default
56
57         find "${D}" -name '*.la' -delete
58 }