Index: Makefile =================================================================== --- Makefile (revision 364194) +++ Makefile (working copy) @@ -1,7 +1,7 @@ # Created by: Stijn Hoop # $FreeBSD$ -PORTNAME= nvidia-driver +PORTNAME?= nvidia-driver DISTVERSION?= 331.67 # Always try to set PORTREVISION as it can be overridden by the slave ports PORTREVISION?= 0 @@ -31,7 +31,12 @@ # hack below to universally set NVIDIA_ROOT. Also provide X11BASE value # since it is still used by legacy drivers. MAKE_ENV= NVIDIA_ROOT=${WRKSRC} X11BASE=${LOCALBASE} +.if ${OPTIMUS} +SUB_FILES= pkg-message +.else SUB_FILES= pkg-deinstall pkg-install pkg-message +.endif + DOCSDIR= ${PREFIX}/share/doc/NVIDIA_GLX-1.0 MODULESDIR= lib/xorg/modules PORTDOCS= * @@ -76,8 +81,8 @@ EXTRA_PATCHES+= ${FILESDIR}/security-patch-CVE-2012-4225 .endif -OPTIONS_DEFINE= ACPI_PM LINUX DOCS -OPTIONS_DEFAULT= LINUX +OPTIONS_DEFINE?= ACPI_PM LINUX DOCS +OPTIONS_DEFAULT?= LINUX ACPI_PM_DESC= ACPI Power Management support LINUX_DESC= Linux compatibility support @@ -231,10 +236,17 @@ .endif # Adjust installation paths of some conflicting files (shared also between # libGL and xorg-server) to ease package manager work, esp. with pkgng +.if !${OPTIMUS} ${REINPLACE_CMD} -e '/LIBDIR/s:xorg/modules/extensions:&/.nvidia:' \ ${WRKSRC}/x11/extension/Makefile ${REINPLACE_CMD} -e '/LIBDIR/s:lib:&/.nvidia:' \ ${WRKSRC}/lib/libGL/Makefile +.else + ${REINPLACE_CMD} -e '/LIBDIR/s:xorg/modules/extensions:&/.nvidia_optimus:' \ + ${WRKSRC}/x11/extension/Makefile + ${REINPLACE_CMD} -e '/LIBDIR/s:lib:&/.nvidia_optimus:' \ + ${WRKSRC}/lib/libGL/Makefile +.endif # Do not execute afterinstall target (prevent automatic module registration # and "smart" installation of conflicting files heuristics) ${REINPLACE_CMD} -e 's/afterinstall/&_dontexecute/' ${WRKSRC}/Makefile