[gentoo-commits] repo/gentoo:master commit in: net-p2p/rtorrent/files/, net-p2p/rtorrent/
commit: 4de5a51b48af8c5de3d3ade1a1adf77c7801c0a7 Author: Sam James gentoo org> AuthorDate: Sat Dec 9 17:02:21 2023 + Commit: Sam James gentoo org> CommitDate: Sat Dec 9 18:06:01 2023 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4de5a51b net-p2p/rtorrent: fix modern C issue in configure Also, stop calling econf twice. Signed-off-by: Sam James gentoo.org> .../files/rtorrent-0.9.8-configure-c99.patch | 79 ++ net-p2p/rtorrent/rtorrent-0.9.8-r3.ebuild | 73 2 files changed, 152 insertions(+) diff --git a/net-p2p/rtorrent/files/rtorrent-0.9.8-configure-c99.patch b/net-p2p/rtorrent/files/rtorrent-0.9.8-configure-c99.patch new file mode 100644 index ..a2fa67799b8e --- /dev/null +++ b/net-p2p/rtorrent/files/rtorrent-0.9.8-configure-c99.patch @@ -0,0 +1,79 @@ +https://github.com/rakshasa/rtorrent/commit/3f72e2760305936b27904d0080a5fb5600948bd5 + +From 3f72e2760305936b27904d0080a5fb5600948bd5 Mon Sep 17 00:00:00 2001 +From: rakshasa +Date: Sat, 27 Feb 2021 22:13:01 +0900 +Subject: [PATCH] Replaced custom execinfo autoconf test. + +--- a/configure.ac b/configure.ac +@@ -20,8 +20,6 @@ TORRENT_DISABLE_IPV6 + + AC_SYS_LARGEFILE + +-TORRENT_CHECK_EXECINFO +- + TORRENT_ENABLE_ARCH + TORRENT_WITH_SYSROOT + +@@ -29,6 +27,7 @@ TORRENT_WITHOUT_VARIABLE_FDSET + TORRENT_WITHOUT_STATVFS + TORRENT_WITHOUT_STATFS + ++AX_EXECINFO + AX_PTHREAD([], AC_MSG_ERROR([requires pthread])) + AX_WITH_CURSES + +--- a/scripts/common.m4 b/scripts/common.m4 +@@ -150,21 +150,6 @@ dnl Need to fix this so that it uses the stuff defined by the system. + ]) + ]) + +-AC_DEFUN([TORRENT_CHECK_EXECINFO], [ +- AC_MSG_CHECKING(for execinfo.h) +- +- AC_COMPILE_IFELSE([AC_LANG_SOURCE([ +- #include +- int main() { backtrace((void**)0, 0); backtrace_symbols((char**)0, 0); return 0;} +- ])], +-[ +- AC_MSG_RESULT(yes) +- AC_DEFINE(USE_EXECINFO, 1, Use execinfo.h) +-], [ +- AC_MSG_RESULT(no) +- ]) +-]) +- + AC_DEFUN([TORRENT_CHECK_ALIGNED], [ + AC_MSG_CHECKING(the byte alignment) + +--- a/src/main.cc b/src/main.cc +@@ -53,7 +53,7 @@ + #include + #include + +-#ifdef USE_EXECINFO ++#ifdef HAVE_BACKTRACE + #include + #endif + +@@ -533,7 +533,7 @@ handle_sigbus(int signum, siginfo_t* sa, void* ptr) { + std::stringstream output; + output << "Caught SIGBUS, dumping stack:" << std::endl; + +-#ifdef USE_EXECINFO ++#ifdef HAVE_BACKTRACE + void* stackPtrs[20]; + + // Print the stack and exit. +@@ -604,7 +604,7 @@ do_panic(int signum) { + + output << "Caught " << SignalHandler::as_string(signum) << ", dumping stack:" << std::endl; + +-#ifdef USE_EXECINFO ++#ifdef HAVE_BACKTRACE + void* stackPtrs[20]; + + // Print the stack and exit. diff --git a/net-p2p/rtorrent/rtorrent-0.9.8-r3.ebuild b/net-p2p/rtorrent/rtorrent-0.9.8-r3.ebuild new file mode 100644 index ..f2faf7732600 --- /dev/null +++ b/net-p2p/rtorrent/rtorrent-0.9.8-r3.ebuild @@ -0,0 +1,73 @@ +# Copyright 1999-2023 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="http://rtorrent.net/downloads/${P}.tar.gz"; + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris" +IUSE="debug selinux test xmlrpc" +RESTRICT="!test? ( test )" + +COMMON_DEPEND="~net-libs/libtorrent-0.13.${PV##*.} + >=net-misc/curl-7.19.1 + sys-libs/ncurses:0= + xmlrpc? ( dev-libs/xmlrpc-c:= )" +RDEPEND="${COMMON_DEPEND} + selinux? ( sec-policy/selinux-rtorrent ) +" +DEPEND="${COMMON_DEPEND} + dev-util/cppunit + virtual/pkgconfig" + +DOCS=( doc/rtorrent.rc ) + +PATCHES=( + "${FILESDIR}/${P}-bgo891995.patch" + "${FILESDIR}/${PN}-0.9.8-configure-c99.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_SH
[gentoo-commits] repo/gentoo:master commit in: net-p2p/rtorrent/files/, net-p2p/rtorrent/
commit: ee4985333e42e9794fb0f165a857e78af0f363d5 Author: Stephen Shkardoon ss23 geek nz> AuthorDate: Mon Feb 27 15:34:06 2023 + Commit: Sam James gentoo org> CommitDate: Sat Mar 4 07:18:15 2023 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ee498533 net-p2p/rtorrent: Resolve overflow issue on hardened build Closes: https://bugs.gentoo.org/891995 Signed-off-by: Stephen Shkardoon ss23.geek.nz> Closes: https://github.com/gentoo/gentoo/pull/29834 Signed-off-by: Sam James gentoo.org> .../rtorrent/files/rtorrent-0.9.8-bgo891995.patch | 27 net-p2p/rtorrent/rtorrent-0.9.8-r2.ebuild | 74 ++ 2 files changed, 101 insertions(+) diff --git a/net-p2p/rtorrent/files/rtorrent-0.9.8-bgo891995.patch b/net-p2p/rtorrent/files/rtorrent-0.9.8-bgo891995.patch new file mode 100644 index ..943fe64dddc1 --- /dev/null +++ b/net-p2p/rtorrent/files/rtorrent-0.9.8-bgo891995.patch @@ -0,0 +1,27 @@ +https://bugs.gentoo.org/891995 +https://github.com/rakshasa/rtorrent/issues/1205 +https://github.com/rakshasa/rtorrent/pull/1169 + +From 812bba81bc049a5f786282b3654cab294b0ef236 Mon Sep 17 00:00:00 2001 +From: Aleksa Sarai +Date: Mon, 20 Jun 2022 19:09:57 +1000 +Subject: [PATCH] utils: lockfile: avoid stack overflow for lockfile buffer + +There appears to have been some change on openSUSE (likely some new +hardening flags for builds, or some glibc hardening) such that incorrect +buffer handling results in a segfault even if the buffer is never +overflowed. + +Signed-off-by: Aleksa Sarai +--- a/src/utils/lockfile.cc b/src/utils/lockfile.cc +@@ -98,7 +98,8 @@ Lockfile::try_lock() { + int pos = ::gethostname(buf, 255); + + if (pos == 0) { +-::snprintf(buf + std::strlen(buf), 255, ":+%i\n", ::getpid()); ++ssize_t len = std::strlen(buf); ++::snprintf(buf + len, 255 - len, ":+%i\n", ::getpid()); + int __UNUSED result = ::write(fd, buf, std::strlen(buf)); + } + diff --git a/net-p2p/rtorrent/rtorrent-0.9.8-r2.ebuild b/net-p2p/rtorrent/rtorrent-0.9.8-r2.ebuild new file mode 100644 index ..b3161479593e --- /dev/null +++ b/net-p2p/rtorrent/rtorrent-0.9.8-r2.ebuild @@ -0,0 +1,74 @@ +# Copyright 1999-2023 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="http://rtorrent.net/downloads/${P}.tar.gz"; + +LICENSE="GPL-2" +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 selinux test xmlrpc" +RESTRICT="!test? ( test )" + +COMMON_DEPEND="~net-libs/libtorrent-0.13.${PV##*.} + >=net-misc/curl-7.19.1 + sys-libs/ncurses:0= + xmlrpc? ( dev-libs/xmlrpc-c:= )" +RDEPEND="${COMMON_DEPEND} + selinux? ( sec-policy/selinux-rtorrent ) +" +DEPEND="${COMMON_DEPEND} + dev-util/cppunit + virtual/pkgconfig" + +DOCS=( doc/rtorrent.rc ) + +PATCHES=( + "${FILESDIR}/${P}-bgo891995.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() { + default + + # configure needs bash or script bombs out on some null shift, bug #291229 + CONFIG_SHELL=${BASH} econf \ + $(use_enable debug) \ + $(use_with xmlrpc xmlrpc-c) +} + +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" +}
[gentoo-commits] repo/gentoo:master commit in: net-p2p/rtorrent/files/, net-p2p/rtorrent/
commit: fc0ccfb9a6015e5eaf040f695224b39b1358f76a Author: Stephen Shkardoon ss23 geek nz> AuthorDate: Fri Aug 10 08:44:19 2018 + Commit: Jason Zaman gentoo org> CommitDate: Fri Aug 10 09:01:16 2018 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fc0ccfb9 net-p2p/rtorrent: remove old version 0.9.6.* Package-Manager: Portage-2.3.40, Repoman-2.3.9 net-p2p/rtorrent/Manifest | 1 - .../rtorrent/files/rtorrent-0.9.1-ncurses.patch| 10 net-p2p/rtorrent/files/rtorrent-0.9.4-tinfo.patch | 37 - .../files/rtorrent-0.9.6-cppunit-pkgconfig.patch | 28 -- net-p2p/rtorrent/rtorrent-0.9.6-r1.ebuild | 63 -- net-p2p/rtorrent/rtorrent-0.9.6.ebuild | 62 - 6 files changed, 201 deletions(-) diff --git a/net-p2p/rtorrent/Manifest b/net-p2p/rtorrent/Manifest index 180ca6b41a6..b7c90d413c5 100644 --- a/net-p2p/rtorrent/Manifest +++ b/net-p2p/rtorrent/Manifest @@ -1,2 +1 @@ -DIST rtorrent-0.9.6.tar.gz 610845 BLAKE2B 4a4faccffe79e7d877e3be9a9b16edcea87f1969ee2689f7789ebd738a19a5a41f5eae3b33c5b874b5c31ad8e872baa88374fae2047dbc76d4f1c0bc6d7ecbd4 SHA512 704f7b79d5bc78b817da21a6886662a5a97fde210a110c50f708bdc18e1dcf3ef5c5f4e2740261d41221cfc69c19926bf34e10057adf10601da9e6e06b2cef75 DIST rtorrent-0.9.7.tar.gz 610149 BLAKE2B 3f1316b0142dade9662630ad40132c5968d7b0ded32d7ae13d1ec1fdb7fec794812203fece367bf6abfd02212ed94d308046d40eb3e7562c408e8da13b23c23d SHA512 e663bd8984bcec91868beaf16d215708bdea8872338365ba6a05c9ea830b2aff045257bbc8bd0414d84009ee85852822c97bb073dfb41c21e3b0081ecaeecc00 diff --git a/net-p2p/rtorrent/files/rtorrent-0.9.1-ncurses.patch b/net-p2p/rtorrent/files/rtorrent-0.9.1-ncurses.patch deleted file mode 100644 index 260cd9a3842..000 --- a/net-p2p/rtorrent/files/rtorrent-0.9.1-ncurses.patch +++ /dev/null @@ -1,10 +0,0 @@ src/display/canvas.h -+++ src/display/canvas.h -@@ -48,5 +48,5 @@ class Canvas { - public: - typedef std::vector attributes_list; - -- Canvas(int x = 0, int y = 0, int width = 0, int height = 0); -+ Canvas(int x = 0, int y = 0, int width = 1, int height = 1); - ~Canvas() { delwin(m_window); } - voidrefresh() { wnoutrefresh(m_window); } diff --git a/net-p2p/rtorrent/files/rtorrent-0.9.4-tinfo.patch b/net-p2p/rtorrent/files/rtorrent-0.9.4-tinfo.patch deleted file mode 100644 index 21ee708782b..000 --- a/net-p2p/rtorrent/files/rtorrent-0.9.4-tinfo.patch +++ /dev/null @@ -1,37 +0,0 @@ -bug 462788 - - configure.ac | 18 -- - 1 file changed, 12 insertions(+), 6 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 430c15d..50ce687 100644 a/configure.ac -+++ b/configure.ac -@@ -31,15 +31,21 @@ TORRENT_WITHOUT_STATVFS() - TORRENT_WITHOUT_STATFS() - - AX_PTHREAD([], AC_MSG_ERROR([requires pthread])) --AX_WITH_CURSES() -- --if test "x$ax_cv_ncursesw" != xyes && test "x$ax_cv_ncurses" != xyes; then -- AC_MSG_ERROR([requires either NcursesW or Ncurses library]) --fi -+PKG_CHECK_MODULES([CURSES],[ncursesw],[ -+ AC_DEFINE(HAVE_NCURSESW_CURSES_H, 1) -+ ], -+ [PKG_CHECK_MODULES([CURSES],[ncurses],[ -+ AC_DEFINE(HAVE_NCURSES_H, 1) -+ ], -+ [AX_WITH_CURSES() -+ if test "x$ax_cv_ncursesw" != xyes && test "x$ax_cv_ncurses" != xyes; then -+ AC_MSG_ERROR([requires either NcursesW or Ncurses library]) -+ fi]) -+ ]) - - CFLAGS="$CFLAGS $PTHREAD_CFLAGS $CURSES_CFLAGS" - CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS $CURSES_CFLAGS" --LIBS="$PTHREAD_LIBS $CURSES_LIB $LIBS" -+LIBS="$PTHREAD_LIBS $CURSES_LIB $CURSES_LIBS $LIBS" - - PKG_CHECK_MODULES([libcurl], libcurl >= 7.15.4, - CXXFLAGS="$CXXFLAGS $libcurl_CFLAGS"; diff --git a/net-p2p/rtorrent/files/rtorrent-0.9.6-cppunit-pkgconfig.patch b/net-p2p/rtorrent/files/rtorrent-0.9.6-cppunit-pkgconfig.patch deleted file mode 100644 index 753f4cb8a7f..000 --- a/net-p2p/rtorrent/files/rtorrent-0.9.6-cppunit-pkgconfig.patch +++ /dev/null @@ -1,28 +0,0 @@ -https://bugs.gentoo.org/620908 - -diff -ur a/configure.ac b/configure.ac a/configure.ac 2017-08-17 08:52:49.596897308 -0500 -+++ b/configure.ac 2017-08-17 08:54:57.171515415 -0500 -@@ -4,7 +4,6 @@ - - AM_INIT_AUTOMAKE - AC_CONFIG_HEADERS(config.h) --AM_PATH_CPPUNIT(1.9.6) - - AC_PROG_CXX - AC_PROG_LIBTOOL -@@ -43,9 +42,11 @@ - fi]) - ]) - --CFLAGS="$CFLAGS $PTHREAD_CFLAGS $CURSES_CFLAGS" --CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS $CURSES_CFLAGS" --LIBS="$PTHREAD_LIBS $CURSES_LIB $CURSES_LIBS $LIBS" -+PKG_CHECK_MODULES([CPPUNIT], [cppunit],, [no_cppunit="yes"]) -+ -+CFLAGS="$CFLAGS $PTHREAD_CFLAGS $CPPUNIT_CFLAGS $CURSES_CFLAGS" -+CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS $CPPUNIT_CFLAGS $CURSES_CFLAGS" -+LIBS="$PTHREAD_LIBS $CURSES_LIB $CURSES_LIBS $CPPUNIT_LIBS $LIBS" - - PKG_CHECK_MODULES(