x11/nvidia-driver: lax the check when applying fix for src df38ada293

It turns out that NVVERSION check is not very accurate and may easily
break the build in various circumstances.  Also, do not use the line
number as an anchor, just spell out the #include line in its entirety
when removing it.

PR:	260318
This commit is contained in:
Alexey Dokuchaev 2022-01-02 15:47:24 +00:00
parent 04138ea7ad
commit 0375fc8f10

View file

@ -169,9 +169,10 @@ post-patch: .SILENT
${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' \
.if ${NVVERSION} >= 358.009
@${REINPLACE_CMD} -e '/^#include <sys\/param\.h>/d; \
/^#include <sys\/module\.h>/ { x; \
s:^:#include <sys/param.h>:; G; }' \
${WRKSRC}/src/nvidia-modeset/nvidia-modeset-freebsd.c
.endif
# Disable installation of Linux libraries (provided by the corresponding