summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Sturmlechner <asturm@gentoo.org>2020-07-11 03:11:43 +0200
committerAndreas Sturmlechner <asturm@gentoo.org>2020-07-11 03:24:56 +0200
commitbff063654b29e7bdbee46aed1ad899b60f1ec2e8 (patch)
tree8150bde302b0954a5f021a070365ee600caf9994 /net-libs
parentapp-emulation/qemu-riscv64-bin: Version bump (diff)
downloadgentoo-bff063654b29e7bdbee46aed1ad899b60f1ec2e8.tar.gz
gentoo-bff063654b29e7bdbee46aed1ad899b60f1ec2e8.tar.bz2
gentoo-bff063654b29e7bdbee46aed1ad899b60f1ec2e8.zip
net-libs/libktorrent: Fix a bug in MultiFileCache
Package-Manager: Portage-2.3.103, Repoman-2.3.23 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'net-libs')
-rw-r--r--net-libs/libktorrent/files/libktorrent-2.2.0-fix-MultiFileCache.patch26
-rw-r--r--net-libs/libktorrent/libktorrent-2.2.0-r1.ebuild64
2 files changed, 90 insertions, 0 deletions
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 <trufanovan@gmail.com>
+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
+}