From 5a2058525a5d52531ddff9b9b1d24714eafe22cc Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Tue, 1 Jul 2025 12:13:33 -0700 Subject: [PATCH] libtorrent: update to 0.15.5 Update patches. Signed-off-by: Rosen Penev --- libs/libtorrent/Makefile | 4 +- .../0001-pkgconfig-fix-static-linking.patch | 7 +- ...0-add-support-for-external-libatomic.patch | 82 ++++--------------- 3 files changed, 24 insertions(+), 69 deletions(-) diff --git a/libs/libtorrent/Makefile b/libs/libtorrent/Makefile index 227fae0c5c..de1fdde8d6 100644 --- a/libs/libtorrent/Makefile +++ b/libs/libtorrent/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libtorrent -PKG_VERSION:=0.15.3 +PKG_VERSION:=0.15.5 PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/rakshasa/libtorrent PKG_SOURCE_VERSION:=v$(PKG_VERSION) -PKG_MIRROR_HASH:=186058e4a965457b67d7190c1d35e1acd26d273632ca768f394be6785b433d32 +PKG_MIRROR_HASH:=f5baa923bf45b84a2d1a8bc279815fc5d4f460e581e2d0e3070b97f134301378 PKG_MAINTAINER:=Rosen Penev PKG_LICENSE:=GPL-2.0-or-later diff --git a/libs/libtorrent/patches/0001-pkgconfig-fix-static-linking.patch b/libs/libtorrent/patches/0001-pkgconfig-fix-static-linking.patch index b08c37991b..9e53d72eaf 100644 --- a/libs/libtorrent/patches/0001-pkgconfig-fix-static-linking.patch +++ b/libs/libtorrent/patches/0001-pkgconfig-fix-static-linking.patch @@ -14,12 +14,13 @@ Signed-off-by: Rosen Penev --- a/libtorrent.pc.in +++ b/libtorrent.pc.in -@@ -6,6 +6,6 @@ includedir=@includedir@ +@@ -6,7 +6,6 @@ includedir=@includedir@ Name: libtorrent Description: A BitTorrent library Version: @VERSION@ +-Requires.private: zlib, libcrypto -Libs: -L${libdir} -ltorrent --Libs.Private: -lz +-Libs.private: @PTHREAD_LIBS@ @ATOMIC_LIBS@ +Requires: zlib, libcrypto -+Libs: -L${libdir} -ltorrent @ATOMIC_LIBS@ ++Libs: -L${libdir} -ltorrent @PTHREAD_LIBS@ @ATOMIC_LIBS@ Cflags: -I${includedir} diff --git a/libs/libtorrent/patches/010-add-support-for-external-libatomic.patch b/libs/libtorrent/patches/010-add-support-for-external-libatomic.patch index c0aac71749..05048d180f 100644 --- a/libs/libtorrent/patches/010-add-support-for-external-libatomic.patch +++ b/libs/libtorrent/patches/010-add-support-for-external-libatomic.patch @@ -7,68 +7,22 @@ Needed on some 32-bit platforms where 64-bit atomics are provided by libatomic. Signed-off-by: Rosen Penev ---- - configure.ac | 3 ++- - scripts/check_atomic.m4 | 46 +++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 49 insertions(+), 1 deletion(-) - create mode 100644 scripts/check_atomic.m4 - ---- a/configure.ac -+++ b/configure.ac -@@ -79,13 +79,14 @@ AC_ARG_ENABLE(execinfo, - ]) - - AX_PTHREAD -+CHECK_ATOMIC - - PKG_CHECK_MODULES([CPPUNIT], [cppunit],, [no_cppunit="yes"]) - PKG_CHECK_MODULES([ZLIB], [zlib]) - - CFLAGS="$PTHREAD_CFLAGS $ZLIB_CFLAGS $CFLAGS" - CXXFLAGS="$PTHREAD_CFLAGS $ZLIB_CFLAGS $CXXFLAGS" --LIBS="$PTHREAD_LIBS $ZLIB_LIBS $LIBS" -+LIBS="$ATOMIC_LIBS $PTHREAD_LIBS $ZLIB_LIBS $LIBS" - - TORRENT_CHECK_OPENSSL - ---- /dev/null +---- +--- a/scripts/check_atomic.m4 +++ b/scripts/check_atomic.m4 -@@ -0,0 +1,38 @@ -+# Some versions of gcc/libstdc++ require linking with -latomic if -+# using the C++ atomic library. -+ -+# Copyright (c) 2015-2016 Tim Kosse -+ -+# Copying and distribution of this file, with or without modification, are -+# permitted in any medium without royalty provided the copyright notice -+# and this notice are preserved. This file is offered as-is, without any -+# warranty. -+ -+m4_define([_CHECK_ATOMIC_testbody], [[ -+ #include -+ #include -+ -+ int main() { -+ std::atomic a{}; -+ -+ int64_t v = 5; -+ int64_t r = a.fetch_add(v); -+ return static_cast(r); -+ } -+]]) -+ -+AC_DEFUN([CHECK_ATOMIC], [ -+ -+ AC_LANG_PUSH(C++) -+ -+ AC_MSG_CHECKING([whether std::atomic can be used without link library]) -+ -+ AC_LINK_IFELSE([AC_LANG_SOURCE([_CHECK_ATOMIC_testbody])],[ -+ AC_MSG_RESULT([yes]) -+ ],[ -+ ATOMIC_LIBS=-latomic -+ ]) -+ -+ AC_LANG_POP -+ AC_SUBST([ATOMIC_LIBS]) -+]) +@@ -30,15 +30,7 @@ AC_DEFUN([CHECK_ATOMIC], [ + AC_LINK_IFELSE([AC_LANG_SOURCE([_CHECK_ATOMIC_testbody])],[ + AC_MSG_RESULT([yes]) + ],[ +- AC_MSG_RESULT([no]) + ATOMIC_LIBS=-latomic +- AC_MSG_CHECKING([whether std::atomic needs -latomic]) +- AC_LINK_IFELSE([AC_LANG_SOURCE([_CHECK_ATOMIC_testbody])],[ +- AC_MSG_RESULT([yes]) +- ],[ +- AC_MSG_RESULT([no]) +- AC_MSG_FAILURE([cannot figure out how to use std::atomic]) +- ]) + ]) + + AC_LANG_POP