diff options
author | danfe <danfe@FreeBSD.org> | 2016-08-20 07:11:59 +0800 |
---|---|---|
committer | danfe <danfe@FreeBSD.org> | 2016-08-20 07:11:59 +0800 |
commit | 5db8d581790a97a89c20428519a7d8d66c3f81d4 (patch) | |
tree | 298c6fd6580d6029a48fe9225639919d3077dd8e | |
parent | cc8895af5d5bfc8236cfb139f54c4fd078b24b11 (diff) | |
download | freebsd-ports-graphics-5db8d581790a97a89c20428519a7d8d66c3f81d4.tar.gz freebsd-ports-graphics-5db8d581790a97a89c20428519a7d8d66c3f81d4.tar.zst freebsd-ports-graphics-5db8d581790a97a89c20428519a7d8d66c3f81d4.zip |
Clean up the Makefile after recent changes: put source code and build logic
patching closer together and move OPTIONS-related patching thereafter. Non
functional.
-rw-r--r-- | x11/nvidia-driver/Makefile | 51 |
1 files changed, 26 insertions, 25 deletions
diff --git a/x11/nvidia-driver/Makefile b/x11/nvidia-driver/Makefile index a30d9b93234..8f98abca206 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 \ |