git: b3c2b81c82c2 - main - sysutils/openzfs: fix build errors

From: Alan Somers <asomers_at_FreeBSD.org>
Date: Tue, 04 Jan 2022 18:01:43 UTC
The branch main has been updated by asomers (src committer):

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

commit b3c2b81c82c2fd58922c342af05977bea8be99c1
Author:     Alan Somers <asomers@FreeBSD.org>
AuthorDate: 2021-12-29 21:49:39 +0000
Commit:     Alan Somers <asomers@FreeBSD.org>
CommitDate: 2022-01-04 17:59:56 +0000

    sysutils/openzfs: fix build errors
    
    * Missing file in pkg-plist
    * shebangfix not applied everywhere
    
    Sponsored by:   Axcient
    Reviewed by:    freqlabs
    Approved by:    lwhsu (ports)
    Differential Revision: https://reviews.freebsd.org/D33692
---
 sysutils/openzfs/Makefile  | 16 ++++++++++++++++
 sysutils/openzfs/pkg-plist |  1 +
 2 files changed, 17 insertions(+)

diff --git a/sysutils/openzfs/Makefile b/sysutils/openzfs/Makefile
index ea3b0e2d3f6d..5e8d6435e261 100644
--- a/sysutils/openzfs/Makefile
+++ b/sysutils/openzfs/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	openzfs
 PORTVERSION=	2021121500
+PORTREVISION=	1
 DISTVERSIONPREFIX=	v
 CATEGORIES=	sysutils
 
@@ -11,9 +12,15 @@ LICENSE=	CDDL
 BROKEN_aarch64=	invokes x86 assembler
 BROKEN_riscv64=	fails to compile: btree_test.c:462:49: result of comparison of constant -1 with expression of type 'char' is always true
 
+BUILD_DEPENDS=	ksh93:shells/ksh93
 RUN_DEPENDS=	openzfs-kmod>=0:sysutils/openzfs-kmod
 
 USES+=		autoreconf:build cpe libtool gmake gettext-runtime python:3.3+,build shebangfix
+SHEBANG_GLOB=	*.ksh *.ksh.in *.kshlib *.py.in
+SHEBANG_FILES=	tests/zfs-tests/tests/functional/trim/trim.cfg \
+		cmd/arcstat/arcstat.in \
+		cmd/dbufstat/dbufstat.in \
+		cmd/arc_summary/arc_summary*
 
 GNU_CONFIGURE=	yes
 CONFIGURE_ARGS=	--prefix=${PREFIX} --with-config="user"
@@ -45,8 +52,17 @@ RUN_DEPENDS+=	${PYTHON_PKGNAMEPREFIX}cffi>0:devel/py-cffi@${PY_FLAVOR}
 RUN_DEPENDS+=	${PYTHON_PKGNAMEPREFIX}sysctl>0:devel/py-sysctl@${PY_FLAVOR}
 .else
 CONFIGURE_ARGS+=	--without-python
+PYTHON_NO_DEPENDS=yes
 .endif
 
+post-extract:
+	# Change certain shebangs into something that shebang fix understands
+	cd ${WRKSRC} && sed -i '' '1s:@PYTHON_SHEBANG@:python3:' \
+		tests/test-runner/bin/zts-report.py.in \
+		tests/test-runner/bin/test-runner.py.in \
+		cmd/arcstat/arcstat.in \
+		cmd/dbufstat/dbufstat.in
+
 pre-configure:
 	cd ${WRKSRC} && ./autogen.sh
 
diff --git a/sysutils/openzfs/pkg-plist b/sysutils/openzfs/pkg-plist
index 772141666070..105495a264a2 100644
--- a/sysutils/openzfs/pkg-plist
+++ b/sysutils/openzfs/pkg-plist
@@ -448,6 +448,7 @@ man/man8/zfs-userspace.8.gz
 man/man8/zfs-wait.8.gz
 man/man8/zfs.8.gz
 man/man8/zfs_ids_to_path.8.gz
+man/man8/zgenhostid.8.gz
 man/man8/zinject.8.gz
 man/man8/zpool-add.8.gz
 man/man8/zpool-attach.8.gz