Reason:
nvidia-driver does not install vdpau library and headers anymore, they
are now provided by multimedia/libvdpau port. To avoid conflict, please
rebuild nvidia-driver port before upgrading your ports and before
installing multimedia/libvdpau.

- Move mainstream version to 346.xx (update to 346.35) and create another
legacy slave port `x11/nvidia-driver-340'; update top comment accordingly
- No longer explicitly advertise brokenness for ${OSVERSION} > 1000041 and
${NVVERSION} <= 71.08615 combination: not only old legacy ports recently
had been removed, but frankly users of those old gfx cards should either
not be running FreeBSD 10.x or totally rely on self-support, thus making
this BROKEN statement merely an annoyance for them (other checks for some
older driver versions still remain as being functional)
- Change CONFLICTS to CONFLICTS_INSTALL (honestly, this change *should* be
no-op since CONFLICTS should be installation-time conflicts in the first
place, but adhere to this stupidity of the framework for the time being)

- Update mainstream version to 340.76
- The d_thread_t typedef is a compatibility shim to support FreeBSD 4.X:
plans are to remove it in FreeBSD 11.X, so prepare for that in advance
PR: 196693
Submitted by: jhb

x11-servers/xorg-server: Update to 1.14
The X.Org server has been updated to 1.14. The changes it brings are described
in a post on the Graphics team blog:
http://blogs.freebsdish.org/graphics/2014/11/19/xserver-1-14-update-ready/
The most noticable change is the DEVD input device autodetection backend
which is enabled by default, replacing the HAL backend. The keyboard
layout configuration must be migrated from HAL's .fdi files to X.Org
files. The procedure is explained in the post mentionned above.
Several ports were removed with this update, mainly because they are not
compatible with the X.Org server anymore:
o nvidia-driver-71
o nvidia-driver-96

Fix libEGL and libGLESv2 conflict between libEGL/libglesv2 and the
nvidia-driver port in the same fashion it was done as the conflict
with the libGL port.
Mesa ports:
Add pkg-[de]install scripts to handle the symlinks in the libEGL
and libglesv2 port.
Move pkg-[de]install scripts of libGL out of files/
Put the real mesa libraries into lib/.mesa so we don't have each
port create a directory for it own use.
Nvidia-driver:
Only apply the libEGL.so and libGLESv2.so alternative install
directory if nvidia-driver actually ships them. Copied from
PR submitter, since it was much cleaner then my initial attempt.

- Stop trying to adopt cap_rights_t type change in FreeBSD src SVN r255219
as recent driver versions are already account for it; this unbreaks the
build for 304.xx branch [*]
- Simplify patching for stack buffer overflow in nvidia_sysctl_bus_type():
NVidia really screwed up fixing it since it was reported. Originally,
they were sprintf(bus_type, "PCI-E")ing to a 4-character buffer allocated
on stack (304.88 and earlier); later they've replaced the buffer with a
char * pointer, but left one sprintf() into it (304.108 and above, up to
304.121); then finally fixed it for real in 304.123. Given versions are
only for 304.xx branch; others retained the same bugs during this time
frame. Fix it across the gang by simply extending bus_type[4] (if found)
to eight bytes instead of employing complex NVVERSION checks: this should
now be no-op for newer versions, but good enough for older ones (e.g. for
173.14.35, 96.xx, and 71.xx)
PR: 194866, 194958 [*]

Switch NVVERSION (internal variable derived from DISTVERSION) to float, in
order to handle version numbers where minor version can exceed 99; integer
scheme was breaking NVVERSION monotonicity and comparability in this case.
While here, put back the comment removed in r327777 for no apparent reason.

Fix two issues with r354638:
- Use MACHINE_CPUARCH rather than MACHINE_ARCH. While the former technically
is more correct it unfortunately doesn't exist in stable/8, yet, and using
the latter actually doesn't make a difference for i386.
- Allow to build nvidia-driver on OSVERSION > 1000052 with the LINUX option
enabled.
Reported by: swills

- Update nvidia-driver to 331.67.
- For i386, allow to build the non-legacy NVIDIA drivers with PAE support
via an option, defaulting to disabled. This is tricky in two ways. First
off, while their binary part is PAE-capable since around version 285,
their build glue and wrapper only partially is. Second, for modules
built along the kernel, enabled PAE support would be picked up via the
generated opt_global.h from KERNBUILDDIR, which isn't available when
compiling modules stand-alone. Nevertheless, these source modifications
are modeled in a way so they also do the right thing when integrating a
nvidia-driver module into a kernel build.
Approved by: maintainer timeout (2 weeks)
Sponsored by: Bally Wulff Games & Entertainment GmbH

- Update long lived branch to version 331.49
- Provide a convenience target to merge new hash and size with existing
distinfo: first, redefine DISTINFO_FILE (so that prerequisite target
`makesum' would not overwrite existing distinfo file), then prepend
relevant SHA256 and SIZE lines with tilde (~) to cope with join(1)'s
requirement for sorted lines, truncate the old values thereof, join(1)
two files so new lines are nicely placed just where intended, finally
removing hackish tildes (improvements to this quick and dirty approach
are very welcome)
- Remove no longer relevant (and now somewhat confusing) comment in the
`pre-install' target after the port was staged
- Fix two identical typos (paqe -> page) in comments while I'm here
Tested by: dhw

- Unbreak the build of 173.14.xx legacy version on recent -CURRENT, and
use more accurate OSVERSION value in the check (1000000 -> 1000041)
- Fix regression introduced in r342061, when <bsd.port.options.mk> was
included before OPTIONS definitions
- Rename patches to get rid of those ugly double underscores (yuck!)
- Wrap couple of overly long lines after STAGEDIR conversion in r342050
- Create `drivers' and `extensions' directories in pre-install, not in
pre-su-install: no longer needed for stagified port
- Fix regex when patching lib/Makefile for WITHOUT_LINUX handling, and
improve nearby expressions while here as well

