From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 919BA1582EF for ; Mon, 10 Mar 2025 03:06:11 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 6F18D343184 for ; Mon, 10 Mar 2025 03:06:11 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 00C071103AC; Mon, 10 Mar 2025 03:06:07 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id EB4CB1103A8 for ; Mon, 10 Mar 2025 03:06:06 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 6A97B3430A0 for ; Mon, 10 Mar 2025 03:06:06 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 2215D28B3 for ; Mon, 10 Mar 2025 03:06:04 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1741575883.03ae7d71b476090c80862c1401fbcfd3cf9fe74c.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: net-p2p/rtorrent/files/, net-p2p/rtorrent/ X-VCS-Repository: repo/gentoo X-VCS-Files: net-p2p/rtorrent/Manifest net-p2p/rtorrent/files/rtorrent-0.15.1-tests-fix-arrays.patch net-p2p/rtorrent/metadata.xml net-p2p/rtorrent/rtorrent-0.15.1.ebuild X-VCS-Directories: net-p2p/rtorrent/files/ net-p2p/rtorrent/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 03ae7d71b476090c80862c1401fbcfd3cf9fe74c X-VCS-Branch: master Date: Mon, 10 Mar 2025 03:06:04 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: d3c9580e-9cf8-447a-bbfe-5a76943e57f9 X-Archives-Hash: 06df52dd689fa4a3d9ff0340df2e3222 commit: 03ae7d71b476090c80862c1401fbcfd3cf9fe74c Author: Nicolas PARLANT parhuet fr> AuthorDate: Wed Jan 1 14:04:48 2025 +0000 Commit: Sam James gentoo org> CommitDate: Mon Mar 10 03:04:43 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=03ae7d71 net-p2p/rtorrent: add 0.15.1 fix SRC_URI as libtorrent/rtorrent are in sync dev-util/cppunit for test only : removed from flags upstream switch to usev as --without-xmlrpc-c is misunderstand by checkconfig add useflag tinyxml2 for namespace-modified-vendor-tinyxml2 (experimental) patch for tests with tinyxml2 Closes: https://bugs.gentoo.org/947327 Bug: https://bugs.gentoo.org/943039 fixed Signed-off-by: Nicolas PARLANT parhuet.fr> Closes: https://github.com/gentoo/gentoo/pull/39937 Signed-off-by: Sam James gentoo.org> net-p2p/rtorrent/Manifest | 1 + .../files/rtorrent-0.15.1-tests-fix-arrays.patch | 144 +++++++++++++++++++++ net-p2p/rtorrent/metadata.xml | 5 + net-p2p/rtorrent/rtorrent-0.15.1.ebuild | 78 +++++++++++ 4 files changed, 228 insertions(+) diff --git a/net-p2p/rtorrent/Manifest b/net-p2p/rtorrent/Manifest index a7735a86481e..7f5e8e4731b2 100644 --- a/net-p2p/rtorrent/Manifest +++ b/net-p2p/rtorrent/Manifest @@ -1,2 +1,3 @@ DIST rtorrent-0.10.0.tar.gz 402931 BLAKE2B 3e11dafeb54fd1435176829c1dc45a9d5ad3bcbfc22a5a3738f3767891adad351d41ae2b40a859ab1bee600250833edd43507558cfdb0fdc51c4381b7336bdb2 SHA512 9c1ca99cd84e5a0984cffd48e37c9f78f66e867cd4df9b1ba0d6060fe447e1c0dd0083328de699fa7011f2b6dd6a22ac569756f24fde074401d8d9a8a11eb636 DIST rtorrent-0.9.8.tar.gz 647523 BLAKE2B 3562ed03dee3baa4a702d20c7c91b9248d9de0f25d1f8cd182863101f293a0ef13cb49164e4d16b25e72a4fbe1cc1a2fbde176d3068c749edbcb2287ef260b2b SHA512 016685948d0290694ab9635ae218c7acd876e6d45bea1bdba3a29c545e64f5d824c5e2f6693a4c2e9200196177881d54f312d72e0a19742bd74a03bd19ca05c7 +DIST rtorrent-0.15.1.tar.gz 688056 BLAKE2B 0fd0b3748e1ec13935fa900434ad5d54c6062ea48c5f8cb320d0a30cb318c09f80347ca665c61a7745770c965eee5e1cfa7e96968a2468ad06711b80be5d6e92 SHA512 e5c713601ecb0c4536b64d98ca53261db35980b04a3f274d12f51467b021d77768e7f6a2004a33a76a99f7d96e0a2c3de4605fd7ee186ba05a7c16aa96b97ea5 diff --git a/net-p2p/rtorrent/files/rtorrent-0.15.1-tests-fix-arrays.patch b/net-p2p/rtorrent/files/rtorrent-0.15.1-tests-fix-arrays.patch new file mode 100644 index 000000000000..33162f1168cf --- /dev/null +++ b/net-p2p/rtorrent/files/rtorrent-0.15.1-tests-fix-arrays.patch @@ -0,0 +1,144 @@ +https://github.com/rakshasa/rtorrent/issues/1360 +https://github.com/rakshasa/rtorrent/commit/350d03ca04fedc2153927b7bf26d43030e23d962 +https://github.com/rakshasa/rtorrent/commit/c2c6a4be268aee3f74fe4d0abcf944208b8617ba +--- a/test/rpc/xmlrpc_test.cc ++++ b/test/rpc/xmlrpc_test.cc +@@ -15,6 +15,89 @@ + void initialize_command_dynamic(); + + #if defined(HAVE_XMLRPC_TINYXML2) && !defined(HAVE_XMLRPC_C) ++ ++std::vector> basic_requests = { ++ std::make_tuple("Basic call", ++ "xmlrpc_reflect", ++ ""), ++ ++ std::make_tuple("Basic call without params", ++ "xmlrpc_reflect", ++ ""), ++ ++ std::make_tuple("UTF-8 string", ++ "xmlrpc_reflectчао", ++ "чао"), ++ ++ std::make_tuple("emoji string", ++ "xmlrpc_reflect😊", ++ "😊"), ++ ++ std::make_tuple("base64 data (which gets returned as a string)", ++ "xmlrpc_reflectZm9vYmFy", ++ "foobar"), ++ ++ std::make_tuple("i8 ints", ++ "xmlrpc_reflect41", ++ "41"), ++ ++ std::make_tuple("i8 ints", ++ "xmlrpc_reflect2247483647", ++ "2247483647"), ++ ++ std::make_tuple("negative i8 ints", ++ "xmlrpc_reflect-2347483647", ++ "-2347483647"), ++ ++ std::make_tuple("Simple array", ++ "xmlrpc_reflect2247483647", ++ "2247483647"), ++ ++ std::make_tuple("Empty array", ++ "xmlrpc_reflect", ++ ""), ++ ++ std::make_tuple("Empty struct", ++ "xmlrpc_reflect", ++ ""), ++ ++ std::make_tuple("Simple struct", ++ "xmlrpc_reflectlowerBound18upperBound139", ++ "lowerBound18upperBound139"), ++ ++ std::make_tuple("Invalid - missing method", ++ "no_such_method41", ++ "faultCode-506faultStringmethod 'no_such_method' not defined"), ++ ++ std::make_tuple("Invalid - i8 target", ++ "xmlrpc_reflect41", ++ "faultCode-500faultStringinvalid parameters: target must be a string"), ++ ++ std::make_tuple("Invalid - empty int tag", ++ "xmlrpc_reflect", ++ "faultCode-501faultStringunable to parse empty integer"), ++ ++ std::make_tuple("Invalid - empty int text", ++ "xmlrpc_reflect", ++ "faultCode-501faultStringunable to parse empty integer"), ++ ++ std::make_tuple("Invalid - broken XML", ++ "thodCall>test_a41faultCode-503faultStringError=XML_ERROR_PARSING_ELEMENT ErrorID=6 (0x6) Line number=1: XMLElement name=method"), ++ ++ std::make_tuple("Invalid - non-integer i8", ++ "xmlrpc_reflectstring value", ++ "faultCode-501faultStringunable to parse integer value"), ++ ++ std::make_tuple("Invalid - float i8", ++ "xmlrpc_reflect3.14", ++ "faultCode-501faultStringunable to parse integer value"), ++ ++ std::make_tuple("Invalid - non-boolean boolean", ++ "xmlrpc_reflectstring value", ++ "faultCode-501faultStringunknown boolean value: string value") ++}; ++ + void + XmlrpcTest::setUp() { + m_commandItr = m_commands; +@@ -30,36 +113,10 @@ + + void + XmlrpcTest::test_basics() { +- std::ifstream file; file.open("rpc/xmlrpc_test_data.txt"); +- CPPUNIT_ASSERT(file.good()); +- std::vector titles; +- std::vector inputs; +- std::vector outputs; +- std::string line; +- int index = 0; +- // Read file into inputs/outputs +- while (std::getline(file, line)) { +- if (line.size() == 0) { +- continue; +- } +- if (line[0] == '#') { +- titles.push_back(line); +- continue; +- } +- if (index % 2) { +- outputs.push_back(line); +- } else { +- inputs.push_back(line); +- } +- index++; +- } +- +- // Sanity check the above parser +- CPPUNIT_ASSERT_MESSAGE("Could not parse test data", inputs.size() > 0 && inputs.size() == outputs.size() && inputs.size() == titles.size()); +- for (int i = 0; i < inputs.size(); i++) { ++ for (auto& test : basic_requests) { + std::string output; +- m_xmlrpc.process(inputs[i].c_str(), inputs[i].size(), [&output](const char* c, uint32_t l){ output.append(c, l); return true;}); +- CPPUNIT_ASSERT_EQUAL_MESSAGE(titles[i], std::string(outputs[i]), output); ++ m_xmlrpc.process(std::get<1>(test).c_str(), std::get<1>(test).size(), [&output](const char* c, uint32_t l){ output.append(c, l); return true;}); ++ CPPUNIT_ASSERT_EQUAL_MESSAGE(std::get<0>(test), std::get<2>(test), output); + } + } + +@@ -69,7 +126,7 @@ + // valid UTF-8, but doesn't check strings, and Object strings are + // just a series of bytes so it reflects just fine. + std::string input = "xmlrpc_reflect\xc3\x28"; +- std::string expected = "\xc3\x28"; ++ std::string expected = "\xc3\x28"; + std::string output; + m_xmlrpc.process(input.c_str(), input.size(), [&output](const char* c, uint32_t l){ output.append(c, l); return true;}); + CPPUNIT_ASSERT_EQUAL(expected, output); diff --git a/net-p2p/rtorrent/metadata.xml b/net-p2p/rtorrent/metadata.xml index b72a3c39282e..f5c1fe38c3a2 100644 --- a/net-p2p/rtorrent/metadata.xml +++ b/net-p2p/rtorrent/metadata.xml @@ -5,6 +5,11 @@ perfinion@gentoo.org Jason Zaman + + + Use vendor tinyxml2 instead of xmlrpc-c. This allows significant reduction in overhead (experimental) + + rakshasa/rtorrent diff --git a/net-p2p/rtorrent/rtorrent-0.15.1.ebuild b/net-p2p/rtorrent/rtorrent-0.15.1.ebuild new file mode 100644 index 000000000000..fd8d4dbb77b6 --- /dev/null +++ b/net-p2p/rtorrent/rtorrent-0.15.1.ebuild @@ -0,0 +1,78 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit autotools linux-info systemd + +DESCRIPTION="BitTorrent Client using libtorrent" +HOMEPAGE="https://rakshasa.github.io/rtorrent/" +SRC_URI="https://github.com/rakshasa/rtorrent/releases/download/v${PV}/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris" +IUSE="debug selinux test tinyxml2 xmlrpc" +RESTRICT="!test? ( test )" +REQUIRED_USE="tinyxml2? ( !xmlrpc )" + +DEPEND=" + ~net-libs/libtorrent-${PV} + net-misc/curl + sys-libs/ncurses:0= + xmlrpc? ( dev-libs/xmlrpc-c:= ) +" +RDEPEND=" + ${DEPEND} + selinux? ( sec-policy/selinux-rtorrent ) +" +BDEPEND=" + virtual/pkgconfig + test? ( dev-util/cppunit ) +" + +DOCS=( doc/rtorrent.rc ) + +PATCHES=( + "${FILESDIR}"/${PN}-0.15.1-tests-fix-arrays.patch +) + +pkg_setup() { + if ! linux_config_exists || ! linux_chkconfig_present IPV6; then + ewarn "rtorrent will not start without IPv6 support in your kernel" + ewarn "without further configuration. Please set bind=0.0.0.0 or" + ewarn "similar in your rtorrent.rc" + ewarn "Upstream bug: https://github.com/rakshasa/rtorrent/issues/732" + fi +} + +src_prepare() { + default + + # https://github.com/rakshasa/rtorrent/issues/332 + cp "${FILESDIR}"/rtorrent.1 "${S}"/doc/ || die + + if [[ ${CHOST} != *-darwin* ]]; then + # syslibroot is only for macos, change to sysroot for others + sed -i 's/Wl,-syslibroot,/Wl,--sysroot,/' "${S}/scripts/common.m4" || die + fi + + eautoreconf +} + +src_configure() { + # configure needs bash or script bombs out on some null shift, bug #291229 + CONFIG_SHELL=${BASH} econf \ + $(use_enable debug) \ + $(usev xmlrpc --with-xmlrpc-c) \ + $(usev tinyxml2 --with-xmlrpc-tinyxml2) +} + +src_install() { + default + doman doc/rtorrent.1 + + newinitd "${FILESDIR}/rtorrent-r1.init" rtorrent + newconfd "${FILESDIR}/rtorrentd.conf" rtorrent + systemd_newunit "${FILESDIR}/rtorrentd_at-r1.service" "rtorrentd@.service" +}