git: c1eb97fea020 - main - x11/nvidia-driver: try to unbreak the build on recent -CURRENT

From: Alexey Dokuchaev <danfe_at_FreeBSD.org>
Date: Wed, 15 Dec 2021 03:03:20 UTC
The branch main has been updated by danfe:

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

commit c1eb97fea020ac09dc329651c4f33436e071997b
Author:     Alexey Dokuchaev <danfe@FreeBSD.org>
AuthorDate: 2021-12-15 03:02:06 +0000
Commit:     Alexey Dokuchaev <danfe@FreeBSD.org>
CommitDate: 2021-12-15 03:02:06 +0000

    x11/nvidia-driver: try to unbreak the build on recent -CURRENT
    
    After src commit df38ada2931f, `sys/module.h' must be included
    after `sys/param.h'.
    
    PR:     260318
---
 x11/nvidia-driver/Makefile | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/x11/nvidia-driver/Makefile b/x11/nvidia-driver/Makefile
index 6899b455b65c..e7de4d18e89a 100644
--- a/x11/nvidia-driver/Makefile
+++ b/x11/nvidia-driver/Makefile
@@ -168,6 +168,12 @@ post-patch: .SILENT
 	${REINPLACE_CMD} -e '/^#include/s:lock\.h:mutex.h:' \
 		${WRKSRC}/src/nvidia-modeset/nvidia-modeset-freebsd.c
 .endif
+# After src df38ada2931f, `sys/module.h' must be included after `sys/param.h'
+.if ${OSVERSION} >= 1400042 && ${NVVERSION} >= 358.009
+	@${REINPLACE_CMD} -e '/^#include <sys\/module/ { x; \
+		s:^:#include <sys/param.h>:; G; }; 14d' \
+		${WRKSRC}/src/nvidia-modeset/nvidia-modeset-freebsd.c
+.endif
 # Disable installation of Linux libraries (provided by the corresponding
 # `x11/linux-nvidia-libs' port or its slaves)
 	${REINPLACE_CMD} -e 's/exists(\/.*/& \&\& 0/' \