diff mbox series

[meta-oe,23/55] libnfs: upgrade 6.0.2 -> 8.1.0

Message ID 20261125080732.2419614-29-khem.raj@oss.qualcomm.com
State New
Headers show
Series [meta-multimedia] clightd: Port ALS sensor to libiio 1.0 | expand

Commit Message

Khem Raj Nov. 25, 2026, 8:06 a.m. UTC
- 7.0.0: SONAME bump to libnfs.so.17 (struct rpc_stats grew), high/low
  priority RPC send queue; 7.0.1 renames _null_auth to
  libnfs_null_auth
- 8.0.0: SONAME libnfs.so.18, NFSv4.2 support, nfs_fallocate(),
  SEEK_DATA/SEEK_HOLE, nfs4_stat64() and named attributes
- 8.1.0: ABI compatible with 8.0.x; NFSv4.1 support, NFS over RDMA,
  RPCSEC_GSS reply verification and security fixes against malicious
  servers, including a use-after-free when a cut-short READ is resent

Drop 0001-CMakeLists.txt-respect-CMAKE_INSTALL_LIBDIR-for-mult.patch,
CMake now installs to CMAKE_INSTALL_FULL_LIBDIR/CMAKE_INSTALL_LIBDIR.
Fetch by tag instead of a bare commit and add
UPSTREAM_CHECK_GITTAGREGEX. TLS, Kerberos and RDMA support are
autodetected by default; pin them with PACKAGECONFIGs (tls on, as
gnutls was already a dependency; krb5 and rdma off) so the build is
deterministic. Inherit pkgconfig, which the krb5-gssapi check uses.
Users (qemu, gvfs) need a rebuild for the new SONAME.

The CMake build writes the absolute path of the GnuTLS library into
libnfs.pc; add a patch that turns it into -lgnutls (buildpaths QA).

AI-Generated: Uses Claude Code
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
---
 ...espect-CMAKE_INSTALL_LIBDIR-for-mult.patch | 61 -------------------
 ...te-absolute-library-paths-into-libnf.patch | 48 +++++++++++++++
 .../libnfs/libnfs_6.0.2.bb                    | 17 ------
 .../libnfs/libnfs_8.1.0.bb                    | 22 +++++++
 4 files changed, 70 insertions(+), 78 deletions(-)
 delete mode 100644 meta-oe/recipes-connectivity/libnfs/libnfs/0001-CMakeLists.txt-respect-CMAKE_INSTALL_LIBDIR-for-mult.patch
 create mode 100644 meta-oe/recipes-connectivity/libnfs/libnfs/0001-cmake-Do-not-write-absolute-library-paths-into-libnf.patch
 delete mode 100644 meta-oe/recipes-connectivity/libnfs/libnfs_6.0.2.bb
 create mode 100644 meta-oe/recipes-connectivity/libnfs/libnfs_8.1.0.bb
diff mbox series

Patch

