git: 28c3a79a6e9d - main - filesystems:py-libzfs: fix the build on FreeBSD 16

From: Alan Somers <asomers_at_FreeBSD.org>
Date: Mon, 22 Dec 2025 21:27:43 UTC
The branch main has been updated by asomers:

URL: https://cgit.FreeBSD.org/ports/commit/?id=28c3a79a6e9dffa203b5f2008c8f5a27fdf7a797

commit 28c3a79a6e9dffa203b5f2008c8f5a27fdf7a797
Author:     Alan Somers <asomers@FreeBSD.org>
AuthorDate: 2025-12-09 21:03:57 +0000
Commit:     Alan Somers <asomers@FreeBSD.org>
CommitDate: 2025-12-22 21:27:23 +0000

    filesystems:py-libzfs: fix the build on FreeBSD 16
    
    freebsd-src recently removed ZFS's libuutil[^1].  Patch py-libzfs so it
    won't attempt to link to that library on FreeBSD 16.
    
    [^1]: https://cgit.freebsd.org/src/commit/?id=66e85755595
    
    Sponsored by:   ConnectWise
    PR:             291530
    Approved by:    brd (ports)
---
 filesystems/py-libzfs/Makefile                   |  6 +++++-
 filesystems/py-libzfs/files/extra-libuutil.patch | 22 ++++++++++++++++++++++
 2 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/filesystems/py-libzfs/Makefile b/filesystems/py-libzfs/Makefile
index 35bed6c55700..148628a298e7 100644
--- a/filesystems/py-libzfs/Makefile
+++ b/filesystems/py-libzfs/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	libzfs
 PORTVERSION=	1.1.2023020700
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	filesystems devel python
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
 
@@ -25,6 +25,10 @@ MAKE_ENV=	freebsd_src=${SRC_BASE}
 
 .include <bsd.port.options.mk>
 
+.if ${OPSYS} == FreeBSD && ${OSVERSION} >= 1600005
+EXTRA_PATCHES+=	${FILESDIR}/extra-libuutil.patch
+.endif
+
 .if ${OPSYS} == FreeBSD && ${OSVERSION} >= 1401000
 EXTRA_PATCHES+=	${FILESDIR}/extra-zpool-add.patch
 .endif
diff --git a/filesystems/py-libzfs/files/extra-libuutil.patch b/filesystems/py-libzfs/files/extra-libuutil.patch
new file mode 100644
index 000000000000..dd6f4d7ab1fc
--- /dev/null
+++ b/filesystems/py-libzfs/files/extra-libuutil.patch
@@ -0,0 +1,22 @@
+--- configure.orig	2025-12-09 20:43:08 UTC
++++ configure
+@@ -3439,7 +3439,7 @@ CFLAGS="-DCYTHON_FALLTHROUGH"
+ esac
+ 
+ CFLAGS="-DCYTHON_FALLTHROUGH"
+-LIBS="-lzfs -lnvpair -lzfs_core -luutil"
++LIBS="-lzfs -lnvpair -lzfs_core -lpthread"
+ 
+ if [ "${build_freebsd}" = "yes" ]; then
+ 	LIBS="-lgeom ${LIBS}"
+--- setup.py.orig	2025-12-09 20:55:09 UTC
++++ setup.py
+@@ -43,7 +43,7 @@ except ImportError:
+         config = namedtuple('config', ['CFLAGS', 'CPPFLAGS', 'LDFLAGS'])([], [], [])
+ 
+ 
+-libraries = ['nvpair', 'zfs', 'zfs_core', 'uutil']
++libraries = ['nvpair', 'zfs', 'zfs_core']
+ if platform.system().lower() == 'freebsd':
+     libraries.append('geom')
+