net-libs/ldns: Remove py2.7
[gentoo.git] / net-libs / libtorrent / libtorrent-0.13.7-r1.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         >=dev-libs/libsigc++-2.2.2:2
27         ssl? (
28             !libressl? ( dev-libs/openssl:0= )
29             libressl? ( dev-libs/libressl:= )
30         )"
31 DEPEND="${RDEPEND}
32         virtual/pkgconfig
33         dev-util/cppunit"
34
35 PATCHES=(
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"
41 )
42
43 src_prepare() {
44         default
45         eautoreconf
46 }
47
48 src_configure() {
49         # bug 518582
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"
55         fi
56
57         # configure needs bash or script bombs out on some null shift, bug #291229
58         CONFIG_SHELL=${BASH} econf \
59                 --enable-aligned \
60                 $(use_enable debug) \
61                 $(use_enable ssl openssl) \
62                 ${disable_instrumentation} \
63                 --with-posix-fallocate \
64                 --with-zlib="${EROOT%/}/usr/"
65 }
66
67 src_install() {
68         default
69
70         find "${D}" -name '*.la' -delete
71 }