From 2f3a5c1081d459b7db9daf92369b1ef3da17db35 Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Sun, 7 Jul 2024 00:22:13 +0200 Subject: [PATCH] fix(main/transmission): Rebuild against miniupnpc 2.2.8 It seems that miniupnpc 2.2.8 broke API compatibility - see https://github.com/miniupnp/miniupnp/issues/758. This causes the current transmission package to segfault (#20490) as well as the build to fail, so we here backport https://github.com/transmission/transmission/pull/6907 to fix that. Closes #20490 --- packages/transmission/build.sh | 1 + packages/transmission/miniupnpc-2.2.8.patch | 71 +++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 packages/transmission/miniupnpc-2.2.8.patch diff --git a/packages/transmission/build.sh b/packages/transmission/build.sh index 6889f9773dc01a..574c508b5b0e12 100644 --- a/packages/transmission/build.sh +++ b/packages/transmission/build.sh @@ -5,6 +5,7 @@ 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="4.0.6" +TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=git+https://github.com/transmission/transmission TERMUX_PKG_AUTO_UPDATE=true TERMUX_PKG_GIT_BRANCH=$TERMUX_PKG_VERSION diff --git a/packages/transmission/miniupnpc-2.2.8.patch b/packages/transmission/miniupnpc-2.2.8.patch new file mode 100644 index 00000000000000..613e227a4eabf4 --- /dev/null +++ b/packages/transmission/miniupnpc-2.2.8.patch @@ -0,0 +1,71 @@ +From 3523b928c8c968d0b7bca2c6c3a84a939e908f8c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?C=C5=93ur?= +Date: Mon, 10 Jun 2024 22:16:06 +0800 +Subject: [PATCH 1/5] bump miniupnpc to 2.2.8 + +--- + libtransmission/port-forwarding-upnp.cc | 4 ++++ + third-party/miniupnp | 2 +- + 2 files changed, 5 insertions(+), 1 deletion(-) + +diff --git a/libtransmission/port-forwarding-upnp.cc b/libtransmission/port-forwarding-upnp.cc +index 6d7bbc7f7c2..d805bc18218 100644 +--- a/libtransmission/port-forwarding-upnp.cc ++++ b/libtransmission/port-forwarding-upnp.cc +@@ -261,7 +261,11 @@ tr_port_forwarding_state tr_upnpPulse( + + FreeUPNPUrls(&handle->urls); + auto lanaddr = std::array{}; ++#if (MINIUPNPC_API_VERSION >= 18) ++ if (UPNP_GetValidIGD(devlist, &handle->urls, &handle->data, std::data(lanaddr), std::size(lanaddr) - 1, NULL, 0) == ++#else + if (UPNP_GetValidIGD(devlist, &handle->urls, &handle->data, std::data(lanaddr), std::size(lanaddr) - 1) == ++#endif + UPNP_IGD_VALID_CONNECTED) + { + tr_logAddInfo(fmt::format(_("Found Internet Gateway Device '{url}'"), fmt::arg("url", handle->urls.controlURL))); +diff --git a/libtransmission/port-forwarding-upnp.cc b/libtransmission/port-forwarding-upnp.cc +index d805bc18218..fadf09bb2e5 100644 +--- a/libtransmission/port-forwarding-upnp.cc ++++ b/libtransmission/port-forwarding-upnp.cc +@@ -261,12 +261,13 @@ tr_port_forwarding_state tr_upnpPulse( + + FreeUPNPUrls(&handle->urls); + auto lanaddr = std::array{}; ++ if ( + #if (MINIUPNPC_API_VERSION >= 18) +- if (UPNP_GetValidIGD(devlist, &handle->urls, &handle->data, std::data(lanaddr), std::size(lanaddr) - 1, NULL, 0) == ++ UPNP_GetValidIGD(devlist, &handle->urls, &handle->data, std::data(lanaddr), std::size(lanaddr) - 1, NULL, 0) + #else +- if (UPNP_GetValidIGD(devlist, &handle->urls, &handle->data, std::data(lanaddr), std::size(lanaddr) - 1) == ++ UPNP_GetValidIGD(devlist, &handle->urls, &handle->data, std::data(lanaddr), std::size(lanaddr) - 1) + #endif +- UPNP_IGD_VALID_CONNECTED) ++ == UPNP_IGD_VALID_CONNECTED) + { + tr_logAddInfo(fmt::format(_("Found Internet Gateway Device '{url}'"), fmt::arg("url", handle->urls.controlURL))); + tr_logAddInfo(fmt::format(_("Local Address is '{address}'"), fmt::arg("address", lanaddr.data()))); + +From 513327f6f3f216c53086191dc9876dcbe7cbeece Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?C=C5=93ur?= +Date: Wed, 12 Jun 2024 13:12:24 +0800 +Subject: [PATCH 4/5] Update Transmission.xcodeproj/project.pbxproj + +Co-authored-by: Mike Gelfand +--- + Transmission.xcodeproj/project.pbxproj | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libtransmission/port-forwarding-upnp.cc b/libtransmission/port-forwarding-upnp.cc +index fadf09bb2e5..a4146e0df13 100644 +--- a/libtransmission/port-forwarding-upnp.cc ++++ b/libtransmission/port-forwarding-upnp.cc +@@ -263,7 +263,7 @@ tr_port_forwarding_state tr_upnpPulse( + auto lanaddr = std::array{}; + if ( + #if (MINIUPNPC_API_VERSION >= 18) +- UPNP_GetValidIGD(devlist, &handle->urls, &handle->data, std::data(lanaddr), std::size(lanaddr) - 1, NULL, 0) ++ UPNP_GetValidIGD(devlist, &handle->urls, &handle->data, std::data(lanaddr), std::size(lanaddr) - 1, nullptr, 0) + #else + UPNP_GetValidIGD(devlist, &handle->urls, &handle->data, std::data(lanaddr), std::size(lanaddr) - 1) + #endif