commit: 157b4b93bd04f2801a31c94205a5b062c8e41ba8 Author: Nicolas PARLANT <nicolas.parlant <AT> parhuet <DOT> fr> AuthorDate: Thu Jun 5 05:23:48 2025 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Fri Jun 6 14:08:08 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=157b4b93
net-p2p/rtorrent: add 0.15.4 Signed-off-by: Nicolas PARLANT <nicolas.parlant <AT> parhuet.fr> Part-of: https://github.com/gentoo/gentoo/pull/42454 Signed-off-by: Sam James <sam <AT> gentoo.org> net-p2p/rtorrent/Manifest | 1 + .../files/rtorrent-0.15.4-fix_waitpid.patch | 63 ++++++++++++ net-p2p/rtorrent/rtorrent-0.15.4.ebuild | 108 +++++++++++++++++++++ 3 files changed, 172 insertions(+) diff --git a/net-p2p/rtorrent/Manifest b/net-p2p/rtorrent/Manifest index 102bfa61025f..9434c3d87fab 100644 --- a/net-p2p/rtorrent/Manifest +++ b/net-p2p/rtorrent/Manifest @@ -2,3 +2,4 @@ DIST rtorrent-0.10.0.tar.gz 402931 BLAKE2B 3e11dafeb54fd1435176829c1dc45a9d5ad3b DIST rtorrent-0.9.8.tar.gz 647523 BLAKE2B 3562ed03dee3baa4a702d20c7c91b9248d9de0f25d1f8cd182863101f293a0ef13cb49164e4d16b25e72a4fbe1cc1a2fbde176d3068c749edbcb2287ef260b2b SHA512 016685948d0290694ab9635ae218c7acd876e6d45bea1bdba3a29c545e64f5d824c5e2f6693a4c2e9200196177881d54f312d72e0a19742bd74a03bd19ca05c7 DIST rtorrent-0.15.1.tar.gz 688056 BLAKE2B 0fd0b3748e1ec13935fa900434ad5d54c6062ea48c5f8cb320d0a30cb318c09f80347ca665c61a7745770c965eee5e1cfa7e96968a2468ad06711b80be5d6e92 SHA512 e5c713601ecb0c4536b64d98ca53261db35980b04a3f274d12f51467b021d77768e7f6a2004a33a76a99f7d96e0a2c3de4605fd7ee186ba05a7c16aa96b97ea5 DIST rtorrent-0.15.3.tar.gz 858703 BLAKE2B 9684141b9785a38ba609783aa5d294fb09f777f73beddf7d683531ad79c3fd09ed9b0a6118ef4f87678c5343d660bdd7a5ab18f5ec8e05a2c71a06588576579c SHA512 060319e0e4a5563c29d21b41e369e14e37bf5cc949c60cf482432c4cadda82151e0c5fef8f8082fd765b777b758676907eed070840117cac30565406717cf77c +DIST rtorrent-0.15.4.tar.gz 866692 BLAKE2B 941defa4393f29ca562bde6692c201df2e64bc2bf83c9a7aa85f8d19884723868019d54e19cb8f27c303dca094c3c135980ddac278960c657812fb4abd5a66e6 SHA512 9e197a49478e2df8959ce92eb065d4c063bfc096509bc53f13bcc2ebb1b1cc89e7156badb11b7a617d018d4dd77291a0e96762d28bc237deacdb29a36d96af1d diff --git a/net-p2p/rtorrent/files/rtorrent-0.15.4-fix_waitpid.patch b/net-p2p/rtorrent/files/rtorrent-0.15.4-fix_waitpid.patch new file mode 100644 index 000000000000..cb96ec4f926c --- /dev/null +++ b/net-p2p/rtorrent/files/rtorrent-0.15.4-fix_waitpid.patch @@ -0,0 +1,63 @@ +https://github.com/rakshasa/rtorrent/pull/1507 +From 231606afc16eef08ec1a344a7aaef7504343bb71 Mon Sep 17 00:00:00 2001 +From: rakshasa <[email protected]> +Date: Sun, 1 Jun 2025 18:21:10 +0200 +Subject: [PATCH] Fix ExecFile waitpid error handling. + +--- + src/rpc/exec_file.cc | 24 +++++++++++++++--------- + 1 file changed, 15 insertions(+), 9 deletions(-) + +diff --git a/src/rpc/exec_file.cc b/src/rpc/exec_file.cc +index 3be7bfa97..edf36697e 100644 +--- a/src/rpc/exec_file.cc ++++ b/src/rpc/exec_file.cc +@@ -1,6 +1,7 @@ + #include "config.h" + + #include <cerrno> ++#include <cstring> + #include <fcntl.h> + #include <string> + #include <unistd.h> +@@ -18,7 +19,7 @@ namespace rpc { + + int + ExecFile::execute(const char* file, char* const* argv, int flags) { +- // Write the execued command and its parameters to the log fd. ++ // Write the executed command and its parameters to the log fd. + [[maybe_unused]] int result; + + if (m_log_fd != -1) { +@@ -117,18 +118,23 @@ ExecFile::execute(const char* file, char* const* argv, int flags) { + } + + int status; +- int wpid; + +- do { +- wpid = waitpid(childPid, &status, 0); +- } while (wpid == -1 && WIFEXITED(status) == 0); +- +- if (wpid != childPid) +- throw torrent::internal_error("ExecFile::execute(...) waitpid failed."); ++ while (waitpid(childPid, &status, 0) == -1) { ++ switch (errno) { ++ case EINTR: ++ continue; ++ case ECHILD: ++ throw torrent::internal_error("ExecFile::execute(...) waitpid failed with ECHILD, child process not found."); ++ case EINVAL: ++ throw torrent::internal_error("ExecFile::execute(...) waitpid failed with EINVAL."); ++ default: ++ throw torrent::internal_error("ExecFile::execute(...) waitpid failed with unexpected error: " + std::string(std::strerror(errno))); ++ } ++ }; + + // Check return value? + if (m_log_fd != -1) { +- if (status == 0) ++ if (WIFEXITED(status) && WEXITSTATUS(status) == 0) + result = write(m_log_fd, "\n--- Success ---\n", sizeof("\n--- Success ---\n")); + else + result = write(m_log_fd, "\n--- Error ---\n", sizeof("\n--- Error ---\n")); diff --git a/net-p2p/rtorrent/rtorrent-0.15.4.ebuild b/net-p2p/rtorrent/rtorrent-0.15.4.ebuild new file mode 100644 index 000000000000..5a2f20511b08 --- /dev/null +++ b/net-p2p/rtorrent/rtorrent-0.15.4.ebuild @@ -0,0 +1,108 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +# require 64-bit integer +LUA_COMPAT=( lua5-{3,4} ) + +inherit autotools linux-info lua-single 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 ~arm64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris" +IUSE="debug lua selinux test tinyxml2 xmlrpc" +RESTRICT="!test? ( test )" +REQUIRED_USE=" + lua? ( ${LUA_REQUIRED_USE} ) + tinyxml2? ( !xmlrpc ) +" + +COMMON_DEPEND=" + ~net-libs/libtorrent-${PV} + net-misc/curl + sys-libs/ncurses:0= + lua? ( ${LUA_DEPS} ) + xmlrpc? ( dev-libs/xmlrpc-c:=[libxml2] ) +" +DEPEND="${COMMON_DEPEND} + dev-cpp/nlohmann_json +" +RDEPEND="${COMMON_DEPEND} + selinux? ( sec-policy/selinux-rtorrent ) +" +BDEPEND=" + virtual/pkgconfig + test? ( dev-util/cppunit ) +" + +DOCS=( doc/rtorrent.rc ) + +PATCHES=( + "${FILESDIR}"/${PN}-0.15.3-unbundle_json.patch + # from upstream. To be removed in next release + "${FILESDIR}"/${PN}-0.15.4-fix_waitpid.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 + use lua && lua-single_pkg_setup +} + +src_prepare() { + default + + # use system-json + rm -r src/rpc/nlohmann || die + + # 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 + export CONFIG_SHELL=${BASH} + + local myeconfargs=( + $(use_enable debug) + $(use_with lua) + $(usev xmlrpc --with-xmlrpc-c) + $(usev tinyxml2 --with-xmlrpc-tinyxml2) + ) + + use lua && myeconfargs+=( + LUA_INCLUDE="-I$(lua_get_include_dir)" + ) + + econf "${myeconfargs[@]}" +} + +src_install() { + default + doman doc/rtorrent.1 + + if use lua; then + insinto $(lua_get_lmod_dir) + doins ${PN}.lua + fi + + newinitd "${FILESDIR}/rtorrent-r1.init" rtorrent + newconfd "${FILESDIR}/rtorrentd.conf" rtorrent + systemd_newunit "${FILESDIR}/rtorrentd_at-r1.service" "[email protected]" +}
