Skip to content

Commit

Permalink
fix(x11/far2l): Backport patch to work with current libnfs
Browse files Browse the repository at this point in the history
  • Loading branch information
fornwall committed Jan 9, 2025
1 parent 7c0475a commit f534192
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
38 changes: 38 additions & 0 deletions x11-packages/far2l/2566.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
From bbf73ee62988b16d629a0f5e76faa7be14a4c490 Mon Sep 17 00:00:00 2001
From: elfmz <[email protected]>
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)
2 changes: 1 addition & 1 deletion x11-packages/far2l/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit f534192

Please sign in to comment.