From f53419262fbd849688f12f4c8ae580946c24ac55 Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Thu, 9 Jan 2025 19:23:05 +0100 Subject: [PATCH] fix(x11/far2l): Backport patch to work with current libnfs --- x11-packages/far2l/2566.patch | 38 +++++++++++++++++++++++++++++++++++ x11-packages/far2l/build.sh | 2 +- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 x11-packages/far2l/2566.patch diff --git a/x11-packages/far2l/2566.patch b/x11-packages/far2l/2566.patch new file mode 100644 index 00000000000000..4b578665ba73c1 --- /dev/null +++ b/x11-packages/far2l/2566.patch @@ -0,0 +1,38 @@ +From bbf73ee62988b16d629a0f5e76faa7be14a4c490 Mon Sep 17 00:00:00 2001 +From: elfmz +Date: Sat, 14 Dec 2024 11:15:40 +0300 +Subject: [PATCH] fixing build with recent libnfs + +--- + NetRocks/src/Protocol/NFS/ProtocolNFS.cpp | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +diff --git a/NetRocks/src/Protocol/NFS/ProtocolNFS.cpp b/NetRocks/src/Protocol/NFS/ProtocolNFS.cpp +index a3c3e764e..4d8412f4e 100644 +--- a/NetRocks/src/Protocol/NFS/ProtocolNFS.cpp ++++ b/NetRocks/src/Protocol/NFS/ProtocolNFS.cpp +@@ -507,7 +507,11 @@ class NFSFileIO : public IFileReader, public IFileWriter + + virtual size_t Read(void *buf, size_t len) + { ++#ifdef LIBNFS_API_V2 ++ const auto rc = nfs_read(_nfs->ctx, _file, (char *)buf, len); ++#else + const auto rc = nfs_read(_nfs->ctx, _file, len, (char *)buf); ++#endif + if (rc < 0) + throw ProtocolError("Read file error", errno); + // uncomment to simulate connection stuck if ( (rand()%100) == 0) sleep(60); +@@ -518,7 +522,11 @@ class NFSFileIO : public IFileReader, public IFileWriter + virtual void Write(const void *buf, size_t len) + { + if (len > 0) for (;;) { +- const auto rc = nfs_write(_nfs->ctx, _file, len, (char *)buf); ++#ifdef LIBNFS_API_V2 ++ const auto rc = nfs_write(_nfs->ctx, _file, (const char *)buf, len); ++#else ++ const auto rc = nfs_write(_nfs->ctx, _file, len, (const char *)buf); ++#endif + if (rc <= 0) + throw ProtocolError("Write file error", errno); + if ((size_t)rc >= len) diff --git a/x11-packages/far2l/build.sh b/x11-packages/far2l/build.sh index 7bab69c0a66309..c02e04a325ac53 100644 --- a/x11-packages/far2l/build.sh +++ b/x11-packages/far2l/build.sh @@ -3,7 +3,7 @@ TERMUX_PKG_DESCRIPTION="FAR Manager v2" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_MAINTAINER="@termux" TERMUX_PKG_VERSION="2.6.3" -TERMUX_PKG_REVISION=1 +TERMUX_PKG_REVISION=2 TERMUX_PKG_SRCURL=https://github.com/elfmz/far2l/archive/refs/tags/v_${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=ffb216a4f9b24bb45a2194d5e833c60334a4f4e9150c1ce0fc8eddffa6a9e173 TERMUX_PKG_DEPENDS="libarchive, libc++, libuchardet, pcre"