[gentoo-commits] repo/gentoo:master commit in: net-libs/libtorrent/files/, net-libs/libtorrent/

2022-07-02 Thread David Seifert
commit: 2d473b12ad24cbcd94edc07dcbbb5a0f57d6d8a8
Author: David Seifert  gentoo  org>
AuthorDate: Sat Jul  2 13:15:58 2022 +
Commit: David Seifert  gentoo  org>
CommitDate: Sat Jul  2 13:15:58 2022 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2d473b12

net-libs/libtorrent: [QA] update EAPI 6 -> 8

Closes: https://bugs.gentoo.org/740698
Closes: https://bugs.gentoo.org/836085
Signed-off-by: David Seifert  gentoo.org>

 .../files/libtorrent-0.13.8-sysroot.patch  | 33 ++
 13.8-r1.ebuild => libtorrent-0.13.8-r2.ebuild} | 30 +++-
 2 files changed, 49 insertions(+), 14 deletions(-)

diff --git a/net-libs/libtorrent/files/libtorrent-0.13.8-sysroot.patch 
b/net-libs/libtorrent/files/libtorrent-0.13.8-sysroot.patch
new file mode 100644
index ..9f696c01ef61
--- /dev/null
+++ b/net-libs/libtorrent/files/libtorrent-0.13.8-sysroot.patch
@@ -0,0 +1,33 @@
+--- a/configure.ac
 b/configure.ac
+@@ -43,7 +43,6 @@
+ TORRENT_ENABLE_INTERRUPT_SOCKET
+ 
+ TORRENT_ENABLE_ARCH
+-TORRENT_WITH_SYSROOT
+ 
+ dnl TORRENT_WITH_XFS
+ TORRENT_WITHOUT_KQUEUE
+@@ -59,8 +58,7 @@
+ CC_ATTRIBUTE_VISIBILITY
+ 
+ AX_PTHREAD
+-AX_CHECK_ZLIB
+-
++PKG_CHECK_MODULES([ZLIB], [zlib])
+ PKG_CHECK_MODULES([CPPUNIT], [cppunit],, [no_cppunit="yes"])
+ 
+ CFLAGS="$PTHREAD_CFLAGS $CPPUNIT_CFLAGS $CFLAGS"
+--- a/src/torrent/utils/Makefile.am
 b/src/torrent/utils/Makefile.am
+@@ -23,8 +23,9 @@
+   thread_interrupt.h \
+   uri_parser.cc \
+   uri_parser.h
++libsub_torrentutils_la_LIBADD = $(ZLIB_LIBS)
+ 
+-AM_CPPFLAGS = -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../.. -I$(top_srcdir)
++AM_CPPFLAGS = -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../.. -I$(top_srcdir) 
$(ZLIB_CFLAGS)
+ 
+ libtorrentincludedir = $(includedir)/torrent/utils
+ libtorrentinclude_HEADERS = \

diff --git a/net-libs/libtorrent/libtorrent-0.13.8-r1.ebuild 
b/net-libs/libtorrent/libtorrent-0.13.8-r2.ebuild
similarity index 80%
rename from net-libs/libtorrent/libtorrent-0.13.8-r1.ebuild
rename to net-libs/libtorrent/libtorrent-0.13.8-r2.ebuild
index 5d3d38cc3667..5bb36208d46b 100644
--- a/net-libs/libtorrent/libtorrent-0.13.8-r1.ebuild
+++ b/net-libs/libtorrent/libtorrent-0.13.8-r2.ebuild
@@ -1,35 +1,37 @@
 # Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=6
+EAPI=8
 
-inherit toolchain-funcs
+inherit autotools toolchain-funcs
 
 DESCRIPTION="BitTorrent library written in C++ for *nix"
 HOMEPAGE="https://rakshasa.github.io/rtorrent/;
 SRC_URI="http://rtorrent.net/downloads/${P}.tar.gz;
 
 LICENSE="GPL-2"
