From bff063654b29e7bdbee46aed1ad899b60f1ec2e8 Mon Sep 17 00:00:00 2001 From: Andreas Sturmlechner Date: Sat, 11 Jul 2020 03:11:43 +0200 Subject: net-libs/libktorrent: Fix a bug in MultiFileCache Package-Manager: Portage-2.3.103, Repoman-2.3.23 Signed-off-by: Andreas Sturmlechner --- .../libktorrent-2.2.0-fix-MultiFileCache.patch | 26 +++++++++ net-libs/libktorrent/libktorrent-2.2.0-r1.ebuild | 64 ++++++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 net-libs/libktorrent/files/libktorrent-2.2.0-fix-MultiFileCache.patch create mode 100644 net-libs/libktorrent/libktorrent-2.2.0-r1.ebuild (limited to 'net-libs/libktorrent') diff --git a/net-libs/libktorrent/files/libktorrent-2.2.0-fix-MultiFileCache.patch b/net-libs/libktorrent/files/libktorrent-2.2.0-fix-MultiFileCache.patch new file mode 100644 index 000000000000..bafdbaffefa5 --- /dev/null +++ b/net-libs/libktorrent/files/libktorrent-2.2.0-fix-MultiFileCache.patch @@ -0,0 +1,26 @@ +From 5b0abf8378d497c5a8881771518df6a02404d031 Mon Sep 17 00:00:00 2001 +From: Alexander Trufanov +Date: Tue, 16 Jun 2020 13:47:42 +0300 +Subject: [PATCH] Fix a bug in MultiFileCache + +Differential Revision: https://phabricator.kde.org/D29852 +--- + src/diskio/multifilecache.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/diskio/multifilecache.cpp b/src/diskio/multifilecache.cpp +index 0a513ad..882630e 100644 +--- a/src/diskio/multifilecache.cpp ++++ b/src/diskio/multifilecache.cpp +@@ -455,7 +455,7 @@ namespace bt + off = file_off + (piece_off - chunk_off); + len = piece_len; + } +- else if(piece_off >= chunk_off && piece_len < chunk_off + chunk_len) ++ else if(piece_off >= chunk_off && piece_off < chunk_off + chunk_len) + { + // The start of the piece lies partially in the current file + off = file_off + (piece_off - chunk_off); +-- +GitLab + diff --git a/net-libs/libktorrent/libktorrent-2.2.0-r1.ebuild b/net-libs/libktorrent/libktorrent-2.2.0-r1.ebuild new file mode 100644 index 000000000000..08d032bf53ff --- /dev/null +++ b/net-libs/libktorrent/libktorrent-2.2.0-r1.ebuild @@ -0,0 +1,64 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +ECM_TEST="forceoptional" +KDE_ORG_CATEGORY="network" +KFMIN=5.60.0 +QTMIN=5.12.3 +VIRTUALX_REQUIRED="test" +inherit ecm kde.org + +DESCRIPTION="BitTorrent library based on KDE Frameworks" +HOMEPAGE="https://kde.org/applications/internet/org.kde.ktorrent +https://userbase.kde.org/KTorrent" +SRC_URI="mirror://kde/stable/ktorrent/5.2.0/${P}.tar.xz" + +LICENSE="GPL-2+" +SLOT="5" +KEYWORDS="~amd64 ~arm ~arm64 ~x86" +IUSE="" + +BDEPEND="sys-devel/gettext" +COMMON_DEPEND=" + app-crypt/qca:2[qt5(+)] + >=dev-libs/gmp-6.0.0a:0= + dev-libs/libgcrypt:0= + >=dev-qt/qtnetwork-${QTMIN}:5 + >=dev-qt/qtxml-${QTMIN}:5 + >=kde-frameworks/karchive-${KFMIN}:5 + >=kde-frameworks/kconfig-${KFMIN}:5 + >=kde-frameworks/kcoreaddons-${KFMIN}:5 + >=kde-frameworks/kcrash-${KFMIN}:5 + >=kde-frameworks/ki18n-${KFMIN}:5 + >=kde-frameworks/kio-${KFMIN}:5 + >=kde-frameworks/solid-${KFMIN}:5 +" +DEPEND="${COMMON_DEPEND} + dev-libs/boost +" +RDEPEND="${COMMON_DEPEND} + !dev-libs/botan[gmp(-)] +" + +PATCHES=( "${FILESDIR}/${P}-fix-MultiFileCache.patch" ) # 2.2 branch + +src_prepare() { + ecm_src_prepare + + # Gentoo workaround because gmp.h in MULTILIB_WRAPPED_HEADERS is breaking this + sed -i -e "/^find_package/ s/\"\${LibGMP_MIN_VERSION}\" //" \ + CMakeLists.txt || die + sed -i -e "/^find_dependency/ s/ \"@LibGMP_MIN_VERSION@\"//" \ + KF5TorrentConfig.cmake.in || die +} + +src_test() { + # failing network tests + local myctestargs=( + -E "(fin|packetloss|send|superseedtest|transmit|utppolltest)" + ) + + ecm_src_test +} -- cgit v1.2.3-65-gdbad