[vlc-commits] [Git][videolan/vlc][master] contrib: nfs: export gnutls in the pkg-config file

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Thu Nov 26 09:05:33 UTC 2026



Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
65e9b26b by Martin Finkel at 2026-11-26T08:01:22+00:00
contrib: nfs: export gnutls in the pkg-config file

The gnutls dependency was only listed in Libs.private, which is not used
when linking on Linux.

Fixes linking the nfs module since 8b8413df61.

- - - - -


2 changed files:

- + contrib/src/nfs/0001-cmake-use-Requires.private-for-gnutls-in-the-pkg-con.patch
- contrib/src/nfs/rules.mak


Changes:

=====================================
contrib/src/nfs/0001-cmake-use-Requires.private-for-gnutls-in-the-pkg-con.patch
=====================================
@@ -0,0 +1,66 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Martin Finkel <me at martinfinkel.com>
+Date: Mon, 23 Nov 2026 12:53:25 +0700
+Subject: [PATCH] cmake: use Requires.private for gnutls in the pkg-config file
+
+Listing the gnutls library path in Libs.private doesn't bring its own
+dependencies when linking statically.
+---
+ CMakeLists.txt        | 11 ++++++++++-
+ cmake/libnfs.pc.cmake |  1 +
+ 2 files changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index c87a9c7..241b45f 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -99,6 +99,8 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}
+ 
+ # list of system libs (sockets/etc) to be linked on this system
+ set(SYSTEM_LIBRARIES "")
++# list of pkg-config packages needed when linking statically
++set(PKG_REQUIRES_PRIVATE "")
+ # list of core (static) libraries built in current configuration (used by lib/CMakeLists.txt)
+ set(CORE_LIBRARIES "" CACHE INTERNAL "")
+ 
+@@ -185,6 +187,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL Linux)
+       message(STATUS "Using ${GNUTLS_LIBRARIES}")
+       add_definitions(-DHAVE_TLS)
+       list(APPEND SYSTEM_LIBRARIES ${GNUTLS_LIBRARIES})
++      list(APPEND PKG_REQUIRES_PRIVATE gnutls)
+       add_subdirectory(tls)
+     endif()
+   endif()
+@@ -252,13 +255,19 @@ install(FILES cmake/FindNFS.cmake
+ 
+ # handle pc-config files
+ set(PKG_LIBLIST "")
+-foreach(LIB ${SYSTEM_LIBRARIES})
++set(PKG_SYSTEM_LIBRARIES ${SYSTEM_LIBRARIES})
++if(PKG_REQUIRES_PRIVATE)
++  # gnutls and its dependencies come from its own pkg-config file
++  list(REMOVE_ITEM PKG_SYSTEM_LIBRARIES ${GNUTLS_LIBRARIES})
++endif()
++foreach(LIB ${PKG_SYSTEM_LIBRARIES})
+   if(IS_ABSOLUTE ${LIB} AND EXISTS ${LIB})
+     list(APPEND PKG_LIBLIST "${LIB}")
+   else()
+     list(APPEND PKG_LIBLIST "-l${LIB}")
+   endif()
+ endforeach()
++string(REPLACE ";" " " PKG_REQUIRES_PRIVATE "${PKG_REQUIRES_PRIVATE}")
+ configure_file(cmake/libnfs.pc.cmake
+                ${CMAKE_CURRENT_BINARY_DIR}/libnfs.pc @ONLY)
+ 
+diff --git a/cmake/libnfs.pc.cmake b/cmake/libnfs.pc.cmake
+index 82fc969..607c0b2 100644
+--- a/cmake/libnfs.pc.cmake
++++ b/cmake/libnfs.pc.cmake
+@@ -9,6 +9,7 @@ Name: libnfs
+ Description: libnfs is a client library for accessing NFS shares over a network.
+ Version: @PROJECT_VERSION@
+ Requires:
++Requires.private: @PKG_REQUIRES_PRIVATE@
+ Conflicts:
+ Libs: -L${libdir} -lnfs
+ Libs.private: @PKG_LIBLIST@


=====================================
contrib/src/nfs/rules.mak
=====================================
@@ -21,6 +21,8 @@ $(TARBALLS)/libnfs-$(NFS_VERSION).tar.gz:
 nfs: UNPACK_DIR=libnfs-libnfs-$(NFS_VERSION)
 nfs: libnfs-$(NFS_VERSION).tar.gz .sum-nfs
 	$(UNPACK)
+	$(APPLY) $(SRC)/nfs/0001-cmake-use-Requires.private-for-gnutls-in-the-pkg-con.patch
+	$(call pkg_static,"cmake/libnfs.pc.cmake")
 	$(MOVE)
 
 .nfs: nfs toolchain.cmake



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/65e9b26b4d381d6eae6b8ff0887d5f81f05840e1

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/65e9b26b4d381d6eae6b8ff0887d5f81f05840e1
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help




More information about the vlc-commits mailing list