Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libnfs: update to 6.0.x and api v2 #9568

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions packages/mediacenter/kodi/patches/kodi-999.99-nfs.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
--- a/xbmc/filesystem/NFSFile.cpp 2024-11-15 21:22:52.000000000 +0000
+++ b/xbmc/filesystem/NFSFile.cpp 2024-12-12 13:15:36.937126708 +0000
@@ -477,7 +477,11 @@

nfs_lseek(pContext, _pFileHandle, 0, SEEK_CUR, &offset);

+#ifdef LIBNFS_API_V2
+ int bytes = nfs_read(pContext, _pFileHandle, buffer, 32);
+#else
int bytes = nfs_read(pContext, _pFileHandle, 32, buffer);
+#endif
if (bytes < 0)
{
CLog::LogF(LOGERROR, "nfs_read - Error ({}, {})", bytes, nfs_get_error(pContext));
@@ -742,7 +746,11 @@
if (m_pFileHandle == NULL || m_pNfsContext == NULL )
return -1;

+#ifdef LIBNFS_API_V2
+ numberOfBytesRead = nfs_read(m_pNfsContext, m_pFileHandle, (char *)lpBuf, uiBufSize);
+#else
numberOfBytesRead = nfs_read(m_pNfsContext, m_pFileHandle, uiBufSize, (char *)lpBuf);
+#endif

lock.unlock(); //no need to keep the connection lock after that

@@ -843,10 +851,17 @@
}
//write chunk
//! @bug libnfs < 2.0.0 isn't const correct
+#ifdef LIBNFS_API_V2
+ writtenBytes = nfs_write(m_pNfsContext,
+ m_pFileHandle,
+ const_cast<char*>((const char *)lpBuf) + numberOfBytesWritten,
+ chunkSize);
+#else
writtenBytes = nfs_write(m_pNfsContext,
m_pFileHandle,
chunkSize,
const_cast<char*>((const char *)lpBuf) + numberOfBytesWritten);
+#endif
//decrease left bytes
leftBytes-= writtenBytes;
//increase overall written bytes
7 changes: 4 additions & 3 deletions packages/network/libnfs/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)

PKG_NAME="libnfs"
PKG_VERSION="5.0.3"
PKG_SHA256="d945cb4f4c8f82ee1f3640893a168810f794a28e1010bb007ec5add345e9df3e"
PKG_VERSION="6.0.2"
PKG_SHA256="4e5459cc3e0242447879004e9ad28286d4d27daa42cbdcde423248fad911e747"
PKG_LICENSE="LGPL2.1+"
PKG_SITE="https://github.com/sahlberg/libnfs"
PKG_URL="https://github.com/sahlberg/libnfs/archive/libnfs-${PKG_VERSION}.tar.gz"
PKG_DEPENDS_TARGET="toolchain"
PKG_LONGDESC="A client library for accessing NFS shares over a network."
PKG_TOOLCHAIN="autotools"

PKG_CONFIGURE_OPTS_TARGET="--disable-examples"
PKG_CONFIGURE_OPTS_TARGET="--disable-examples \
--without-libkrb5"

pre_configure_target() {
export CFLAGS="${CFLAGS} -D_FILE_OFFSET_BITS=64"
Expand Down