transmission: Bump to 4.0.0

This commit is contained in:
termux-pacman-bot
2023-02-13 06:35:16 +00:00
parent 126b937346
commit 67c7372fa8
8 changed files with 54 additions and 280 deletions

View File

@@ -1,42 +0,0 @@
From 857ac91a03a096601f62b358fc61355d4cc25b9b Mon Sep 17 00:00:00 2001
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Date: Sat, 9 Oct 2021 18:51:13 +0200
Subject: [PATCH] configure.ac: fix autoreconf with autoconf >= 2.70
Remove the whitespace before IT_PROG_INTLTOOL as suggested in
https://www.mail-archive.com/bug-autoconf@gnu.org/msg04851.html
to avoid the following build failure with autoconf >= 2.70:
ERROR: 'IT_PROG_INTLTOOL' must appear in configure.ac for intltool to work.
The problem has been introduced by upstream autoconf commit
http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commit;h=b3b3af821a0b9e82ebe56b77b1731d2fe58f52de
Fixes:
- http://autobuild.buildroot.org/results/e8bea26f6b12adf16335b24836a7c5c31911af6a
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
[Upstream status: not upstreamable as upstream swicthed to cmake (
https://github.com/transmission/transmission/issues/1573)]
---
configure.ac | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/configure.ac b/configure.ac
index fd1132fda..04e0e19bb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -555,9 +555,7 @@ dnl it should be safe to re-edit 0.40 back down to 0.23
use_nls=no
if test "x$enable_nls" = "xyes" ; then
use_nls=yes
- m4_ifdef([IT_PROG_INTLTOOL],
- [IT_PROG_INTLTOOL([0.35.0],[no-xml])],
- [AC_MSG_ERROR("--enable-nls requires intltool to be installed.")])
+IT_PROG_INTLTOOL([0.35.0],[no-xml])
AC_CHECK_HEADERS([libintl.h])
GETTEXT_PACKAGE=transmission-gtk
AC_SUBST(GETTEXT_PACKAGE)
--
2.33.0

View File

@@ -1,34 +0,0 @@
diff -u -r ../transmission-2.82/third-party/libnatpmp/getgateway.h ./third-party/libnatpmp/getgateway.h
--- ../transmission-2.82/third-party/libnatpmp/getgateway.h 2013-08-09 04:47:55.000000000 +0200
+++ ./third-party/libnatpmp/getgateway.h 2014-01-28 23:57:43.000000000 +0100
@@ -40,6 +40,8 @@
#endif
#include "declspec.h"
+#include <arpa/inet.h>
+
/* getdefaultgateway() :
* return value :
* 0 : success
--- ../natpmp.c.orig 2020-05-14 20:17:03.002657737 +0200
+++ ./third-party/libnatpmp/natpmp.c 2020-05-14 20:17:34.527090133 +0200
@@ -54,6 +54,7 @@
#include "natpmp.h"
#include "getgateway.h"
#include <stdio.h>
+#include <arpa/inet.h>
NATPMP_LIBSPEC int initnatpmp(natpmp_t * p, int forcegw, in_addr_t forcedgw)
{
diff -u -r ../transmission-2.82/third-party/libnatpmp/natpmp.h ./third-party/libnatpmp/natpmp.h
--- ../transmission-2.82/third-party/libnatpmp/natpmp.h 2013-08-09 04:47:55.000000000 +0200
+++ ./third-party/libnatpmp/natpmp.h 2014-01-28 23:58:05.000000000 +0100
@@ -51,6 +51,8 @@
#include <netinet/in.h>
#endif
+#include <arpa/inet.h>
+
typedef struct {
int s; /* socket */
in_addr_t gateway; /* default gateway (IPv4) */

View File

@@ -1,13 +1,19 @@
TERMUX_PKG_HOMEPAGE=https://transmissionbt.com/
TERMUX_PKG_DESCRIPTION="Easy, lean and powerful BitTorrent client"
TERMUX_PKG_LICENSE="MIT"
# with OpenSSL linking exception:
TERMUX_PKG_LICENSE="GPL-2.0, GPL-3.0"
TERMUX_PKG_LICENSE_FILE="COPYING, licenses/gpl-2.0.txt, licenses/gpl-3.0.txt"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=3.00
TERMUX_PKG_REVISION=9
TERMUX_PKG_VERSION=4.0.0
TERMUX_PKG_SRCURL=git+https://github.com/transmission/transmission
TERMUX_PKG_GIT_BRANCH=$TERMUX_PKG_VERSION
TERMUX_PKG_DEPENDS="libcurl, libevent, miniupnpc, openssl"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--without-gtk --enable-lightweight --cache-file=termux_configure.cache"
TERMUX_PKG_DEPENDS="libc++, libcurl, libevent, libpsl, miniupnpc, natpmpc, openssl"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
-DENABLE_GTK=OFF
-DENABLE_QT=OFF
-DENABLE_TESTS=OFF
-DENABLE_NLS=OFF
"
# transmission already puts timestamps in the info printed to stdout so no need for svlogd -tt,
# therefore we override the transmission/log run script
TERMUX_PKG_SERVICE_SCRIPT=(
@@ -16,10 +22,5 @@ TERMUX_PKG_SERVICE_SCRIPT=(
)
termux_step_pre_configure() {
CFLAGS+=" -D_POSIX_C_SOURCE=200809L"
./autogen.sh
echo "ac_cv_func_getmntent=no" >> termux_configure.cache
echo "ac_cv_search_getmntent=false" >> termux_configure.cache
chmod a-w termux_configure.cache
LDFLAGS+=" -llog"
}

View File

@@ -1,22 +1,20 @@
diff --git a/libtransmission/platform.c b/libtransmission/platform.c
index cf0ecd825..1540dbf4f 100644
--- a/libtransmission/platform.c
+++ b/libtransmission/platform.c
@@ -593,7 +593,7 @@ char const* tr_getWebClientDir(tr_session const* session UNUSED)
{
char const* pkg = PACKAGE_DATA_DIR;
char* xdg = tr_env_get_string("XDG_DATA_DIRS", NULL);
- char const* fallback = "/usr/local/share:/usr/share";
+ char const* fallback = "@TERMUX_PREFIX@/share";
char* buf = tr_strdup_printf("%s:%s:%s", pkg != NULL ? pkg : "", xdg != NULL ? xdg : "", fallback);
tr_free(xdg);
tmp = buf;
@@ -649,7 +649,7 @@ char* tr_getSessionIdDir(void)
--- a/libtransmission/platform.cc
+++ b/libtransmission/platform.cc
@@ -304,7 +304,7 @@
{
char const* const pkg = PACKAGE_DATA_DIR;
auto const xdg = tr_env_get_string("XDG_DATA_DIRS"sv);
- auto const buf = fmt::format(FMT_STRING("{:s}:{:s}:/usr/local/share:/usr/share"), pkg, xdg);
+ auto const buf = fmt::format(FMT_STRING("{:s}:{:s}:@TERMUX_PREFIX@/share"), pkg, xdg);
auto sv = std::string_view{ buf };
auto token = std::string_view{};
@@ -336,7 +336,7 @@
{
#ifndef _WIN32
- return tr_strdup("/tmp");
+ return tr_strdup("@TERMUX_PREFIX@/tmp");
- return std::string{ "/tmp"sv };
+ return std::string{ "@TERMUX_PREFIX@/tmp"sv };
#else

View File

@@ -1,11 +0,0 @@
diff -u -r ../transmission-2.92/libtransmission/fdlimit.c ./libtransmission/fdlimit.c
--- ../transmission-2.92/libtransmission/fdlimit.c 2015-10-23 21:35:22.638234970 -0400
+++ ./libtransmission/fdlimit.c 2016-03-07 20:32:58.075869242 -0500
@@ -11,6 +11,7 @@
#include <errno.h>
#include <inttypes.h>
#include <string.h>
+#include <sys/select.h>
#ifndef _WIN32
#include <sys/time.h> /* getrlimit */

View File

@@ -1,11 +1,11 @@
--- ./libtransmission/utils.c.orig 2020-05-14 20:22:41.415540431 +0200
+++ ./libtransmission/utils.c 2020-05-14 20:23:46.340145553 +0200
@@ -1627,7 +1627,7 @@
char buf[128];
tr_snprintf(buf, sizeof(buf), "%.*f", DBL_DIG, x);
--- a/libtransmission/utils.cc
+++ b/libtransmission/utils.cc
@@ -482,7 +482,7 @@
auto const [out, len] = fmt::format_to_n(std::data(buf), std::size(buf) - 1, "{:.{}f}", x, DBL_DIG);
*out = '\0';
- if ((pt = strstr(buf, localeconv()->decimal_point)) != NULL)
+ if ((pt = strstr(buf, ".")) != NULL)
- if (auto* const pt = strstr(std::data(buf), localeconv()->decimal_point); pt != nullptr)
+ if (auto* const pt = strstr(std::data(buf), "."); pt != nullptr)
{
pt[precision != 0 ? precision + 1 : 0] = '\0';
pt[decimal_places != 0 ? decimal_places + 1 : 0] = '\0';
}

View File

@@ -1,6 +1,6 @@
--- ../platform-quota.c.orig 2020-05-14 20:26:21.167021182 +0200
+++ ./libtransmission/platform-quota.c 2020-05-14 21:35:02.917361346 +0200
@@ -26,7 +26,7 @@
--- a/libtransmission/platform-quota.cc
+++ b/libtransmission/platform-quota.cc
@@ -23,7 +23,7 @@
#endif
#elif defined(__sun)
#include <sys/fs/ufs_quota.h> /* quotactl */
@@ -9,37 +9,29 @@
#include <sys/quota.h> /* quotactl() */
#endif
#ifdef HAVE_GETMNTENT
@@ -77,7 +77,9 @@
@@ -73,7 +73,9 @@
static char const* getdev(char const* path)
[[nodiscard]] char const* getdev(std::string_view path)
{
-#ifdef HAVE_GETMNTENT
+#ifdef __ANDROID__
+ return NULL;
+ return NULL;
+#elif defined(HAVE_GETMNTENT)
FILE* fp;
#ifdef __sun
@@ -315,11 +317,12 @@
static int64_t getquota(char const* device)
{
-#if defined(__DragonFly__)
+#ifdef __ANDROID__
+ return -1;
+#elif defined(__DragonFly__)
struct ufs_dqblk dq;
#else
struct dqblk dq;
-#endif
int64_t limit;
int64_t freespace;
int64_t spaceused;
@@ -389,6 +392,7 @@
/* something went wrong */
return -1;
+#endif
@@ -281,6 +283,14 @@
return disk_space;
}
#endif
+#elif defined(__ANDROID__)
+
+[[nodiscard]] tr_disk_space getquota(char const* device)
+{
+ struct tr_disk_space disk_space = { -1, -1 };
+ return disk_space;
+}
+
#else
[[nodiscard]] tr_disk_space getquota(char const* device)

View File

@@ -1,130 +0,0 @@
Description: Compatibility with OpenSSL 3
We rely on RC4 because of the torrent protocol we're implementing, but this
is no longer available in the default provider.
Author: Steve Langasek <steve.langasek@ubuntu.com>
Bug-Ubuntu: https://bugs.launchpad.net/bugs/1946215
Last-Update: 2021-12-13
Forwarded: no
Index: transmission-3.00/libtransmission/crypto-utils-openssl.c
===================================================================
--- transmission-3.00.orig/libtransmission/crypto-utils-openssl.c
+++ transmission-3.00/libtransmission/crypto-utils-openssl.c
@@ -20,6 +20,9 @@
#include <openssl/rand.h>
#include <openssl/ssl.h>
#include <openssl/x509.h>
+#if OPENSSL_VERSION_NUMBER >= 0x30000000L
+#include <openssl/provider.h>
+#endif
#include "transmission.h"
#include "crypto-utils.h"
@@ -182,46 +185,86 @@
#endif
+typedef struct tr_rc4_ctx {
+ EVP_CIPHER_CTX *cipher_ctx;
+#if OPENSSL_VERSION_NUMBER >= 0x30000000L
+ OSSL_LIB_CTX *lib_ctx;
+#endif
+} tr_rc4_ctx;
+
tr_rc4_ctx_t tr_rc4_new(void)
{
- EVP_CIPHER_CTX* handle = EVP_CIPHER_CTX_new();
+#if OPENSSL_VERSION_NUMBER >= 0x30000000L
+ OSSL_PROVIDER *legacy_provider = NULL;
+ OSSL_PROVIDER *default_provider = NULL;
+#endif
+ const EVP_CIPHER *cipher;
- if (check_result(EVP_CipherInit_ex(handle, EVP_rc4(), NULL, NULL, NULL, -1)))
+ tr_rc4_ctx *handle = malloc(sizeof(tr_rc4_ctx));
+
+ handle->cipher_ctx = EVP_CIPHER_CTX_new();
+
+#if OPENSSL_VERSION_NUMBER >= 0x30000000L
+ handle->lib_ctx = OSSL_LIB_CTX_new();
+ TR_ASSERT(handle->lib_ctx);
+ legacy_provider = OSSL_PROVIDER_load(handle->lib_ctx, "legacy");
+ TR_ASSERT(legacy_provider);
+ default_provider = OSSL_PROVIDER_load(handle->lib_ctx, "default");
+ TR_ASSERT(default_provider);
+
+ cipher = EVP_CIPHER_fetch(handle->lib_ctx, "RC4", NULL);
+#else
+ cipher = EVP_rc4();
+#endif
+
+ if (check_result(EVP_CipherInit_ex(handle->cipher_ctx, cipher, NULL, NULL,
+ NULL, -1)))
{
return handle;
}
- EVP_CIPHER_CTX_free(handle);
+ EVP_CIPHER_CTX_free(handle->cipher_ctx);
+#if OPENSSL_VERSION_NUMBER >= 0x30000000L
+ OSSL_LIB_CTX_free(handle->lib_ctx);
+#endif
return NULL;
}
-void tr_rc4_free(tr_rc4_ctx_t handle)
+void tr_rc4_free(tr_rc4_ctx_t h)
{
- if (handle == NULL)
+ if (h == NULL)
{
return;
}
- EVP_CIPHER_CTX_free(handle);
+ tr_rc4_ctx *handle = (tr_rc4_ctx *)h;
+
+ EVP_CIPHER_CTX_free(handle->cipher_ctx);
+#if OPENSSL_VERSION_NUMBER >= 0x30000000L
+ OSSL_LIB_CTX_free(handle->lib_ctx);
+#endif
+ free(handle);
}
-void tr_rc4_set_key(tr_rc4_ctx_t handle, uint8_t const* key, size_t key_length)
+void tr_rc4_set_key(tr_rc4_ctx_t h, uint8_t const* key, size_t key_length)
{
- TR_ASSERT(handle != NULL);
+ TR_ASSERT(h != NULL);
TR_ASSERT(key != NULL);
- if (!check_result(EVP_CIPHER_CTX_set_key_length(handle, key_length)))
+ tr_rc4_ctx *handle = (tr_rc4_ctx *)h;
+ if (!check_result(EVP_CIPHER_CTX_set_key_length(handle->cipher_ctx, key_length)))
{
return;
}
- check_result(EVP_CipherInit_ex(handle, NULL, NULL, key, NULL, -1));
+ check_result(EVP_CipherInit_ex(handle->cipher_ctx, NULL, NULL, key, NULL, -1));
}
-void tr_rc4_process(tr_rc4_ctx_t handle, void const* input, void* output, size_t length)
+void tr_rc4_process(tr_rc4_ctx_t h, void const* input, void* output, size_t length)
{
- TR_ASSERT(handle != NULL);
+ TR_ASSERT(h != NULL);
+ tr_rc4_ctx *handle = (tr_rc4_ctx *)h;
if (length == 0)
{
return;
@@ -232,7 +275,7 @@
int output_length;
- check_result(EVP_CipherUpdate(handle, output, &output_length, input, length));
+ check_result(EVP_CipherUpdate(handle->cipher_ctx, output, &output_length, input, length));
}
/***