pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
libnfs: switch to build with cmake
Module Name: pkgsrc-wip
Committed By: Paolo Vincenzo Olivo <vms%retrobsd.ddns.net@localhost>
Pushed By: vms
Date: Fri May 1 15:38:03 2026 +0200
Changeset: fd20258b57921af753bfceff863080167cdf41ca
Modified Files:
libnfs/Makefile
libnfs/PLIST
libnfs/distinfo
libnfs/options.mk
Added Files:
libnfs/patches/patch-CMakeLists.txt
libnfs/patches/patch-cmake_ConfigureChecks.cmake
libnfs/patches/patch-cmake_config.h.cmake
Removed Files:
libnfs/patches/patch-configure.ac
Log Message:
libnfs: switch to build with cmake
+ various minor changes
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=fd20258b57921af753bfceff863080167cdf41ca
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
libnfs/Makefile | 33 +++++++-------------
libnfs/PLIST | 7 ++++-
libnfs/distinfo | 4 ++-
libnfs/options.mk | 39 ++++++++++++++++++++++--
libnfs/patches/patch-CMakeLists.txt | 15 +++++++++
libnfs/patches/patch-cmake_ConfigureChecks.cmake | 19 ++++++++++++
libnfs/patches/patch-cmake_config.h.cmake | 16 ++++++++++
libnfs/patches/patch-configure.ac | 15 ---------
8 files changed, 106 insertions(+), 42 deletions(-)
diffs:
diff --git a/libnfs/Makefile b/libnfs/Makefile
index 0c47239423..6fc2fce2e7 100644
--- a/libnfs/Makefile
+++ b/libnfs/Makefile
@@ -3,35 +3,24 @@
DISTNAME= libnfs-6.0.2
CATEGORIES= net filesystems
MASTER_SITES= ${MASTER_SITE_GITHUB:=sahlberg/}
-GITHUB_TAG= refs/tags/${DISTNAME}
+GITHUB_TAG= ${GITHUB_PROJECT}-${PKGVERSION_NOREV}
MAINTAINER= pkgsrc-users%NetBSD.org@localhost
HOMEPAGE= https://github.com/sahlberg/libnfs
COMMENT= NFS client library
-# LGPL applies to the library itself, and GPL applies to utilities.
-LICENSE= gnu-lgpl-v2.1 AND gnu-gpl-v3
+# LGPL applies to the library itself, while GPL applies to the utilities.
+# BSD applies to other misc files.
+LICENSE= gnu-lgpl-v2.1 AND gnu-gpl-v3 AND 2-clause-bsd
-WRKSRC= ${WRKDIR}/${GITHUB_PROJECT}-${DISTNAME}
+PKGCONFIG_OVERRIDE= cmake/libnfs.pc.cmake
-USE_TOOLS+= autoconf automake autoreconf pkg-config
-USE_LIBTOOL= yes
-
-GNU_CONFIGURE= yes
-CONFIGURE_ARGS+= --enable-utils
-CONFIGURE_ARGS+= --enable-pthread
-CONFIGURE_ARGS+= --disable-werror # -Werror is only good for development.
-
-.include "../../mk/bsd.fast.prefs.mk"
-.if ${OPSYS} == "Linux"
-# GnuTLS is of course platform-independent but the way libnfs uses it is
-# Linux-dependent.
-. include "../../security/gnutls/buildlink3.mk"
-.endif
+CMAKE_CONFIGURE_ARGS+= -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_INSTALL_PREFIX='${PREFIX}' \
+ -DINSTALL_MAN_DIR:PATH='${PREFIX}/${PKGMANDIR}' \
+ -DENABLE_UTILS:BOOL=ON \
+ -DENABLE_DOCUMENTATION:BOOL=ON
.include "options.mk"
-pre-configure:
- cd ${WRKSRC} && ${SH} ./bootstrap
-
-.include "../../mk/pthread.buildlink3.mk"
+.include "../../devel/cmake/build.mk"
.include "../../mk/bsd.pkg.mk"
diff --git a/libnfs/PLIST b/libnfs/PLIST
index 546f721022..a4a83481aa 100644
--- a/libnfs/PLIST
+++ b/libnfs/PLIST
@@ -13,7 +13,12 @@ include/nfsc/libnfs-raw-rquota.h
include/nfsc/libnfs-raw.h
include/nfsc/libnfs-zdr.h
include/nfsc/libnfs.h
-lib/libnfs.la
+lib/cmake/libnfs/FindNFS.cmake
+lib/cmake/libnfs/libnfs-config-release.cmake
+lib/cmake/libnfs/libnfs-config-version.cmake
+lib/cmake/libnfs/libnfs-config.cmake
+lib/libnfs.so
+lib/libnfs.so.16.2.0
lib/pkgconfig/libnfs.pc
man/man1/nfs-cat.1
man/man1/nfs-cp.1
diff --git a/libnfs/distinfo b/libnfs/distinfo
index b324572af7..9c62adccaf 100644
--- a/libnfs/distinfo
+++ b/libnfs/distinfo
@@ -3,7 +3,9 @@ $NetBSD$
BLAKE2s (libnfs-6.0.2.tar.gz) = 0932b7a35afda2e6d819113448bf4f0355e516f06111325f2f0fd09389ec7e2c
SHA512 (libnfs-6.0.2.tar.gz) = 539790ab98aac7b2f25755b745d1f5e016518f1adb3748b8c58df187048bc31e091915d59e6359bb95c49dd986361cbbf2536edcda02598b0fac236762b61a46
Size (libnfs-6.0.2.tar.gz) = 338988 bytes
-SHA1 (patch-configure.ac) = 57b3a9158a7cfcd94bd197a25e3555a6cf4b1acb
+SHA1 (patch-CMakeLists.txt) = b997d2e9cab237bca6ca8f283f7573ae43e51158
+SHA1 (patch-cmake_ConfigureChecks.cmake) = 45d3185755b5c37b60a31695e8bdf0d01793776e
+SHA1 (patch-cmake_config.h.cmake) = c3e1fd72dc1c3ec21666128961ef25e266c36b23
SHA1 (patch-include_libnfs-multithreading.h) = b83c7e448823f3943174ecc290e7f10a0eac51f8
SHA1 (patch-lib_libnfs-sync.c) = e038e91cfbe2d2392452b0c81e7284ed77cfdff6
SHA1 (patch-lib_libnfs.c) = de2e55d0d29762e7e8cb800e2337a2db2b88ffb5
diff --git a/libnfs/options.mk b/libnfs/options.mk
index 2ecafb88f0..557fac7a2f 100644
--- a/libnfs/options.mk
+++ b/libnfs/options.mk
@@ -1,18 +1,51 @@
# $NetBSD$
PKG_OPTIONS_VAR= PKG_OPTIONS.libnfs
-PKG_SUPPORTED_OPTIONS= gssapi
+PKG_SUPPORTED_OPTIONS= gnutls gssapi threads
PKG_SUGGESTED_OPTIONS= # empty
+CHECK_BUILTIN.pthread:= yes
+.include "../../mk/pthread.builtin.mk"
+CHECK_BUILTIN.pthread:= no
+
+.if ${USE_BUILTIN.pthread:tl} == yes
+PKG_SUGGESTED_OPTIONS+= threads
+.endif
+
+# Requires Linux kTLS
+.if exists(/usr/include/linux/tls.h)
+PKG_SUGGESTED_OPTIONS+= gnutls
+.endif
+
.include "../../mk/bsd.options.mk"
###
### KRB5 support
###
.if !empty(PKG_OPTIONS:Mgssapi)
-CONFIGURE_ARGS+= --with-libkrb5
KRB5_ACCEPTED= mit-krb5
+CMAKE_CONFIGURE_ARGS+= -DENABLE_GSSAPI=ON
. include "../../mk/krb5.buildlink3.mk"
.else
-CONFIGURE_ARGS+= --without-libkrb5
+CONFIGURE_ARGS+= -DENABLE_GSSAPI=OFF
+.endif
+
+##
+## Multithreading support
+##
+.if !empty(PKG_OPTIONS:Mthreads)
+. include "../../mk/pthread.buildlink3.mk"
+# otherwise we get undefined refderences to semaphores
+PTHREAD_AUTO_VARS= yes
+PTHREAD_OPTS+= require
+CMAKE_CONFIGURE_ARGS+= -DENABLE_MULTITHREADING=ON
+.else
+CMAKE_CONFIGURE_ARGS+= -DENABLE_MULTITHREADING=OFF
+.endif
+
+###
+### GnuTLS support
+###
+.if !empty(PKG_OPTIONS:Mgnutls)
+. include "../../security/gnutls/buildlink3.mk"
.endif
diff --git a/libnfs/patches/patch-CMakeLists.txt b/libnfs/patches/patch-CMakeLists.txt
new file mode 100644
index 0000000000..b9cd40d483
--- /dev/null
+++ b/libnfs/patches/patch-CMakeLists.txt
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Improve portability: make GSSAPI support platform independent.
+
+--- CMakeLists.txt.orig 2024-12-14 08:03:11.000000000 +0000
++++ CMakeLists.txt
+@@ -35,7 +35,7 @@ endif()
+
+ include(cmake/Macros.cmake)
+
+-if(IOS)
++if(ENABLE_GSSAPI)
+ find_package(GSSAPI)
+
+ if(GSSAPI_FOUND)
diff --git a/libnfs/patches/patch-cmake_ConfigureChecks.cmake b/libnfs/patches/patch-cmake_ConfigureChecks.cmake
new file mode 100644
index 0000000000..b361bb9f24
--- /dev/null
+++ b/libnfs/patches/patch-cmake_ConfigureChecks.cmake
@@ -0,0 +1,19 @@
+$NetBSD$
+
+Improve portability: Directly check for getprotobyname(3) instead of
+guessing with OS-specific CPP macros.
+
+--- cmake/ConfigureChecks.cmake.orig 2024-12-14 08:03:11.000000000 +0000
++++ cmake/ConfigureChecks.cmake
+@@ -41,6 +41,11 @@ check_struct_has_member("struct sockaddr
+ check_struct_has_member("struct sockaddr_storage" ss_family sys/socket.h HAVE_SOCKADDR_STORAGE)
+ check_struct_has_member("struct stat" st_mtim.tv_nsec sys/stat.h HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC)
+
++include(CheckSymbolExists)
++if(HAVE_NETDB_H)
++ check_symbol_exists(getprotobyname "netdb.h" HAVE_GETPROTOBYNAME)
++endif()
++
+ include(CheckCSourceCompiles)
+ check_c_source_compiles("#include <net/if.h>
+ int main(void)
diff --git a/libnfs/patches/patch-cmake_config.h.cmake b/libnfs/patches/patch-cmake_config.h.cmake
new file mode 100644
index 0000000000..72a216d481
--- /dev/null
+++ b/libnfs/patches/patch-cmake_config.h.cmake
@@ -0,0 +1,16 @@
+$NetBSD$
+
+Set definition for getprotobyname() check.
+
+--- cmake/config.h.cmake.orig 2024-12-14 08:03:11.000000000 +0000
++++ cmake/config.h.cmake
+@@ -33,6 +33,9 @@
+ /* Define to 1 if you have the <netdb.h> header file. */
+ #cmakedefine HAVE_NETDB_H
+
++/* Define to 1 if <netdb.h> has the getprotobyname() function. */
++#cmakedefine HAVE_GETPROTOBYNAME
++
+ /* Define to 1 if you have the <netinet/in.h> header file. */
+ #cmakedefine HAVE_NETINET_IN_H
+
diff --git a/libnfs/patches/patch-configure.ac b/libnfs/patches/patch-configure.ac
deleted file mode 100644
index 0194e2749d..0000000000
--- a/libnfs/patches/patch-configure.ac
+++ /dev/null
@@ -1,15 +0,0 @@
-$NetBSD$
-
-Improve portability: Directly check for getprotobyname(3) instead of
-guessing with OS-specific CPP macros.
-
---- configure.ac.orig 2025-11-14 13:42:24.723919501 +0000
-+++ configure.ac
-@@ -182,6 +182,7 @@ AC_CHECK_HEADERS([unistd.h])
- # check for netdb.h
- dnl Check for netdb.h
- AC_CHECK_HEADERS([netdb.h])
-+AC_CHECK_FUNCS([getprotobyname])
-
- # check for utime.h
- dnl Check for utime.h
Home |
Main Index |
Thread Index |
Old Index