diff --git a/meta-oe/recipes-connectivity/libnfs/libnfs/0001-CMakeLists.txt-respect-CMAKE_INSTALL_LIBDIR-for-mult.patch b/meta-oe/recipes-connectivity/libnfs/libnfs/0001-CMakeLists.txt-respect-CMAKE_INSTALL_LIBDIR-for-mult.patch
deleted file mode 100644
index ffb6bfbea8..0000000000
--- a/meta-oe/recipes-connectivity/libnfs/libnfs/0001-CMakeLists.txt-respect-CMAKE_INSTALL_LIBDIR-for-mult.patch
+++ /dev/null
@@ -1,61 +0,0 @@ 
-From 0d5d6a14f6e9c2ff8998ebb3acbefcad6221952f Mon Sep 17 00:00:00 2001
-From: Martin Jansa <Martin.Jansa@gmail.com>
-Date: Wed, 3 May 2023 22:27:10 +0200
-Subject: [PATCH] CMakeLists.txt: respect ${CMAKE_INSTALL_LIBDIR} for multilib
-
-* fixes:
-  ERROR: libnfs-5.0.2-r0 do_package: QA Issue: libnfs: Files/directories were installed but not shipped in any package:
-    /usr/lib/libnfs.so
-    /usr/lib/libnfs.so.11.1.0
-    /usr/lib/libnfs.so.5.0.2
-    /usr/lib/pkgconfig
-    /usr/lib/cmake
-    /usr/lib/pkgconfig/libnfs.pc
-    /usr/lib/cmake/libnfs
-    /usr/lib/cmake/libnfs/libnfs-config-version.cmake
-    /usr/lib/cmake/libnfs/libnfs-config.cmake
-    /usr/lib/cmake/libnfs/libnfs-config-noconfig.cmake
-    /usr/lib/cmake/libnfs/FindNFS.cmake
-  Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install.
-  libnfs: 11 installed and not shipped files. [installed-vs-shipped]
-
-  when libdir is /usr/lib64 with multilib
-
-Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
-Upstream-Status: Pending
----
- CMakeLists.txt     | 6 +++---
- lib/CMakeLists.txt | 4 ++--
- 2 files changed, 5 insertions(+), 5 deletions(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 1b94d2e..a295403 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -7,11 +7,11 @@ project(libnfs
- set(SOVERSION 16.2.0 CACHE STRING "" FORCE)
- 
- set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation directory for binaries")
--set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation directory for libraries")
-+set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}" CACHE PATH "Installation directory for libraries")
- set(INSTALL_INC_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "Installation directory for headers")
- set(INSTALL_MAN_DIR "${CMAKE_INSTALL_PREFIX}/share/man" CACHE PATH "Installation directory for manual pages")
--set(INSTALL_PKGCONFIG_DIR "${INSTALL_LIB_DIR}/pkgconfig" CACHE PATH "Installation directory for pkgconfig (.pc) files")
--set(INSTALL_CMAKE_DIR "${INSTALL_LIB_DIR}/cmake/libnfs" CACHE PATH "Installation directory for cmake (.cmake) files")
-+set(INSTALL_PKGCONFIG_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/pkgconfig" CACHE PATH "Installation directory for pkgconfig (.pc) files")
-+set(INSTALL_CMAKE_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/cmake/libnfs" CACHE PATH "Installation directory for cmake (.cmake) files")
- 
- option(BUILD_SHARED_LIBS "Build shared libraries" ON)
- option(ENABLE_TESTS "Build and run test programs" OFF)
-diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
-index 987b735..9b2032f 100644
---- a/lib/CMakeLists.txt
-+++ b/lib/CMakeLists.txt
-@@ -24,5 +24,5 @@ set_target_properties(nfs PROPERTIES
- 
- install(TARGETS nfs EXPORT libnfs
-                     RUNTIME DESTINATION bin
--                    ARCHIVE DESTINATION lib
--                    LIBRARY DESTINATION lib)
-+                    ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
-+                    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
diff --git a/meta-oe/recipes-connectivity/libnfs/libnfs/0001-cmake-Do-not-write-absolute-library-paths-into-libnf.patch b/meta-oe/recipes-connectivity/libnfs/libnfs/0001-cmake-Do-not-write-absolute-library-paths-into-libnf.patch
new file mode 100644
index 0000000000..47b8d0c4b8
--- /dev/null
+++ b/meta-oe/recipes-connectivity/libnfs/libnfs/0001-cmake-Do-not-write-absolute-library-paths-into-libnf.patch
@@ -0,0 +1,48 @@ 
+From a0a24106214fc7be8cc1321d8c4f27091cfceb2c Mon Sep 17 00:00:00 2001
+From: Khem Raj <khem.raj@oss.qualcomm.com>
+Date: Tue, 24 Nov 2026 22:41:43 -0800
+Subject: [PATCH] cmake: do not write absolute library paths into libnfs.pc
+
+find_library() and find_package() return absolute paths, such as
+/usr/lib/libgnutls.so for GnuTLS or the GSSAPI library, and these went
+verbatim into Libs.private. That leaks the build machine's library
+directory (a cross-compile sysroot, for example) into the installed
+libnfs.pc, where it is wrong for every other consumer. Turn such paths
+into -l<name> by dropping the directory, a leading "lib" and the
+library suffix along with any version after it.
+
+Libs.private was also written with the CMake list separator, e.g.
+"/usr/lib/libgnutls.so;-ldl;/usr/lib/libgssapi_krb5.so" with TLS and
+Kerberos enabled, which pkg-config passes on as a single argument, so
+"pkg-config --static --libs libnfs" did not link. Separate the entries
+with spaces.
+
+Upstream-Status: Submitted [https://github.com/sahlberg/libnfs/pull/641]
+AI-Generated: Uses Claude Code
+Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
+---
+ CMakeLists.txt | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 237ac86..2b8b9d8 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -306,11 +306,16 @@ foreach(LIB ${SYSTEM_LIBRARIES})
+   if(LIB MATCHES "/([^/]+)\\.framework$")
+     list(APPEND PKG_LIBLIST "-framework ${CMAKE_MATCH_1}")
+   elseif(IS_ABSOLUTE ${LIB} AND EXISTS ${LIB})
+-    list(APPEND PKG_LIBLIST "${LIB}")
++    # find_library() paths are only valid on the build machine, use -l<name>
++    get_filename_component(LIBNAME ${LIB} NAME)
++    string(REGEX REPLACE "^lib" "" LIBNAME ${LIBNAME})
++    string(REGEX REPLACE "\\.(so|a|dylib|tbd|lib|dll\\.a)(\\..*)?$" "" LIBNAME ${LIBNAME})
++    list(APPEND PKG_LIBLIST "-l${LIBNAME}")
+   else()
+     list(APPEND PKG_LIBLIST "-l${LIB}")
+   endif()
+ endforeach()
++string(REPLACE ";" " " PKG_LIBLIST "${PKG_LIBLIST}")
+ configure_file(cmake/libnfs.pc.cmake
+                ${CMAKE_CURRENT_BINARY_DIR}/libnfs.pc @ONLY)
+ 
diff --git a/meta-oe/recipes-connectivity/libnfs/libnfs_6.0.2.bb b/meta-oe/recipes-connectivity/libnfs/libnfs_6.0.2.bb
deleted file mode 100644
index 49617eaa29..0000000000
--- a/meta-oe/recipes-connectivity/libnfs/libnfs_6.0.2.bb
+++ /dev/null
@@ -1,17 +0,0 @@ 
-SUMMARY = "NFS client library"
-HOMEPAGE = "https://github.com/sahlberg/libnfs"
-LICENSE = "BSD-2-Clause AND GPL-3.0-only AND LGPL-2.1-only"
-LIC_FILES_CHKSUM = "file://COPYING;md5=825301ba17efc9d188ee0abd4b924ada"
-
-SRC_URI = "git://github.com/sahlberg/libnfs.git;protocol=https;branch=master \
-           file://0001-CMakeLists.txt-respect-CMAKE_INSTALL_LIBDIR-for-mult.patch \
-           "
-SRCREV = "18c5c73ee88bb7dc8da0d55dc95164bb77e49dc6"
-
-DEPENDS += "gnutls"
-
-inherit cmake
-
-do_install:append() {
-	rm -f ${D}${libdir}/cmake/libnfs/libnfs-config.cmake
-}
diff --git a/meta-oe/recipes-connectivity/libnfs/libnfs_8.1.0.bb b/meta-oe/recipes-connectivity/libnfs/libnfs_8.1.0.bb
new file mode 100644
index 0000000000..4a11b6d42d
--- /dev/null
+++ b/meta-oe/recipes-connectivity/libnfs/libnfs_8.1.0.bb
@@ -0,0 +1,22 @@ 
+SUMMARY = "NFS client library"
+HOMEPAGE = "https://github.com/sahlberg/libnfs"
+LICENSE = "BSD-2-Clause AND GPL-3.0-only AND LGPL-2.1-only"
+LIC_FILES_CHKSUM = "file://COPYING;md5=825301ba17efc9d188ee0abd4b924ada"
+
+SRC_URI = "git://github.com/sahlberg/libnfs.git;protocol=https;branch=master;tag=libnfs-${PV} \
+           file://0001-cmake-Do-not-write-absolute-library-paths-into-libnf.patch \
+           "
+SRCREV = "5c48d277783073a1be5aa3ce8ff1ca9a690c20a0"
+
+UPSTREAM_CHECK_GITTAGREGEX = "^libnfs-(?P<pver>\d+(\.\d+)+)$"
+
+inherit cmake pkgconfig
+
+PACKAGECONFIG ??= "tls"
+PACKAGECONFIG[krb5] = "-DENABLE_KRB5=ON,-DENABLE_KRB5=OFF,krb5"
+PACKAGECONFIG[rdma] = "-DENABLE_RDMA=ON,-DENABLE_RDMA=OFF,rdma-core"
+PACKAGECONFIG[tls] = "-DENABLE_TLS=ON,-DENABLE_TLS=OFF,gnutls"
+
+do_install:append() {
+	rm -f ${D}${libdir}/cmake/libnfs/libnfs-config.cmake
+}