x11-drivers/nvidia-drivers: Version bump (bug #559650 by Nuno Lopes).
authorJeroen Roovers <jer@gentoo.org>
Sat, 5 Sep 2015 13:28:13 +0000 (15:28 +0200)
committerJeroen Roovers <jer@gentoo.org>
Sat, 5 Sep 2015 13:28:42 +0000 (15:28 +0200)
Package-Manager: portage-2.2.20.1

x11-drivers/nvidia-drivers/Manifest
x11-drivers/nvidia-drivers/nvidia-drivers-304.128.ebuild [new file with mode: 0644]

index b568f7b503526914bd0b949195a321df81ce5f2d..773de5725a520094ae54d6732b150dec6d682932 100644 (file)
@@ -1,5 +1,6 @@
 DIST NVIDIA-FreeBSD-x86-173.14.39.tar.gz 20038266 SHA256 63a922ce4c5b676b4cb1ace98094dace4cc5408f2553e183df7b2127777a238b SHA512 96982fe7e0751c52fbef534193de09d187b99c1984c05e791223eb804719d8b3ba72efd983f227661ded4b71569bdbb914f1f629ab73a8bc9b8172832ccf3ec6 WHIRLPOOL 21f5906f42adf0064c7a7f81ac8e323de488e6d36356ee42c31a15c31ebb64335d5e2cff0ff022d41de480f9e0a57b3b96387f17151c7b59eceba2c61a7a102b
 DIST NVIDIA-FreeBSD-x86-304.125.tar.gz 34494889 SHA256 806d0bff9d394390b3a257472bc342857f150e9dba6673e6b930f47a93ec0269 SHA512 d2760196d3f0dfb1837d496bd11dbedab6a2bf3de98da35f16c92133452b915b425a718f72e560f5d6483caf5e2e5bcf99a462b2e392d7a08c77b59695649108 WHIRLPOOL eb008e1956043d48af5f928dc594c8ae9c8a946834d889db5b4a9b3f16bfaeb311221e5d3f83c8c599dee860b54a42030dccf2aaec31dffb6e8460bf646b82ad
+DIST NVIDIA-FreeBSD-x86-304.128.tar.gz 34479549 SHA256 c26d0ce5bda8965b37a8b8f91e8580f98b740e16dd21f3aaf7fb6bc84d3dd363 SHA512 9b7cd4fdb59c8d4783c2625d8e301869e1ddae0b7d3f81e9ca2eea4722168ddf513c7ed5853ce34607e219aa11c4da687c5e68a6d2021bf3aa54969cd3337ba2 WHIRLPOOL 98ada42a1b73d6858343fccd2aebe2c345e3275f7f7371e14980ef87a8407f0167e01c6963e498feba29860bf3ffbd2245789dc3ad3cff97635af1820bb42edf
 DIST NVIDIA-FreeBSD-x86-331.113.tar.gz 56371300 SHA256 f3b4b5ddf5977223646d2cdb0617ea8a5f667814ca23b29cb225c5685eacd9d7 SHA512 5c45142807a5b8ecb5e037921e4e449f4710a65358579087429e14ee50124863e6a65fbf8cc73efec22bd8ca85d3eb5a815c7301403dd3236e0bb0b177e5f3e8 WHIRLPOOL 97240066b1c45c887770bfe8539b733a2957fdc1511af5b08de4149b0ce9fedc87b6aa8ee8d243793d225c98c09681e4cca93dd1c5f601389637644e659d7863
 DIST NVIDIA-FreeBSD-x86-340.76.tar.gz 59362290 SHA256 0abbcc3bed3f017e7f1887a5c2d014e2b5a020462071998986ed49cdb8e7119f SHA512 e6d8b6d03fe0f9ab25ddeef680e0159ea4073d03762d3419761c02b917edefa9a1f81c209bd386838141c1924364c81126b0a356c325b056a0c2451865bed5eb WHIRLPOOL 7ec0cef6f92bfbd4c8b6a051dc8de4b6b138f63fd4f7e18756178a9aebb91ea32523d5ca885481d8c8c3d1531b153699f4e5606c155d6c3aa79a340637d3744b
 DIST NVIDIA-FreeBSD-x86-340.93.tar.gz 59385673 SHA256 094dc6df60b8e57cf9b94d982cb29c32d5e0c1d81796dbadb39145e78a3b0086 SHA512 ae5ef62aa8dea2f67026dc9e7f369294895516cd443daa277ac2c783ef1fe85df23706aef70cbce41722d239a50c562b66210fd76f662186e25c58b38e617230 WHIRLPOOL 816b2b8c1de3609c03059fbb6f102f54fba5fcc64539745701ef3e20e435ca767ff8fe93c7f0242fcee5fb941210781a526b67cf693a48974723ccbf8e95595f
@@ -13,6 +14,7 @@ DIST NVIDIA-FreeBSD-x86-355.06.tar.gz 56677167 SHA256 49f691695228e0c2effcee4ad0
 DIST NVIDIA-FreeBSD-x86-355.11.tar.gz 56832647 SHA256 3d4d5d8fcf558a8f5f1a88846161b1a89bd7fc66c0268b40613c7e3457f5ce7b SHA512 744d9b8c48b82bac0bfeea5e8b2b2bbaa0e6a183cbd1f5d4f782fa7b21a6f6c5b252e556a8b2161c3b5d43938ef8fabf6cb36f995ee823fbf792f3c9a92b87e1 WHIRLPOOL 43bceb8e8d3b00789cf2c8163a055b1d2405ef93e471fda4c4e2146093289891557f4ec8debfe6bca89ad6ed6dc2e389f1d3060759a71e8949df343bc31b85b9
 DIST NVIDIA-FreeBSD-x86-96.43.23.tar.gz 15463464 SHA256 18d855db8381eda1a6cf548c9e5095fc5bb8694bf1d6e24fc1072fba4e54cd78 SHA512 42d7b1b76cdb3b23680363e565614a22112162a5dd3639cb804fe670c0c3f3f23595bbefa3f78afdc6a8ca848446dee853c7a355f2c96a0d01b354753ba2785c WHIRLPOOL f8e59ce521990cd9edee441e73f973f074db492952807a0931e362102874cddbb47604ff5c5eb20a0cbde27f9b6d4e440dd12cc2e5a20c9cb65bf3c0b3e62511
 DIST NVIDIA-FreeBSD-x86_64-304.125.tar.gz 35498616 SHA256 46b14b8c5ee1c02ff5e30afc9c99f4dd2edc426ccb2b73764093a1787639699d SHA512 34d48f24b1f5019b23c2937f8b5280fcc596764e1f5833cfe33db5e4d8395a0d69aa4c4214a5b97620dbaade73ac0fa333c36cceb4a137bb26d3ba37c31a0eb7 WHIRLPOOL 82677bd2aec3a60fe64211170573ef702b1dd1ab5a71ec922fb56b8d40f2163c0151a7c7f8bdace9127c8afcaf278f8f23a1cb585a8ad3bb7a0d42787ab17fb2
+DIST NVIDIA-FreeBSD-x86_64-304.128.tar.gz 35481444 SHA256 ee38635fb02eb598dd0cdfdbc9014096774104d75ba42fee7688126e531fed8f SHA512 36b045bd556512c83fc841e5d379b1af70b47df99f7042b64d3ed009f3dadb8e7a06e34506b839d0e936de06064c343aac370dad3fe96ea53aa3e25322eda0ff WHIRLPOOL bc53f009da857ca34396f6d49e9c8774e0062cfb437a1b711256b3c0bbbd50d49bb4691697ce7bee347533aeb150d7fe6d061170c1ca9ced6a694694399542c8
 DIST NVIDIA-FreeBSD-x86_64-331.113.tar.gz 47509194 SHA256 c848e187c79064ea3f52406312aa09d06f0aaef5063be7522b2b2319c43c872c SHA512 4e206719afcee47179e0756ac67fc4e61d513efb1cd0264b28726d6de16846feee873a2df362bf645b0527d395b6d82f5b54dbc447bccb74128d7bff37bb7b1b WHIRLPOOL a51b0bd9f7301d9bb76b54ffa44337ad4d875125281c4b9921e66a76d434879832f542df9c6ba436ef83fb3fa0afe5197f3425f1b7aa16274aca5080259f343d
 DIST NVIDIA-FreeBSD-x86_64-340.76.tar.gz 60206978 SHA256 60037d035b9af9f1d4dcdd5033e1b28b0cd4c7ca94f6bcb8d267e037a930fdc0 SHA512 d478eac282dfb43205f7464d6542cf1f71ed4dea6b8381314affb8647d104c5ddf7e658b6b8eb5e0bdb18207b92f76c574b24959ce23034d375cc712998e6e7c WHIRLPOOL 98ebffd792a47e3a9ef369976db11909bc13551f38977f85ece41e5a31a790c2c173badfc166e3a0bfe4361d5221129d19364c074ba11fc4aa9062d5cb1499a8
 DIST NVIDIA-FreeBSD-x86_64-340.93.tar.gz 60215584 SHA256 07208f6a832c2da8748b1c4f8b5ce42a7b617f2ee1ac59155fecaff952c30988 SHA512 c480df2f36c3d6eba53af9c3070e1561ae7c56cd5d31fb531dcb6897ca02d0d205c0ce99597304ea36b7b75b173e31a9a4c07ddd143ad13884aff0a7c3479bce WHIRLPOOL c1b28898ffe733961bdb622e8b430715c74871cfaab0348a9e5990df5a92676e8fb8c199ea1f1a06fa6c6ded65877b987b802a7a9ea0b7023cbaa62fb52eda01
@@ -26,6 +28,7 @@ DIST NVIDIA-FreeBSD-x86_64-355.06.tar.gz 53894942 SHA256 65c5c44bdb6eb19817dfce9
 DIST NVIDIA-FreeBSD-x86_64-355.11.tar.gz 54031364 SHA256 3637a879905bb541bf02f9bcdfe37c242a52ec6071671a0ba33581efdce1504e SHA512 84add7d90c7f45d19d736ee70c1c4a6434be1c512bafa29cbbf9221e99a31fc383971696dce99da5a77a171eb3537c98cfec7005ff061411ac9c310fa219c906 WHIRLPOOL d8ade5d63c3ef78fa92f9dc07934eed8fdd4ead1e40f1820ad95feb166264a95a800879e1fc6374bf2deef419b0838b4864796d9f81a81110d06ccd9b65c459d
 DIST NVIDIA-Linux-x86-173.14.39-pkg0.run 15134997 SHA256 a09935f37121ed3db8ae3da63a0d8e9d4348a19c859811c9fe44d6ce8e3eab23 SHA512 e24e15ccec725d3cbca502c2b77061776a81ef92917a950adec4ff6bdc34f10903aa654433177ea74be0dade4af81c5380d5710d375a5ea445940d06154bde93 WHIRLPOOL fce3d8e4f6cdf698f5a057514b6fe220bb1011025bdce5bd4cf0e424fb4d306d38251b6726bda03f290ea8137d5a95ed418cf8751722879f9042462abd9181b6
 DIST NVIDIA-Linux-x86-304.125.run 40589395 SHA256 aec5b3a792910e152d5af756ef6fd7224c448c564564c7c448ab8ec3fc78c4f7 SHA512 cd77736790876b66c1e88bf30b7a93f755c0f94118edda8fde1701dc07dc4eb60f89a27b0ed432db74729f269cb239f32f3c5e045d701f60baf69da7fc0d0ea7 WHIRLPOOL 85cd375e1b67bbabe9a8119affec20b7a9a258f8b5be89d755f7ea596a94f98df053e8ade33f1aba1f74f753dcb636268c4f2074a09eaf68d858241f1482552c
+DIST NVIDIA-Linux-x86-304.128.run 40607927 SHA256 f6aa695b3375473e3444412e4a3b7ef6bd8b13e3f3678f4cbe7a3649b5129068 SHA512 9822b61872ae28751cd5c41714048612f7ddf0fd9f02e6340598150afbea43dddeba88482a8c88bcf893b015d14b2a2cf5157ed60583da57fdfe183ecb620c90 WHIRLPOOL 6ffb8d0638af82c3a844f699c57379863fbef3a79b1308bb382c38015fbf26889e41f911f327b63a955586c1c636ecc4ad399fc12db189739d9e80fd63ed1390
 DIST NVIDIA-Linux-x86-331.113.run 37300924 SHA256 42535a99ab68452d30d9c3fad2fb162db01d1f6821115a3c1733ed203efd588b SHA512 bc820609e0379cc5805a5428cc364795b8a5d9e5a2a4395a1ddaa1dda85e6acc59368f87f5974a39fb42bd272458627b2c742fbf1f7fedddb17102439883b111 WHIRLPOOL 1d7b5cb8be5bb76dbe1b238aab4e39ccda0e5b07da268f0652966e79d5e0d2192773316d8f22a2d6a551305b17b610242918822e94e43263c9dbfba8a48bf49b
 DIST NVIDIA-Linux-x86-340.76.run 38818911 SHA256 9b29d93b49009caed84a8852825c3e7c6ebbbba8ec99b03ee5113108c8b036d0 SHA512 45d7b29670f9ca50de80d6d61260015b45f74422bbd12039923d04ae8b033b903b27e9f4c174461055f3cf45a4af44565ce9a8b9cd671e0e54d37770a1156839 WHIRLPOOL da7e072a56e3aff8b4688e60c5acd76c97804fa582d21c70dce043b13fa2317d1021f19927e827cf6132aebe2d40371c750e3eb56697bc7eda16bb7369bf2994
 DIST NVIDIA-Linux-x86-340.93.run 38703394 SHA256 4a81c158302c595e1e72b5a1812eb3c67c8cf584ca74b1bc24163dad5289d612 SHA512 7507553bd4b11cac2cd882cd8afba59e773f58a26e67ee7e781c488be963a4f1eb54dcd72b40b29d33dd81c74d4748a76c1632b2c8ea08b524b4318c18b5dfe5 WHIRLPOOL 242190999da74f2fe4bfe4b223f43dec6ec73d97afd1e84e2c78c5fd5616d9814b647067ddf3f591ea8064d29234491de1c6f87b442e240d2aac4a1e598aefad
@@ -40,6 +43,7 @@ DIST NVIDIA-Linux-x86-355.11.run 43569515 SHA256 94ce6b879581b931b84d83a9111040b
 DIST NVIDIA-Linux-x86-96.43.23-pkg0.run 11504817 SHA256 51e6adf4ba73071622045fc37169f80db3ae3e784dff53b29d35146a04042142 SHA512 bed5726e57637481fe4e3c03a65ec14fe949f00860e729ebde408f4fd861d7bfdc296a78bc2f5d42e8b282db09f4bbde1e0545df7228fa20227080dc4b868ba7 WHIRLPOOL 6d4fd1786c11f4e326cc3101d0bb1a2f8b63c25c3dd59f10188f8355759e2861ce44fd53d60258b513d5a1d6124d0f91ba8edf4d3668b6feabfb3e8d585f14fe
 DIST NVIDIA-Linux-x86_64-173.14.39-pkg2.run 21100833 SHA256 15a953666d5681ba54c97498b578ffd286a1dc96d605f3b02110f3f99813100e SHA512 a65cd496e6ed57f771c3d99f37f616a1242d97844f6faef7a807825ad899c0e536a99fde397020839f0857883b934032f9491024f3047a6b06d3eea1f5d77713 WHIRLPOOL dc5f243b7d1de7e2d1b7f005e018a2940d63335b11a7c83c234b348b7a1839e9131169d2ea928bd8c2f549a4535149b03e16e6c94d59dfa745f7f904ff790a45
 DIST NVIDIA-Linux-x86_64-304.125.run 69108272 SHA256 c654889b85a18326f2c610260a8fbc3b1bb6f9b8be1c052a46a213f60bd62262 SHA512 75bd5700281b0aa4e19be5b779e3484711ce3db92641a32f3bf5e890601b353b23113f6218d5a2fa6b2c8d93702fac92810013c7c0f8efe484b0a39d09b1b073 WHIRLPOOL d8b9794253b1ab270680da7420f50df5ab6aa4d5123bad695be5b7891b2df55bf06ecdd0b221fd29e799077c0a64da8059df16ebea9a3535e402f2c0cf482dcf
+DIST NVIDIA-Linux-x86_64-304.128.run 69091465 SHA256 e301342b93af24a6676519cb3a7fbe5d557b6a23a588ef121478b7fbab8a495f SHA512 493b6c9647122c9fda5ac3146f3e8f60000d3efd09e93762d49d70266baffeba493479fb046cf2f6465b2ce9e53a8699254cbd165b5a3efcefee5fca9fb11056 WHIRLPOOL fe9735282f91e8e68c50325a4c0506d18347b53fb11f0328a6d0fc1f395ec3d2ea48a510b90f3c05f1c447b40db94216a0445eadac220ff500c5864439845b1b
 DIST NVIDIA-Linux-x86_64-331.113.run 60509547 SHA256 e9d5eb4394ef31825f7a86290b19b522851d1b599284095d81bac0f33a996219 SHA512 f71f3d20016bebe4e7f83704a7539f0d53c92a2598a34f9f48ad421e5743ef554aa97315f2a762f132b730b1f37c5811aa617fed3c5a90d3e2e9cc5320e366b7 WHIRLPOOL 2f06c45cb4750eb5c7d6a2ff4e4c3abaf813df135da13691f30238baf89c2fa1477d5694088f268d8681cf719889b9e2644fc1d707785113703cd2e4d7c0b27f
 DIST NVIDIA-Linux-x86_64-340.76.run 69955037 SHA256 3bf670e9a2bdb184648dec54ce06fab65e798a9a4c9dd5155e2be4efee3e0994 SHA512 59ad49a49f170ec971e2b5ee3a45b9f972521bc4b7ab6f02f46a5cfc5b1998841195cc5c91dffc417d2183de39c5a589eabf7b48864e0c6842363a75051db40c WHIRLPOOL 8c846f2b5b6f56bd2962fe4660751a4485e0ddd2186bde0affccece32271b03f4f3c226377c0b1877ea391ab130ed6f282c316f227205488a63e4f0a19db82cc
 DIST NVIDIA-Linux-x86_64-340.93.run 69813449 SHA256 ea2ac747fd473ea55ed5f6263bd314efa94c71384f3e03d527f8d550ba84c218 SHA512 f7540f3a49ccd67346b81332e4bfd03becef135f7e777cef3256fe33b3313456456ae095a352e333bbf6463bb13b9486a70718fa4c4355d66222bb0a7437de29 WHIRLPOOL e5286fbcaeffbcd3bd66c5adba8c20eb9cd64915b38606289cfab41a754a46b250667e6ac3485f8c3ed3b5a16bc14dcce6a9227d486be71d5b58298ca7d70f4d
diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-304.128.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-304.128.ebuild
new file mode 100644 (file)
index 0000000..8aa6cd6
--- /dev/null
@@ -0,0 +1,457 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils flag-o-matic linux-info linux-mod multilib nvidia-driver \
+       portability toolchain-funcs unpacker user versionator udev
+
+NV_URI="http://us.download.nvidia.com/XFree86/"
+X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
+AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
+X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
+AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
+
+DESCRIPTION="NVIDIA Accelerated Graphics Driver"
+HOMEPAGE="http://www.nvidia.com/"
+SRC_URI="
+       amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
+       amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
+       x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
+       x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
+"
+
+LICENSE="GPL-2 NVIDIA-r1"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd"
+IUSE="acpi multilib kernel_FreeBSD kernel_linux pax_kernel +tools +X"
+RESTRICT="bindist mirror strip"
+EMULTILIB_PKG="true"
+
+COMMON="app-eselect/eselect-opencl
+       kernel_linux? ( >=sys-libs/glibc-2.6.1 )
+       X? (
+               >=app-eselect/eselect-opengl-1.0.9
+       )"
+DEPEND="${COMMON}
+       kernel_linux? (
+               virtual/linux-sources
+               virtual/pkgconfig
+       )"
+RDEPEND="${COMMON}
+       acpi? ( sys-power/acpid )
+       tools? (
+               dev-libs/atk
+               dev-libs/glib:2
+               x11-libs/gdk-pixbuf
+               x11-libs/gtk+:2
+               x11-libs/libX11
+               x11-libs/libXext
+               x11-libs/pango[X]
+               x11-libs/pangox-compat
+       )
+       X? (
+               <x11-base/xorg-server-1.17.99:=
+               x11-libs/libXvMC
+               multilib? (
+                       >=x11-libs/libX11-1.6.2[abi_x86_32]
+                       >=x11-libs/libXext-1.3.2[abi_x86_32]
+               )
+       )
+"
+PDEPEND="X? ( >=x11-libs/libvdpau-0.3-r1 )"
+
+REQUIRED_USE="tools? ( X )"
+
+QA_PREBUILT="opt/* usr/lib*"
+
+S=${WORKDIR}/
+
+pkg_pretend() {
+
+       if use amd64 && has_multilib_profile && \
+               [ "${DEFAULT_ABI}" != "amd64" ]; then
+               eerror "This ebuild doesn't currently support changing your default ABI"
+               die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
+       fi
+
+       if use kernel_linux && kernel_is ge 4 3; then
+               ewarn "Gentoo supports kernels which are supported by NVIDIA"
+               ewarn "which are limited to the following kernels:"
+               ewarn "<sys-kernel/gentoo-sources-4.3"
+               ewarn "<sys-kernel/vanilla-sources-4.3"
+               ewarn ""
+               ewarn "You are free to utilize epatch_user to provide whatever"
+               ewarn "support you feel is appropriate, but will not receive"
+               ewarn "support as a result of those changes."
+               ewarn ""
+               ewarn "Do not file a bug report about this."
+       fi
+
+       # Since Nvidia ships 3 different series of drivers, we need to give the user
+       # some kind of guidance as to what version they should install. This tries
+       # to point the user in the right direction but can't be perfect. check
+       # nvidia-driver.eclass
+       nvidia-driver-check-warning
+
+       # Kernel features/options to check for
+       CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
+       use x86 && CONFIG_CHECK+=" ~HIGHMEM"
+
+       # Now do the above checks
+       use kernel_linux && check_extra_config
+}
+
+pkg_setup() {
+       # try to turn off distcc and ccache for people that have a problem with it
+       export DISTCC_DISABLE=1
+       export CCACHE_DISABLE=1
+
+       if use kernel_linux; then
+               linux-mod_pkg_setup
+               MODULE_NAMES="nvidia(video:${S}/kernel)"
+               BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
+               SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC)"
+               # linux-mod_src_compile calls set_arch_to_kernel, which
+               # sets the ARCH to x86 but NVIDIA's wrapping Makefile
+               # expects x86_64 or i386 and then converts it to x86
+               # later on in the build process
+               BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
+       fi
+
+       # set variables to where files are in the package structure
+       if use kernel_FreeBSD; then
+               use x86-fbsd   && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
+               use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
+               NV_DOC="${S}/doc"
+               NV_OBJ="${S}/obj"
+               NV_SRC="${S}/src"
+               NV_MAN="${S}/x11/man"
+               NV_X11="${S}/obj"
+               NV_SOVER=1
+       elif use kernel_linux; then
+               NV_DOC="${S}"
+               NV_OBJ="${S}"
+               NV_SRC="${S}/kernel"
+               NV_MAN="${S}"
+               NV_X11="${S}"
+               NV_SOVER=${PV}
+       else
+               die "Could not determine proper NVIDIA package"
+       fi
+}
+
+src_unpack() {
+       if ! use kernel_FreeBSD; then
+               cd "${S}"
+               unpack_makeself
+       else
+               unpack ${A}
+       fi
+}
+
+src_prepare() {
+       # Please add a brief description for every added patch
+
+       if use kernel_linux; then
+               if kernel_is lt 2 6 9 ; then
+                       eerror "You must build this against 2.6.9 or higher kernels."
+               fi
+
+               # If greater than 2.6.5 use M= instead of SUBDIR=
+               convert_to_m "${NV_SRC}"/Makefile.kbuild
+       fi
+
+       if use pax_kernel; then
+               ewarn "Using PAX patches is not supported. You will be asked to"
+               ewarn "use a standard kernel should you have issues. Should you"
+               ewarn "need support with these patches, contact the PaX team."
+               epatch "${FILESDIR}"/${PN}-pax-const.patch
+               epatch "${FILESDIR}"/${PN}-pax-usercopy.patch
+       fi
+
+       cat <<- EOF > "${S}"/nvidia.icd
+               /usr/$(get_libdir)/libnvidia-opencl.so
+       EOF
+
+       # Allow user patches so they can support RC kernels and whatever else
+       epatch_user
+}
+
+src_compile() {
+       # This is already the default on Linux, as there's no toplevel Makefile, but
+       # on FreeBSD there's one and triggers the kernel module build, as we install
+       # it by itself, pass this.
+
+       cd "${NV_SRC}"
+       if use kernel_FreeBSD; then
+               MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
+                       LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
+       elif use kernel_linux; then
+               MAKEOPTS=-j1 linux-mod_src_compile
+       fi
+}
+
+# Install nvidia library:
+# the first parameter is the library to install
+# the second parameter is the provided soversion
+# the third parameter is the target directory if its not /usr/lib
+donvidia() {
+       # Full path to library minus SOVER
+       MY_LIB="$1"
+
+       # SOVER to use
+       MY_SOVER="$2"
+
+       # Where to install
+       MY_DEST="$3"
+
+       if [[ -z "${MY_DEST}" ]]; then
+               MY_DEST="/usr/$(get_libdir)"
+               action="dolib.so"
+       else
+               exeinto ${MY_DEST}
+               action="doexe"
+       fi
+
+       # Get just the library name
+       libname=$(basename $1)
+
+       # Install the library with the correct SOVER
+       ${action} ${MY_LIB}.${MY_SOVER} || \
+               die "failed to install ${libname}"
+
+       # If SOVER wasn't 1, then we need to create a .1 symlink
+       if [[ "${MY_SOVER}" != "1" ]]; then
+               dosym ${libname}.${MY_SOVER} \
+                       ${MY_DEST}/${libname}.1 || \
+                       die "failed to create ${libname} symlink"
+       fi
+
+       # Always create the symlink from the raw lib to the .1
+       dosym ${libname}.1 \
+               ${MY_DEST}/${libname} || \
+               die "failed to create ${libname} symlink"
+}
+
+src_install() {
+       if use kernel_linux; then
+               linux-mod_src_install
+
+               # Add the aliases
+               # This file is tweaked with the appropriate video group in
+               # pkg_preinst, see bug #491414
+               insinto /etc/modprobe.d
+               newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
+
+               # Ensures that our device nodes are created when not using X
+               exeinto "$(get_udevdir)"
+               doexe "${FILESDIR}"/nvidia-udev.sh
+               udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
+       elif use kernel_FreeBSD; then
+               if use x86-fbsd; then
+                       insinto /boot/modules
+                       doins "${S}/src/nvidia.kld"
+               fi
+
+               exeinto /boot/modules
+               doexe "${S}/src/nvidia.ko"
+       fi
+
+       # NVIDIA kernel <-> userspace driver config lib
+       donvidia ${NV_OBJ}/libnvidia-cfg.so ${NV_SOVER}
+
+       if use kernel_linux; then
+               # NVIDIA video decode <-> CUDA
+               donvidia ${NV_OBJ}/libnvcuvid.so ${NV_SOVER}
+       fi
+
+       if use X; then
+               # Xorg DDX driver
+               insinto /usr/$(get_libdir)/xorg/modules/drivers
+               doins ${NV_X11}/nvidia_drv.so
+
+               # Xorg GLX driver
+               donvidia ${NV_X11}/libglx.so ${NV_SOVER} \
+                       /usr/$(get_libdir)/opengl/nvidia/extensions
+
+               # XvMC driver
+               dolib.a ${NV_X11}/libXvMCNVIDIA.a || \
+                       die "failed to install libXvMCNVIDIA.so"
+               donvidia ${NV_X11}/libXvMCNVIDIA.so ${NV_SOVER}
+               dosym libXvMCNVIDIA.so.${NV_SOVER} \
+                       /usr/$(get_libdir)/libXvMCNVIDIA_dynamic.so.1 || \
+                       die "failed to create libXvMCNVIDIA_dynamic.so symlink"
+       fi
+
+       # OpenCL ICD for NVIDIA
+       if use kernel_linux; then
+               insinto /etc/OpenCL/vendors
+               doins nvidia.icd
+               donvidia ${NV_OBJ}/libnvidia-opencl.so ${NV_SOVER}
+       fi
+
+       # Documentation
+       dohtml ${NV_DOC}/html/*
+       if use kernel_FreeBSD; then
+               dodoc "${NV_DOC}/README"
+               use X && doman "${NV_MAN}/nvidia-xconfig.1"
+               use tools && doman "${NV_MAN}/nvidia-settings.1"
+       else
+               # Docs
+               newdoc "${NV_DOC}/README.txt" README
+               dodoc "${NV_DOC}/NVIDIA_Changelog"
+               doman "${NV_MAN}/nvidia-smi.1.gz"
+               use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
+               use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
+               doman "${NV_MAN}/nvidia-cuda-proxy-control.1.gz"
+       fi
+
+       # Helper Apps
+       exeinto /opt/bin/
+
+       if use X; then
+               doexe ${NV_OBJ}/nvidia-xconfig
+       fi
+
+       if use kernel_linux ; then
+               doexe ${NV_OBJ}/nvidia-debugdump
+               doexe ${NV_OBJ}/nvidia-cuda-proxy-control
+               doexe ${NV_OBJ}/nvidia-cuda-proxy-server
+               doexe ${NV_OBJ}/nvidia-smi
+               newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
+       fi
+
+       if use tools; then
+               doexe ${NV_OBJ}/nvidia-settings
+       fi
+
+       dobin ${NV_OBJ}/nvidia-bug-report.sh
+
+       # Desktop entries for nvidia-settings
+       if use tools ; then
+               # There is no icon in the FreeBSD tarball.
+               use kernel_FreeBSD || newicon ${NV_OBJ}/nvidia-settings.png ${PN}-settings.png
+               domenu "${FILESDIR}"/${PN}-settings.desktop
+               exeinto /etc/X11/xinit/xinitrc.d
+               doexe "${FILESDIR}"/95-nvidia-settings
+       fi
+
+       #doenvd "${FILESDIR}"/50nvidia-prelink-blacklist
+
+       if has_multilib_profile && use multilib ; then
+               local OABI=${ABI}
+               for ABI in $(get_install_abis) ; do
+                       src_install-libs
+               done
+               ABI=${OABI}
+               unset OABI
+       else
+               src_install-libs
+       fi
+
+       is_final_abi || die "failed to iterate through all ABIs"
+
+       readme.gentoo_create_doc
+}
+
+src_install-libs() {
+       local inslibdir=$(get_libdir)
+       local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
+       local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
+       local libdir=${NV_OBJ}
+
+       if use kernel_linux && has_multilib_profile && \
+                       [[ ${ABI} == "x86" ]] ; then
+               libdir=${NV_OBJ}/32
+       fi
+
+       if use X; then
+               # The GLX libraries
+               donvidia ${libdir}/libGL.so ${NV_SOVER} ${GL_ROOT}
+               donvidia ${libdir}/libnvidia-glcore.so ${NV_SOVER}
+               if use kernel_FreeBSD; then
+                       donvidia ${libdir}/libnvidia-tls.so ${NV_SOVER} ${GL_ROOT}
+               else
+                       donvidia ${libdir}/tls/libnvidia-tls.so ${NV_SOVER} ${GL_ROOT}
+               fi
+
+               # VDPAU
+               donvidia ${libdir}/libvdpau_nvidia.so ${NV_SOVER}
+       fi
+
+       # NVIDIA monitoring library
+       if use kernel_linux ; then
+               donvidia ${libdir}/libnvidia-ml.so ${NV_SOVER}
+       fi
+
+       # CUDA & OpenCL
+       if use kernel_linux; then
+               donvidia ${libdir}/libcuda.so ${NV_SOVER}
+               donvidia ${libdir}/libnvidia-compiler.so ${NV_SOVER}
+               donvidia ${libdir}/libOpenCL.so 1.0.0 ${CL_ROOT}
+       fi
+}
+
+pkg_preinst() {
+       if use kernel_linux; then
+               linux-mod_pkg_preinst
+
+               local videogroup="$(egetent group video | cut -d ':' -f 3)"
+               if [ -z "${videogroup}" ]; then
+                       eerror "Failed to determine the video group gid"
+                       die "Failed to determine the video group gid"
+               else
+                       sed -i \
+                               -e "s:PACKAGE:${PF}:g" \
+                               -e "s:VIDEOGID:${videogroup}:" \
+                               "${D}"/etc/modprobe.d/nvidia.conf || die
+               fi
+       fi
+
+       # Clean the dynamic libGL stuff's home to ensure
+       # we dont have stale libs floating around
+       if [ -d "${ROOT}"/usr/lib/opengl/nvidia ] ; then
+               rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
+       fi
+       # Make sure we nuke the old nvidia-glx's env.d file
+       if [ -e "${ROOT}"/etc/env.d/09nvidia ] ; then
+               rm -f "${ROOT}"/etc/env.d/09nvidia
+       fi
+}
+
+pkg_postinst() {
+       use kernel_linux && linux-mod_pkg_postinst
+
+       # Switch to the nvidia implementation
+       use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
+       "${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
+
+       readme.gentoo_print_elog
+
+       if ! use X; then
+               elog "You have elected to not install the X.org driver. Along with"
+               elog "this the OpenGL libraries, XvMC, and VDPAU libraries were not"
+               elog "installed. Additionally, once the driver is loaded your card"
+               elog "and fan will run at max speed which may not be desirable."
+               elog "Use the 'nvidia-smi' init script to have your card and fan"
+               elog "speed scale appropriately."
+               elog
+       fi
+       if ! use tools; then
+               elog "USE=tools controls whether the nvidia-settings application"
+               elog "is installed. If you would like to use it, enable that"
+               elog "flag and re-emerge this ebuild. Optionally you can install"
+               elog "media-video/nvidia-settings"
+               elog
+       fi
+}
+
+pkg_prerm() {
+       use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+       use kernel_linux && linux-mod_pkg_postrm
+       use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}