nvidia-drivers: Version bump, loads of changes in the ebuild...

This commit is contained in:
Stefan Reimer 2012-08-16 12:34:39 -07:00
parent f42f4b8722
commit df2eb49950
6 changed files with 500 additions and 634 deletions

View File

@ -1,17 +1,18 @@
AUX nvidia-169.07 639 RMD160 8baddb6fd1bf7f0e2688870a78e8ace051d62e3f SHA1 b30487ba2a24a6b1359d1fd831eeb1705060953c SHA256 a8c4860f008d53776fda7a17b59524f271236559af688e9a2c9845cbbcba1577
AUX nvidia-blacklist-vga-pmu-registers-256-304.diff 1713 RMD160 3c73d0986c65b553bc2e0f84291417581a95caee SHA1 c0d2bd12aeee4d5e02428ab9060e0d4cb37cf86c SHA256 674a51e77beb3e076dd29b1d9a37ee23e1498ab128490ea2efb2140e45b44fde
AUX nvidia-drivers-pax-const.patch 833 RMD160 100c36ed4c7db0f30c0680b276a708cd5ed75749 SHA1 b336665366340fec6bd400f36d3e4b9de86473f5 SHA256 74ba8aa3b03e1b4a0515fd84c159eaeb7635fa1364e77544b01ff6f571f0e6d8
AUX nvidia-drivers-pax-usercopy.patch 2350 RMD160 c102590aba1b4191c08fc0ac045640bab3f8f5e2 SHA1 5cd57aef42db6dbb5cf97ed773ec632d3a5f3ec7 SHA256 56980f43db38d582bc6a9bfd881973fce6e3e056b77ce4f4005bdcf79526a863
AUX nvidia-udev.sh 185 RMD160 26d8e7e1447daa7d4fd09993f855b58ae1754a72 SHA1 d607b57662e0542b335cbc86ed3c946bb522891f SHA256 120c0af2b64fbcbd7032217a78eec8b104874c1ca68726367bce22c57944e07e
AUX nvidia.udev-rule 462 RMD160 a7bc1d61d75a7fd7847903064ae5974e4079db5a SHA1 ac04cf8838bab05d5c092446d34c0154b9f6220e SHA256 37b152a5055a16d1947171567178e2841679ddf03dba9d48e7d30f1e3b469ac6
DIST NVIDIA-FreeBSD-x86-295.59.tar.gz 32092806 RMD160 522250a83eec34f252a4568627f2a974e44a1905 SHA1 1bf1216e5cb29ecc88623ded6a6adcc2dc3505d0 SHA256 9a3e1794418add03ad97aad93608d1bc1f2f9c5a82e0321a2a8ba1c9db7d41dd
DIST NVIDIA-FreeBSD-x86-302.17.tar.gz 32072917 RMD160 b6bcfdc8eb6270f6749944c046ae06ee0c6247cc SHA1 fad55e852492570c821390c557cdee368fdfd591 SHA256 b0d50c3333ee7c485bfd5287b37e253ed358dd5d205997f0c50e16f04b7714c5
DIST NVIDIA-FreeBSD-x86_64-295.59.tar.gz 33049711 RMD160 a8c7d971b1da68b3779651f9365481d710fd7cd8 SHA1 4b4b318845e4377587f49372396c8fb61396c7cd SHA256 4993f2c4874c080352856b1eac529c7be61aff73ea9db7012a04a571f3553bfd
DIST NVIDIA-FreeBSD-x86_64-302.17.tar.gz 32993726 RMD160 9765207456e02de02b5b6e6c7a07f3587daa50fc SHA1 b7ec92f163682c53753c0151126144500d0b3c5f SHA256 609f2abe8459714993f62eb6ee90114a26beecfc375d72ab1776b503ef549166
DIST NVIDIA-Linux-x86-295.59.run 34730118 RMD160 9770e734bcc145f52ce8f299c3fba6f39173c697 SHA1 0936db03eafb0562dfbb1c032d82f71e3e9abe8c SHA256 084bbb76c57d5c2a5b780322a95dcc230ec6e25b4f6c176574a93621399ce5a0
DIST NVIDIA-Linux-x86-302.17.run 34598956 RMD160 8993d78afe1edd9534b91b3c91c1377413a6b39e SHA1 50c80dc6bc619e1bd000f039248c93ac656a279b SHA256 3525d3814361bd202998cea2962bb3d1bb3419206d02fd8ac30d61358c1a284f
DIST NVIDIA-Linux-x86_64-295.59.run 58529480 RMD160 de86cf0c445f3c6625e340fbc7f2340b49e9e466 SHA1 67a0b326172309e262d31f40d1f545f371ca374a SHA256 4b1d96389abd2b804ad470c5189142a02ee4c82c1ac56cea37ecb45e8051313e
DIST NVIDIA-Linux-x86_64-302.17.run 58653717 RMD160 330b2c019db4f28b7cd0872220328d862548db92 SHA1 3a3b2ff80bc39d20d4bc8b1fb56e6318ae4ccbee SHA256 5cf9059ebb70ade99e5621c0a605ed5bbb6c274f7c52a7ef40342ceb41b381fc
EBUILD nvidia-drivers-295.59.ebuild 18723 RMD160 e8a593ba24bbf2f619b98e18d046498bba887f8f SHA1 9ae2717e9e1b21e525e9514a8f1468adb7e3fbcd SHA256 e4cc8079bdb25440819e152cb02eb45a032ffcaaa2c7108d8d5aac155e41c42f
EBUILD nvidia-drivers-302.17-r1.ebuild 18678 RMD160 f830677d2b8fc297d928fc0617a286b6090f08f8 SHA1 c68ed9e1772a70529b75124c1f7c409e9fc6b4af SHA256 d395432824e0071a728f42a6059f7496f3dfe9714199324d60199b64b09ae22f
MISC ebuild.diff 798 RMD160 94df7f56f961bd94473bf26b2212920bf9c1b6be SHA1 d97b392f6a08fae2f708f7fced8d5bc2c3fabef1 SHA256 1eebb334781f1bd00e5166248b0716fc751e60379d89cd79c757aec2a6631ffa
AUX nvidia-169.07 639 SHA256 a8c4860f008d53776fda7a17b59524f271236559af688e9a2c9845cbbcba1577 SHA512 3af295c026280dc3a2b73c2cc7772254686b09cad15f1333ab0b4de8cb0ccf78e725ced2a399b10edcf8af6ba42ab1485dc0661af67461b0c3789f786357772f WHIRLPOOL 626ae3c01c879e0cfe05bd373e0b9dfd6f462dd9ef6ae94a7d60276fe2d17c57fbb20aaa4d2a186a0ffc2a860076692aac854d00a3545bc9736e7bb8d0581055
AUX nvidia-autostart.desktop 227 SHA256 850c22fad5ac5a0cf6795b47cfc34f88f151f2802fa1256d2c2422108d59400a SHA512 704b0291505e74c75b55b6d1c75f23399b2e76743093d1ad4dfdf1eafc71bba70aa4e0003b155f247fa4b861fffecf53cd72eeef04e86ba15c0c4e4af477d69a WHIRLPOOL 74e93677417c721fc06691078f813717b59d9fd8a07e00870dcfe518f904143b7af4a253595c0c226c926012ae0fe5b439f387578fc53246a0a8c0e4de00c2a0
AUX nvidia-drivers-pax-const.patch 833 SHA256 74ba8aa3b03e1b4a0515fd84c159eaeb7635fa1364e77544b01ff6f571f0e6d8 SHA512 6ef94db71cab2dd47273eaed1857209d03ef648d268c7645f3ca4caf6b894590e42a8e716e4354f2eed656e7d55a4c1774b1e6a4be215fbf59fc9d0b1a5762a0 WHIRLPOOL 1b2d737ee7ccee831c85bd8af9605c0633fd025bb209e6d76c13f49a5664aa490bd5b6ce48855e541fe87380cd7b723162e1965b803e1ed630f239bf4dbd0d19
AUX nvidia-drivers-pax-usercopy.patch 2350 SHA256 56980f43db38d582bc6a9bfd881973fce6e3e056b77ce4f4005bdcf79526a863 SHA512 54a1354ba008d014a608044610027b4d808120f8e77cc7d5ac855c3dcf4f487b0a4c0870ae4e727db0643cb56ee21513b803976e9a30c6838adf2f5414232804 WHIRLPOOL 78ac54bfe52cc3b6dfa28e17020991dfb7056984d667b0fefa41d23372b03e1a8e6d66c74e1dee234733d5b2b36e2c0813f507a89716ae2d8f1f6db917fdf01d
AUX nvidia-smi.init 671 SHA256 5776a661b510e072d34e779c23dfc710a13d04c49acc22772d2aeb0e415820d6 SHA512 f71bcdf2fcaf4aac69056a04f3e57c9f5e4d6c210fe571704d3f9a0798cc9615cd0560840ae336744f43563528db5b9a7b67730895eff438be330b13ab863ed6 WHIRLPOOL db48549b0d2b02d2f9ca6a86f38229dae67853939ac1c2147d5066b9b8958c2e0fb8539f70ddf5c92ae6ad642bb48ea8b1119d1779c80dd66bb450240fd0b40a
AUX nvidia-udev.sh 185 SHA256 120c0af2b64fbcbd7032217a78eec8b104874c1ca68726367bce22c57944e07e SHA512 166df3a4e7c1862ca2e0f634bf5eed7aad1bdd7e55764ca42371b91a7077c59f0bc243de5616fd38dac9694159d1695d54fbd08ac89d4d3f3649c70c7db5977e WHIRLPOOL cb9995029cdb2fe1bc7fe5ae54041ee5de8da86bf5eb3616d062475e56c44d436e1e66683ecddd986fc5bca5723d88da4b1a42f65f3cd7e15636928bd21fce14
AUX nvidia.udev-rule 462 SHA256 37b152a5055a16d1947171567178e2841679ddf03dba9d48e7d30f1e3b469ac6 SHA512 96f9edaa0b46bea5fce17596f868bea5265b303d7185af6ba81527bbd7b8fdf92de9311317cbde51a29d222083d451c25ab77c3d6837cbc4072a50d9af89aa86 WHIRLPOOL 89ed95f33db7485a3a1acd91df33ecdfb7d0a249db2d7674f134fb85b35a54653d0458e478503315ce506ae5d3c8dcd4ac20420711fdbdd087ea4bd779627d13
DIST NVIDIA-FreeBSD-x86-295.59.tar.gz 32092806 SHA256 9a3e1794418add03ad97aad93608d1bc1f2f9c5a82e0321a2a8ba1c9db7d41dd SHA512 e6bb158b8c1bad81068a000b9a4848d038bee2c78519b8a4f61627dd63e84baf233b2328aa4e7b56d9b2de862f1e67318ee67a332e6f9002171ecc5cb157d419 WHIRLPOOL 6b2ba86629d3364b1efb988227860c998e6d0f3161252a742c46600ebe8b7d1f22e4e9d5368067deff8df191be975f05db8df6200d7747d9dd2a7c135713ef89
DIST NVIDIA-FreeBSD-x86-304.37.tar.gz 33291575 SHA256 e6c3a1d4a757b5d4f2ab54a43d5d7008fcb1b481f14515f58adcd31f3edc6576 SHA512 4370cc805b428f331402f5adde386813e40272ab30744f38442b706b1f80c45e2b44ab56477fe7f3ddeb437b5a97cc088ba2f9a67834a45cf42377d450d3f8bf WHIRLPOOL e41ac7c8cbd207483503da81b64ea16f8d80a8c20b45508ce6a817fd5986628c95e7f64bafc8967d96bf0c0611b66da6899153e4e22cb7b0bb9840c07e76c27c
DIST NVIDIA-FreeBSD-x86_64-295.59.tar.gz 33049711 SHA256 4993f2c4874c080352856b1eac529c7be61aff73ea9db7012a04a571f3553bfd SHA512 be7ddf23181386979b085825d0b22c0270a1acd3b17aba1468f16370db5ad7886d96d66eede213427f442c7e857e44e5a734aa5f20753d4ed9f4b2dc649dcad2 WHIRLPOOL c833c5a587645765b781cd869bccdab92fabd9ae133574c3698ec5b29d4b91ae93635de6fba962586af426e6b797b2a8f6c897af7958a0a596155c5cfd9ea6e0
DIST NVIDIA-FreeBSD-x86_64-304.37.tar.gz 34210803 SHA256 0d00046c8463954b6c8e13e245b2619758e947389161a113aa005ef7566e5dd3 SHA512 8414efc3c4b2d654b960892178fc5bc3c6c1ea6fb24558887dd18f0a72fa02dd16adf228a97d53b34c679f61c0c7fdaf72f460bbe818eaeef85ae7d69a204b21 WHIRLPOOL 5db2fb3cb23608703e9e915ccb3324465a23832516990f7765fb5317203f37fe8f91c76f88578583eba749a3440b7b13a7cb95e3dfe855c4c54f1f884c861b44
DIST NVIDIA-Linux-x86-295.59.run 34730118 SHA256 084bbb76c57d5c2a5b780322a95dcc230ec6e25b4f6c176574a93621399ce5a0 SHA512 91194816de17831e1abb4a2c80dac483dc78222a29921371d43a81626e3a6537468da663ca7a0c0c0a987d116801fce9f169d205beaaa061ab34c8e1818a7b82 WHIRLPOOL fe35d7f3edc5562fdbc2c6045889cb22cf87ff766e55ed68b9ebe0eeffe5c3d044306bbcad4b9086db921ca2489507ce6754803581156e118880fdaa35ec52f9
DIST NVIDIA-Linux-x86-304.37.run 39349097 SHA256 ab3174a0c9ab37a8fc3f4a8fc1121d72fbdd5e00ddecf44f7dbd84bb8d51b337 SHA512 82b38b6aabcce910bc5b9c4e80c7e1eeff0c969388e34bab30a6ae79fe58101b576bbdf3483bd9d846a39f124491ee3e4bb5c5592c3ee794b55f67f45d014719 WHIRLPOOL 79517d7258d5dd765c3d92fa2dab9f0d648e06c1d4db6799e87d888e7ce633f75004ec649712cadbab01f97f310d1c796f32b3ba697d60e1031890eedc40f2e6
DIST NVIDIA-Linux-x86_64-295.59.run 58529480 SHA256 4b1d96389abd2b804ad470c5189142a02ee4c82c1ac56cea37ecb45e8051313e SHA512 e0c0c67f4906ee4d933d168e9d1b76d5e8f82182282cc5b164e0361bb846d64251505732830d1a777eac5d736e444bac0c78661d24ddf0d24d687bf6047d1f5f WHIRLPOOL b7618dd0fb0bbbe6428fd0217c44585566cc05c3757e2fa2bcf805509533e4fc089f8ac08ef7b60f90abf962d788e11c8d56f808a369cdb3ced2a32dbc868e19
DIST NVIDIA-Linux-x86_64-304.37.run 64075318 SHA256 cae75158047d0b97ea48f269fd2903a6731f53b978a1065720343436c97ca9c2 SHA512 03ce52ad2f3ba232a9c9665ece40611a249ebd0bd74505adefe758064027f0d4afb4ea4e2411372183f46e372298d974c16708735f3d2b5bafe0038716d77bbc WHIRLPOOL 9a8f299db7e47a603805ce383bb30be520aa63acf91949f6ece7a8cac638eaf01d5e40b5f6279d2e243020b8d9c9af1ca94c6ca20c1ae5fa1ab3133bb56b4ed9
EBUILD nvidia-drivers-295.59.ebuild 18723 SHA256 e4cc8079bdb25440819e152cb02eb45a032ffcaaa2c7108d8d5aac155e41c42f SHA512 ef3f3755b21aaa0d25eb783275d843ac664d9b62e173735f053f8d2bcdf9fd11a571ffc68a724ce0e8de83a2de0a1bdd36c99c2d90dd8468ab991c758b8dd283 WHIRLPOOL 294416fd6790d1f076568184a0fab7d7de3c4dfaf130b69f71cc031163af911796b32bd43e862a2734d8d99afcf82754ada2cdebfb46f3c18290cb3938c392f9
EBUILD nvidia-drivers-304.37.ebuild 12678 SHA256 a0b6d2ebc0b2422e6faa88f174f2a90ca36c99cf9a10ab1a4107d3a8a91ab028 SHA512 8a5f97b85347f72f12fa29b827c50274a0de13b4e9b241e44604909e465a92b3f8a43d4402627dd574d1b08cfe5a67a895fa44928e3b4751616f99c4cc1576eb WHIRLPOOL a326f21ff651fae748d85d95d5d693f0e73b8fba8dfa8075604f3ff3175ea392affdf58efd0412ffb65d4f1146c441d585c9429626f8a47dbfb0344d0e16f897
MISC ebuild.diff 798 SHA256 1eebb334781f1bd00e5166248b0716fc751e60379d89cd79c757aec2a6631ffa SHA512 306f9f26e6e38c51da8967f215db09ce67e3e3ffdc1516e12227a53fdce63059fa14b95306dbe5c2814d8a842dc40d2fe7dbc99455b74b7d732b85d8472c698e WHIRLPOOL da15aac03818f776542a50659e45b97aef51541442fb8d793d97b0f2bb9fc7c2cbf81d2811125a7f853a6f1397c0718242333f8f9bb01889df0d384674bf0d2a