-
 # The README says that the library ABI is not yet stable and dependencies on
 # the library should be an explicit, syncronized version until the library
 # has had more time to mature. Until it matures we should not include a soname
 # subslot.
 SLOT="0"
-
 KEYWORDS="amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~sparc x86 
~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~x64-solaris"
-IUSE="debug ssl test"
-RESTRICT="!test? ( test )"
+IUSE="debug ssl"
 
 # cppunit dependency - https://github.com/rakshasa/libtorrent/issues/182
 RDEPEND="
dev-util/cppunit:=
sys-libs/zlib
-   ssl? (
-   dev-libs/openssl:0=
-   )"
-DEPEND="${RDEPEND}
-   virtual/pkgconfig"
+   ssl? ( dev-libs/openssl:= )"
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=( "${FILESDIR}"/${PN}-0.13.8-sysroot.patch )
+
+src_prepare() {
+   default
+   eautoreconf
+}
 
 src_configure() {
# bug 518582
@@ -37,6 +39,7 @@ src_configure() {
echo -e "#include \nint main(){ int64_t var = 7; 
__sync_add_and_fetch(, 1); return 0;}" > "${T}/sync_add_and_fetch.c" || die
$(tc-getCC) ${CFLAGS} -o /dev/null -x c "${T}/sync_add_and_fetch.c" 
>/dev/null 2>&1
if [[ $? -ne 0 ]]; then
+   einfo "Disabling instrumentation"
disable_instrumentation="--disable-instrumentation"
fi
 
@@ -46,12 +49,11 @@ src_configure() {
$(use_enable debug) \
$(use_enable ssl openssl) \
${disable_instrumentation} \
-   --with-posix-fallocate \
-   --with-zlib="${EROOT%/}/usr/"
+   --with-posix-fallocate
 }
 
 src_install() {
default
 
-   find "${D}" -name '*.la' -delete
+   find "${ED}" -type f -name '*.la' -delete || die
 }



[gentoo-commits] repo/gentoo:master commit in: net-libs/libtorrent/files/, net-libs/libtorrent/

2018-08-10 Thread Jason Zaman
commit: e50ffcc2e188a03aab940c28a5621f166c786a99
Author: Stephen Shkardoon  ss23  geek  nz>
AuthorDate: Fri Aug 10 08:38:45 2018 +
Commit: Jason Zaman  gentoo  org>
CommitDate: Fri Aug 10 09:00:49 2018 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e50ffcc2

net-libs/libtorrent: remove old version 0.13.6.*

Package-Manager: Portage-2.3.40, Repoman-2.3.9

 net-libs/libtorrent/Manifest   |  1 -
 net-libs/libtorrent/files/libtorrent-cppunit.patch | 36 ---
 net-libs/libtorrent/libtorrent-0.13.6-r1.ebuild| 61 ---
 net-libs/libtorrent/libtorrent-0.13.6-r2.ebuild| 69 --
 net-libs/libtorrent/libtorrent-0.13.6.ebuild   | 52 
 5 files changed, 219 deletions(-)

diff --git a/net-libs/libtorrent/Manifest b/net-libs/libtorrent/Manifest
index edb5f26ca27..400d43d513e 100644
--- a/net-libs/libtorrent/Manifest
+++ b/net-libs/libtorrent/Manifest
@@ -1,2 +1 @@
-DIST libtorrent-0.13.6.tar.gz 781253 BLAKE2B 
f5293309b0e6b64a3659ea839528f94b346e1698f6892383b11f30b6d10d161d88582159ac9f4b1864d47e5f8c84cb3830376dde531d84c47327e7c342c75bbb
 SHA512 
b8aea4060357a8a40d15d42f1f698ef6f3ebdc885000bfbfa5bf9c81af8c88b5503a107e05c214e3e8489126928d336356c5e7e0eaf836b6b84a3cf74633b050
 DIST libtorrent-0.13.7.tar.gz 782854 BLAKE2B 
940e6162567d391f3d05034bf6d7d55a40070da7e2fd3279b1aa6acd169ca2783e7a2040efc472285f918c434e74380ec40fcddb823871ecf441c85670b9f273
 SHA512 
7bf3e87dbd19eb4e6806dff8a01c3ec61ea960bbd809d4bcbee96a46e169f97d0baf0fc85ab4a1efbbab07850e9b1060bae46c453ea6c42f5c23f8d921295efb

diff --git a/net-libs/libtorrent/files/libtorrent-cppunit.patch 
b/net-libs/libtorrent/files/libtorrent-cppunit.patch
deleted file mode 100644
index eed21733b29..000
--- a/net-libs/libtorrent/files/libtorrent-cppunit.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From b8b24b58a9bed6db1c886ea71a9bb407fb41fc2f Mon Sep 17 00:00:00 2001
-From: rakshasa 
-Date: Sun, 23 Oct 2016 08:54:11 +0900
-Subject: [PATCH] Use pkg-config for cppunit.
-

- configure.ac | 9 +
- 1 file changed, 5 insertions(+), 4 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index 2b3eb7ab..65e34872 100644
 a/configure.ac
-+++ b/configure.ac
-@@ -19,7 +19,6 @@ AC_SUBST(LIBTORRENT_INTERFACE_VERSION_NO)
- 
- AM_INIT_AUTOMAKE
- AC_CONFIG_HEADERS(config.h)
--AM_PATH_CPPUNIT(1.9.6)
- 
- AC_PROG_CXX
- 
-@@ -60,9 +59,11 @@ CC_ATTRIBUTE_VISIBILITY
- AX_PTHREAD
- AX_CHECK_ZLIB
- 
--CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
--CXXFLAGS="$PTHREAD_CFLAGS $CXXFLAGS"
--LIBS="$PTHREAD_LIBS $LIBS"
-+PKG_CHECK_MODULES([CPPUNIT], [cppunit],, [no_cppunit="yes"])
-+
-+CFLAGS="$PTHREAD_CFLAGS $CPPUNIT_CFLAGS $CFLAGS"
-+CXXFLAGS="$PTHREAD_CFLAGS $CPPUNIT_CFLAGS $CXXFLAGS"
-+LIBS="$PTHREAD_LIBS $CPPUNIT_LIBS $LIBS"
- 
- AC_ARG_ENABLE(openssl,
-   [  --disable-openssl   Don't use OpenSSL's SHA1 implementation.],

diff --git a/net-libs/libtorrent/libtorrent-0.13.6-r1.ebuild 
b/net-libs/libtorrent/libtorrent-0.13.6-r1.ebuild
deleted file mode 100644
index 402b6608920..000
--- a/net-libs/libtorrent/libtorrent-0.13.6-r1.ebuild
+++ /dev/null
@@ -1,61 +0,0 @@
-# Copyright 1999-2018 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=5
-
-inherit eutils libtool toolchain-funcs
-
-DESCRIPTION="BitTorrent library written in C++ for *nix"
-HOMEPAGE="https://rakshasa.github.io/rtorrent/;
-SRC_URI="http://rtorrent.net/downloads/${P}.tar.gz;
-
-LICENSE="GPL-2"
-
-# The README says that the library ABI is not yet stable and dependencies on
-# the library should be an explicit, syncronized version until the library
-# has had more time to mature. Until it matures we should not include a soname
-# subslot.
-SLOT="0"
-
-KEYWORDS="amd64 ~arm ~hppa ~ia64 ppc ppc64 sparc x86 ~x86-fbsd ~amd64-linux 
~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris 
~x64-solaris"
-IUSE="debug ipv6 libressl ssl test"
-
-RDEPEND="
-   sys-libs/zlib
-   >=dev-libs/libsigc++-2.2.2:2
-   ssl? (
-   !libressl? ( \nint main(){ int64_t var = 7; 
__sync_add_and_fetch(, 1); return 0;}" > "${T}/sync_add_and_fetch.c" || die
-   $(tc-getCC) ${CFLAGS} -o /dev/null -x c "${T}/sync_add_and_fetch.c" 
>/dev/null 2>&1
-   if [[ $? -ne 0 ]]; then
-   disable_instrumentation="--disable-instrumentation"
-   fi
-
-   # configure needs bash or script bombs out on some null shift, bug 
#291229
-   CONFIG_SHELL=${BASH} econf \
-   --enable-aligned \
-   $(use_enable debug) \
-   $(use_enable ipv6) \
-   $(use_enable ssl openssl) \
-   ${disable_instrumentation} \
-   --with-posix-fallocate
-}
-
-src_install() {
-   default
-
-   prune_libtool_files --all
-}

diff --git a/net-libs/libtorrent/libtorrent-0.13.6-r2.ebuild 
b/net-libs/libtorrent/libtorrent-0.13.6-r2.ebuild
deleted file mode 100644
index 52019c36aa2..000

[gentoo-commits] repo/gentoo:master commit in: net-libs/libtorrent/files/, net-libs/libtorrent/

2018-05-20 Thread Jason Zaman
commit: c02b0a1017107506f92c6f705bf2b5c9bcada806
Author: Stephen Shkardoon  ss23  geek  nz>
AuthorDate: Sun May 20 07:42:12 2018 +
Commit: Jason Zaman  gentoo  org>
CommitDate: Sun May 20 13:45:46 2018 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c02b0a10

net-libs/libtorrent: support openssl-1.1

Closes: https://bugs.gentoo.org/655696

Package-Manager: Portage-2.3.24, Repoman-2.3.6

 ...DH-parameters-generation-with-OpenSSL-1.1.patch | 105 +
 net-libs/libtorrent/files/libtorrent-cppunit.patch |  36 +++
 .../files/libtorrent-openssl-1.1-part2.patch   |  57 +++
 .../files/libtorrent-openssl-1.1-part3.patch   |  68 +
 net-libs/libtorrent/libtorrent-0.13.6-r2.ebuild|  69 ++
 5 files changed, 335 insertions(+)

diff --git 
a/net-libs/libtorrent/files/libtorrent-0001-Fix-the-DH-parameters-generation-with-OpenSSL-1.1.patch
 
b/net-libs/libtorrent/files/libtorrent-0001-Fix-the-DH-parameters-generation-with-OpenSSL-1.1.patch
new file mode 100644
index 000..55d0cb901b7
--- /dev/null
+++ 
b/net-libs/libtorrent/files/libtorrent-0001-Fix-the-DH-parameters-generation-with-OpenSSL-1.1.patch
@@ -0,0 +1,105 @@
+From 4607bbf78040789dee29266878ce109136b984ef Mon Sep 17 00:00:00 2001
+From: rakshasa 
+Date: Tue, 20 Dec 2016 19:51:02 +0900
+Subject: [PATCH] Added support for openssl 1.1.
+
+---
+ configure.ac|  4 
+ src/utils/diffie_hellman.cc | 36 ++--
+ 2 files changed, 38 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 65e34872..27e33570 100644
+--- a/configure.ac
 b/configure.ac
+@@ -69,12 +69,15 @@ AC_ARG_ENABLE(openssl,
+   [  --disable-openssl   Don't use OpenSSL's SHA1 implementation.],
+   [
+ if test "$enableval" = "yes"; then
++dnl move to scripts.
+   PKG_CHECK_MODULES(OPENSSL, libcrypto,
+ CXXFLAGS="$CXXFLAGS $OPENSSL_CFLAGS";
+ LIBS="$LIBS $OPENSSL_LIBS")
+ 
+   AC_DEFINE(USE_OPENSSL, 1, Using OpenSSL.)
+   AC_DEFINE(USE_OPENSSL_SHA, 1, Using OpenSSL's SHA1 implementation.)
++  AC_CHECK_LIB([crypto], [DH_set0_pqg], [AC_DEFINE(USE_OPENSSL_1_1, 1, 
Using OpenSSL 1.1.)])
++
+ else
+   AC_DEFINE(USE_NSS_SHA, 1, Using Mozilla's SHA1 implementation.)
+ fi
+@@ -85,6 +88,7 @@ AC_ARG_ENABLE(openssl,
+ 
+ AC_DEFINE(USE_OPENSSL, 1, Using OpenSSL.)
+ AC_DEFINE(USE_OPENSSL_SHA, 1, Using OpenSSL's SHA1 implementation.)
++AC_CHECK_LIB([crypto], [DH_set0_pqg], [AC_DEFINE(USE_OPENSSL_1_1, 1, 
Using OpenSSL 1.1.)])
+   ]
+ )
+ 
+diff --git a/src/utils/diffie_hellman.cc b/src/utils/diffie_hellman.cc
+index aa653d45..7ec13165 100644
+--- a/src/utils/diffie_hellman.cc
 b/src/utils/diffie_hellman.cc
+@@ -54,11 +54,23 @@ DiffieHellman::DiffieHellman(const unsigned char *prime, 
int primeLength,
+   m_secret(NULL), m_size(0) {
+ 
+ #ifdef USE_OPENSSL
++
+   m_dh = DH_new();
++
++#ifdef USE_OPENSSL_1_1
++  BIGNUM * const dh_p = BN_bin2bn(prime, primeLength, NULL);
++  BIGNUM * const dh_g = BN_bin2bn(generator, generatorLength, NULL);
++
++  if (dh_p == NULL || dh_g == NULL ||
++  !DH_set0_pqg(m_dh, dh_p, NULL, dh_g))
++throw internal_error("Could not generate Diffie-Hellman parameters");
++#else
+   m_dh->p = BN_bin2bn(prime, primeLength, NULL);
+   m_dh->g = BN_bin2bn(generator, generatorLength, NULL);
++#endif
+ 
+   DH_generate_key(m_dh);
++
+ #else
+   throw internal_error("Compiled without encryption support.");
+ #endif
+@@ -74,7 +86,19 @@ DiffieHellman::~DiffieHellman() {
+ bool
+ DiffieHellman::is_valid() const {
+ #ifdef USE_OPENSSL
++  if (m_dh == NULL)
++return false;
++
++#ifdef USE_OPENSSL_1_1
++  const BIGNUM *pub_key;
++
++  DH_get0_key(m_dh, _key, NULL);
++
++  return pub_key != NULL;
++#else
+   return m_dh != NULL && m_dh->pub_key != NULL;
++#endif
++
+ #else
+   return false;
+ #endif
+@@ -103,8 +127,16 @@ DiffieHellman::store_pub_key(unsigned char* dest, 
unsigned int length) {
+ #ifdef USE_OPENSSL
+   std::memset(dest, 0, length);
+ 
+-  if ((int)length >= BN_num_bytes(m_dh->pub_key))
+-BN_bn2bin(m_dh->pub_key, dest + length - BN_num_bytes(m_dh->pub_key));
++  const BIGNUM *pub_key;
++
++#ifdef USE_OPENSSL_1_1
++  DH_get0_key(m_dh, _key, NULL);
++#else
++  pub_key = m_dh->pub_key;
++#endif
++
++  if ((int)length >= BN_num_bytes(pub_key))
++BN_bn2bin(pub_key, dest + length - BN_num_bytes(pub_key));
+ #endif
+ }
+ 

diff --git a/net-libs/libtorrent/files/libtorrent-cppunit.patch 
b/net-libs/libtorrent/files/libtorrent-cppunit.patch
new file mode 100644
index 000..eed21733b29
--- /dev/null
+++ b/net-libs/libtorrent/files/libtorrent-cppunit.patch
@@ -0,0 +1,36 @@
+From b8b24b58a9bed6db1c886ea71a9bb407fb41fc2f Mon Sep 17 00:00:00 2001
+From: rakshasa 
+Date: Sun, 23 Oct 2016 08:54:11 +0900
+Subject: [PATCH] Use pkg-config for cppunit.
+
+---
+ configure.ac | 9