diff --git a/x11-drivers/nvidia-drivers/Manifest b/x11-drivers/nvidia-drivers/Manifest new file mode 100644 index 0000000..4e3f9a6 --- /dev/null +++ b/x11-drivers/nvidia-drivers/Manifest @@ -0,0 +1,18 @@ +AUX 50nvidia-prelink-blacklist 319 SHA256 61adce61498451898c22fb538151379438729957418eacf4f69195b3e03ec1f4 SHA512 7252b464c45669bb402859ddb2c95f4553a37027870b6aeada3e1dd58fefe7b4713d3486d301177efdcd7559dbc31ceb6078220d5c0187bdc636d817a98e1a41 WHIRLPOOL 93e14ed7c8fb5dba87295c87e1e8906afac290f63dc6ea023fa6c387ed47ff13d488b3b24c400aee42a22737856a7782925d9a3a412ddcd1984dbbd7e51579a5 +AUX 95-nvidia-settings 54 SHA256 c4b293c6c2659bebcbad9cffc1e237c6908a3763599e432aba89d07bc2826ba0 SHA512 0fdaff8701598081eeb78defcd140b78f75309ace998df67569a15d0ff653aca7ad0576912bf9a619f42990e6fb35cdb79e21f8181d3cd04dea719d912da8be9 WHIRLPOOL d71fef01f8c346089ef2556ffe62c5094f89582b73500711a7f18f25424e59baa12f6b0861bd8efd9bf4c5bbf794642927ca322cee218fd2da9fc7baa50fa827 +AUX NVIDIA_glx-defines.patch 437 SHA256 0007f3d962edb87da4788ce58869679c1b10f28223a6bf1c23696fede57305da SHA512 a9cbbe5d5d362db0eb92d5b9fe87f28cccb600df9b44ae2b323ed08da97c32d6a4a0553c7c82ea3777ab91a1a4bf6b74f04d89b6ec28e60565e677cc4af48351 WHIRLPOOL a826b11c86803530346a65612ebd1a12f77f6c6ba1d93af597435993086451648b825fbc245a2c5850e0680c58129924843744d7e29013d5087c3b4dd9fefb14 +AUX NVIDIA_glx-glheader.patch 380 SHA256 f630e24067bf6199a64f8fe8c5d6fc158cb4b153bda65ffc3f97b36a9cb08faf SHA512 366ebbe967001f4d694e9d6ae61fbd8b57e2946bba495894936809634bb87bd6ba6b10689969977e4d0eaba6983c16fe8d78830112b5b28f01c78381a0a095d6 WHIRLPOOL 8609fcedb439299189d9d05606a290a63de8b207bab855f874faa36e892396f41159d26e505dfead89fdac9d7e61aeeb50b16877aa14ad62dc3cd617353d7d60 +AUX nvidia-169.07 639 SHA256 a8c4860f008d53776fda7a17b59524f271236559af688e9a2c9845cbbcba1577 SHA512 3af295c026280dc3a2b73c2cc7772254686b09cad15f1333ab0b4de8cb0ccf78e725ced2a399b10edcf8af6ba42ab1485dc0661af67461b0c3789f786357772f WHIRLPOOL 626ae3c01c879e0cfe05bd373e0b9dfd6f462dd9ef6ae94a7d60276fe2d17c57fbb20aaa4d2a186a0ffc2a860076692aac854d00a3545bc9736e7bb8d0581055 +AUX nvidia-drivers-331.13-kernel-3.11.patch 591 SHA256 c03b8d8410482f1ee42a4b023c66382b129aa67f0947e9f8472d54ddaf1b630e SHA512 a656262407ca4ef6159e2b97073814564fb276fd76961b05fd7e608401c5c8a89fd27c1c09a46a586d9b9f119c6127c2ac97b6bcaac682b60b8ab2be4bf4f432 WHIRLPOOL b22ac117847bdc87a9ae1fc10f360c81bc3ffe734641aa8f49bfbf973ee8ae17fe1004fc1b563bcc0052e25f9898a4ee17421d4367970fca1d15f192782164f5 +AUX nvidia-drivers-331.13-pax-usercopy.patch 2127 SHA256 669ffcab77432f116c2b9bc7ed55e2a1f4e208ff19b63d43003af2b346f7c0c0 SHA512 c6ebd534d1e88fe5c1b71ef5ccced8957e34931cab72d1adb4017c703fc2e285f6e36a778bb36a319f505cfe6408be098569944aa5d78c00c8837ffe880d006a WHIRLPOOL 798d3f3edeae2361f039372f5fe13cf9df5aef20ee63c7cdc83e806cbad097b0ddccd6b30968c2b2ceb768ad0425b02aaefe1ba41709e3f0fb79a82f908579a6 +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-drivers-settings.desktop 193 SHA256 31c062449b8bcc8adcd3ee649d8aebf0bef502400bcbbbb46124217e1efb17a3 SHA512 fbb81d2520e9025fbffb2a8e7b3647f621ddc9d36c79d063d49e901286e8d1ea45de1274f42e33ff1aece5cebd547a42829d65b421db39d808947554b0f57453 WHIRLPOOL c797eb0ec1044ecaaa979ca5180f840d9c82c5c040dd81b2d86ca4afade9f0c006fb8951f04cc4d2b206110d38b339690386d291ff8f625a22b38178a3cd970b +AUX nvidia-smi.init 664 SHA256 c996033b81cc1512d8370d62575a0ea0c694f6e1b91cc948b4529625130601a7 SHA512 f7cc27d6cce7c13adecb0b927680979ca6a398bc742a93492ab7f85702e4442d8fc00c476f381a0177ae031a9ae45c5cbb6777f20c545d5cd695150f9551a4ce WHIRLPOOL 66bf1a70fa0038a54ca9254cd5543f61bdc69a4c070544660f4ef9b2a004d28f1defdb26b1bc102b1eabd24e679f36fec14c9b313fba4b54c7a9a51a73ca021e +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-331.13.tar.gz 55428438 SHA256 a9d2c761c0c58898f536728728420b36685364fccf864b57a7d3413d74a8ba5f SHA512 96e922797cbc1a51147e07b208f33d54ae5648ad8b033ef9e7cb4f2fc5730a56b54ac265a8ea8b5004413dfd468db261d6f33a71e7879db7e431656c378adf21 WHIRLPOOL 7aab0be204e69c6f44333593150ae4bbb9e97d8967a52ae8d228acfa2051763ac174a80e170cb11978dac3c91eb285b845a5c6c5e74b5b7f398b35417b409650 +DIST NVIDIA-FreeBSD-x86_64-331.13.tar.gz 46552607 SHA256 3f42aaf4b35bb04dedd4f9511e36bb473ae4174c7609ea100396d16ec532a17f SHA512 7daae19273f31a7802852dd4fa7726a1b6c828e0c868f7fa918f5c6378b1152223638d7556a7c4f02246bb1e0ed2d32d9118c67c9b651f2d792ccc796b09bbbd WHIRLPOOL aec73e407be9280fa160fcfac4b7652f7f21f684c1442c106eedc8b82c2f99a0c5a3b4ee82f3c41244d22f819e96b9752f4989ec37ed0e975a3c8fe724236c86 +DIST NVIDIA-Linux-x86-331.13.run 36834516 SHA256 36d5402d9cca8eb24261e1141ecc67040a4120f5a9391de0481c68e9de9009be SHA512 97603a193e63dd747a38751e79dfb97425af2c9332d2a40bd0083ad82b35e003e602ba029d5c7b0683bbc4644af19e133214c72e72af0f23bf55976e61637151 WHIRLPOOL d7e18bf5f3725973b48dc57e6137c91c31c2654b90c28f8606ca193d40d970f61a2ec089bacee282753bc51673390c38b8704a9693d36c30a09cc5de7a0fbfa5 +DIST NVIDIA-Linux-x86_64-331.13.run 59835902 SHA256 571741b8ea153281916382d287849f99a9fa65b911aa54d678b48ef0091cc0cd SHA512 5c7c6a23a691b67ad5943c36829b9e4f0c5103f4e3d3b28fbdfd9ee9cd697bb69a7474239313feb67ff9e0499749b49aa6ee33aaf59c1f14c14bd14ea5b25d62 WHIRLPOOL 5587c94c050134d13076955c3bdd7e33aca86f61befa3b70522338bcd535bcd1902140b2564fecdff1dda4fce025a028bf6698c025c80939fe84970c507ed00d +EBUILD nvidia-drivers-331.13-r1.ebuild 12270 SHA256 7b1c66c9e7d263e53d83a2ae2fed9e695a519211600d4c3e313fb290efeca690 SHA512 e7c195a5244d8cf1e235fda7f9464df397bf1b214dcb9b172bd766170cae4ffb5cc4e6211e5ef87fa240837e552bf9270f614187c4d6f232851d16d840d9a34f WHIRLPOOL b4aaf7a278984062553b2e951ca5344467533d944290747f240f4da63a647945f71a4c6d91356199f36aa58e3b816f3024e450764299ac684462497c9c070bfa diff --git a/x11-drivers/nvidia-drivers/files/50nvidia-prelink-blacklist b/x11-drivers/nvidia-drivers/files/50nvidia-prelink-blacklist new file mode 100644 index 0000000..5e139de --- /dev/null +++ b/x11-drivers/nvidia-drivers/files/50nvidia-prelink-blacklist @@ -0,0 +1 @@ +PRELINK_PATH_MASK="/usr/lib{,64}/tls/libnvidia-tls*:/usr/lib{,64}/libnvidia*:/usr/lib{,64}/libGL*:/usr/lib{,64}/opengl/nvidia/*:/usr/lib{,64}/OpenCL/vendors/nvidia/*:/usr/lib{,64}/xorg/modules/drivers/nvidia*:/usr/lib{,64}/libvdpau_nvidia*:/usr/lib{,64}/libXvMCNVIDIA*:/usr/lib{,64}/libcuda*:/usr/lib{,64}/libnvcuvid*" diff --git a/x11-drivers/nvidia-drivers/files/95-nvidia-settings b/x11-drivers/nvidia-drivers/files/95-nvidia-settings new file mode 100644 index 0000000..e9d6274 --- /dev/null +++ b/x11-drivers/nvidia-drivers/files/95-nvidia-settings @@ -0,0 +1,2 @@ +#!/bin/sh +/opt/bin/nvidia-settings --load-config-only diff --git a/x11-drivers/nvidia-drivers/files/NVIDIA_glx-defines.patch b/x11-drivers/nvidia-drivers/files/NVIDIA_glx-defines.patch new file mode 100644 index 0000000..da9933f --- /dev/null +++ b/x11-drivers/nvidia-drivers/files/NVIDIA_glx-defines.patch @@ -0,0 +1,11 @@ +diff -ur NVIDIA_GLX-1.0-4191/usr/include/GL/glx.h NVIDIA_GLX-1.0-4191.new/usr/include/GL/glx.h +--- NVIDIA_GLX-1.0-4191/usr/include/GL/glx.h 2002-12-09 21:26:55.000000000 +0100 ++++ NVIDIA_GLX-1.0-4191.new/usr/include/GL/glx.h 2003-01-30 18:20:23.000000000 +0100 +@@ -39,6 +39,7 @@ + typedef XID GLXPixmap; + typedef XID GLXDrawable; + typedef XID GLXPbuffer; ++typedef XID GLXPbufferSGIX; + typedef XID GLXWindow; + typedef XID GLXFBConfigID; + diff --git a/x11-drivers/nvidia-drivers/files/NVIDIA_glx-glheader.patch b/x11-drivers/nvidia-drivers/files/NVIDIA_glx-glheader.patch new file mode 100644 index 0000000..e0393e1 --- /dev/null +++ b/x11-drivers/nvidia-drivers/files/NVIDIA_glx-glheader.patch @@ -0,0 +1,13 @@ +--- usr/include/GL/gl.g.orig 2004-07-17 19:56:59.789410584 +1000 ++++ usr/include/GL/gl.h 2004-07-17 19:59:08.844791184 +1000 +@@ -66,6 +66,10 @@ + typedef double GLclampd; + typedef void GLvoid; + ++/* Patching for some better defines in the global system */ ++#ifndef GL_GLEXT_LEGACY ++#include ++#endif + + /*************************************************************/ + diff --git a/x11-drivers/nvidia-drivers/files/nvidia-169.07 b/x11-drivers/nvidia-drivers/files/nvidia-169.07 new file mode 100644 index 0000000..a96b0cd --- /dev/null +++ b/x11-drivers/nvidia-drivers/files/nvidia-169.07 @@ -0,0 +1,14 @@ +# Nvidia drivers support +alias char-major-195 nvidia +alias /dev/nvidiactl char-major-195 + +# To tweak the driver the following options can be used, note that +# you should be careful, as it could cause instability!! For more +# options see /usr/share/doc/PACKAGE/README +# +# !!! SECURITY WARNING !!! +# DO NOT MODIFY OR REMOVE THE DEVICE FILE RELATED OPTIONS UNLESS YOU KNOW +# WHAT YOU ARE DOING. +# ONLY ADD TRUSTED USERS TO THE VIDEO GROUP, THESE USERS MAY BE ABLE TO CRASH, +# COMPROMISE, OR IRREPARABLY DAMAGE THE MACHINE. +options nvidia NVreg_DeviceFileMode=432 NVreg_DeviceFileUID=0 NVreg_DeviceFileGID=VIDEOGID NVreg_ModifyDeviceFiles=1 diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-331.13-kernel-3.11.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-331.13-kernel-3.11.patch new file mode 100644 index 0000000..ac0ff3b --- /dev/null +++ b/x11-drivers/nvidia-drivers/files/nvidia-drivers-331.13-kernel-3.11.patch @@ -0,0 +1,17 @@ +--- nvidia-331.13/kernel/nv-linux.h 2013-09-06 05:16:30.000000000 +0100 ++++ nvidia-331.13-new/kernel/nv-linux.h 2013-09-06 05:25:06.000000000 +0100 +@@ -958,7 +958,13 @@ + #endif + + #if !defined(NV_VMWARE) +-#define NV_NUM_PHYSPAGES num_physpages ++ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0) ++#define NV_NUM_PHYSPAGES get_num_physpages ++#else ++#define NV_NUM_PHYSPAGES num_physpages ++#endif ++ + #define NV_GET_CURRENT_PROCESS() current->tgid + #define NV_IN_ATOMIC() in_atomic() + #define NV_LOCAL_BH_DISABLE() local_bh_disable() diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-331.13-pax-usercopy.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-331.13-pax-usercopy.patch new file mode 100644 index 0000000..9777ce6 --- /dev/null +++ b/x11-drivers/nvidia-drivers/files/nvidia-drivers-331.13-pax-usercopy.patch @@ -0,0 +1,52 @@ +--- a/kernel/nv-linux.h ++++ b/kernel/nv-linux.h +@@ -757,16 +757,16 @@ + + #if defined(NV_KMEM_CACHE_CREATE_PRESENT) + #if (NV_KMEM_CACHE_CREATE_ARGUMENT_COUNT == 6) +-#define NV_KMEM_CACHE_CREATE(kmem_cache, name, type) \ ++#define NV_KMEM_CACHE_CREATE(kmem_cache, name, type, flags) \ + { \ + kmem_cache = kmem_cache_create(name, sizeof(type), \ +- 0, 0, NULL, NULL); \ ++ 0, flags, NULL, NULL); \ + } + #elif (NV_KMEM_CACHE_CREATE_ARGUMENT_COUNT == 5) +-#define NV_KMEM_CACHE_CREATE(kmem_cache, name, type) \ ++#define NV_KMEM_CACHE_CREATE(kmem_cache, name, type, flags) \ + { \ + kmem_cache = kmem_cache_create(name, sizeof(type), \ +- 0, 0, NULL); \ ++ 0, flags, NULL); \ + } + #else + #error "NV_KMEM_CACHE_CREATE_ARGUMENT_COUNT value unrecognized!" +--- a/kernel/nv.c ++++ b/kernel/nv.c +@@ -794,7 +794,7 @@ + NV_SPIN_LOCK_INIT(&km_lock); + #endif + +- NV_KMEM_CACHE_CREATE(nv_stack_t_cache, NV_STACK_CACHE_STR, nv_stack_t); ++ NV_KMEM_CACHE_CREATE(nv_stack_t_cache, NV_STACK_CACHE_STR, nv_stack_t, SLAB_USERCOPY); + if (nv_stack_t_cache == NULL) + { + nv_printf(NV_DBG_ERRORS, "NVRM: stack cache allocation failed!\n"); +@@ -924,7 +924,7 @@ + nv->os_state = (void *) &nv_ctl_device; + nv_lock_init_locks(nv); + +- NV_KMEM_CACHE_CREATE(nv_pte_t_cache, NV_PTE_CACHE_STR, nv_pte_t); ++ NV_KMEM_CACHE_CREATE(nv_pte_t_cache, NV_PTE_CACHE_STR, nv_pte_t, 0); + if (nv_pte_t_cache == NULL) + { + rc = -ENOMEM; +@@ -935,7 +935,7 @@ + if (NV_BUILD_MODULE_INSTANCES == 0) + { + NV_KMEM_CACHE_CREATE(nvidia_p2p_page_t_cache, "nvidia_p2p_page_t", +- nvidia_p2p_page_t); ++ nvidia_p2p_page_t, 0); + if (nvidia_p2p_page_t_cache == NULL) + { + rc = -ENOMEM; diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-pax-const.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-pax-const.patch new file mode 100644 index 0000000..f3b8259 --- /dev/null +++ b/x11-drivers/nvidia-drivers/files/nvidia-drivers-pax-const.patch @@ -0,0 +1,17 @@ +Binary files kernel.orig/.nv-procfs.c.swp and kernel/.nv-procfs.c.swp differ +diff -urp kernel.orig/nv-procfs.c kernel/nv-procfs.c +--- kernel.orig/nv-procfs.c 2011-07-13 03:29:30.000000000 +0200 ++++ kernel/nv-procfs.c 2011-07-19 15:45:27.982993911 +0200 +@@ -707,8 +707,10 @@ int nv_register_procfs(void) + * However, in preparation for this, we need to preserve + * the procfs read() and write() operations. + */ +- nv_procfs_registry_fops.read = entry->proc_fops->read; +- nv_procfs_registry_fops.write = entry->proc_fops->write; ++ pax_open_kernel(); ++ *(void **)&nv_procfs_registry_fops.read = entry->proc_fops->read; ++ *(void **)&nv_procfs_registry_fops.write = entry->proc_fops->write; ++ pax_close_kernel(); + + entry = NV_CREATE_PROC_FILE("registry", proc_nvidia, + nv_procfs_read_registry, diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-pax-usercopy.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-pax-usercopy.patch new file mode 100644 index 0000000..ce8c201 --- /dev/null +++ b/x11-drivers/nvidia-drivers/files/nvidia-drivers-pax-usercopy.patch @@ -0,0 +1,54 @@ +diff -urp kernel.orig/nv.c kernel/nv.c +--- kernel.orig/nv.c 2011-09-24 02:32:09.000000000 +0200 ++++ kernel/nv.c 2011-10-05 19:13:41.474242252 +0200 +@@ -1105,7 +1105,7 @@ static int __init nvidia_init_module(voi + NV_SPIN_LOCK_INIT(&km_lock); + #endif + +- NV_KMEM_CACHE_CREATE(nv_stack_t_cache, "nv_stack_t", nv_stack_t); ++ NV_KMEM_CACHE_CREATE(nv_stack_t_cache, "nv_stack_t", nv_stack_t, SLAB_USERCOPY); + if (nv_stack_t_cache == NULL) + { + nv_printf(NV_DBG_ERRORS, "NVRM: stack cache allocation failed!\n"); +@@ -1220,7 +1220,7 @@ static int __init nvidia_init_module(voi + } + #endif + +- NV_KMEM_CACHE_CREATE(nv_pte_t_cache, "nv_pte_t", nv_pte_t); ++ NV_KMEM_CACHE_CREATE(nv_pte_t_cache, "nv_pte_t", nv_pte_t, 0); + if (nv_pte_t_cache == NULL) + { + rc = -ENOMEM; +@@ -1229,7 +1229,7 @@ static int __init nvidia_init_module(voi + } + + NV_KMEM_CACHE_CREATE(nvidia_p2p_page_t_cache, "nvidia_p2p_page_t", +- nvidia_p2p_page_t); ++ nvidia_p2p_page_t, 0); + if (nvidia_p2p_page_t_cache == NULL) + { + rc = -ENOMEM; +diff -urp kernel.orig/nv-linux.h kernel/nv-linux.h +--- kernel.orig/nv-linux.h 2011-09-24 02:32:09.000000000 +0200 ++++ kernel/nv-linux.h 2011-10-05 19:14:42.522238996 +0200 +@@ -695,16 +695,16 @@ extern nv_spinlock_t km_lock; + + #if defined(NV_KMEM_CACHE_CREATE_PRESENT) + #if (NV_KMEM_CACHE_CREATE_ARGUMENT_COUNT == 6) +-#define NV_KMEM_CACHE_CREATE(kmem_cache, name, type) \ ++#define NV_KMEM_CACHE_CREATE(kmem_cache, name, type, flags) \ + { \ + kmem_cache = kmem_cache_create(name, sizeof(type), \ +- 0, 0, NULL, NULL); \ ++ 0, flags, NULL, NULL); \ + } + #elif (NV_KMEM_CACHE_CREATE_ARGUMENT_COUNT == 5) +-#define NV_KMEM_CACHE_CREATE(kmem_cache, name, type) \ ++#define NV_KMEM_CACHE_CREATE(kmem_cache, name, type, flags) \ + { \ + kmem_cache = kmem_cache_create(name, sizeof(type), \ +- 0, 0, NULL); \ ++ 0, flags, NULL); \ + } + #else + #error "NV_KMEM_CACHE_CREATE_ARGUMENT_COUNT value unrecognized!" diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-settings.desktop b/x11-drivers/nvidia-drivers/files/nvidia-drivers-settings.desktop new file mode 100644 index 0000000..773a5af --- /dev/null +++ b/x11-drivers/nvidia-drivers/files/nvidia-drivers-settings.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Type=Application +Name=NVIDIA X Server Settings +Comment=Configure NVIDIA X Server Settings +Exec=/opt/bin/nvidia-settings +Icon=nvidia-drivers-settings +Categories=System;Settings; diff --git a/x11-drivers/nvidia-drivers/files/nvidia-smi.init b/x11-drivers/nvidia-drivers/files/nvidia-smi.init new file mode 100644 index 0000000..71bbc6d --- /dev/null +++ b/x11-drivers/nvidia-drivers/files/nvidia-smi.init @@ -0,0 +1,25 @@ +#!/sbin/runscript +# Copyright 1999-2013 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.2 2013/05/09 16:32:00 jer Exp $ + +pidfile="/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 $? +} diff --git a/x11-drivers/nvidia-drivers/files/nvidia-udev.sh b/x11-drivers/nvidia-drivers/files/nvidia-udev.sh new file mode 100644 index 0000000..9487b08 --- /dev/null +++ b/x11-drivers/nvidia-drivers/files/nvidia-udev.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +if [ $# -ne 1 ]; then + echo "Invalid args" >&2 + exit 1 +fi + +case $1 in + add|ADD) + /opt/bin/nvidia-smi > /dev/null + ;; + remove|REMOVE) + rm -f /dev/nvidia* + ;; +esac + +exit 0 diff --git a/x11-drivers/nvidia-drivers/files/nvidia.udev-rule b/x11-drivers/nvidia-drivers/files/nvidia.udev-rule new file mode 100644 index 0000000..2eb30bb --- /dev/null +++ b/x11-drivers/nvidia-drivers/files/nvidia.udev-rule @@ -0,0 +1,6 @@ +ACTION=="add", DEVPATH=="/module/nvidia", SUBSYSTEM=="module", RUN+="nvidia-udev.sh $env{ACTION}" +# Previously the ACTION was "add|remove" but one user on bug #376527 had a +# problem until he recompiled udev-171-r5, which is one of the versions I +# tested with and it was fine. I'm breaking the rules out just to be safe +# so someone else doesn't have an issue +ACTION=="remove", DEVPATH=="/module/nvidia", SUBSYSTEM=="module", RUN+="nvidia-udev.sh $env{ACTION}" diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-331.13-r1.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-331.13-r1.ebuild new file mode 100644 index 0000000..d5ed270 --- /dev/null +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-331.13-r1.ebuild @@ -0,0 +1,456 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-331.13.ebuild,v 1.3 2013/10/12 15:14:41 jer Exp $ + +EAPI=5 + +inherit eutils flag-o-matic linux-info linux-mod multilib nvidia-driver \ + portability toolchain-funcs unpacker user 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 X11 driver and GLX libraries" +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-admin/eselect-opencl + kernel_linux? ( >=sys-libs/glibc-2.6.1 ) + X? ( + >=app-admin/eselect-opengl-1.0.9 + ) +" +DEPEND=" + ${COMMON} + app-arch/xz-utils + kernel_linux? ( virtual/linux-sources ) +" +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/libvdpau-0.3-r1 + multilib? ( + || ( + ( + x11-libs/libX11[abi_x86_32] + x11-libs/libXext[abi_x86_32] + ) + app-emulation/emul-linux-x86-xlibs + ) + ) + ) +" + +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 3 11 ; then + ewarn "Gentoo supports kernels which are supported by NVIDIA" + ewarn "which are limited to the following kernels:" + ewarn " \ + "${WORKDIR}"/nvidia + insinto /etc/modprobe.d + newins "${WORKDIR}"/nvidia nvidia.conf + + # Ensures that our device nodes are created when not using X + exeinto "$(udev_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} + + # NVIDIA video encode/decode <-> CUDA + if use kernel_linux; then + donvidia ${NV_OBJ}/libnvcuvid.so ${NV_SOVER} + donvidia ${NV_OBJ}/libnvidia-encode.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 + fi + + # OpenCL ICD for NVIDIA + if use kernel_linux; then + insinto /etc/OpenCL/vendors + doins ${NV_OBJ}/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-mps-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-cuda-mps-control + doexe ${NV_OBJ}/nvidia-cuda-mps-server + doexe ${NV_OBJ}/nvidia-debugdump + doexe ${NV_OBJ}/nvidia-modprobe + doexe ${NV_OBJ}/nvidia-persistenced + doexe ${NV_OBJ}/nvidia-smi + doman nvidia-cuda-mps-control.1.gz + doman nvidia-modprobe.1.gz + doman nvidia-persistenced.1.gz + newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi + fi + + if use tools; then + doexe ${NV_OBJ}/nvidia-settings + fi + + exeinto /usr/bin/ + doexe ${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} + else + donvidia ${libdir}/tls/libnvidia-tls.so ${NV_SOVER} + 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} + donvidia ${libdir}/libnvidia-opencl.so ${NV_SOVER} + 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 + + 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 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 +}