View File

@ -0,0 +1,8 @@
[Desktop Entry]
Type=Application
Name=NVIDIA X Server Settings
Comment=Configure NVIDIA X Server Settings
Exec=sh -c "/opt/bin/nvidia-settings --load-config-only"
Terminal=false
Icon=nvidia-settings
Categories=System;Settings;

View File

@ -1,25 +0,0 @@
diff -ur kernel/nv.h kernel/nv.h
--- kernel/nv.h 2012-08-02 18:19:37.000000000 -0700
+++ kernel/nv.h 2012-08-02 18:19:37.000000000 -0700
@@ -448,7 +448,20 @@
#define IS_BLACKLISTED_REG_OFFSET(nv, offset, length) \
((IS_REG_RANGE_WITHIN_MAPPING(nv, 0x1000, 0x1000, offset, length)) ||\
- (IS_REG_RANGE_WITHIN_MAPPING(nv, 0x700000, 0x100000, offset, length)))
+ (IS_REG_RANGE_WITHIN_MAPPING(nv, 0x84000, 0x1000, offset, length)) ||\
+ (IS_REG_RANGE_WITHIN_MAPPING(nv, 0x85000, 0x1000, offset, length)) ||\
+ (IS_REG_RANGE_WITHIN_MAPPING(nv, 0x86000, 0x1000, offset, length)) ||\
+ (IS_REG_RANGE_WITHIN_MAPPING(nv, 0x87000, 0x1000, offset, length)) ||\
+ (IS_REG_RANGE_WITHIN_MAPPING(nv, 0x89000, 0x1000, offset, length)) ||\
+ (IS_REG_RANGE_WITHIN_MAPPING(nv, 0xa0000, 0x20000, offset, length)) ||\
+ (IS_REG_RANGE_WITHIN_MAPPING(nv, 0x104000, 0x1000, offset, length)) ||\
+ (IS_REG_RANGE_WITHIN_MAPPING(nv, 0x105000, 0x1000, offset, length)) ||\
+ (IS_REG_RANGE_WITHIN_MAPPING(nv, 0x10a000, 0x1000, offset, length)) ||\
+ (IS_REG_RANGE_WITHIN_MAPPING(nv, 0x1c2000, 0x1000, offset, length)) ||\
+ (IS_REG_RANGE_WITHIN_MAPPING(nv, 0x1c3000, 0x1000, offset, length)) ||\
+ (IS_REG_RANGE_WITHIN_MAPPING(nv, 0x618000, 0x2000, offset, length)) ||\
+ (IS_REG_RANGE_WITHIN_MAPPING(nv, 0x627000, 0x1000, offset, length)) ||\
+ (IS_REG_RANGE_WITHIN_MAPPING(nv, 0x700000, 0x100000, offset, length)))
/* duplicated from nvos.h for external builds */
#ifndef NVOS_AGP_CONFIG_DISABLE_AGP

