summaryrefslogtreecommitdiff
path: root/x11/nvidia-driver
diff options
context:
space:
mode:
authorAlexey Dokuchaev <danfe@FreeBSD.org>2016-08-19 23:11:59 +0000
committerAlexey Dokuchaev <danfe@FreeBSD.org>2016-08-19 23:11:59 +0000
commite89df832e55586a91f7aa0c3708b49856402bd60 (patch)
tree298c6fd6580d6029a48fe9225639919d3077dd8e /x11/nvidia-driver
parent- Update to version 4.6 (diff)
Clean up the Makefile after recent changes: put source code and build logic
patching closer together and move OPTIONS-related patching thereafter. Non functional.
Notes
Notes: svn path=/head/; revision=420499
Diffstat (limited to 'x11/nvidia-driver')
-rw-r--r--x11/nvidia-driver/Makefile51
1 files changed, 26 insertions, 25 deletions
diff --git a/x11/nvidia-driver/Makefile b/x11/nvidia-driver/Makefile
index a30d9b932346..8f98abca206c 100644
--- a/x11/nvidia-driver/Makefile
+++ b/x11/nvidia-driver/Makefile
@@ -127,27 +127,7 @@ 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
-# Process OPTIONS
-.if ${PORT_OPTIONS:MFREEBSD_AGP}
- ${REINPLACE_CMD} -E 's/undef (NV_SUPPORT_OS_AGP)/define \1/' \
- ${WRKSRC}/src/nv-freebsd.h
-.endif
-.if ${PORT_OPTIONS:MACPI_PM}
- ${REINPLACE_CMD} -E 's/undef (NV_SUPPORT_ACPI_PM)/define \1/' \
- ${WRKSRC}/src/nv-freebsd.h
-.endif
-.if ! ${PORT_OPTIONS:MLINUX}
- ${REINPLACE_CMD} -E 's/define (NV_SUPPORT_LINUX_COMPAT)/undef \1/' \
- ${WRKSRC}/src/nv-freebsd.h
-.endif
-.if ${PORT_OPTIONS:MPAE}
- ${REINPLACE_CMD} -E 's/undef (NV_SUPPORT_PAE)/define \1/' \
- ${WRKSRC}/src/nv-freebsd.h
-.endif
-.if ${PORT_OPTIONS:MWBINVD}
- ${REINPLACE_CMD} -E 's/undef (NV_USE_WBINVD)/define \1/' \
- ${WRKSRC}/src/nv-freebsd.h
-.endif
+# Respect WITHOUT_LINUX setting
${REINPLACE_CMD} -e 's/exists(\/.*/& \&\& !defined(WITHOUT_LINUX)/' \
${WRKSRC}/lib/Makefile
# Do not install VDPAU libraries which are provided by `multimedia/libvdpau'
@@ -162,10 +142,6 @@ post-patch: .SILENT
.if ${NVVERSION} >= 346.016
${REINPLACE_CMD} -e '/libnvidia-gtk/d' ${WRKSRC}/lib/Makefile
.endif
-# Conditionally install documentation (but you generally want it)
-.if ! ${PORT_OPTIONS:MDOCS}
- ${REINPLACE_CMD} -E 's/(x11).*/\1/ ; /doc/d' ${WRKSRC}/Makefile
-.endif
# Adjust installation paths of some conflicting files (shared also between
# libGL, libEGL, libGLESv2, and xorg-server) to ease package manager work
${REINPLACE_CMD} -e '/LIBDIR/s:xorg/modules/extensions:&/.nvidia:' \
@@ -189,6 +165,31 @@ post-patch: .SILENT
${REINPLACE_CMD} -e 's,/usr/share/nvidia,${STAGEDIR}${DOCSDIR},' \
${WRKSRC}/lib/libGL/Makefile ${WRKSRC}/doc/Makefile
.endif
+# Finally, process OPTIONS
+.if ${PORT_OPTIONS:MFREEBSD_AGP}
+ ${REINPLACE_CMD} -E 's/undef (NV_SUPPORT_OS_AGP)/define \1/' \
+ ${WRKSRC}/src/nv-freebsd.h
+.endif
+.if ${PORT_OPTIONS:MACPI_PM}
+ ${REINPLACE_CMD} -E 's/undef (NV_SUPPORT_ACPI_PM)/define \1/' \
+ ${WRKSRC}/src/nv-freebsd.h
+.endif
+.if ! ${PORT_OPTIONS:MLINUX}
+ ${REINPLACE_CMD} -E 's/define (NV_SUPPORT_LINUX_COMPAT)/undef \1/' \
+ ${WRKSRC}/src/nv-freebsd.h
+.endif
+.if ${PORT_OPTIONS:MPAE}
+ ${REINPLACE_CMD} -E 's/undef (NV_SUPPORT_PAE)/define \1/' \
+ ${WRKSRC}/src/nv-freebsd.h
+.endif
+.if ${PORT_OPTIONS:MWBINVD}
+ ${REINPLACE_CMD} -E 's/undef (NV_USE_WBINVD)/define \1/' \
+ ${WRKSRC}/src/nv-freebsd.h
+.endif
+# Conditionally install documentation (but you generally want it)
+.if ! ${PORT_OPTIONS:MDOCS}
+ ${REINPLACE_CMD} -E 's/(x11).*/\1/ ; /doc/d' ${WRKSRC}/Makefile
+.endif
pre-install:
@${MKDIR} ${STAGEDIR}${PREFIX}/${MODULESDIR}/drivers \