SSP support has been added to ports with WITH_SSP for i386 and amd64
on FreeBSD 10, and amd64 on earlier versions.
SSP_UNSAFE is added to disable in a port if it fails to build, but
this should only be used in rare circumstances such as kernel modules.
Otherwise, the port may just be failing due to lack of respecting
LDFLAGS.
On FreeBSD 10, this uses an ldscript in /usr/lib/libc.so to pull in
libssp_nonshared.a to address issues linking on i386 [1].
On earlier FreeBSD versions the WITH_SSP knob will add -lssp_nonshared
to LDFLAGS on i386. This is not needed on amd64. However, several hundred
ports do not currently respect LDFLAGS, so this support is disabled currently
as it causes build failures if a dependency is looking for the stack_chk

- Update NVidia driver to the latest LTS stable version, 319.32
- Only offer FREEBSD_AGP option when it is actually supported
- Use new syntax for specifying LIB_DEPENDS
- Buffer overflow in nvidia_sysctl_bus_type() was fixed in 319.23

Update to version 304.64. While as of yesterday this version is technically
legacy per nVidia, retain it for a while until the dust settles and new long
lived branch version 310.19 can be declared stable.
Feature safe: yes

Fix the problem that PKGVERSION for 173.14.xx legacy driver went backwards
when it was updated to .35 on the 12th. That moment, it kept PORTREVISION
1 from the master port. When the master port was updated and PORTREVISION
removed on the 22nd, PKGVERSION of nvidia-driver-173 went backwards as its
PORTREVISION dropped from 1 to 0. While I am at it, provide a comments in
all makefiles that keeping PORTREVISION setting (even when it is seemingly
zero) is important.
Reported by: erwin

- Update legacy 173.14.xx series driver to version 173.14.35 and provide a
patch for CVE-2012-4225 for this version
- Augment security patch for CVE-2012-0946 to cover CVE-2012-4225 as well
for the benefit of really old legacy drivers

Provide home-made patch for legacy nVidia drivers against recent arbitrary
memory access vulnerability. While affected underlying code is very similar
in all released drivers, and they all are technically exploitable the same
way, the exploit relies on hardware that is not present in GPUs older than
NV50/G80, hence versions starting from 100.14.03 must be patched.
That said, while the patch does apply to all legacy versions, port revision
bump makes sense only for 173.14.xx series (as 96.43.xx and 71.86.xx do not
hardware exploit relies upon).
Discussed with: Christian Zander
Security: CVE-2012-0946

X11BASE has been deprecated for a long time now, and is going to be dropped
from `Mk/bsd.port.mk' soon. Account for it and pass it to make environment
locally as nVidia driver code still uses it.
PR: ports/161558
Submitted by: eadler (PR), crees (nvidia-driver patch)
Feature safe: yes

- Update NVidia drivers to their corresponding latest versions
- Apply a workaround to fix the build on recent -CURRENT after fget(9) KPI
was changed in r224778 (affects the driver since version 195.22)

- Update corresponding NVidia drivers to versions 270.41.19 and 173.14.30
- Turn formal requirement for X server into explicit dependency and bump
port revisions in nvidia-driver-96 and nvidia-driver-71 accordingly
- Remove NO_PACKAGE; along with previous change, this enables us to build
nvidia-driver packages
- Try to rely a little less on the assumption that PREFIX == LOCALBASE and
explicitly create ${PREFIX}/${MODULESDIR}/extensions directory
- Fix pkg-plist issue when both lib/xorg/modules/extensions/libglx.so and
lib/libGL.so.1 handling worked for installation from the port, but was
insufficient for the package
Special thanks to ale@ for proposing pkg-plist fix and patiently waiting
for me to realize it is indeed correct.
PR: ports/152400

Restore correct MASTER_SITE_SUBDIR for legacy driver versions that was
mistakenly dropped in rev. 1.97 and add a comment explaining why do we
set it not in PORTNAME section, but later (when NVVERSION is defined).
PR: ports/146566

Update to version 195.22. These are BETA drivers, and normally update would
not occur, but now it is special: it features long-awaited x86-64 (amd64)
support. In order to use this driver release, your system will need to have
either FreeBSD 7-STABLE after 702106 or FreeBSD 8.0 and above.
Both the FreeBSD/x86 and FreeBSD/x86-64 driver packages include 32-bit Linux
ABI compatibility libraries; 64-bit Linux libraries may be included with a
future release (when support for Linux/x86-64 compatibility is added to
FreeBSD/amd64). The FreeBSD/x86-64 package does not include the FreeBSD/x86
OpenGL libraries; however, the libraries shipped with the FreeBSD/x86 driver
package have been tested on FreeBSD/x86-64.
Port was updated to serve both versions seamlessly. No need to specify
anything to distinguish between architectures.
I would like to thank everyone involved to make this happen.
Reviewed on: -ports@

- Update to version 177.80, the latest from NVidia
- As this update renders even more GPUs obsolete (please consult README file
to find out if your card needs legacy driver), x11/nvidia-driver-173 slave
port will be committed shortly