View File

@ -0,0 +1,25 @@
#!/sbin/runscript
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/files/nvidia-smi.init,v 1.1 2012/07/22 21:08:43 cardoe Exp $
pidfile="/var/run/nvidia-smi.pid"
depend() {
after modules
}
start() {
ebegin "Starting NVIDIA System Management Interface"
rm -f ${pidfile}
start-stop-daemon --start --quiet --pidfile ${pidfile} \
--make-pidfile --background --exec /opt/bin/nvidia-smi -- \
-q -l 300
eend $?
}
stop() {
ebegin "Stopping NVIDIA System Management Interface"
start-stop-daemon --stop --quiet --pidfile ${pidfile}
eend $?
}

View File

@ -1,592 +0,0 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-302.17-r1.ebuild,v 1.1 2012/08/05 22:43:04 cardoe Exp $
EAPI="2"
inherit eutils unpacker multilib portability versionator linux-mod flag-o-matic nvidia-driver
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 X11 driver and GLX libraries"
HOMEPAGE="http://www.nvidia.com/"
SRC_URI="x86? ( http://us.download.nvidia.com/XFree86/Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
amd64? ( http://us.download.nvidia.com/XFree86/Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
amd64-fbsd? ( http://us.download.nvidia.com/XFree86/FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
x86-fbsd? ( http://us.download.nvidia.com/XFree86/FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )"
LICENSE="NVIDIA"
SLOT="0"
KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd"
IUSE="acpi multilib kernel_FreeBSD kernel_linux pax_kernel +tools"
RESTRICT="strip"
EMULTILIB_PKG="true"
COMMON="<x11-base/xorg-server-1.12.99
kernel_linux? ( >=sys-libs/glibc-2.6.1 )
multilib? ( app-emulation/emul-linux-x86-xlibs )
>=app-admin/eselect-opengl-1.0.9
app-admin/eselect-opencl"
DEPEND="${COMMON}
kernel_linux? ( virtual/linux-sources )"
RDEPEND="${COMMON}
x11-libs/libXvMC
acpi? ( sys-power/acpid )
tools? (
dev-libs/atk
dev-libs/glib
x11-libs/gdk-pixbuf
x11-libs/gtk+:2
x11-libs/libX11
x11-libs/libXext
x11-libs/pango
)"
PDEPEND=">=x11-libs/libvdpau-0.3-r1"
QA_TEXTRELS_x86="
usr/lib/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0
usr/lib/libXvMCNVIDIA.so.${PV}
usr/lib/libcuda.so.${PV}
usr/lib/libnvcuvid.so.${PV}
usr/lib/libnvidia-cfg.so.${PV}
usr/lib/libnvidia-compiler.so.${PV}
usr/lib/libnvidia-glcore.so.${PV}
usr/lib/libnvidia-ml.so.${PV}
usr/lib/libvdpau_nvidia.so.${PV}
usr/lib/opengl/nvidia/extensions/libglx.so.${PV}
usr/lib/opengl/nvidia/lib/libGL.so.${PV}
usr/lib/opengl/nvidia/lib/libnvidia-tls.so.${PV}
usr/lib/xorg/modules/drivers/nvidia_drv.so"
QA_TEXTRELS_x86_fbsd="boot/modules/nvidia.ko
usr/lib/opengl/nvidia/lib/libGL.so.1
usr/lib/libnvidia-glcore.so.1
usr/lib/libvdpau_nvidia.so.1
usr/lib/libnvidia-cfg.so.1
usr/lib/opengl/nvidia/extensions/libglx.so.1
usr/lib/xorg/modules/drivers/nvidia_drv.so"
QA_TEXTRELS_amd64="usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV}
usr/lib32/libnvidia-glcore.so.${PV}
usr/lib32/libvdpau_nvidia.so.${PV}
usr/lib32/opengl/nvidia/lib/libGL.so.${PV}
usr/lib32/libcuda.so.${PV}
usr/lib32/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0
usr/lib32/libnvidia-compiler.so.${PV}"
QA_EXECSTACK_x86="usr/lib/opengl/nvidia/lib/libGL.so.${PV}
usr/lib/libnvidia-glcore.so.${PV}
usr/lib/opengl/nvidia/extensions/libglx.so.${PV}
usr/lib64/libXvMCNVIDIA.so.${PV}
usr/lib/libXvMCNVIDIA.a:NVXVMC.o
usr/lib/libvdpau_nvidia.so.${PV}
usr/lib/libnvidia-compiler.so.${PV}
usr/lib/libcuda.so.${PV}
usr/lib/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0"
QA_EXECSTACK_amd64="usr/lib32/libnvidia-glcore.so.${PV}
usr/lib32/opengl/nvidia/lib/libGL.so.${PV}
usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV}
usr/lib32/libvdpau_nvidia.so.${PV}
usr/lib32/libcuda.so.${PV}
usr/lib32/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0
usr/lib32/libnvidia-compiler.so.${PV}
usr/lib64/libXvMCNVIDIA.a:NVXVMC.o
usr/lib64/libnvidia-cfg.so.${PV}
usr/lib64/libnvidia-ml.so.${PV}
usr/lib64/libvdpau_nvidia.so.${PV}
usr/lib64/opengl/nvidia/lib/libnvidia-tls.so.${PV}
usr/lib64/opengl/nvidia/lib/libGL.so.${PV}
usr/lib64/libnvidia-glcore.so.${PV}
usr/lib64/opengl/nvidia/extensions/libglx.so.${PV}
usr/lib64/libXvMCNVIDIA.so.${PV}
usr/lib64/libcuda.so.${PV}
usr/lib64/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0
usr/lib64/libnvidia-compiler.so.${PV}
usr/lib64/xorg/modules/drivers/nvidia_drv.so
opt/bin/nvidia-smi
opt/bin/nvidia-xconfig
opt/bin/nvidia-debugdump
opt/bin/nvidia-settings"
QA_WX_LOAD_x86="usr/lib/libnvidia-glcore.so.${PV}
usr/lib/opengl/nvidia/lib/libGL.so.${PV}
usr/lib/opengl/nvidia/extensions/libglx.so.${PV}
usr/lib/libXvMCNVIDIA.a
usr/lib64/libXvMCNVIDIA.so.${PV}"
QA_WX_LOAD_amd64="usr/lib32/opengl/nvidia/lib/libGL.so.${PV}
usr/lib32/libnvidia-glcore.so.${PV}
usr/lib64/opengl/nvidia/lib/libGL.so.${PV}
usr/lib64/libnvidia-glcore.so.${PV}
usr/lib64/opengl/nvidia/extensions/libglx.so.${PV}
usr/lib64/libXvMCNVIDIA.so.${PV}"
QA_SONAME_x86="usr/lib/libnvidia-compiler.so.${PV}"
QA_SONAME_amd64="usr/lib64/libnvidia-compiler.so.${PV}
usr/lib32/libnvidia-compiler.so.${PV}"
QA_DT_HASH_amd64="usr/lib32/libcuda.so.${PV}
usr/lib32/opengl/nvidia/lib/libGL.so.${PV}
usr/lib32/libnvidia-glcore.so.${PV}
usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV}
usr/lib32/libvdpau_nvidia.so.${PV}
usr/lib32/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0
usr/lib32/libnvidia-compiler.so.${PV}
usr/lib64/libXvMCNVIDIA.so.${PV}
usr/lib64/libcuda.so.${PV}
usr/lib64/libnvidia-cfg.so.${PV}
usr/lib64/libnvidia-glcore.so.${PV}
usr/lib64/libnvidia-ml.so.${PV}
usr/lib64/opengl/nvidia/lib/libGL.so.${PV}
usr/lib64/opengl/nvidia/lib/libnvidia-tls.so.${PV}
usr/lib64/opengl/nvidia/extensions/libglx.so.${PV}
usr/lib64/xorg/modules/drivers/nvidia_drv.so
usr/lib64/libvdpau_nvidia.so.${PV}
usr/lib64/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0
usr/lib64/libnvidia-compiler.so.${PV}
usr/lib64/libnvcuvid.so.${PV}
opt/bin/nvidia-smi
opt/bin/nvidia-xconfig
opt/bin/nvidia-debugdump
opt/bin/nvidia-settings"
QA_DT_HASH_x86="usr/lib/libcuda.so.${PV}
usr/lib/libnvidia-cfg.so.${PV}
usr/lib/libnvidia-glcore.so.${PV}
usr/lib/libnvidia-ml.so.${PV}
usr/lib/opengl/nvidia/lib/libGL.so.${PV}
usr/lib/opengl/nvidia/lib/libnvidia-tls.so.${PV}
usr/lib/opengl/nvidia/extensions/libglx.so.${PV}
usr/lib/xorg/modules/drivers/nvidia_drv.so
usr/lib/libXvMCNVIDIA.so.${PV}
usr/lib/libvdpau_nvidia.so.${PV}
usr/lib/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0
usr/lib/libnvidia-compiler.so.${PV}
usr/lib/libnvcuvid.so.${PV}
opt/bin/nvidia-smi
opt/bin/nvidia-xconfig
opt/bin/nvidia-debugdump
opt/bin/nvidia-settings"
S=${WORKDIR}/
mtrr_check() {
ebegin "Checking for MTRR support"
linux_chkconfig_present MTRR
eend $?
if [[ $? -ne 0 ]] ; then
eerror "Please enable MTRR support in your kernel config, found at:"
eerror
eerror " Processor type and features"
eerror " [*] MTRR (Memory Type Range Register) support"
eerror
eerror "and recompile your kernel ..."
die "MTRR support not detected!"
fi
}
lockdep_check() {
if linux_chkconfig_present LOCKDEP; then
eerror "You've enabled LOCKDEP -- lock tracking -- in the kernel."
eerror "Unfortunately, this option exports the symbol "
eerror "'lockdep_init_map' as GPL-only which will prevent "
eerror "${P} from compiling."
eerror "Please make sure the following options have been unset:"
eerror
eerror " Kernel hacking --->"
eerror " [ ] Lock debugging: detect incorrect freeing of live locks"
eerror " [ ] Lock debugging: prove locking correctness"
eerror " [ ] Lock usage statistics"
eerror "in 'menuconfig'"
die "LOCKDEP enabled"
fi
}
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 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; 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/')"
mtrr_check
lockdep_check
fi
# On BSD userland it wants real make command
use userland_BSD && MAKE="$(get_bmake)"
export _POSIX2_VERSION="199209"
# 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
# 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_EXEC="${S}/obj"
NV_LIB="${S}/obj"
NV_SRC="${S}/src"
NV_MAN="${S}/x11/man"
NV_X11="${S}/obj"
NV_X11_DRV="${NV_X11}"
NV_X11_EXT="${NV_X11}"
NV_SOVER=1
elif use kernel_linux; then
NV_DOC="${S}"
NV_EXEC="${S}"
NV_LIB="${S}"
NV_SRC="${S}/kernel"
NV_MAN="${S}"
NV_X11="${S}"
NV_X11_DRV="${NV_X11}"
NV_X11_EXT="${NV_X11}"
NV_SOVER=${PV}
else
die "Could not determine proper NVIDIA package"
fi
}
src_unpack() {
if use kernel_linux && kernel_is lt 2 6 7; then
echo
ewarn "Your kernel version is ${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}"
ewarn "This is not officially supported for ${P}. It is likely you"
ewarn "will not be able to compile or use the kernel module."
ewarn "It is recommended that you upgrade your kernel to a version >= 2.6.7"
echo
ewarn "DO NOT file bug reports for kernel versions less than 2.6.7 as they will be ignored."
fi
if ! use kernel_FreeBSD; then
cd "${S}"
unpack_makeself
else
unpack ${A}
fi
}
src_prepare() {
# Please add a brief description for every added patch
use kernel_FreeBSD && cd doc
if use kernel_linux; then
# Fix CVE-2012-xxxx VGA window resize vulnerability
epatch "${FILESDIR}"/nvidia-blacklist-vga-pmu-registers-256-304.diff
# Quiet down warnings the user does not need to see
sed -i \
-e 's:-Wsign-compare::g' \
"${NV_SRC}"/Makefile.kbuild
# If greater than 2.6.5 use M= instead of SUBDIR=
convert_to_m "${NV_SRC}"/Makefile.kbuild
fi
if use pax_kernel; then
epatch "${FILESDIR}"/nvidia-drivers-pax-const.patch
epatch "${FILESDIR}"/nvidia-drivers-pax-usercopy.patch
fi
cat <<- EOF > "${S}"/nvidia.icd
/usr/$(get_libdir)/libcuda.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
linux-mod_src_compile
fi
}
src_install() {
if use kernel_linux; then
linux-mod_src_install
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."
fi
# Add the aliases
[ -f "${FILESDIR}/nvidia-169.07" ] || die "nvidia missing in FILESDIR"
sed -e 's:PACKAGE:'${PF}':g' \
-e 's:VIDEOGID:'${VIDEOGROUP}':' "${FILESDIR}"/nvidia-169.07 > \
"${WORKDIR}"/nvidia
insinto /etc/modprobe.d
newins "${WORKDIR}"/nvidia nvidia.conf || die
# Ensures that our device nodes are created when not using X
exeinto /lib/udev
doexe "${FILESDIR}"/nvidia-udev.sh
insinto /lib/udev/rules.d
newins "${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" || die
fi
exeinto /boot/modules
doexe "${S}/src/nvidia.ko" || die
fi
# NVIDIA kernel <-> userspace driver config lib
dolib.so ${NV_LIB}/libnvidia-cfg.so.${NV_SOVER} || \
die "failed to install libnvidia-cfg"
dosym libnvidia-cfg.so.${NV_SOVER} \
/usr/$(get_libdir)/libnvidia-cfg.so.1 || \
die "failed to create libnvidia-cfg.so symlink"
dosym libnvidia-cfg.so.1 \
/usr/$(get_libdir)/libnvidia-cfg.so || \
die "failed to create libnvidia-cfg.so symlink"
if use kernel_linux; then
# NVIDIA monitoring library
dolib.so ${NV_LIB}/libnvidia-ml.so.${NV_SOVER} || \
die "failed to install libnvidia-ml"
dosym libnvidia-ml.so.${NV_SOVER} \
/usr/$(get_libdir)/libnvidia-ml.so.1 || \
die "failed to create libnvidia-ml.so symlink"
dosym libnvidia-ml.so.1 \
/usr/$(get_libdir)/libnvidia-ml.so || \
die "failed to create libnvidia-ml.so symlink"
# NVIDIA video decode <-> CUDA
dolib.so ${NV_LIB}/libnvcuvid.so.${NV_SOVER} || \
die "failed to install libnvcuvid.so"
dosym libnvcuvid.so.${NV_SOVER} \
/usr/$(get_libdir)/libnvcuvid.so.1 || \
die "failed to create libnvcuvid.so symlink"
dosym libnvcuvid.so.1 \
/usr/$(get_libdir)/libnvcuvid.so || \
die "failed to create libnvcuvid.so symlink"
fi
# Xorg DDX driver
insinto /usr/$(get_libdir)/xorg/modules/drivers
doins ${NV_X11_DRV}/nvidia_drv.so || die "failed to install nvidia_drv.so"
# Xorg GLX driver
insinto /usr/$(get_libdir)/opengl/nvidia/extensions
doins ${NV_X11_EXT}/libglx.so.${NV_SOVER} || \
die "failed to install libglx.so"
dosym libglx.so.${NV_SOVER} \
/usr/$(get_libdir)/opengl/nvidia/extensions/libglx.so || \
die "failed to create libglx.so symlink"
# XvMC driver
dolib.a ${NV_X11}/libXvMCNVIDIA.a || \
die "failed to install libXvMCNVIDIA.so"
dolib.so ${NV_X11}/libXvMCNVIDIA.so.${NV_SOVER} || \
die "failed to install libXvMCNVIDIA.so"
dosym libXvMCNVIDIA.so.${NV_SOVER} \
/usr/$(get_libdir)/libXvMCNVIDIA.so.1 || \
die "failed to create libXvMCNVIDIA.so symlink"
dosym libXvMCNVIDIA.so.1 /usr/$(get_libdir)/libXvMCNVIDIA.so || \
die "failed to create libXvMCNVIDIA.so symlink"
dosym libXvMCNVIDIA.so.${NV_SOVER} \
/usr/$(get_libdir)/libXvMCNVIDIA_dynamic.so.1 || \
die "failed to create libXvMCNVIDIA_dynamic.so symlink"
# OpenCL ICD for NVIDIA
if use kernel_linux; then
insinto /etc/OpenCL/vendors
doins nvidia.icd
fi
# Documentation
dohtml ${NV_DOC}/html/*
if use kernel_FreeBSD; then
dodoc "${NV_DOC}/README"
doman "${NV_MAN}/nvidia-xconfig.1"
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"
doman "${NV_MAN}/nvidia-xconfig.1.gz"
doman "${NV_MAN}/nvidia-settings.1.gz"
fi
# Helper Apps
exeinto /opt/bin/
doexe ${NV_EXEC}/nvidia-xconfig || die
use kernel_linux && { doexe ${NV_EXEC}/nvidia-debugdump || die ; }
if use tools; then
doexe ${NV_EXEC}/nvidia-settings || die
fi
doexe ${NV_EXEC}/nvidia-bug-report.sh || die
if use kernel_linux; then
doexe ${NV_EXEC}/nvidia-smi || die
fi
# Desktop entries for nvidia-settings
if use tools && use kernel_linux ; then
sed -e 's:__UTILS_PATH__:/opt/bin:' \
-e 's:__PIXMAP_PATH__:/usr/share/pixmaps:' \
-i "${NV_EXEC}/nvidia-settings.desktop"
newmenu ${NV_EXEC}/nvidia-settings.desktop nvidia-settings-opt.desktop
fi
doicon ${NV_EXEC}/nvidia-settings.png
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"
}
# Install nvidia library:
# the first parameter is the place where to install it
# the second parameter is the base name of the library
# the third parameter is the provided soversion
donvidia() {
dodir $1
exeinto $1
libname=$(basename $2)
doexe $2.$3 || die "failed to install $2"
dosym ${libname}.$3 $1/${libname} || die "failed to symlink $2"
[[ $3 != "1" ]] && dosym ${libname}.$3 $1/${libname}.1
}
src_install-libs() {
local inslibdir=$(get_libdir)
local NV_ROOT="/usr/${inslibdir}/opengl/nvidia"
local CL_ROOT=/usr/${inslibdir}/OpenCL/vendors/nvidia
local libdir= sover=
if use kernel_linux; then
if has_multilib_profile && [[ ${ABI} == "x86" ]] ; then
libdir=32
else
libdir=.
fi
sover=${PV}
else
libdir=obj
# on FreeBSD it has just .1 suffix
sover=1
fi
# The GLX libraries
donvidia ${NV_ROOT}/lib ${libdir}/libGL.so ${sover}
donvidia /usr/${inslibdir} ${libdir}/libnvidia-glcore.so ${sover}
if use kernel_FreeBSD; then
donvidia ${NV_ROOT}/lib ${libdir}/libnvidia-tls.so ${sover}
else
donvidia ${NV_ROOT}/lib ${libdir}/tls/libnvidia-tls.so ${sover}
fi
# VDPAU
donvidia /usr/${inslibdir} ${libdir}/libvdpau_nvidia.so ${sover}
# CUDA & OpenCL
if use kernel_linux; then
donvidia /usr/${inslibdir} ${libdir}/libcuda.so ${sover}
donvidia /usr/${inslibdir} ${libdir}/libnvidia-compiler.so ${sover}
donvidia ${CL_ROOT} ${libdir}/libOpenCL.so 1.0.0
#dosym libOpenCL.so.1 ${CL_ROOT}/libOpenCL.so
fi
}
pkg_preinst() {
use kernel_linux && linux-mod_pkg_preinst
# 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
"${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
"${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
elog "You must be in the video group to use the NVIDIA device"
elog "For more info, read the docs at"
elog "http://www.gentoo.org/doc/en/nvidia-guide.xml#doc_chap3_sect6"
elog
elog "This ebuild installs a kernel module and X driver. Both must"
elog "match explicitly in their version. This means, if you restart"
elog "X, you must modprobe -r nvidia before starting it back up"
elog
elog "To use the NVIDIA GLX, run \"eselect opengl set nvidia\""
elog
elog "To use the NVIDIA CUDA/OpenCL, run \"eselect opencl set nvidia\""
elog
elog "NVIDIA has requested that any bug reports submitted have the"
elog "output of /opt/bin/nvidia-bug-report.sh included."
elog
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"
fi
}
pkg_prerm() {
"${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
}
pkg_postrm() {
use kernel_linux && linux-mod_pkg_postrm
"${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
}

View File

@ -0,0 +1,449 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-304.37.ebuild,v 1.1 2012/08/16 15:37:41 cardoe Exp $
EAPI=4
inherit eutils flag-o-matic linux-info linux-mod multilib nvidia-driver \
portability toolchain-funcs unpacker user versionator
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 X11 driver and GLX libraries"
HOMEPAGE="http://www.nvidia.com/"
SRC_URI="x86? ( http://us.download.nvidia.com/XFree86/Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
amd64? ( http://us.download.nvidia.com/XFree86/Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
amd64-fbsd? ( http://us.download.nvidia.com/XFree86/FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
x86-fbsd? ( http://us.download.nvidia.com/XFree86/FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )"
LICENSE="NVIDIA"
SLOT="0"
KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd"
IUSE="acpi multilib kernel_FreeBSD kernel_linux pax_kernel +tools +X"
RESTRICT="strip"
EMULTILIB_PKG="true"
COMMON="app-admin/eselect-opencl
kernel_linux? ( >=sys-libs/glibc-2.6.1 )
multilib? ( app-emulation/emul-linux-x86-xlibs )
X? (
<x11-base/xorg-server-1.12.99
>=app-admin/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
x11-libs/gdk-pixbuf
x11-libs/gtk+:2
x11-libs/libX11
x11-libs/libXext
x11-libs/pango[X]
)
X? ( x11-libs/libXvMC )"
PDEPEND="X? ( >=x11-libs/libvdpau-0.3-r1 )"
REQUIRED_USE="tools? ( X )"
QA_PREBUILT=""
S=${WORKDIR}/
pkg_pretend() {
if [ "${I_AM_CRAZY_TO_USE_MASKED_VERSIONS}" != "1" ]; then
die "Don't use experimental in development ebuilds"
fi
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
# 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
# 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
# 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
epatch "${FILESDIR}"/nvidia-drivers-pax-const.patch
epatch "${FILESDIR}"/nvidia-drivers-pax-usercopy.patch
fi
cat <<- EOF > "${S}"/nvidia.icd
/usr/$(get_libdir)/libcuda.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
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)
# Add it to QA_PREBUILT
QA_PREBUILT+=" ${MY_DEST}/${libname}.${MY_SOVER}"
# 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
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."
fi
# Add the aliases
[ -f "${FILESDIR}/nvidia-169.07" ] || die "nvidia missing in FILESDIR"
sed -e 's:PACKAGE:'${PF}':g' \
-e 's:VIDEOGID:'${VIDEOGROUP}':' "${FILESDIR}"/nvidia-169.07 > \
"${WORKDIR}"/nvidia
insinto /etc/modprobe.d
newins "${WORKDIR}"/nvidia nvidia.conf || die
local udevdir=/lib/udev
has_version sys-fs/udev && udevdir="$($(tc-getPKG_CONFIG) --variable=udevdir udev)"
# Ensures that our device nodes are created when not using X
exeinto "${udevdir}"
doexe "${FILESDIR}"/nvidia-udev.sh
insinto "${udevdir}"/rules.d
newins "${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" || die
fi
exeinto /boot/modules
doexe "${S}/src/nvidia.ko" || die
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 || die "failed to install 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
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 || die
fi
if use kernel_linux ; then
doexe ${NV_OBJ}/nvidia-debugdump || die
doexe ${NV_OBJ}/nvidia-cuda-proxy-control || die
doexe ${NV_OBJ}/nvidia-cuda-proxy-server || die
doexe ${NV_OBJ}/nvidia-smi || die
newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
fi
if use tools; then
doexe ${NV_OBJ}/nvidia-settings || die
fi
exeinto /usr/bin/
doexe ${NV_OBJ}/nvidia-bug-report.sh || die
# Desktop entries for nvidia-settings
if use tools ; then
newicon ${NV_OBJ}/nvidia-settings.png nvidia-drivers-settings.png
domenu "${FILESDIR}"/nvidia-drivers-settings.desktop
insinto /etc/xdg/autostart
doins "${FILESDIR}"/nvidia-autostart.desktop
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"
}
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() {
use kernel_linux && linux-mod_pkg_preinst
# 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
elog "You must be in the video group to use the NVIDIA device"
elog "For more info, read the docs at"
elog "http://www.gentoo.org/doc/en/nvidia-guide.xml#doc_chap3_sect6"
elog
elog "This ebuild installs a kernel module and X driver. Both must"
elog "match explicitly in their version. This means, if you restart"
elog "X, you must modprobe -r nvidia before starting it back up"
elog
elog "To use the NVIDIA GLX, run \"eselect opengl set nvidia\""
elog
elog "To use the NVIDIA CUDA/OpenCL, run \"eselect opencl set nvidia\""
elog
elog "NVIDIA has requested that any bug reports submitted have the"
elog "output of /opt/bin/nvidia-bug-report.sh included."
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
}