Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Nov 2014 21:32:46 +0000 (UTC)
From:      Alexey Dokuchaev <danfe@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r372092 - head/x11/nvidia-driver
Message-ID:  <201411022132.sA2LWkv1049305@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: danfe
Date: Sun Nov  2 21:32:46 2014
New Revision: 372092
URL: https://svnweb.freebsd.org/changeset/ports/372092
QAT: https://qat.redports.org/buildarchive/r372092/

Log:
  - Finish conversion of NVVERSION to float (left-pad minor < 99 with zero
    to allow version comparison); now we're safe until minor wraps to 1000
  - Augment a comment about NVVERSION and reword PAE option description
  - Make `update-distinfo' target more robust (by respecting ARCH_SUFX)

Modified:
  head/x11/nvidia-driver/Makefile

Modified: head/x11/nvidia-driver/Makefile
==============================================================================
--- head/x11/nvidia-driver/Makefile	Sun Nov  2 21:15:21 2014	(r372091)
+++ head/x11/nvidia-driver/Makefile	Sun Nov  2 21:32:46 2014	(r372092)
@@ -17,7 +17,7 @@ PORTREVISION?=	1
 CATEGORIES=	x11
 MASTER_SITES=	${MASTER_SITE_NVIDIA}
 # MASTER_SITE_SUBDIR has to be set later because it depends on NVVERSION
-DISTNAME=	NVIDIA-FreeBSD-x86${ARCH_SUFX}-${DISTVERSION}
+DISTNAME=	NVIDIA-FreeBSD-${ARCH_SUFX}-${DISTVERSION}
 
 MAINTAINER=	danfe@FreeBSD.org
 COMMENT=	NVidia graphics card binary drivers for hardware OpenGL rendering
@@ -27,7 +27,7 @@ LICENSE_NAME=	License For Customer Use o
 LICENSE_FILE=	${WRKSRC}/doc/license.txt
 LICENSE_PERMS=	dist-mirror no-dist-sell pkg-mirror no-pkg-sell auto-accept
 
-ARCH_SUFX=	${ARCH:S/i386//:S/amd/_/}
+ARCH_SUFX=	x86${ARCH:S/i386//:S/amd/_/}
 USES=		kmod uidfix
 USE_XORG=	xorg-server
 USE_GL=		gl
@@ -45,42 +45,47 @@ DOCSDIR=	${PREFIX}/share/doc/NVIDIA_GLX-
 MODULESDIR=	lib/xorg/modules
 PORTDOCS=	*
 
-# NVVERSION is float since r372065
+# NVVERSION is float since r372065 (integer values become less readable
+# after minor version could occupy three digits)
 .if ${DISTVERSION:C/[0-9]+//g} == ".."		# major.minor.update
-NVVERSION=	${DISTVERSION:R}${DISTVERSION:E}
+NVVERSION=	${DISTVERSION:S/./.0/:R}${DISTVERSION:E}
 .else						# major.minor
+.  if ${DISTVERSION:E} < 100
+NVVERSION=	${DISTVERSION:S/./.0/}		# allow minor > 99
+.  else
 NVVERSION=	${DISTVERSION}
+.  endif
 .endif
 
-.if ${NVVERSION} >= 195.22
-MASTER_SITE_SUBDIR=	XFree86/FreeBSD-x86${ARCH_SUFX}/${DISTVERSION}
+.if ${NVVERSION} >= 195.022
+MASTER_SITE_SUBDIR=	XFree86/FreeBSD-${ARCH_SUFX}/${DISTVERSION}
 ONLY_FOR_ARCHS=	i386 amd64
 .else
 MASTER_SITE_SUBDIR=	freebsd/${DISTVERSION}
 ONLY_FOR_ARCHS=	i386
 .endif
 
-.if ${NVVERSION} <= 190.42
+.if ${NVVERSION} <= 190.042
 EXTRA_PATCHES=	${FILESDIR}/legacy-patch-mk-nvidia.lib.mk
 .else
 EXTRA_PATCHES=	${FILESDIR}/extra-patch-mk-nvidia.lib.mk
 .endif
 
-.if ${NVVERSION} >= 304.88
+.if ${NVVERSION} >= 304.088
 EXTRA_PATCHES+=	${FILESDIR}/extra-patch-src-Makefile \
 		${FILESDIR}/extra-patch-src-nv-freebsd.h \
 		${FILESDIR}/extra-patch-src-nv-misc.h
 .endif
 
-.if ${NVVERSION} >= 331.20
+.if ${NVVERSION} >= 331.020
 EXTRA_PATCHES+=	${FILESDIR}/extra-patch-x11-driver-Makefile
 .else
 EXTRA_PATCHES+=	${FILESDIR}/legacy-patch-x11-driver-Makefile
 .endif
 
 # Fix recent arbitrary memory access vulnerability in legacy drivers
-.if ${NVVERSION} <= 190.53
-.  if ${NVVERSION} != 173.1435
+.if ${NVVERSION} <= 190.053
+.  if ${NVVERSION} != 173.01435
 EXTRA_PATCHES+=	${FILESDIR}/security-patch-CVE-2012-0946
 .  endif
 EXTRA_PATCHES+=	${FILESDIR}/security-patch-CVE-2012-4225
@@ -92,19 +97,19 @@ OPTIONS_DEFAULT=	LINUX
 ACPI_PM_DESC=		ACPI Power Management support
 LINUX_DESC=		Linux compatibility support
 
-.if ${NVVERSION} < 310.14
+.if ${NVVERSION} < 310.014
 OPTIONS_DEFINE+=	FREEBSD_AGP
 FREEBSD_AGP_DESC=	Use FreeBSD AGP GART driver
 .endif
 
-.if ${NVVERSION} >= 195.22
+.if ${NVVERSION} >= 195.022
 OPTIONS_DEFINE+=	WBINVD
 WBINVD_DESC=		Flush CPU caches directly with WBINVD
 .endif
 
-.if ${NVVERSION} >= 304.88
+.if ${NVVERSION} >= 304.088
 OPTIONS_DEFINE_i386=	PAE
-PAE_DESC=		Physical Address Extensions Kernel
+PAE_DESC=		Physical Address Extensions support
 .endif
 
 PLIST_SUB+=	LINUXBASE=${LINUXBASE} SHLIB_VERSION=${PORTVERSION} \
@@ -113,7 +118,7 @@ PLIST_SUB+=	LINUXBASE=${LINUXBASE} SHLIB
 .include <bsd.port.options.mk>
 
 # FreeBSD src SVN r254138 had broken 71.86.xx legacy series :(
-.if ${OSVERSION} > 1000041 && ${NVVERSION} <= 71.8615
+.if ${OSVERSION} > 1000041 && ${NVVERSION} <= 71.08615
 BROKEN=		does not compile
 .endif
 
@@ -127,7 +132,7 @@ PLIST_SUB+=	LINUX="@comment "
 MAKE_ENV+=	WITHOUT_LINUX=yes
 .endif
 
-.if ${NVVERSION} < 195.22
+.if ${NVVERSION} < 195.022
 # ABI version is hardcoded inside the binary, so specify it explicitly here
 LIB_DEPENDS=	libm.so.3:${PORTSDIR}/misc/compat5x
 .endif
@@ -136,7 +141,7 @@ 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 ${OSVERSION} > 900005 && ${NVVERSION} < 195.22
+.if ${OSVERSION} > 900005 && ${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/' \
@@ -146,18 +151,18 @@ post-patch: .SILENT
 # 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 ${OSVERSION} > 900011 && ${NVVERSION} < 304.64
+.if ${OSVERSION} > 900011 && ${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 ${OSVERSION} > 900043 && ${NVVERSION} < 195.22
+.if ${OSVERSION} > 900043 && ${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.4323
+.if ${OSVERSION} > 1000027 && ${NVVERSION} >= 96.04323
 	${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
@@ -171,30 +176,30 @@ post-patch: .SILENT
 		${WRKSRC}/src/nvidia_subr.c
 .endif
 # Adjust kmem(9) calls after FreeBSD src SVN r254025
-.if ${OSVERSION} > 1000040 && ${NVVERSION} < 331.67
+.if ${OSVERSION} > 1000040 && ${NVVERSION} < 331.067
 	${REINPLACE_CMD} -e '/kmem_/s/kernel_map/kernel_arena/' \
 		${WRKSRC}/src/nvidia_subr.c
 .endif
 # Adopt to cap_rights_t type change in FreeBSD src SVN r255219
-.if ${OSVERSION} > 1000052 && ${NVVERSION} < 331.67
+.if ${OSVERSION} > 1000052 && ${NVVERSION} < 331.067
 	${REINPLACE_CMD} -e 's/u_long cmd;/& cap_rights_t rights;/ ; \
 		s/CAP_IOCTL/cap_rights_init(\&rights, &)/' \
 			${WRKSRC}/src/nvidia_linux.c
 .endif
 # Argument count of vm_map_find() changed in FreeBSD src SVN r255426
-.if ${OSVERSION} > 1000054 && ${NVVERSION} < 331.67
+.if ${OSVERSION} > 1000054 && ${NVVERSION} < 331.067
 	${REINPLACE_CMD} -e 's/virtual_address, size,/& 0,/' \
 		${WRKSRC}/src/nvidia_subr.c
 .endif
 # Fix stack buffer overflow in nvidia_sysctl_bus_type()
-.if ${NVVERSION} < 319.23
+.if ${NVVERSION} < 319.023
 	${REINPLACE_CMD} -E '/bus_type\[4\]/d ; \
 		s/sprintf\(bus_type, (".+")/return SYSCTL_OUT(req, \1, sizeof(\1)/ ; \
 		/return SYSCTL_OUT\(req, bus_type/d' \
 			${WRKSRC}/src/nvidia_sysctl.c
 .endif
 # Unbreak the build of 173.14.xx legacy series on recent -CURRENT
-.if ${NVVERSION} < 195.22 && ${NVVERSION} >= 169.04
+.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
@@ -223,13 +228,13 @@ 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.29
+.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.46 || ${NVVERSION} >= 195.22
+.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
@@ -259,33 +264,33 @@ post-install: .SILENT
 	${INSTALL_SCRIPT} ${WRKSRC}/obj/nvidia-bug-report.sh \
 		${STAGEDIR}${PREFIX}/bin
 # pkg-plist is already overbloated, so use these hacks instead of PLIST_SUB's
-.if ${NVVERSION} < 81.74
+.if ${NVVERSION} < 81.074
 	${REINPLACE_CMD} -e '/libnvidia-cfg/d' ${TMPPLIST}
 .endif
-.if ${NVVERSION} < 97.46 || ${NVVERSION} >= 195.22
+.if ${NVVERSION} < 97.046 || ${NVVERSION} >= 195.022
 	${REINPLACE_CMD} -e '/wfb/d' ${TMPPLIST}
 .endif
-.if ${NVVERSION} < 180.29
+.if ${NVVERSION} < 180.029
 	${REINPLACE_CMD} -e '/vdpau/d' ${TMPPLIST}
 .endif
-.if ${NVVERSION} < 185.1829
+.if ${NVVERSION} < 185.01829
 	${REINPLACE_CMD} -e '/libcuda/d' ${TMPPLIST}
 .endif
-.if ${NVVERSION} >= 256.53
+.if ${NVVERSION} >= 256.053
 	${REINPLACE_CMD} -E 's/libGLcore/libnvidia-glcore/ ; \
 		/usr.*(glcore|tls).*so\.1$$/d' ${TMPPLIST}
 .endif
-.if ${NVVERSION} >= 310.19
+.if ${NVVERSION} >= 310.019
 	${REINPLACE_CMD} -e '/libXvMCNVIDIA/d' ${TMPPLIST}
 .else	# some applications need this symlink (see PR ports/72877)
 	${LN} -sf libXvMCNVIDIA.so.1 \
 		${STAGEDIR}${PREFIX}/lib/libXvMCNVIDIA_dynamic.so.1
 .endif
-.if ${NVVERSION} < 331.13 || ${ARCH} == amd64
+.if ${NVVERSION} < 331.013 || ${ARCH} == amd64
 	${REINPLACE_CMD} -E '/lib(nvidia-)?(EGL|eglcore|GLESv|glsi)/d' \
 		${TMPPLIST}
 .endif
-.if ${NVVERSION} >= 195.22
+.if ${NVVERSION} >= 195.022
 	${REINPLACE_CMD} -e '/does not support PAE/,+1d' ${PKGMESSAGE}
 .endif
 
@@ -297,7 +302,7 @@ JOIN?=		/usr/bin/join
 .endif
 
 update-distinfo: makesum .SILENT
-	${REINPLACE_CMD} -i '' -e '/${NVVERSION:R}/s/^/~/' \
+	${REINPLACE_CMD} -i '' -e '/${ARCH_SUFX}-${NVVERSION:R}/s/^/~/' \
 		${MASTERDIR}/distinfo ${DISTINFO_FILE}
 	${SED} -e '/^~/s/(.*//' ${MASTERDIR}/distinfo | ${JOIN} -a 1 \
 		- ${DISTINFO_FILE} | ${SED} -e 's/^~//' \



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201411022132.sA2LWkv1049305>