aboutsummaryrefslogtreecommitdiffstats
path: root/x11/nvidia-driver
diff options
context:
space:
mode:
authordanfe <danfe@FreeBSD.org>2016-08-20 05:15:45 +0800
committerdanfe <danfe@FreeBSD.org>2016-08-20 05:15:45 +0800
commita0b60cd5ccf67050825be4346a7688cb1533c501 (patch)
tree36582250a6f0e681d45cc201d012cd2e576974dd /x11/nvidia-driver
parente024673387c86275d68cfde811a5730ede828d1e (diff)
downloadfreebsd-ports-gnome-a0b60cd5ccf67050825be4346a7688cb1533c501.tar.gz
freebsd-ports-gnome-a0b60cd5ccf67050825be4346a7688cb1533c501.tar.zst
freebsd-ports-gnome-a0b60cd5ccf67050825be4346a7688cb1533c501.zip
Deorbit support for nVidia driver legacy versions by cleaning up in-place
patching of the driver(s) source code (part 2): - Only legacy drivers didn't know about new d_mmap() after src r201223, and page queue locking changes after src r207410, r207617, r207644, and r163622; ditto for /return/s/ioctl/sys_&/ after src r225617 - Remove now always true condition when adjusting Linux headers #include's after src r246085 - Contemporary driver versions are now aware of the +1 argument count in vm_map_find() since src r255426 - Do not try to unbreak the build of 173.14.xx series on recent -CURRENT: this legacy driver version was removed by kwm@ in r399180 last year - Remove remaining checks and patching code for outdated NVVERSION values
Diffstat (limited to 'x11/nvidia-driver')
-rw-r--r--x11/nvidia-driver/Makefile39
1 files changed, 1 insertions, 38 deletions
diff --git a/x11/nvidia-driver/Makefile b/x11/nvidia-driver/Makefile
index 19b47ab51766..49a1cb1dde48 100644
--- a/x11/nvidia-driver/Makefile
+++ b/x11/nvidia-driver/Makefile
@@ -95,29 +95,8 @@ MAKE_ENV+= WITHOUT_LINUX=yes
post-patch: .SILENT
# We should support -CURRENT: kill the check
${REINPLACE_CMD} -e '24,26d' ${WRKSRC}/src/nv-freebsd.h
-# Adjust legacy drivers for updated d_mmap() since FreeBSD src SVN r201223
-.if ${NVVERSION} < 195.022
- ${REINPLACE_CMD} -e 's/vm_offset_t offset/vm_ooffset_t offset/ ; \
- s/vm_offset_t \*address/vm_paddr_t *address/ ; \
- s/int nprot/&, vm_memattr_t *memattr/' \
- ${WRKSRC}/src/nvidia_dev.c
-.endif
-# In the legacy drivers: remove page queue locking and add page locking
-# around vm_page_(un)wire() after FreeBSD src SVN r207410, r207617, and
-# r207644; also remove page queue locking around vm_page_wakeup() after
-# FreeBSD src SVN r163622
-.if ${NVVERSION} < 304.064
- ${REINPLACE_CMD} -E '/vm_page_(un)?lock_queues\(\);/d ; \
- s/(vm_page_(un)?wire\()([^,]+)(, 0)?(\);)/vm_page_lock(\3); & vm_page_unlock(\3);/' \
- ${WRKSRC}/src/nvidia_subr.c
-.endif
-# Catch up legacy drivers with FreeBSD src SVN r225617
-.if ${NVVERSION} < 195.022
- ${REINPLACE_CMD} -e '/return/s/ioctl/sys_&/' \
- ${WRKSRC}/src/nvidia_linux.c
-.endif
# Adjust Linux headers #include's after FreeBSD src SVN r246085
-.if ${OSVERSION} > 1000027 && ${NVVERSION} >= 96.04323
+.if ${OSVERSION} > 1000027
${REINPLACE_CMD} -E '/#include "machine\/\.\.\/linux(32)?\/linux.h"/ \
{ x ; s/.*/#include "machine\/..\/..\/compat\/linux\/linux_ioctl.h"/ ; H ; x ; }' \
${WRKSRC}/src/nvidia_linux.c
@@ -135,11 +114,6 @@ post-patch: .SILENT
${REINPLACE_CMD} -e '/kmem_/s/kernel_map/kernel_arena/' \
${WRKSRC}/src/nvidia_subr.c
.endif
-# Argument count of vm_map_find() changed in FreeBSD src SVN r255426
-.if ${OSVERSION} > 1000054 && ${NVVERSION} < 304.123 # < 331.067
- ${REINPLACE_CMD} -e 's/virtual_address, size,/& 0,/' \
- ${WRKSRC}/src/nvidia_subr.c
-.endif
# Fix CTLFLAG_* values for SYSCTL_ADD_PROC() after FreeBSD src SVN r273377
.if ${OSVERSION} > 1100039 || ${OSVERSION} > 1001501 && ${OSVERSION} < 1100000
${REINPLACE_CMD} -e '/SYSCTL_ADD_PROC/,/;/ \
@@ -153,11 +127,6 @@ post-patch: .SILENT
# Fix stack buffer overflow in nvidia_sysctl_bus_type()
${REINPLACE_CMD} -e 's/8 bus_type\[4\]/8 bus_type[8]/' \
${WRKSRC}/src/nvidia_sysctl.c
-# Unbreak the build of 173.14.xx legacy series on recent -CURRENT
-.if ${NVVERSION} < 195.022 && ${NVVERSION} >= 169.004
- ${REINPLACE_CMD} -E 's/os_(alloc|free)_contig_pages/NV_API_CALL &/' \
- ${WRKSRC}/src/nv-freebsd.h
-.endif
# Process OPTIONS
.if ${PORT_OPTIONS:MFREEBSD_AGP}
${REINPLACE_CMD} -E 's/undef (NV_SUPPORT_OS_AGP)/define \1/' \
@@ -183,17 +152,11 @@ post-patch: .SILENT
${WRKSRC}/lib/Makefile
# Do not install VDPAU libraries which are provided by `multimedia/libvdpau'
# port for a while now
-.if ${NVVERSION} >= 180.029
${REINPLACE_CMD} -e '/libvdpau[[:blank:]_][^n]/d ; \
s/name libvdpau/&_nvidia/' ${WRKSRC}/lib/Makefile
-.endif
# Do not build any binaries (native nvidia-settings and nvidia-xconfig are
# provided by corresponding ports) and manual pages
-.if ${NVVERSION} < 97.046 || ${NVVERSION} >= 195.022
${REINPLACE_CMD} -E 's/(extension).*/\1/' ${WRKSRC}/x11/Makefile
-.else
- ${REINPLACE_CMD} -E 's/(lib).*/\1/' ${WRKSRC}/x11/Makefile
-.endif
${REINPLACE_CMD} -e '/bin/d ; /man/d' ${WRKSRC}/x11/Makefile
# Also do not install libnvidia-gtk* libraries which are for nvidia-settings
.if ${NVVERSION} >= 346.016