mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-11-09 06:37:10 -08:00
x11-drivers/nvidia-drivers: Drop unmaintained branches
Bug: https://bugs.gentoo.org/669588 Closes: https://bugs.gentoo.org/673392 Closes: https://bugs.gentoo.org/673490 Package-Manager: Portage-2.3.56, Repoman-2.3.12 Signed-off-by: Jeroen Roovers <jer@gentoo.org>
This commit is contained in:
@@ -1,58 +1,20 @@
|
||||
DIST NVIDIA-FreeBSD-x86-304.137.tar.gz 35399011 BLAKE2B 823726e4a54f029a47b4c473718099b97d0364b19ac73d36111c0e3552af9a896f60c2aef0eac05d84eb7386fd32ff0a33b2b26d572b6803fddf3c9df0443caa SHA512 9bab183289461d915371b7b5b34e66fdfe8ffff945806dbdf00e0e1cc7242f7b74a0acfc6ed24c3643a6d51edc837cd905ba3b224c30040b0f40d662dc6e7a6d
|
||||
DIST NVIDIA-FreeBSD-x86-340.107.tar.gz 60305952 BLAKE2B b634bfd610653f1c546b68e87d934c5d0e25a2e5be6df15e0cb6016793274b4cf08577669e61c35976f3482da2221b05797459b2814965bcfdbf519c8a6d2681 SHA512 fe09e1b3dd870a07b4edd163d302e2d98f00e139d05a8fa627c292182b61d2bd9b37eb746d639ba592dcf90fecedc57430cf1ef76b6522785ffcb3fd46fe9ba0
|
||||
DIST NVIDIA-FreeBSD-x86-375.82.tar.gz 59566154 BLAKE2B b888b08cd434899ff73f04a855b47f9416ab247f63023f742dff55e9249d20b8da07bc5cd42e6d555cd9a8ecc62c97821ae09dce1986f0ac2384a16a70c7f181 SHA512 6747bf6d6278c6ed0828c6fdcad5353e516f28384609a3f0a885966707eebb096926a876c17843bfa7626a01a6d4e0ab12c781faf9ac0291771b195c9eb13d85
|
||||
DIST NVIDIA-FreeBSD-x86-378.13.tar.gz 59610253 BLAKE2B 723b392b869dd5cc9244cfe9df371fc6df6b4ebc4c1f01082fd79b2bbd0cbf4e670cfb69511f1773d28f6fc51a8801777dd6e3066f50fc96888a9efa467e459e SHA512 a0101201089df2bbf5bdc4ded2228dd989da6a47da31c3ec8d55916b1ff3457924555f82c7381934745fdc1b1f8f78e3fc10e5089279eb13423628dbfe560c6b
|
||||
DIST NVIDIA-FreeBSD-x86-381.22.tar.gz 60112159 BLAKE2B 4a61e9a09218eb7d259f82d0a43fee313754004c8716e921b9a83a3e87fff9a291450bef5d7304b2a7ddf5750a830fb7c5cc9dab890dac4a714354265ca25034 SHA512 ffe5882051fad081854e7b7fefe86a4da55b263b2ca217664991a7e0d84ff2f22d62a37c89afd578f3c99c12be897e5db7a3d1c71c747df655af8e220eb983fa
|
||||
DIST NVIDIA-FreeBSD-x86-384.130.tar.gz 63719036 BLAKE2B 971006aec05f5bb8f815420f5e1a62103119ae0192a275cc4df3034c20908ebcb8d5a886e030ec06a854102a79e2b31d53c2fcbf3450cb7fa0d9e1f64eeb835f SHA512 54d6d0776190d12f2562fe0ffdf82661fb8a0a4d3d575386a19f5dd5890a7ae4d2ad6704253e7cded62a9a0e1880f1bee9e6bf3aeeb8ce7a265a3d077b0c8018
|
||||
DIST NVIDIA-FreeBSD-x86-387.34.tar.gz 64228643 BLAKE2B 80011df5d037cd0a2a6faccf6c990e6019cb85c906c1410d4dde033a8a945ecd46e80a1315e46dc05fa47003eb328c6b8e8e41e18dce60942e645c0e6b813717 SHA512 875648459a149d506b20eb7105e73086e1fb51dddfbd8b484b8cc4793682c088ba16b3d374b0e807738f7aa7489dd9eab2449f70bc9feefeec0bf3a88025b9ef
|
||||
DIST NVIDIA-FreeBSD-x86-390.87.tar.gz 64326801 BLAKE2B 91cf9e77040d8c710a0fef58f9bae685a86962f8460a5d55e2c0733dc7bd2050c910bbd0732bb89efb8550d501b08c02e0587118ea767ba768dcf1c356e0e872 SHA512 b7ff9f4e61de08c0626e5e55c1f51e3451640043066944d791f79f4c0b57f39211c0648a2551c0b5ed1622809d7c9579e24b8ee9a46a7988319e25ab709c1400
|
||||
DIST NVIDIA-FreeBSD-x86_64-304.137.tar.gz 36474676 BLAKE2B bd75e2916d34f76566d838406419991a860118830366f0297fa63baade3a99f637dae601d6bc6a051596222f2715297dffbf9b81ff5478b030741e6c8a09bc13 SHA512 f0ae7ccea417aceedf34bfb9c96fd79b31cbf74a8fa59d5199b0ad7b81b8a4aeb66cd4801a45cc37f836979cb4267aa69e08517beaa9b8cb9c66a477d02ef8de
|
||||
DIST NVIDIA-FreeBSD-x86_64-340.107.tar.gz 61179967 BLAKE2B c12c7c07c090fd7bca78a30082890d0b0330dde07ce9beacdb94fad97d40e9ff9e1413fc36fd94116821137e74076d99a82ab85ecd0a8e16d52b47abeb747802 SHA512 661a4cc79a0adc9a1abebfb3567c26e69628266794b5b539c112112a0989760ea1ea2d8c35a5fe7539b579d4e9cef2685e3e1d12fc7031cd6d1b743c23eadc52
|
||||
DIST NVIDIA-FreeBSD-x86_64-375.82.tar.gz 58748290 BLAKE2B 629d65b71270d1c0d94c71e4215a72f0e49bb82e68ebb93fd4b14cd56a2031674458764f4c3e2e3dec7379ec0d5ed9212c8d09a64e4361f40352e52aa9b57de5 SHA512 5e2b42ff63e06219764db8187203ce1a2c3c8b478be31fc713ef396e8f8d46def9b2631d7989866740bd0c6a81bbf5d2ed083c14cfa7171c0d993553ca6f431c
|
||||
DIST NVIDIA-FreeBSD-x86_64-378.13.tar.gz 58779963 BLAKE2B d0a165dab740b25e1d97050e4dfc9f916ae17159eb4e4b79e068a4cd6ec3e2bc146d061abb4a411847cbb0d987253f86327e67ffd6efaf725c4fa4dce27e4fa9 SHA512 34cfc383ba196ecec2cd27fc12bf30dd58f8782b73414e7b4c182e832ae0dce1f8c017afbb2101d7525d4e321f80cac49d3b578a8fc0cf88be9310f4deb77057
|
||||
DIST NVIDIA-FreeBSD-x86_64-381.22.tar.gz 59284579 BLAKE2B 45703b5658c586fe2fbfaf84a54a591a7d25e836195c47c43375b74a730c1a7aa4dd7bd17d13e7194b37d51da0f11540da1bee564e1c27351ecc6915e65012d5 SHA512 51c5a87fabe87ec7f2589ed97d97447b127ecb5fe501c60bc7c9fce74141c127f4f9bb820d2a9b34fb56db436476d0cb18a73845ab4e7ec2315d4975c8ce4e32
|
||||
DIST NVIDIA-FreeBSD-x86_64-384.130.tar.gz 62901704 BLAKE2B 50be9af398f88caa012a7af702ed3d150bd4d0e5aca862dab09f30038906d79254999079983fe242dfe8158549e25f3a49ea8ad07114d8d3bcd01c8a076e8c8f SHA512 ad1a32f8268003d165570137947f517c82074b0851b86a1928f016de95f3dacef4d48f4873f00d603d49b44fe2b99d65295ed4e655d4b16f71c284994a1ea148
|
||||
DIST NVIDIA-FreeBSD-x86_64-387.34.tar.gz 63387097 BLAKE2B 53689ba098b4a4de08dca056618ea533c92d17137ec954dea0ae71e1b2c825c021979871e4ff82c820be0a78d3c365f282b760940ebe2caa1ca5bfd2453e178e SHA512 0a905ee72ee6f4e9c941e5dd1f7cddf96bfb20c6da32fd05599258e1bb154f68463d775ba8ff4f67f0d4b8e637e9ed9624fc9a4873a1f2621dc86732f0d6d70d
|
||||
DIST NVIDIA-FreeBSD-x86_64-390.87.tar.gz 63648591 BLAKE2B 88aa38b11b64b2ad91f723ec84a2adb6829571136aabb1441a9119418395d5f143736487902f0c60b49ebc1284f3100fbd089e4c941cdd3519ab8511cc1d3261 SHA512 0865fef8b8a3be8f6d9fc81908b162fd6062ba0ea81fd00200e7b2a1e3149ef62408b46bc4ccb7a77f1ac943557a22b13a10cfdde084f0b76cf2b23432e57540
|
||||
DIST NVIDIA-FreeBSD-x86_64-396.54.tar.gz 60938322 BLAKE2B a23488b625a15703b0c40bc6871314b05d117d489f64a6f7c70ac3c934b02028b9623be10f0369c98c7d3b5e018e1eb6f1d2cde9d9e1b90be5065f06f6a646dd SHA512 52df85364bfd45a23394078855859ce85de996f7990bb96ba63eb33e516c3cf8e72c4391af9817213f735286f2cf6444bc8ed00312365f12ae17373cfbdc3fc7
|
||||
DIST NVIDIA-FreeBSD-x86_64-410.93.tar.gz 61977979 BLAKE2B a662fa13866cfb36ef61a0b9dd459519e26ea93a6ad6ae7bf34075fae8e7622a91707d88cec8de0660513cb959c3596e8b6169357891c83e847870ecffd72928 SHA512 ecdd5270f9d5f32117d83cd3e3cf0376f0b37c748fe164e702c4230d225c6b28bdbbea4334555b6928d05f1a7cfaf87caf20dd2e7e06e1259c526f6bd50e4d0e
|
||||
DIST NVIDIA-FreeBSD-x86_64-415.25.tar.gz 62373961 BLAKE2B 4c1ce36ad31933efdb7b9b3a5a530439cadb50c6ee29c0689a521308fbc213266a761765998c44643fd8511159ae96387a3a278accc4a0d00322b06b9b327232 SHA512 792f0cfafb1d6b2137db62c3a5a7e76217d89c3b18cee92ec8317d6c583fdc9676aa46efd55bc795aeaaf1532501f7b40d1d9609d782ffe63e55bb37d0d6db14
|
||||
DIST NVIDIA-FreeBSD-x86_64-415.27.tar.gz 62389955 BLAKE2B 39ac5970ef1a6ffbb03abe8b758a6f5d7eaca787231845fa4b4bff5f26aa770fb7c695bbd5585d919c934c65b9ed0cfe42f9674bcaabd796c9bd8b89cea87ee6 SHA512 857d1523bad2fca21c75b45c29066be0f530afa8ca124806bcaa36509ac5135df1c4037e6b09e5718c701f085b3608925e2b1fea45d0681e69a99ef709c307d0
|
||||
DIST NVIDIA-Linux-armv7l-gnueabihf-375.82.run 26650801 BLAKE2B 31446667065c56b48f6a3e737afe29a4517459d3462138136bffe383bc6fe514d6e80b49c391c27edc96b8abc3da3dd4d6ee3f3dca17f3c9a0f1cdf0e72cf099 SHA512 28554f1c24fe63c9257c0de3e84e4e739a45bf1c20ec7a53bc2c1b69b4e2355675061491ef5b03f3ae489cf623e553cfa68442f5536f137837327036d1c53d63
|
||||
DIST NVIDIA-Linux-armv7l-gnueabihf-378.13.run 26514235 BLAKE2B 2b3c540704496a290be7ae3f1ff378487c75af2298c12488da8b3a1814446e5df02a1ed99afd8ee7fc459d950aab472155359eae0bf56ac83389711d70638152 SHA512 253786a821df85fa926ae842114321b3c70502f887ea7c2b6790dfe3836039ee5d390e6722ca8785904ec6487e465916923d3042dc6191b3b4522c3161b80cb0
|
||||
DIST NVIDIA-Linux-armv7l-gnueabihf-381.22.run 26815484 BLAKE2B e5f0241b07d1e54edea2025dd30061d1018c68cc2c7136c507eb894bbad5be3d0724494e2b9f33d1f8f60da4904999bbb964e6f2e78d045d7cd86bcd46b7f6d0 SHA512 934cda37c7aed26243b5b661122e1c060de5b4df890aaf2295b6650dddea37cb4f0e3f0bebddb00b5d687b66ab5e028a203195c4d4ad3379593babda42febe77
|
||||
DIST NVIDIA-Linux-armv7l-gnueabihf-384.130.run 28899034 BLAKE2B 4f104243e87d0688d5f234bcadeb501914394ca5ae29c0f7ca7ae8038982c7df14652a1b85fb62a3466a6d4f7cda95c9726367bfd8ab1bf0b73f3fa617418276 SHA512 bd7be99881295f4ddf92b8c6791c4315c7b8699cdd346247dd54dfeb48ee61a40597483379922f5e3d0b28c9b9b9e75dca91c535e4695ebe57734c26f1484f61
|
||||
DIST NVIDIA-Linux-armv7l-gnueabihf-387.34.run 29406773 BLAKE2B af27fb1bfa8e432c83220f88c57219d572dfab2d3624c8702759a747f25ff962dba7c39028af5746e04c913c9a53dfbec8a46801bfa7e38df65a8823c4858cca SHA512 cb631dc3b851d84881dfcabee776c68a935853d03f21595acfea84a3efbc85276070f9d0958c0bcced1e66f42f25ecf3fd7d615c715274130ca24426da678c2e
|
||||
DIST NVIDIA-Linux-armv7l-gnueabihf-390.87.run 29078256 BLAKE2B a7ce24bcaf82e6c2c95cd11a0d9e0e2aa69c717b8455d4ce0a79a9c03c92f5f6b84107dea6347dedc5c4f8fe076e616fc7a36053c6a5f571af9d794bada6cb1f SHA512 3f8ef4eabc7275685bd5d887c6b7dc20786baab1f4a89bfb23ae6c8d837188d93369c777915d3ea010b08e578c4fb7318d9428811971470e31a8b8b4f51e240f
|
||||
DIST NVIDIA-Linux-x86-304.137.run 41504115 BLAKE2B 5938d4df818947e5576172c0ee9bfa42a2fc49a7a7a2b14128cf3b967dfea6d4523901b33283284d450cfadc2c6d72a82a1533b27ebb4b542b6b1454fe8ae960 SHA512 021c5a88d50489aa0a1c7eac14259e23542b93578ae339995a2e38b786d06d239968c07933cab3fb78a922cffc7e213d6fa3fe07e34065a9c7f03e24f8729370
|
||||
DIST NVIDIA-Linux-x86-340.107.run 39016798 BLAKE2B 2632c8f257d0cf7c5b9294eb2c0b763eee6feb60eacc316024655971e4d067c4af6548aab3b7b2b295792b064f3f3ac3e6403a2ecfa096761d308dfb6b2569b8 SHA512 0add713942bcdb639d19b5c36f5e0cea14f9e07490191d46dfeba0515ede7700fd8e9467ec531d38329fe1e76bf45905e70e0d440e7bc2dc79c1d767eab03338
|
||||
DIST NVIDIA-Linux-x86-375.82.run 44633335 BLAKE2B 55392ba748108b47994bf272829a6476dfc23f7756e0c18d56c8e4d827968196ee70e521c2e6307c134ca0c85d59715db777583fb07c8e06ae7325d586a8117b SHA512 cbd6edd7490e0e5ef9dd2020c18eb5f75412993e06b9c4f1919f49a8ffdc36131a96d868ab51691fb5c4a661e826b000ec93363c9b168304f6498014e300bf24
|
||||
DIST NVIDIA-Linux-x86-378.13.run 44397547 BLAKE2B 5b45bdceba75e214028b9f59a3655482ac1ac2b51cc0a6ea22927e5143b47c670db7078ed898e04663feb9fd495165954c90df5ee3afca00155dcc2ae6a97dc8 SHA512 b96d2558a1003a3c66cade3a1e16abd34d855c0e27cdebacdc0495e0ba3cd5c68bb84cc5f81bff1b9ddce36ac52e0dc125c56d868b77d7c8e2f606d559b13b4a
|
||||
DIST NVIDIA-Linux-x86-381.22.run 42931990 BLAKE2B cf1ae154854860557bf3e4a50216f1373ff66a45535e7beec67392b1cd1d40a02d758fa3e1cfa0462145b912430b0d1a3b6de3e6d6ede8aa1f484ea0ab46f816 SHA512 15723bfa25b0f39224ad5098c784a292abe4bf1daafaeb2f1df910bbab466e666b848b12e50b0bdd45f83e2d81957425a63501550b3dc5eb8fe3e576a8a10d22
|
||||
DIST NVIDIA-Linux-x86-384.130.run 47539521 BLAKE2B d0b84aa6e0a41d7202cce247a419adad5c94d0d98feb83594644d8e0a9426d0c07a5b5889297bc830c7456a4e8cc165a3b23c004e83cabad1000bf5a6e1a147a SHA512 0ed01818606eb7309811a3cb0ae71e9906e318d579dfd85bafcbae498a27f801836c1f1eefee6791ec5d9c6a4c41d244c43b8329583ae4991b45171cac99638d
|
||||
DIST NVIDIA-Linux-x86-387.34.run 47797853 BLAKE2B 4ae211ee00e09fe385f24e05cfac3af28447ec18e7a7f53e7f310c210ec22f60094be087aae45d0ea99c90214a07d3c46ce6867984ac0ff6e56559693fcdf148 SHA512 ba9362123a75f85a0a5a9dcc95c06bcb350a8dff2db864db30a73172db44006fa39eee8e23cf959ab2012b61b922d1f0d7ab225329815737819f27d1be300b95
|
||||
DIST NVIDIA-Linux-x86-390.87.run 47959124 BLAKE2B bb799a53b6d25ecd0e6013cea544402c25332efcedf0db5c490dc7ebfa064f97a31427d529f0453092e0f6495a996acb8ffcdd29dc1fed5fc8af31514d959c80 SHA512 18c5ef058098c0f055bada06888ee07da4d1455d90d393357483c289eab27969d49a593318d28e535941e7ebacde33e349f3a1cb2f7c627366ba5c6b7835ccbd
|
||||
DIST NVIDIA-Linux-x86_64-304.137.run 70087133 BLAKE2B 8db0ade7cf64231ae11e6fc55a16a68a2f7b11a8bb7debb49799fee96eba06a3062b97fe539b093727623a1ed1067282813de047c2aeb89d93bf35a97c71aac5 SHA512 d7fae1e486005ffa2f2bf7f14f901bf5156fc784407a9acfea584f49bdab92ff5f4d0fb66c4c5b2800a461fc06aebb7d760bcb59f69ce4f2cb4e03e11816b3e9
|
||||
DIST NVIDIA-Linux-x86_64-340.107.run 70233686 BLAKE2B 821a2672dcc3b546fbb3f826230fb06741503d75b06f72cb407dd3c9de4f2cbd150bff34e554dca8aa86e7f6bf64ce4f7f9b52976799a477c6c2659aaa5bb4d3 SHA512 51df9370526732db099a8a925d35cdf1317ae2b0ab2c130eaf82373f25186165b4af7d44f71e51e2a68f7d07c7ae3f441a6c6c4be8467003b15dc770c4f4e89b
|
||||
DIST NVIDIA-Linux-x86_64-375.82.run 77461911 BLAKE2B e7f32bdf1672d98a1fe98c82d80a08dd6f63b3c859df4c60124977dae19520a21e4239ff7be6c272243d4af9416320b5e166d8f100979daa0d005ea2a44fc16d SHA512 6da63b807d6dd7cc8ac2b794d5c9ab8383e3c0ce6a47adc600941545509fb40b5f06344781afc895bd83f2780b2bce187994df5684db2890f50b41adfee8f910
|
||||
DIST NVIDIA-Linux-x86_64-378.13.run 76239469 BLAKE2B 0f2be330645f8d9d2828fa6d159f9e41ef09bb32805f94cf3fa255f088a8c6f4c25add584787bd1ed64756ef75821f7143c14330718cc5f5ac3cbcf8b7c3bae4 SHA512 2f6789aa0a400c035c0a074631dc5c26abb4f8a62efe928ca3a2865b89d29acfc09c27f23a664e438275e4bfd25c261745d4d495f9aca5f54ee6c53a389059d2
|
||||
DIST NVIDIA-Linux-x86_64-381.22.run 76581130 BLAKE2B fdb5912a775b56edf7dd784b640997fe683d0a32d57db6079dc5466a1a8dc1354cd31ff86aa1e993e0a33163e4c18f6a7aa990e334448ad069db3a5ffc4f1ffa SHA512 669a3dd0896d68ba8eef4689b01971b92ec1c54e6cf2a9ff8d3f281ae9f2fe402f079e76109b65e698d76798bcc7a9bb43da9d128fec59ac1fafafd1c4a1e42c
|
||||
DIST NVIDIA-Linux-x86_64-384.130.run 82260837 BLAKE2B 55b6f3627680c881821f5d20f05cb6c7941b1deebf28f22f6712cac73d07e6202507c9f3b98eb8fc59ca8ed0c6aaa4819db5fc5a331f4505887dac6f31774335 SHA512 301fa7d9d73a0654e0090bf4bae98896388c1f52453f1b886e320e36765dc529f802c509a2d518714f2b348df59f9c9048e01b3874819bde4f53cf98aaa2cfff
|
||||
DIST NVIDIA-Linux-x86_64-387.34.run 82784271 BLAKE2B b7140d5d6a693892df50b3ad2e20387673dec6b5ac609cc0300bdc4b4a93ca94849255699126e4d55e67f10e488bfe6008e987197ea239b1a1b643b4ae5c7808 SHA512 6742768f1258a028c9ba56ad1d72f27d7eea4b6bfd324ba29c7f057ab5819816bd728aeaf2a8058031dadcd4c51bc6d08f0e0e0e26c68ed57955e90d68ac5a4b
|
||||
DIST NVIDIA-Linux-x86_64-390.87.run 82690871 BLAKE2B b43a45a7d48160a72185417360a4ff4238922f6d77c7b58c0562f0e01c8aa33e89057e8a5d354e8d3c8e6fa86acf8908a6c2eab81e06158a92908eec18a9b02e SHA512 f4883744f5e07150677918669eed03c7b87774f752112aabd52d903a09ae16351b34105075da2ff0fcb7a847cf66ec17e9797826859fcaecc44fdcd464a61805
|
||||
DIST NVIDIA-Linux-x86_64-396.54.run 86946680 BLAKE2B 9b3ab39c9d09c663238d0fac6346c24feea6ecc44b0ecaf3de871522697685c1c474ec4cc83f3bab0a2bcfecc7c77acea0e6bfee6e8ca8e6883bd338fd6da8a2 SHA512 17139abe99d4f32ec87379ee57af2cc0fec7d24605b2be7e3cd6609d9fcdf871e3c1cb7414b3544e14eb32d2213fec7ac45b3261f27c8d6565d510ccb14a1247
|
||||
DIST NVIDIA-Linux-x86_64-410.93.run 107257681 BLAKE2B 56e9b6a17ab4d2fe2f18d90b4e209fe048c53dc43846ee9c8bd0960999a06ef9d9b6ba7e4c242f77cc35cfc5b9a0e2ae24aa5f07f68cb7662bd5010de41a9b36 SHA512 1132884210e447d20768c4ae84ff572c9f6886fb9a082da4d229a03c13932a5c6ccc518cad3311a9302b6a0d9e9675e3a53199e7183e07c81282d46883d26105
|
||||
DIST NVIDIA-Linux-x86_64-415.25.run 108599932 BLAKE2B 958a345f03157ebd8f8a84da91af78143ada75be4bf1d5abbbec9bc8b0ca11549891efb2f78c3ae89ed86fa94a4bf179834d1b229b2dc7d3587a138235a8ce7f SHA512 d289a37344916f5d17425f17d0530a7838b264c49866a0148665c9b87dcb7c23e868abae866a2568abac425701149d9075da540dd0f45f3d18f67b57102c0857
|
||||
DIST NVIDIA-Linux-x86_64-415.27.run 108399659 BLAKE2B 05fb81a4ab8626d0170a30b70ed114c639ba7f0e5ac260d2f38cb5042a4d6052e40ada51cf2feff6bae0f394781d77cb70014f390873a715b7d9495b86918bf1 SHA512 5919333136042a227ff36c850d0c57898fb428a77d88633d205a269db4b844356a87f5b1e5c3042f40feaf083d4f82d32df5366820375b601f9d69d98cada0b6
|
||||
DIST nvidia-settings-304.137.tar.bz2 1481361 BLAKE2B cf52a55a34eeb03a685a683487af6a198ba467dd8ba9983cc75624a37a226373cd931d98e8448b7b8ed430c54be2118c7b240ed2a9100b19bec5e832e2f6cdad SHA512 676d1f70c9a78ee234f5f1a283412430a386fa604de211afba02806a45906c5e246a002989b724d74752178d28c92a268de1c98d4c87876797d991253f16b0cc
|
||||
DIST nvidia-settings-340.107.tar.bz2 1549413 BLAKE2B 127442ee2c35ceec47ab4f103bdd2d0278c621fcb9be47051111f6f8728ef5699bdc95fe33a3812a807c38c4868b04c2176e2ed218a422171d2a88ac0c00de96 SHA512 593e7e83aa350a3a7beaaa32aca8660d7e203f6f2e460a6e6eabcdc092087f9917ee4e6d141e37ad4e3b0a1b9908c085e4a71d2f579e481a03bbd1c6f75ca776
|
||||
DIST nvidia-settings-375.82.tar.bz2 1620463 BLAKE2B 0c100ee95c91bb53c2192da8ddd1042ce4e0dec7defcf4793a1745020f65d538c4b0d09f690f00034bb02f7ec219048a0539e81031c8b3eb12006f2a0d566d2e SHA512 abc650089cad57ae95a3e3456deb16d2e3c116e148aed83ab40ca5e381445561cdf4c3c0d8676930fb4c73dd5f3282dd1cc1a62d876b7ed07146569ccfb38488
|
||||
DIST nvidia-settings-378.13.tar.bz2 1618011 BLAKE2B cc9d5cf7ad63fce3b084c1116c076925ec5c07b8743b6aea80d19c46177d6f33f1916ac90bf8d639e962599e209a0f23bcf945d78e056839e7cc7adcaa6c1ede SHA512 a12352c92fd4f56002bda2b07e8cddd5573af98521ec3495cd428b784eb368c9f2cb40f9b4372400ba1ea67c9349c6a9b4f7c218ede2d0d5dabb08325eda9844
|
||||
DIST nvidia-settings-381.22.tar.bz2 1629344 BLAKE2B 1e7fe16b28f12ebef380e85d96597f5a8171fc33b6054eea4c44b5347c579dcf2e114d540c527f9ac5d39d08c90aabfac3a3feab2456e69b336d7d1d8ea64df4 SHA512 be8e7051df88202fdc6afd63da86231453ab19c8ac35d0940ec4d11a011b0bf886919a3c3ba51bd3e8f9b34a29de727586b63dd861eaa6a0ee6190238c682a0f
|
||||
DIST nvidia-settings-384.130.tar.bz2 1633217 BLAKE2B ffc1381e680e94aee95752074c39163e48082615f92c6184c01fc7d21e20bf18308d30960db0db602baf89b34fdd295a715692446d21fb2491056ec707e8b844 SHA512 3d878552a78234347f4e51920e8358e56b42d595375e8fd2b0520c3495b02d6fc3877d4346354145c420acd79ff1e9607c312330b2a2e27781a3a576f8860939
|
||||
DIST nvidia-settings-387.34.tar.bz2 1080507 BLAKE2B 4eeae3ad4b489f574832e967f0c72198d2b5be0139e36981b701e5ca2cde17119d584677e705243f1be6f920669b921f8e4b54968e2d56e98142aec81383dff5 SHA512 a7a1a2db170b803b769a7307c8507289b763f6cbcecc746edf988491fcc28d7ef1eb76574d6c1f24283e6aebeb56fc8a99d5302a81422c3384df0c8979f006d6
|
||||
DIST nvidia-settings-390.87.tar.bz2 1109274 BLAKE2B 20eb809ceeade932e89592ac91071e6d3311f4a075812225d68342806b7ab1f9f8ed0399ea7a47241b7974311794852fd932fd8e824065589de6c124a3c81ef3 SHA512 cafdf2bfefac187409dfcffd593ff23eaba5ab7ab8dd85a9f14a4b6a47ffb3649af770bd2615887af9d30de3ef8fedaad7afc2ebe9f60a8ba7355a9004702959
|
||||
DIST nvidia-settings-396.54.tar.bz2 1116371 BLAKE2B 114b88f393b0909c8d84a56a280854e258d0e7e7ce800ee58547ef68b4989f22a3bbb380795472b8222493a988dc9308fc20ef03c81589448b518a12285cf204 SHA512 23dc3c61bef71200b3e8185940dd52a50dae7ca7f2b8a68fa96eaa937aabc87ded5d5f73081af51d1e7af2b78b0ec10ab80d28dadbcf10a046c32ec14db1d83c
|
||||
DIST nvidia-settings-410.93.tar.bz2 1115704 BLAKE2B 1119181feb2704711593c19a43dce5feb58778d0251cb2dcb8647de7bfb1abe3a7f374bddd62e4c983b07a207bca7c1d99a7ac51cba3ae41f78fb97c4d1e9666 SHA512 4e5a5babae382dbe9f6899e51d3b1081fd7123f9ba5e147f7d5cc1899904892ea8d953983e43643ea4355d06348db40005755a02c7c0ff6ba104eac4a9d450f2
|
||||
DIST nvidia-settings-415.25.tar.bz2 1121689 BLAKE2B acd9dd12b4d9a3d76e08d1498fe2373327308d0764791c7e14c6471cf98e79f635a1073dfacdaa4fa60dd148c15803a18061b185cdea24676d851b3a1b695184 SHA512 8646e4eb8d491cbd20205766833fa9f0629a2567797fbb7ca085e07946f4698645cc134615bc20a42090d4f4fe826df48ab4be717b227ee59c17941d185e0b0b
|
||||
DIST nvidia-settings-415.27.tar.bz2 1128013 BLAKE2B 36513252ff3d5f2036c80250e012d79bebfc14daff56fdaabb032856f5f78ce77cf4ce32d6eaee5fe4c1a18db63d5c69d6848517f025c711f133e28b3e509396 SHA512 5ac3b673c41194a1952ec10cd3c961aefd281bb044ecae5c9d11cb55d4555fed44e6056b5a2e97b5b87687743cd7f702f33ce7e0f841f04c8175d63693a24594
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
--- a/nvidia-application-profiles-375.82-rc
|
||||
+++ b/nvidia-application-profiles-375.82-rc
|
||||
@@ -48,7 +48,7 @@
|
||||
{
|
||||
"name" : "NoEnforceShaderInputOutputMatching",
|
||||
"settings" : [ "GLShaderPortabilityWarnings", false ]
|
||||
- },
|
||||
+ }
|
||||
],
|
||||
"rules" : [
|
||||
{
|
||||
@@ -1,17 +0,0 @@
|
||||
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,
|
||||
@@ -1,54 +0,0 @@
|
||||
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!"
|
||||
@@ -1,499 +0,0 @@
|
||||
# Copyright 1999-2018 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=6
|
||||
inherit eutils flag-o-matic linux-info linux-mod multilib-minimal nvidia-driver \
|
||||
portability toolchain-funcs unpacker user versionator udev
|
||||
|
||||
NV_URI="https://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/ http://www.nvidia.com/Download/Find.aspx"
|
||||
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 )
|
||||
tools? (
|
||||
https://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2
|
||||
)
|
||||
"
|
||||
|
||||
LICENSE="GPL-2 NVIDIA-r1"
|
||||
SLOT="0/${PV%.*}"
|
||||
KEYWORDS="-* amd64 x86 ~amd64-fbsd ~x86-fbsd"
|
||||
IUSE="acpi multilib kernel_FreeBSD kernel_linux pax_kernel static-libs +tools +X"
|
||||
RESTRICT="bindist mirror"
|
||||
EMULTILIB_PKG="true"
|
||||
|
||||
COMMON="
|
||||
app-eselect/eselect-opencl
|
||||
kernel_linux? ( >=sys-libs/glibc-2.6.1 )
|
||||
tools? (
|
||||
dev-libs/atk
|
||||
dev-libs/glib:2
|
||||
x11-libs/gdk-pixbuf[X]
|
||||
x11-libs/gtk+:2
|
||||
x11-libs/libX11
|
||||
x11-libs/libXext
|
||||
x11-libs/libXv
|
||||
x11-libs/pango[X]
|
||||
x11-libs/pangox-compat
|
||||
)
|
||||
X? (
|
||||
>=app-eselect/eselect-opengl-1.0.9
|
||||
)
|
||||
"
|
||||
DEPEND="${COMMON}
|
||||
kernel_linux? (
|
||||
virtual/linux-sources
|
||||
virtual/pkgconfig
|
||||
)"
|
||||
RDEPEND="${COMMON}
|
||||
acpi? ( sys-power/acpid )
|
||||
tools? ( !media-video/nvidia-settings )
|
||||
X? (
|
||||
<x11-base/xorg-server-1.19.99:=
|
||||
>=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
|
||||
>=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
|
||||
sys-libs/zlib[${MULTILIB_USEDEP}]
|
||||
x11-libs/libXvMC[${MULTILIB_USEDEP}]
|
||||
)
|
||||
"
|
||||
PDEPEND="X? ( >=x11-libs/libvdpau-0.3-r1[${MULTILIB_USEDEP}] )"
|
||||
|
||||
REQUIRED_USE="
|
||||
tools? ( X )
|
||||
static-libs? ( tools )
|
||||
"
|
||||
|
||||
QA_PREBUILT="opt/* usr/lib*"
|
||||
|
||||
S=${WORKDIR}/
|
||||
|
||||
nvidia_drivers_versions_check() {
|
||||
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 13; then
|
||||
ewarn "Gentoo supports kernels which are supported by NVIDIA"
|
||||
ewarn "which are limited to the following kernels:"
|
||||
ewarn "<sys-kernel/gentoo-sources-4.13"
|
||||
ewarn "<sys-kernel/vanilla-sources-4.13"
|
||||
ewarn ""
|
||||
ewarn "You are free to utilize eapply_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."
|
||||
ewarn ""
|
||||
fi
|
||||
|
||||
# Since Nvidia ships many 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="!DEBUG_MUTEXES ~!LOCKDEP ~MTRR ~SYSVIPC ~ZONE_DMA"
|
||||
use x86 && CONFIG_CHECK+=" ~HIGHMEM"
|
||||
|
||||
# Now do the above checks
|
||||
use kernel_linux && check_extra_config
|
||||
}
|
||||
|
||||
pkg_pretend() {
|
||||
nvidia_drivers_versions_check
|
||||
}
|
||||
|
||||
pkg_setup() {
|
||||
nvidia_drivers_versions_check
|
||||
|
||||
# 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_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."
|
||||
eapply "${FILESDIR}"/${PN}-pax-const.patch
|
||||
eapply "${FILESDIR}"/${PN}-pax-usercopy.patch
|
||||
fi
|
||||
|
||||
cat <<- EOF > "${S}"/nvidia.icd
|
||||
/usr/$(get_libdir)/libnvidia-opencl.so
|
||||
EOF
|
||||
|
||||
local man_file
|
||||
for man_file in "${NV_MAN}"/*1.gz; do
|
||||
gunzip $man_file || die
|
||||
done
|
||||
|
||||
# Allow user patches so they can support RC kernels and whatever else
|
||||
eapply_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 src="${KERNEL_DIR}" KERNELRELEASE="${KV_FULL}"
|
||||
fi
|
||||
|
||||
if use tools; then
|
||||
emake -C "${S}"/nvidia-settings-${PV}/src/libXNVCtrl clean
|
||||
emake -C "${S}"/nvidia-settings-${PV}/src/libXNVCtrl \
|
||||
AR="$(tc-getAR)" \
|
||||
CC="$(tc-getCC)" \
|
||||
RANLIB="$(tc-getRANLIB)" \
|
||||
libXNVCtrl.a
|
||||
emake -C "${S}"/nvidia-settings-${PV}/src \
|
||||
AR="$(tc-getAR)" \
|
||||
CC="$(tc-getCC)" \
|
||||
LD="$(tc-getCC)" \
|
||||
LIBDIR="$(get_libdir)" \
|
||||
NVML_ENABLED=0 \
|
||||
NV_USE_BUNDLED_LIBJANSSON=0 \
|
||||
NV_VERBOSE=1 \
|
||||
RANLIB="$(tc-getRANLIB)" \
|
||||
STRIP_CMD=true
|
||||
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)"
|
||||
newexe "${FILESDIR}"/nvidia-udev.sh-r1 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
|
||||
dodoc -r "${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
|
||||
use X && doman "${NV_MAN}"/nvidia-xconfig.1
|
||||
use tools && doman "${NV_MAN}"/nvidia-settings.1
|
||||
doman "${NV_MAN}"/nvidia-cuda-proxy-control.1
|
||||
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
|
||||
|
||||
dobin "${NV_OBJ}"/nvidia-bug-report.sh
|
||||
|
||||
# Desktop entries for nvidia-settings
|
||||
if use tools ; then
|
||||
emake -C "${S}"/nvidia-settings-${PV}/src/ \
|
||||
DESTDIR="${D}" \
|
||||
LIBDIR="${D}/usr/$(get_libdir)" \
|
||||
PREFIX=/usr \
|
||||
NV_USE_BUNDLED_LIBJANSSON=0 \
|
||||
install
|
||||
|
||||
if use static-libs; then
|
||||
dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
|
||||
|
||||
insinto /usr/include/NVCtrl
|
||||
doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
|
||||
fi
|
||||
|
||||
# There is no icon in the FreeBSD tarball.
|
||||
use kernel_FreeBSD || \
|
||||
doicon "${NV_OBJ}"/nvidia-settings.png
|
||||
|
||||
domenu "${FILESDIR}"/nvidia-settings.desktop
|
||||
|
||||
exeinto /etc/X11/xinit/xinitrc.d
|
||||
newexe "${FILESDIR}"/95-nvidia-settings-r1 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 nv_libdir="${NV_OBJ}"
|
||||
|
||||
if use kernel_linux && has_multilib_profile && \
|
||||
[[ ${ABI} == "x86" ]] ; then
|
||||
nv_libdir="${NV_OBJ}"/32
|
||||
fi
|
||||
|
||||
if use X; then
|
||||
# The GLX libraries
|
||||
donvidia "${nv_libdir}"/libGL.so ${NV_SOVER} ${GL_ROOT}
|
||||
donvidia "${nv_libdir}"/libnvidia-glcore.so ${NV_SOVER}
|
||||
if use kernel_FreeBSD; then
|
||||
donvidia "${nv_libdir}"/libnvidia-tls.so ${NV_SOVER} ${GL_ROOT}
|
||||
else
|
||||
donvidia "${nv_libdir}"/tls/libnvidia-tls.so ${NV_SOVER} ${GL_ROOT}
|
||||
fi
|
||||
|
||||
# VDPAU
|
||||
donvidia "${nv_libdir}"/libvdpau_nvidia.so ${NV_SOVER}
|
||||
fi
|
||||
|
||||
# NVIDIA monitoring library
|
||||
if use kernel_linux ; then
|
||||
donvidia "${nv_libdir}"/libnvidia-ml.so ${NV_SOVER}
|
||||
fi
|
||||
|
||||
# CUDA & OpenCL
|
||||
if use kernel_linux; then
|
||||
donvidia "${nv_libdir}"/libcuda.so ${NV_SOVER}
|
||||
donvidia "${nv_libdir}"/libnvidia-compiler.so ${NV_SOVER}
|
||||
donvidia "${nv_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
|
||||
}
|
||||
@@ -1,569 +0,0 @@
|
||||
# Copyright 1999-2018 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=6
|
||||
inherit eutils flag-o-matic linux-info linux-mod multilib-minimal nvidia-driver \
|
||||
portability toolchain-funcs unpacker user udev
|
||||
|
||||
NV_URI="https://download.nvidia.com/XFree86/"
|
||||
X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
|
||||
AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
|
||||
ARM_NV_PACKAGE="NVIDIA-Linux-armv7l-gnueabihf-${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/ http://www.nvidia.com/Download/Find.aspx"
|
||||
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 )
|
||||
arm? ( ${NV_URI}Linux-32bit-ARM/${PV}/${ARM_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 )
|
||||
tools? (
|
||||
https://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2
|
||||
)
|
||||
"
|
||||
|
||||
LICENSE="GPL-2 NVIDIA-r2"
|
||||
SLOT="0/${PV%.*}"
|
||||
KEYWORDS="-* amd64 x86 ~amd64-fbsd ~x86-fbsd"
|
||||
RESTRICT="bindist mirror"
|
||||
EMULTILIB_PKG="true"
|
||||
|
||||
IUSE="acpi compat +driver gtk3 kernel_FreeBSD kernel_linux +kms multilib pax_kernel static-libs +tools uvm wayland +X"
|
||||
REQUIRED_USE="
|
||||
tools? ( X )
|
||||
static-libs? ( tools )
|
||||
"
|
||||
|
||||
COMMON="
|
||||
app-eselect/eselect-opencl
|
||||
kernel_linux? ( >=sys-libs/glibc-2.6.1 )
|
||||
tools? (
|
||||
dev-libs/atk
|
||||
dev-libs/glib:2
|
||||
dev-libs/jansson
|
||||
gtk3? (
|
||||
x11-libs/gtk+:3
|
||||
)
|
||||
x11-libs/cairo
|
||||
x11-libs/gdk-pixbuf[X]
|
||||
x11-libs/gtk+:2
|
||||
x11-libs/libX11
|
||||
x11-libs/libXext
|
||||
x11-libs/libXrandr
|
||||
x11-libs/libXv
|
||||
x11-libs/libXxf86vm
|
||||
x11-libs/pango[X]
|
||||
)
|
||||
X? (
|
||||
>=app-eselect/eselect-opengl-1.0.9
|
||||
app-misc/pax-utils
|
||||
)
|
||||
"
|
||||
DEPEND="
|
||||
${COMMON}
|
||||
kernel_linux? ( virtual/linux-sources )
|
||||
"
|
||||
RDEPEND="
|
||||
${COMMON}
|
||||
acpi? ( sys-power/acpid )
|
||||
tools? ( !media-video/nvidia-settings )
|
||||
wayland? ( dev-libs/wayland[${MULTILIB_USEDEP}] )
|
||||
X? (
|
||||
<x11-base/xorg-server-1.19.99:=
|
||||
>=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
|
||||
>=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
|
||||
>=x11-libs/libvdpau-1.0[${MULTILIB_USEDEP}]
|
||||
sys-libs/zlib[${MULTILIB_USEDEP}]
|
||||
)
|
||||
"
|
||||
|
||||
QA_PREBUILT="opt/* usr/lib*"
|
||||
|
||||
S=${WORKDIR}/
|
||||
|
||||
nvidia_drivers_versions_check() {
|
||||
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 14; then
|
||||
ewarn "Gentoo supports kernels which are supported by NVIDIA"
|
||||
ewarn "which are limited to the following kernels:"
|
||||
ewarn "<sys-kernel/gentoo-sources-4.14"
|
||||
ewarn "<sys-kernel/vanilla-sources-4.14"
|
||||
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."
|
||||
ewarn ""
|
||||
fi
|
||||
|
||||
# Since Nvidia ships many 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="!DEBUG_MUTEXES ~!LOCKDEP ~MTRR ~SYSVIPC ~ZONE_DMA"
|
||||
use x86 && CONFIG_CHECK+=" ~HIGHMEM"
|
||||
|
||||
# Now do the above checks
|
||||
use kernel_linux && check_extra_config
|
||||
}
|
||||
|
||||
pkg_pretend() {
|
||||
nvidia_drivers_versions_check
|
||||
}
|
||||
|
||||
pkg_setup() {
|
||||
nvidia_drivers_versions_check
|
||||
|
||||
# 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 driver && use kernel_linux; then
|
||||
MODULE_NAMES="nvidia(video:${S}/kernel)"
|
||||
use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel)"
|
||||
use kms && MODULE_NAMES+=" nvidia-modeset(video:${S}/kernel) nvidia-drm(video:${S}/kernel)"
|
||||
|
||||
# This needs to run after MODULE_NAMES (so that the eclass checks
|
||||
# whether the kernel supports loadable modules) but before BUILD_PARAMS
|
||||
# is set (so that KV_DIR is populated).
|
||||
linux-mod_pkg_setup
|
||||
|
||||
BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
|
||||
SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC) NV_VERBOSE=1"
|
||||
|
||||
# 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
|
||||
|
||||
if use kernel_linux && kernel_is lt 2 6 9; then
|
||||
eerror "You must build this against 2.6.9 or higher kernels."
|
||||
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_prepare() {
|
||||
eapply "${FILESDIR}"/${P}-profiles-rc.patch
|
||||
|
||||
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."
|
||||
eapply "${FILESDIR}"/${PN}-375.20-pax.patch
|
||||
fi
|
||||
|
||||
local man_file
|
||||
for man_file in "${NV_MAN}"/*1.gz; do
|
||||
gunzip $man_file || die
|
||||
done
|
||||
|
||||
# Allow user patches so they can support RC kernels and whatever else
|
||||
eapply_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 driver && use kernel_linux; then
|
||||
MAKEOPTS=-j1 linux-mod_src_compile
|
||||
fi
|
||||
|
||||
if use tools; then
|
||||
emake -C "${S}"/nvidia-settings-${PV}/src \
|
||||
AR="$(tc-getAR)" \
|
||||
CC="$(tc-getCC)" \
|
||||
LIBDIR="$(get_libdir)" \
|
||||
NV_VERBOSE=1 \
|
||||
RANLIB="$(tc-getRANLIB)" \
|
||||
DO_STRIP= \
|
||||
build-xnvctrl
|
||||
|
||||
emake -C "${S}"/nvidia-settings-${PV}/src \
|
||||
CC="$(tc-getCC)" \
|
||||
GTK3_AVAILABLE=$(usex gtk3 1 0) \
|
||||
LD="$(tc-getCC)" \
|
||||
LIBDIR="$(get_libdir)" \
|
||||
NVML_ENABLED=0 \
|
||||
NV_USE_BUNDLED_LIBJANSSON=0 \
|
||||
NV_VERBOSE=1 \
|
||||
DO_STRIP=
|
||||
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 it is not /usr/lib
|
||||
donvidia() {
|
||||
# Full path to library
|
||||
nv_LIB="${1}"
|
||||
|
||||
# SOVER to use
|
||||
nv_SOVER="$(scanelf -qF'%S#F' ${nv_LIB})"
|
||||
|
||||
# Where to install
|
||||
nv_DEST="${2}"
|
||||
|
||||
# Get just the library name
|
||||
nv_LIBNAME=$(basename "${nv_LIB}")
|
||||
|
||||
if [[ "${nv_DEST}" ]]; then
|
||||
exeinto ${nv_DEST}
|
||||
action="doexe"
|
||||
else
|
||||
nv_DEST="/usr/$(get_libdir)"
|
||||
action="dolib.so"
|
||||
fi
|
||||
|
||||
# Install the library
|
||||
${action} ${nv_LIB} || die "failed to install ${nv_LIBNAME}"
|
||||
|
||||
# If the library has a SONAME and SONAME does not match the library name,
|
||||
# then we need to create a symlink
|
||||
if [[ ${nv_SOVER} ]] && ! [[ "${nv_SOVER}" = "${nv_LIBNAME}" ]]; then
|
||||
dosym ${nv_LIBNAME} ${nv_DEST}/${nv_SOVER} \
|
||||
|| die "failed to create ${nv_DEST}/${nv_SOVER} symlink"
|
||||
fi
|
||||
|
||||
dosym ${nv_LIBNAME} ${nv_DEST}/${nv_LIBNAME/.so*/.so} \
|
||||
|| die "failed to create ${nv_LIBNAME/.so*/.so} symlink"
|
||||
}
|
||||
|
||||
src_install() {
|
||||
if use driver && 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
|
||||
doins "${FILESDIR}"/nvidia-rmmod.conf
|
||||
|
||||
# Ensures that our device nodes are created when not using X
|
||||
exeinto "$(get_udevdir)"
|
||||
newexe "${FILESDIR}"/nvidia-udev.sh-r1 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 framebuffer capture library
|
||||
donvidia "${NV_OBJ}"/libnvidia-fbc.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
|
||||
|
||||
# Xorg nvidia.conf
|
||||
if has_version '>=x11-base/xorg-server-1.16'; then
|
||||
insinto /usr/share/X11/xorg.conf.d
|
||||
newins {,50-}nvidia-drm-outputclass.conf
|
||||
fi
|
||||
|
||||
insinto /usr/share/glvnd/egl_vendor.d
|
||||
doins "${NV_X11}"/10_nvidia.json
|
||||
fi
|
||||
|
||||
# OpenCL ICD for NVIDIA
|
||||
if use kernel_linux; then
|
||||
insinto /etc/OpenCL/vendors
|
||||
doins "${NV_OBJ}"/nvidia.icd
|
||||
fi
|
||||
|
||||
# Documentation
|
||||
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
|
||||
use X && doman "${NV_MAN}"/nvidia-xconfig.1
|
||||
use tools && doman "${NV_MAN}"/nvidia-settings.1
|
||||
doman "${NV_MAN}"/nvidia-cuda-mps-control.1
|
||||
fi
|
||||
|
||||
docinto html
|
||||
dodoc -r "${NV_DOC}"/html/*
|
||||
|
||||
# Helper Apps
|
||||
exeinto /opt/bin/
|
||||
|
||||
if use X; then
|
||||
doexe "${NV_OBJ}"/nvidia-xconfig
|
||||
|
||||
insinto /etc/vulkan/icd.d
|
||||
doins nvidia_icd.json
|
||||
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-persistenced
|
||||
doexe "${NV_OBJ}"/nvidia-smi
|
||||
|
||||
# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
|
||||
doexe "${NV_OBJ}"/nvidia-modprobe
|
||||
fowners root:video /opt/bin/nvidia-modprobe
|
||||
fperms 4710 /opt/bin/nvidia-modprobe
|
||||
dosym /{opt,usr}/bin/nvidia-modprobe
|
||||
|
||||
doman nvidia-cuda-mps-control.1
|
||||
doman nvidia-modprobe.1
|
||||
doman nvidia-persistenced.1
|
||||
newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
|
||||
newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
|
||||
newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
|
||||
fi
|
||||
|
||||
if use tools; then
|
||||
emake -C "${S}"/nvidia-settings-${PV}/src/ \
|
||||
DESTDIR="${D}" \
|
||||
GTK3_AVAILABLE=$(usex gtk3 1 0) \
|
||||
LIBDIR="${D}/usr/$(get_libdir)" \
|
||||
NV_USE_BUNDLED_LIBJANSSON=0 \
|
||||
NV_VERBOSE=1 \
|
||||
PREFIX=/usr \
|
||||
DO_STRIP= \
|
||||
install
|
||||
|
||||
if use static-libs; then
|
||||
dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
|
||||
|
||||
insinto /usr/include/NVCtrl
|
||||
doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
|
||||
fi
|
||||
|
||||
insinto /usr/share/nvidia/
|
||||
doins nvidia-application-profiles-${PV}-key-documentation
|
||||
|
||||
insinto /etc/nvidia
|
||||
newins \
|
||||
nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
|
||||
|
||||
# There is no icon in the FreeBSD tarball.
|
||||
use kernel_FreeBSD || \
|
||||
doicon "${NV_OBJ}"/nvidia-settings.png
|
||||
|
||||
domenu "${FILESDIR}"/nvidia-settings.desktop
|
||||
|
||||
exeinto /etc/X11/xinit/xinitrc.d
|
||||
newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
|
||||
fi
|
||||
|
||||
dobin "${NV_OBJ}"/nvidia-bug-report.sh
|
||||
|
||||
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 nv_libdir="${NV_OBJ}"
|
||||
|
||||
if use kernel_linux && has_multilib_profile && [[ ${ABI} == "x86" ]]; then
|
||||
nv_libdir="${NV_OBJ}"/32
|
||||
fi
|
||||
|
||||
if use X; then
|
||||
NV_GLX_LIBRARIES=(
|
||||
"libEGL.so.$(usex compat ${NV_SOVER} 1) ${GL_ROOT}"
|
||||
"libEGL_nvidia.so.${NV_SOVER} ${GL_ROOT}"
|
||||
"libGL.so.$(usex compat ${NV_SOVER} 1.0.0) ${GL_ROOT}"
|
||||
"libGLESv1_CM.so.1 ${GL_ROOT}"
|
||||
"libGLESv1_CM_nvidia.so.${NV_SOVER} ${GL_ROOT}"
|
||||
"libGLESv2.so.2 ${GL_ROOT}"
|
||||
"libGLESv2_nvidia.so.${NV_SOVER} ${GL_ROOT}"
|
||||
"libGLX.so.0 ${GL_ROOT}"
|
||||
"libGLX_nvidia.so.${NV_SOVER} ${GL_ROOT}"
|
||||
"libGLdispatch.so.0 ${GL_ROOT}"
|
||||
"libOpenCL.so.1.0.0 ${CL_ROOT}"
|
||||
"libOpenGL.so.0 ${GL_ROOT}"
|
||||
"libcuda.so.${NV_SOVER}"
|
||||
"libnvcuvid.so.${NV_SOVER}"
|
||||
"libnvidia-compiler.so.${NV_SOVER}"
|
||||
"libnvidia-eglcore.so.${NV_SOVER}"
|
||||
"libnvidia-encode.so.${NV_SOVER}"
|
||||
"libnvidia-fatbinaryloader.so.${NV_SOVER}"
|
||||
"libnvidia-fbc.so.${NV_SOVER}"
|
||||
"libnvidia-glcore.so.${NV_SOVER}"
|
||||
"libnvidia-glsi.so.${NV_SOVER}"
|
||||
"libnvidia-ifr.so.${NV_SOVER}"
|
||||
"libnvidia-opencl.so.${NV_SOVER}"
|
||||
"libnvidia-ptxjitcompiler.so.${NV_SOVER}"
|
||||
"libvdpau_nvidia.so.${NV_SOVER}"
|
||||
)
|
||||
|
||||
if use wayland && has_multilib_profile && [[ ${ABI} == "amd64" ]];
|
||||
then
|
||||
NV_GLX_LIBRARIES+=(
|
||||
"libnvidia-egl-wayland.so.${NV_SOVER}"
|
||||
)
|
||||
fi
|
||||
|
||||
if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
|
||||
then
|
||||
NV_GLX_LIBRARIES+=(
|
||||
"libnvidia-wfb.so.${NV_SOVER}"
|
||||
)
|
||||
fi
|
||||
|
||||
if use kernel_FreeBSD; then
|
||||
NV_GLX_LIBRARIES+=(
|
||||
"libnvidia-tls.so.${NV_SOVER}"
|
||||
)
|
||||
fi
|
||||
|
||||
if use kernel_linux; then
|
||||
NV_GLX_LIBRARIES+=(
|
||||
"libnvidia-ml.so.${NV_SOVER}"
|
||||
"tls/libnvidia-tls.so.${NV_SOVER}"
|
||||
)
|
||||
fi
|
||||
|
||||
for NV_LIB in "${NV_GLX_LIBRARIES[@]}"; do
|
||||
donvidia "${nv_libdir}"/${NV_LIB}
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
pkg_preinst() {
|
||||
if use driver && 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 driver && 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 driver && use kernel_linux && linux-mod_pkg_postrm
|
||||
use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
|
||||
}
|
||||
@@ -1,572 +0,0 @@
|
||||
# Copyright 1999-2018 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=6
|
||||
inherit eutils flag-o-matic linux-info linux-mod multilib-minimal nvidia-driver \
|
||||
portability toolchain-funcs unpacker user udev
|
||||
|
||||
NV_URI="https://download.nvidia.com/XFree86/"
|
||||
X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
|
||||
AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
|
||||
ARM_NV_PACKAGE="NVIDIA-Linux-armv7l-gnueabihf-${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/ http://www.nvidia.com/Download/Find.aspx"
|
||||
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 )
|
||||
arm? ( ${NV_URI}Linux-32bit-ARM/${PV}/${ARM_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 )
|
||||
tools? (
|
||||
https://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2
|
||||
)
|
||||
"
|
||||
|
||||
LICENSE="GPL-2 NVIDIA-r2"
|
||||
SLOT="0/${PV%.*}"
|
||||
KEYWORDS="-* amd64 x86 ~amd64-fbsd ~x86-fbsd"
|
||||
RESTRICT="bindist mirror"
|
||||
EMULTILIB_PKG="true"
|
||||
|
||||
IUSE="acpi compat +driver gtk3 kernel_FreeBSD kernel_linux +kms multilib pax_kernel static-libs +tools uvm wayland +X"
|
||||
REQUIRED_USE="
|
||||
tools? ( X )
|
||||
static-libs? ( tools )
|
||||
"
|
||||
|
||||
COMMON="
|
||||
app-eselect/eselect-opencl
|
||||
kernel_linux? ( >=sys-libs/glibc-2.6.1 )
|
||||
tools? (
|
||||
dev-libs/atk
|
||||
dev-libs/glib:2
|
||||
dev-libs/jansson
|
||||
gtk3? (
|
||||
x11-libs/gtk+:3
|
||||
)
|
||||
x11-libs/cairo
|
||||
x11-libs/gdk-pixbuf[X]
|
||||
x11-libs/gtk+:2
|
||||
x11-libs/libX11
|
||||
x11-libs/libXext
|
||||
x11-libs/libXrandr
|
||||
x11-libs/libXv
|
||||
x11-libs/libXxf86vm
|
||||
x11-libs/pango[X]
|
||||
)
|
||||
X? (
|
||||
>=app-eselect/eselect-opengl-1.0.9
|
||||
app-misc/pax-utils
|
||||
)
|
||||
"
|
||||
DEPEND="
|
||||
${COMMON}
|
||||
kernel_linux? ( virtual/linux-sources )
|
||||
"
|
||||
RDEPEND="
|
||||
${COMMON}
|
||||
acpi? ( sys-power/acpid )
|
||||
tools? ( !media-video/nvidia-settings )
|
||||
wayland? ( dev-libs/wayland[${MULTILIB_USEDEP}] )
|
||||
X? (
|
||||
<x11-base/xorg-server-1.19.99:=
|
||||
>=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
|
||||
>=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
|
||||
>=x11-libs/libvdpau-1.0[${MULTILIB_USEDEP}]
|
||||
sys-libs/zlib[${MULTILIB_USEDEP}]
|
||||
)
|
||||
"
|
||||
|
||||
QA_PREBUILT="opt/* usr/lib*"
|
||||
|
||||
S=${WORKDIR}/
|
||||
|
||||
nvidia_drivers_versions_check() {
|
||||
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 10; then
|
||||
ewarn "Gentoo supports kernels which are supported by NVIDIA"
|
||||
ewarn "which are limited to the following kernels:"
|
||||
ewarn "<sys-kernel/gentoo-sources-4.10"
|
||||
ewarn "<sys-kernel/vanilla-sources-4.10"
|
||||
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."
|
||||
ewarn ""
|
||||
fi
|
||||
|
||||
# Since Nvidia ships many 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="!DEBUG_MUTEXES ~!LOCKDEP ~MTRR ~SYSVIPC ~ZONE_DMA"
|
||||
use x86 && CONFIG_CHECK+=" ~HIGHMEM"
|
||||
|
||||
# Now do the above checks
|
||||
use kernel_linux && check_extra_config
|
||||
}
|
||||
|
||||
pkg_pretend() {
|
||||
nvidia_drivers_versions_check
|
||||
}
|
||||
|
||||
pkg_setup() {
|
||||
nvidia_drivers_versions_check
|
||||
|
||||
# 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 driver && use kernel_linux; then
|
||||
MODULE_NAMES="nvidia(video:${S}/kernel)"
|
||||
use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel)"
|
||||
use kms && MODULE_NAMES+=" nvidia-modeset(video:${S}/kernel) nvidia-drm(video:${S}/kernel)"
|
||||
|
||||
# This needs to run after MODULE_NAMES (so that the eclass checks
|
||||
# whether the kernel supports loadable modules) but before BUILD_PARAMS
|
||||
# is set (so that KV_DIR is populated).
|
||||
linux-mod_pkg_setup
|
||||
|
||||
BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
|
||||
SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC) NV_VERBOSE=1"
|
||||
|
||||
# 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
|
||||
|
||||
if use kernel_linux && kernel_is lt 2 6 9; then
|
||||
eerror "You must build this against 2.6.9 or higher kernels."
|
||||
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_prepare() {
|
||||
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."
|
||||
eapply "${FILESDIR}"/${PN}-375.20-pax.patch
|
||||
fi
|
||||
|
||||
local man_file
|
||||
for man_file in "${NV_MAN}"/*1.gz; do
|
||||
gunzip $man_file || die
|
||||
done
|
||||
|
||||
# Allow user patches so they can support RC kernels and whatever else
|
||||
eapply_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 driver && use kernel_linux; then
|
||||
MAKEOPTS=-j1 linux-mod_src_compile
|
||||
fi
|
||||
|
||||
if use tools; then
|
||||
emake -C "${S}"/nvidia-settings-${PV}/src \
|
||||
AR="$(tc-getAR)" \
|
||||
CC="$(tc-getCC)" \
|
||||
LIBDIR="$(get_libdir)" \
|
||||
NV_VERBOSE=1 \
|
||||
RANLIB="$(tc-getRANLIB)" \
|
||||
DO_STRIP= \
|
||||
build-xnvctrl
|
||||
|
||||
emake -C "${S}"/nvidia-settings-${PV}/src \
|
||||
CC="$(tc-getCC)" \
|
||||
GTK3_AVAILABLE=$(usex gtk3 1 0) \
|
||||
LD="$(tc-getCC)" \
|
||||
LIBDIR="$(get_libdir)" \
|
||||
NVML_ENABLED=0 \
|
||||
NV_USE_BUNDLED_LIBJANSSON=0 \
|
||||
NV_VERBOSE=1 \
|
||||
DO_STRIP=
|
||||
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 it is not /usr/lib
|
||||
donvidia() {
|
||||
# Full path to library
|
||||
nv_LIB="${1}"
|
||||
|
||||
# SOVER to use
|
||||
nv_SOVER="$(scanelf -qF'%S#F' ${nv_LIB})"
|
||||
|
||||
# Where to install
|
||||
nv_DEST="${2}"
|
||||
|
||||
# Get just the library name
|
||||
nv_LIBNAME=$(basename "${nv_LIB}")
|
||||
|
||||
if [[ "${nv_DEST}" ]]; then
|
||||
exeinto ${nv_DEST}
|
||||
action="doexe"
|
||||
else
|
||||
nv_DEST="/usr/$(get_libdir)"
|
||||
action="dolib.so"
|
||||
fi
|
||||
|
||||
# Install the library
|
||||
${action} ${nv_LIB} || die "failed to install ${nv_LIBNAME}"
|
||||
|
||||
# If the library has a SONAME and SONAME does not match the library name,
|
||||
# then we need to create a symlink
|
||||
if [[ ${nv_SOVER} ]] && ! [[ "${nv_SOVER}" = "${nv_LIBNAME}" ]]; then
|
||||
dosym ${nv_LIBNAME} ${nv_DEST}/${nv_SOVER} \
|
||||
|| die "failed to create ${nv_DEST}/${nv_SOVER} symlink"
|
||||
fi
|
||||
|
||||
dosym ${nv_LIBNAME} ${nv_DEST}/${nv_LIBNAME/.so*/.so} \
|
||||
|| die "failed to create ${nv_LIBNAME/.so*/.so} symlink"
|
||||
}
|
||||
|
||||
src_install() {
|
||||
if use driver && 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
|
||||
doins "${FILESDIR}"/nvidia-rmmod.conf
|
||||
|
||||
# Ensures that our device nodes are created when not using X
|
||||
exeinto "$(get_udevdir)"
|
||||
newexe "${FILESDIR}"/nvidia-udev.sh-r1 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 framebuffer capture library
|
||||
donvidia ${NV_OBJ}/libnvidia-fbc.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
|
||||
|
||||
# Xorg nvidia.conf
|
||||
if has_version '>=x11-base/xorg-server-1.16'; then
|
||||
insinto /usr/share/X11/xorg.conf.d
|
||||
newins {,50-}nvidia-drm-outputclass.conf
|
||||
fi
|
||||
|
||||
insinto /usr/share/glvnd/egl_vendor.d
|
||||
doins ${NV_X11}/10_nvidia.json
|
||||
fi
|
||||
|
||||
if use wayland; then
|
||||
insinto /usr/share/egl/egl_external_platform.d
|
||||
doins ${NV_X11}/10_nvidia_wayland.json
|
||||
fi
|
||||
|
||||
# OpenCL ICD for NVIDIA
|
||||
if use kernel_linux; then
|
||||
insinto /etc/OpenCL/vendors
|
||||
doins ${NV_OBJ}/nvidia.icd
|
||||
fi
|
||||
|
||||
# Documentation
|
||||
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
|
||||
use X && doman "${NV_MAN}"/nvidia-xconfig.1
|
||||
use tools && doman "${NV_MAN}"/nvidia-settings.1
|
||||
doman "${NV_MAN}"/nvidia-cuda-mps-control.1
|
||||
fi
|
||||
|
||||
docinto html
|
||||
dodoc -r ${NV_DOC}/html/*
|
||||
|
||||
# Helper Apps
|
||||
exeinto /opt/bin/
|
||||
|
||||
if use X; then
|
||||
doexe ${NV_OBJ}/nvidia-xconfig
|
||||
|
||||
insinto /etc/vulkan/icd.d
|
||||
doins nvidia_icd.json
|
||||
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-persistenced
|
||||
doexe ${NV_OBJ}/nvidia-smi
|
||||
|
||||
# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
|
||||
doexe ${NV_OBJ}/nvidia-modprobe
|
||||
fowners root:video /opt/bin/nvidia-modprobe
|
||||
fperms 4710 /opt/bin/nvidia-modprobe
|
||||
dosym /{opt,usr}/bin/nvidia-modprobe
|
||||
|
||||
doman nvidia-cuda-mps-control.1
|
||||
doman nvidia-modprobe.1
|
||||
doman nvidia-persistenced.1
|
||||
newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
|
||||
newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
|
||||
newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
|
||||
fi
|
||||
|
||||
if use tools; then
|
||||
emake -C "${S}"/nvidia-settings-${PV}/src/ \
|
||||
DESTDIR="${D}" \
|
||||
GTK3_AVAILABLE=$(usex gtk3 1 0) \
|
||||
LIBDIR="${D}/usr/$(get_libdir)" \
|
||||
NV_USE_BUNDLED_LIBJANSSON=0 \
|
||||
NV_VERBOSE=1 \
|
||||
PREFIX=/usr \
|
||||
DO_STRIP= \
|
||||
install
|
||||
|
||||
if use static-libs; then
|
||||
dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
|
||||
|
||||
insinto /usr/include/NVCtrl
|
||||
doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
|
||||
fi
|
||||
|
||||
insinto /usr/share/nvidia/
|
||||
doins nvidia-application-profiles-${PV}-key-documentation
|
||||
|
||||
insinto /etc/nvidia
|
||||
newins \
|
||||
nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
|
||||
|
||||
# There is no icon in the FreeBSD tarball.
|
||||
use kernel_FreeBSD || \
|
||||
doicon ${NV_OBJ}/nvidia-settings.png
|
||||
|
||||
domenu "${FILESDIR}"/nvidia-settings.desktop
|
||||
|
||||
exeinto /etc/X11/xinit/xinitrc.d
|
||||
newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
|
||||
fi
|
||||
|
||||
dobin ${NV_OBJ}/nvidia-bug-report.sh
|
||||
|
||||
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 nv_libdir="${NV_OBJ}"
|
||||
|
||||
if use kernel_linux && has_multilib_profile && [[ ${ABI} == "x86" ]]; then
|
||||
nv_libdir="${NV_OBJ}"/32
|
||||
fi
|
||||
|
||||
if use X; then
|
||||
NV_GLX_LIBRARIES=(
|
||||
"libEGL.so.$(usex compat ${NV_SOVER} 1) ${GL_ROOT}"
|
||||
"libEGL_nvidia.so.${NV_SOVER} ${GL_ROOT}"
|
||||
"libGL.so.$(usex compat ${NV_SOVER} 1.0.0) ${GL_ROOT}"
|
||||
"libGLESv1_CM.so.1 ${GL_ROOT}"
|
||||
"libGLESv1_CM_nvidia.so.${NV_SOVER} ${GL_ROOT}"
|
||||
"libGLESv2.so.2 ${GL_ROOT}"
|
||||
"libGLESv2_nvidia.so.${NV_SOVER} ${GL_ROOT}"
|
||||
"libGLX.so.0 ${GL_ROOT}"
|
||||
"libGLX_nvidia.so.${NV_SOVER} ${GL_ROOT}"
|
||||
"libGLdispatch.so.0 ${GL_ROOT}"
|
||||
"libOpenCL.so.1.0.0 ${CL_ROOT}"
|
||||
"libOpenGL.so.0 ${GL_ROOT}"
|
||||
"libcuda.so.${NV_SOVER}"
|
||||
"libnvcuvid.so.${NV_SOVER}"
|
||||
"libnvidia-compiler.so.${NV_SOVER}"
|
||||
"libnvidia-eglcore.so.${NV_SOVER}"
|
||||
"libnvidia-encode.so.${NV_SOVER}"
|
||||
"libnvidia-fatbinaryloader.so.${NV_SOVER}"
|
||||
"libnvidia-fbc.so.${NV_SOVER}"
|
||||
"libnvidia-glcore.so.${NV_SOVER}"
|
||||
"libnvidia-glsi.so.${NV_SOVER}"
|
||||
"libnvidia-ifr.so.${NV_SOVER}"
|
||||
"libnvidia-opencl.so.${NV_SOVER}"
|
||||
"libnvidia-ptxjitcompiler.so.${NV_SOVER}"
|
||||
"libvdpau_nvidia.so.${NV_SOVER}"
|
||||
)
|
||||
|
||||
if use wayland && has_multilib_profile && [[ ${ABI} == "amd64" ]];
|
||||
then
|
||||
NV_GLX_LIBRARIES+=(
|
||||
"libnvidia-egl-wayland.so.1.0.1"
|
||||
)
|
||||
fi
|
||||
|
||||
if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
|
||||
then
|
||||
NV_GLX_LIBRARIES+=(
|
||||
"libnvidia-wfb.so.${NV_SOVER}"
|
||||
)
|
||||
fi
|
||||
|
||||
if use kernel_FreeBSD; then
|
||||
NV_GLX_LIBRARIES+=(
|
||||
"libnvidia-tls.so.${NV_SOVER}"
|
||||
)
|
||||
fi
|
||||
|
||||
if use kernel_linux; then
|
||||
NV_GLX_LIBRARIES+=(
|
||||
"libnvidia-ml.so.${NV_SOVER}"
|
||||
"tls/libnvidia-tls.so.${NV_SOVER}"
|
||||
)
|
||||
fi
|
||||
|
||||
for NV_LIB in "${NV_GLX_LIBRARIES[@]}"; do
|
||||
donvidia "${nv_libdir}"/${NV_LIB}
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
pkg_preinst() {
|
||||
if use driver && 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 driver && 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 driver && use kernel_linux && linux-mod_pkg_postrm
|
||||
use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
|
||||
}
|
||||
@@ -1,573 +0,0 @@
|
||||
# Copyright 1999-2018 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=6
|
||||
inherit eutils flag-o-matic linux-info linux-mod multilib-minimal nvidia-driver \
|
||||
portability toolchain-funcs unpacker user udev
|
||||
|
||||
NV_URI="https://download.nvidia.com/XFree86/"
|
||||
X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
|
||||
AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
|
||||
ARM_NV_PACKAGE="NVIDIA-Linux-armv7l-gnueabihf-${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/ http://www.nvidia.com/Download/Find.aspx"
|
||||
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 )
|
||||
arm? ( ${NV_URI}Linux-32bit-ARM/${PV}/${ARM_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 )
|
||||
tools? (
|
||||
${NV_URI}nvidia-settings/nvidia-settings-${PV}.tar.bz2
|
||||
)
|
||||
"
|
||||
|
||||
LICENSE="GPL-2 NVIDIA-r2"
|
||||
SLOT="0/${PV%.*}"
|
||||
KEYWORDS="-* amd64 x86 ~amd64-fbsd ~x86-fbsd"
|
||||
RESTRICT="bindist mirror"
|
||||
EMULTILIB_PKG="true"
|
||||
|
||||
IUSE="acpi compat +driver gtk3 kernel_FreeBSD kernel_linux +kms multilib pax_kernel static-libs +tools uvm wayland +X"
|
||||
REQUIRED_USE="
|
||||
tools? ( X )
|
||||
static-libs? ( tools )
|
||||
"
|
||||
|
||||
COMMON="
|
||||
app-eselect/eselect-opencl
|
||||
kernel_linux? ( >=sys-libs/glibc-2.6.1 )
|
||||
tools? (
|
||||
dev-libs/atk
|
||||
dev-libs/glib:2
|
||||
dev-libs/jansson
|
||||
gtk3? (
|
||||
x11-libs/gtk+:3
|
||||
)
|
||||
x11-libs/cairo
|
||||
x11-libs/gdk-pixbuf[X]
|
||||
x11-libs/gtk+:2
|
||||
x11-libs/libX11
|
||||
x11-libs/libXext
|
||||
x11-libs/libXrandr
|
||||
x11-libs/libXv
|
||||
x11-libs/libXxf86vm
|
||||
x11-libs/pango[X]
|
||||
)
|
||||
X? (
|
||||
>=app-eselect/eselect-opengl-1.0.9
|
||||
app-misc/pax-utils
|
||||
)
|
||||
"
|
||||
DEPEND="
|
||||
${COMMON}
|
||||
kernel_linux? ( virtual/linux-sources )
|
||||
tools? ( sys-apps/dbus )
|
||||
"
|
||||
RDEPEND="
|
||||
${COMMON}
|
||||
acpi? ( sys-power/acpid )
|
||||
tools? ( !media-video/nvidia-settings )
|
||||
wayland? ( dev-libs/wayland[${MULTILIB_USEDEP}] )
|
||||
X? (
|
||||
<x11-base/xorg-server-1.19.99:=
|
||||
>=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
|
||||
>=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
|
||||
>=x11-libs/libvdpau-1.0[${MULTILIB_USEDEP}]
|
||||
sys-libs/zlib[${MULTILIB_USEDEP}]
|
||||
)
|
||||
"
|
||||
|
||||
QA_PREBUILT="opt/* usr/lib*"
|
||||
|
||||
S=${WORKDIR}/
|
||||
|
||||
nvidia_drivers_versions_check() {
|
||||
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 12; then
|
||||
ewarn "Gentoo supports kernels which are supported by NVIDIA"
|
||||
ewarn "which are limited to the following kernels:"
|
||||
ewarn "<sys-kernel/gentoo-sources-4.12"
|
||||
ewarn "<sys-kernel/vanilla-sources-4.12"
|
||||
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."
|
||||
ewarn ""
|
||||
fi
|
||||
|
||||
# Since Nvidia ships many 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="!DEBUG_MUTEXES ~!LOCKDEP ~MTRR ~SYSVIPC ~ZONE_DMA"
|
||||
use x86 && CONFIG_CHECK+=" ~HIGHMEM"
|
||||
|
||||
# Now do the above checks
|
||||
use kernel_linux && check_extra_config
|
||||
}
|
||||
|
||||
pkg_pretend() {
|
||||
nvidia_drivers_versions_check
|
||||
}
|
||||
|
||||
pkg_setup() {
|
||||
nvidia_drivers_versions_check
|
||||
|
||||
# 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 driver && use kernel_linux; then
|
||||
MODULE_NAMES="nvidia(video:${S}/kernel)"
|
||||
use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel)"
|
||||
use kms && MODULE_NAMES+=" nvidia-modeset(video:${S}/kernel) nvidia-drm(video:${S}/kernel)"
|
||||
|
||||
# This needs to run after MODULE_NAMES (so that the eclass checks
|
||||
# whether the kernel supports loadable modules) but before BUILD_PARAMS
|
||||
# is set (so that KV_DIR is populated).
|
||||
linux-mod_pkg_setup
|
||||
|
||||
BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
|
||||
SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC) NV_VERBOSE=1"
|
||||
|
||||
# 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
|
||||
|
||||
if use kernel_linux && kernel_is lt 2 6 9; then
|
||||
eerror "You must build this against 2.6.9 or higher kernels."
|
||||
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_prepare() {
|
||||
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."
|
||||
eapply "${FILESDIR}"/${PN}-375.20-pax.patch
|
||||
fi
|
||||
|
||||
local man_file
|
||||
for man_file in "${NV_MAN}"/*1.gz; do
|
||||
gunzip $man_file || die
|
||||
done
|
||||
|
||||
# Allow user patches so they can support RC kernels and whatever else
|
||||
eapply_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 driver && use kernel_linux; then
|
||||
MAKEOPTS=-j1 linux-mod_src_compile
|
||||
fi
|
||||
|
||||
if use tools; then
|
||||
emake -C "${S}"/nvidia-settings-${PV}/src \
|
||||
AR="$(tc-getAR)" \
|
||||
CC="$(tc-getCC)" \
|
||||
LIBDIR="$(get_libdir)" \
|
||||
NV_VERBOSE=1 \
|
||||
RANLIB="$(tc-getRANLIB)" \
|
||||
DO_STRIP= \
|
||||
build-xnvctrl
|
||||
|
||||
emake -C "${S}"/nvidia-settings-${PV}/src \
|
||||
CC="$(tc-getCC)" \
|
||||
GTK3_AVAILABLE=$(usex gtk3 1 0) \
|
||||
LD="$(tc-getCC)" \
|
||||
LIBDIR="$(get_libdir)" \
|
||||
NVML_ENABLED=0 \
|
||||
NV_USE_BUNDLED_LIBJANSSON=0 \
|
||||
NV_VERBOSE=1 \
|
||||
DO_STRIP=
|
||||
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 it is not /usr/lib
|
||||
donvidia() {
|
||||
# Full path to library
|
||||
nv_LIB="${1}"
|
||||
|
||||
# SOVER to use
|
||||
nv_SOVER="$(scanelf -qF'%S#F' ${nv_LIB})"
|
||||
|
||||
# Where to install
|
||||
nv_DEST="${2}"
|
||||
|
||||
# Get just the library name
|
||||
nv_LIBNAME=$(basename "${nv_LIB}")
|
||||
|
||||
if [[ "${nv_DEST}" ]]; then
|
||||
exeinto ${nv_DEST}
|
||||
action="doexe"
|
||||
else
|
||||
nv_DEST="/usr/$(get_libdir)"
|
||||
action="dolib.so"
|
||||
fi
|
||||
|
||||
# Install the library
|
||||
${action} ${nv_LIB} || die "failed to install ${nv_LIBNAME}"
|
||||
|
||||
# If the library has a SONAME and SONAME does not match the library name,
|
||||
# then we need to create a symlink
|
||||
if [[ ${nv_SOVER} ]] && ! [[ "${nv_SOVER}" = "${nv_LIBNAME}" ]]; then
|
||||
dosym ${nv_LIBNAME} ${nv_DEST}/${nv_SOVER} \
|
||||
|| die "failed to create ${nv_DEST}/${nv_SOVER} symlink"
|
||||
fi
|
||||
|
||||
dosym ${nv_LIBNAME} ${nv_DEST}/${nv_LIBNAME/.so*/.so} \
|
||||
|| die "failed to create ${nv_LIBNAME/.so*/.so} symlink"
|
||||
}
|
||||
|
||||
src_install() {
|
||||
if use driver && 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
|
||||
doins "${FILESDIR}"/nvidia-rmmod.conf
|
||||
|
||||
# Ensures that our device nodes are created when not using X
|
||||
exeinto "$(get_udevdir)"
|
||||
newexe "${FILESDIR}"/nvidia-udev.sh-r1 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 framebuffer capture library
|
||||
donvidia ${NV_OBJ}/libnvidia-fbc.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
|
||||
|
||||
# Xorg nvidia.conf
|
||||
if has_version '>=x11-base/xorg-server-1.16'; then
|
||||
insinto /usr/share/X11/xorg.conf.d
|
||||
newins {,50-}nvidia-drm-outputclass.conf
|
||||
fi
|
||||
|
||||
insinto /usr/share/glvnd/egl_vendor.d
|
||||
doins ${NV_X11}/10_nvidia.json
|
||||
fi
|
||||
|
||||
if use wayland; then
|
||||
insinto /usr/share/egl/egl_external_platform.d
|
||||
doins ${NV_X11}/10_nvidia_wayland.json
|
||||
fi
|
||||
|
||||
# OpenCL ICD for NVIDIA
|
||||
if use kernel_linux; then
|
||||
insinto /etc/OpenCL/vendors
|
||||
doins ${NV_OBJ}/nvidia.icd
|
||||
fi
|
||||
|
||||
# Documentation
|
||||
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
|
||||
use X && doman "${NV_MAN}"/nvidia-xconfig.1
|
||||
use tools && doman "${NV_MAN}"/nvidia-settings.1
|
||||
doman "${NV_MAN}"/nvidia-cuda-mps-control.1
|
||||
fi
|
||||
|
||||
docinto html
|
||||
dodoc -r ${NV_DOC}/html/*
|
||||
|
||||
# Helper Apps
|
||||
exeinto /opt/bin/
|
||||
|
||||
if use X; then
|
||||
doexe ${NV_OBJ}/nvidia-xconfig
|
||||
|
||||
insinto /etc/vulkan/icd.d
|
||||
doins nvidia_icd.json
|
||||
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-persistenced
|
||||
doexe ${NV_OBJ}/nvidia-smi
|
||||
|
||||
# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
|
||||
doexe ${NV_OBJ}/nvidia-modprobe
|
||||
fowners root:video /opt/bin/nvidia-modprobe
|
||||
fperms 4710 /opt/bin/nvidia-modprobe
|
||||
dosym /{opt,usr}/bin/nvidia-modprobe
|
||||
|
||||
doman nvidia-cuda-mps-control.1
|
||||
doman nvidia-modprobe.1
|
||||
doman nvidia-persistenced.1
|
||||
newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
|
||||
newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
|
||||
newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
|
||||
fi
|
||||
|
||||
if use tools; then
|
||||
emake -C "${S}"/nvidia-settings-${PV}/src/ \
|
||||
DESTDIR="${D}" \
|
||||
GTK3_AVAILABLE=$(usex gtk3 1 0) \
|
||||
LIBDIR="${D}/usr/$(get_libdir)" \
|
||||
NV_USE_BUNDLED_LIBJANSSON=0 \
|
||||
NV_VERBOSE=1 \
|
||||
PREFIX=/usr \
|
||||
DO_STRIP= \
|
||||
install
|
||||
|
||||
if use static-libs; then
|
||||
dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
|
||||
|
||||
insinto /usr/include/NVCtrl
|
||||
doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
|
||||
fi
|
||||
|
||||
insinto /usr/share/nvidia/
|
||||
doins nvidia-application-profiles-${PV}-key-documentation
|
||||
|
||||
insinto /etc/nvidia
|
||||
newins \
|
||||
nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
|
||||
|
||||
# There is no icon in the FreeBSD tarball.
|
||||
use kernel_FreeBSD || \
|
||||
doicon ${NV_OBJ}/nvidia-settings.png
|
||||
|
||||
domenu "${FILESDIR}"/nvidia-settings.desktop
|
||||
|
||||
exeinto /etc/X11/xinit/xinitrc.d
|
||||
newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
|
||||
fi
|
||||
|
||||
dobin ${NV_OBJ}/nvidia-bug-report.sh
|
||||
|
||||
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 nv_libdir="${NV_OBJ}"
|
||||
|
||||
if use kernel_linux && has_multilib_profile && [[ ${ABI} == "x86" ]]; then
|
||||
nv_libdir="${NV_OBJ}"/32
|
||||
fi
|
||||
|
||||
if use X; then
|
||||
NV_GLX_LIBRARIES=(
|
||||
"libEGL.so.$(usex compat ${NV_SOVER} 1) ${GL_ROOT}"
|
||||
"libEGL_nvidia.so.${NV_SOVER} ${GL_ROOT}"
|
||||
"libGL.so.$(usex compat ${NV_SOVER} 1.0.0) ${GL_ROOT}"
|
||||
"libGLESv1_CM.so.1 ${GL_ROOT}"
|
||||
"libGLESv1_CM_nvidia.so.${NV_SOVER} ${GL_ROOT}"
|
||||
"libGLESv2.so.2 ${GL_ROOT}"
|
||||
"libGLESv2_nvidia.so.${NV_SOVER} ${GL_ROOT}"
|
||||
"libGLX.so.0 ${GL_ROOT}"
|
||||
"libGLX_nvidia.so.${NV_SOVER} ${GL_ROOT}"
|
||||
"libGLdispatch.so.0 ${GL_ROOT}"
|
||||
"libOpenCL.so.1.0.0 ${CL_ROOT}"
|
||||
"libOpenGL.so.0 ${GL_ROOT}"
|
||||
"libcuda.so.${NV_SOVER}"
|
||||
"libnvcuvid.so.${NV_SOVER}"
|
||||
"libnvidia-compiler.so.${NV_SOVER}"
|
||||
"libnvidia-eglcore.so.${NV_SOVER}"
|
||||
"libnvidia-encode.so.${NV_SOVER}"
|
||||
"libnvidia-fatbinaryloader.so.${NV_SOVER}"
|
||||
"libnvidia-fbc.so.${NV_SOVER}"
|
||||
"libnvidia-glcore.so.${NV_SOVER}"
|
||||
"libnvidia-glsi.so.${NV_SOVER}"
|
||||
"libnvidia-ifr.so.${NV_SOVER}"
|
||||
"libnvidia-opencl.so.${NV_SOVER}"
|
||||
"libnvidia-ptxjitcompiler.so.${NV_SOVER}"
|
||||
"libvdpau_nvidia.so.${NV_SOVER}"
|
||||
)
|
||||
|
||||
if use wayland && has_multilib_profile && [[ ${ABI} == "amd64" ]];
|
||||
then
|
||||
NV_GLX_LIBRARIES+=(
|
||||
"libnvidia-egl-wayland.so.1.0.1"
|
||||
)
|
||||
fi
|
||||
|
||||
if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
|
||||
then
|
||||
NV_GLX_LIBRARIES+=(
|
||||
"libnvidia-wfb.so.${NV_SOVER}"
|
||||
)
|
||||
fi
|
||||
|
||||
if use kernel_FreeBSD; then
|
||||
NV_GLX_LIBRARIES+=(
|
||||
"libnvidia-tls.so.${NV_SOVER}"
|
||||
)
|
||||
fi
|
||||
|
||||
if use kernel_linux; then
|
||||
NV_GLX_LIBRARIES+=(
|
||||
"libnvidia-ml.so.${NV_SOVER}"
|
||||
"tls/libnvidia-tls.so.${NV_SOVER}"
|
||||
)
|
||||
fi
|
||||
|
||||
for NV_LIB in "${NV_GLX_LIBRARIES[@]}"; do
|
||||
donvidia "${nv_libdir}"/${NV_LIB}
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
pkg_preinst() {
|
||||
if use driver && 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 driver && 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 driver && use kernel_linux && linux-mod_pkg_postrm
|
||||
use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
|
||||
}
|
||||
@@ -1,581 +0,0 @@
|
||||
# Copyright 1999-2018 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=6
|
||||
inherit eutils flag-o-matic linux-info linux-mod multilib-minimal nvidia-driver \
|
||||
portability toolchain-funcs unpacker user udev
|
||||
|
||||
DESCRIPTION="NVIDIA Accelerated Graphics Driver"
|
||||
HOMEPAGE="http://www.nvidia.com/ http://www.nvidia.com/Download/Find.aspx"
|
||||
|
||||
AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
|
||||
AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
|
||||
ARM_NV_PACKAGE="NVIDIA-Linux-armv7l-gnueabihf-${PV}"
|
||||
X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
|
||||
X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
|
||||
|
||||
NV_URI="https://download.nvidia.com/XFree86/"
|
||||
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 )
|
||||
arm? ( ${NV_URI}Linux-32bit-ARM/${PV}/${ARM_NV_PACKAGE}.run )
|
||||
x86-fbsd? (
|
||||
https://us.download.nvidia.com/XFree86/FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz
|
||||
)
|
||||
x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
|
||||
tools? (
|
||||
${NV_URI}nvidia-settings/nvidia-settings-${PV}.tar.bz2
|
||||
)
|
||||
"
|
||||
|
||||
LICENSE="GPL-2 NVIDIA-r2"
|
||||
SLOT="0/${PV%.*}"
|
||||
KEYWORDS="-* amd64 x86 ~amd64-fbsd ~x86-fbsd"
|
||||
RESTRICT="bindist mirror"
|
||||
EMULTILIB_PKG="true"
|
||||
|
||||
IUSE="acpi compat +driver gtk3 kernel_FreeBSD kernel_linux +kms multilib pax_kernel static-libs +tools uvm wayland +X"
|
||||
REQUIRED_USE="
|
||||
tools? ( X )
|
||||
static-libs? ( tools )
|
||||
"
|
||||
|
||||
COMMON="
|
||||
app-eselect/eselect-opencl
|
||||
kernel_linux? ( >=sys-libs/glibc-2.6.1 )
|
||||
tools? (
|
||||
dev-libs/atk
|
||||
dev-libs/glib:2
|
||||
dev-libs/jansson
|
||||
gtk3? (
|
||||
x11-libs/gtk+:3
|
||||
)
|
||||
x11-libs/cairo
|
||||
x11-libs/gdk-pixbuf[X]
|
||||
x11-libs/gtk+:2
|
||||
x11-libs/libX11
|
||||
x11-libs/libXext
|
||||
x11-libs/libXrandr
|
||||
x11-libs/libXv
|
||||
x11-libs/libXxf86vm
|
||||
x11-libs/pango[X]
|
||||
)
|
||||
X? (
|
||||
>=app-eselect/eselect-opengl-1.0.9
|
||||
app-misc/pax-utils
|
||||
)
|
||||
"
|
||||
DEPEND="
|
||||
${COMMON}
|
||||
kernel_linux? ( virtual/linux-sources )
|
||||
tools? ( sys-apps/dbus )
|
||||
"
|
||||
RDEPEND="
|
||||
${COMMON}
|
||||
acpi? ( sys-power/acpid )
|
||||
tools? ( !media-video/nvidia-settings )
|
||||
wayland? ( dev-libs/wayland[${MULTILIB_USEDEP}] )
|
||||
X? (
|
||||
<x11-base/xorg-server-1.19.99:=
|
||||
>=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
|
||||
>=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
|
||||
>=x11-libs/libvdpau-1.0[${MULTILIB_USEDEP}]
|
||||
sys-libs/zlib[${MULTILIB_USEDEP}]
|
||||
)
|
||||
"
|
||||
|
||||
QA_PREBUILT="opt/* usr/lib*"
|
||||
|
||||
S=${WORKDIR}/
|
||||
|
||||
nvidia_drivers_versions_check() {
|
||||
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 16; then
|
||||
ewarn "Gentoo supports kernels which are supported by NVIDIA"
|
||||
ewarn "which are limited to the following kernels:"
|
||||
ewarn "<sys-kernel/gentoo-sources-4.16"
|
||||
ewarn "<sys-kernel/vanilla-sources-4.16"
|
||||
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."
|
||||
ewarn ""
|
||||
fi
|
||||
|
||||
# Since Nvidia ships many 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="!DEBUG_MUTEXES ~!LOCKDEP ~MTRR ~SYSVIPC ~ZONE_DMA"
|
||||
use x86 && CONFIG_CHECK+=" ~HIGHMEM"
|
||||
|
||||
# Now do the above checks
|
||||
use kernel_linux && check_extra_config
|
||||
}
|
||||
|
||||
pkg_pretend() {
|
||||
nvidia_drivers_versions_check
|
||||
}
|
||||
|
||||
pkg_setup() {
|
||||
nvidia_drivers_versions_check
|
||||
|
||||
# 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 driver && use kernel_linux; then
|
||||
MODULE_NAMES="nvidia(video:${S}/kernel)"
|
||||
use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel)"
|
||||
use kms && MODULE_NAMES+=" nvidia-modeset(video:${S}/kernel) nvidia-drm(video:${S}/kernel)"
|
||||
|
||||
# This needs to run after MODULE_NAMES (so that the eclass checks
|
||||
# whether the kernel supports loadable modules) but before BUILD_PARAMS
|
||||
# is set (so that KV_DIR is populated).
|
||||
linux-mod_pkg_setup
|
||||
|
||||
BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
|
||||
SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC) NV_VERBOSE=1"
|
||||
|
||||
# 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
|
||||
|
||||
if use kernel_linux && kernel_is lt 2 6 9; then
|
||||
eerror "You must build this against 2.6.9 or higher kernels."
|
||||
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_prepare() {
|
||||
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."
|
||||
eapply "${FILESDIR}"/${PN}-375.20-pax.patch
|
||||
fi
|
||||
|
||||
local man_file
|
||||
for man_file in "${NV_MAN}"/*1.gz; do
|
||||
gunzip $man_file || die
|
||||
done
|
||||
|
||||
# Allow user patches so they can support RC kernels and whatever else
|
||||
eapply_user
|
||||
|
||||
if ! [ -f nvidia_icd.json ]; then
|
||||
cp nvidia_icd.json.template nvidia_icd.json || die
|
||||
sed -i -e 's:__NV_VK_ICD__:libGLX_nvidia.so.0:g' nvidia_icd.json || die
|
||||
fi
|
||||
}
|
||||
|
||||
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 driver && use kernel_linux; then
|
||||
linux-mod_src_compile src="${KERNEL_DIR}" KERNELRELEASE="${KV_FULL}"
|
||||
fi
|
||||
|
||||
if use tools; then
|
||||
emake -C "${S}"/nvidia-settings-${PV}/src \
|
||||
AR="$(tc-getAR)" \
|
||||
CC="$(tc-getCC)" \
|
||||
LIBDIR="$(get_libdir)" \
|
||||
NV_VERBOSE=1 \
|
||||
RANLIB="$(tc-getRANLIB)" \
|
||||
DO_STRIP= \
|
||||
build-xnvctrl
|
||||
|
||||
emake -C "${S}"/nvidia-settings-${PV}/src \
|
||||
CC="$(tc-getCC)" \
|
||||
GTK3_AVAILABLE=$(usex gtk3 1 0) \
|
||||
LD="$(tc-getCC)" \
|
||||
LIBDIR="$(get_libdir)" \
|
||||
NVML_ENABLED=0 \
|
||||
NV_USE_BUNDLED_LIBJANSSON=0 \
|
||||
NV_VERBOSE=1 \
|
||||
DO_STRIP=
|
||||
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 it is not /usr/lib
|
||||
donvidia() {
|
||||
# Full path to library
|
||||
nv_LIB="${1}"
|
||||
|
||||
# SOVER to use
|
||||
nv_SOVER="$(scanelf -qF'%S#F' ${nv_LIB})"
|
||||
|
||||
# Where to install
|
||||
nv_DEST="${2}"
|
||||
|
||||
# Get just the library name
|
||||
nv_LIBNAME=$(basename "${nv_LIB}")
|
||||
|
||||
if [[ "${nv_DEST}" ]]; then
|
||||
exeinto ${nv_DEST}
|
||||
action="doexe"
|
||||
else
|
||||
nv_DEST="/usr/$(get_libdir)"
|
||||
action="dolib.so"
|
||||
fi
|
||||
|
||||
# Install the library
|
||||
${action} ${nv_LIB} || die "failed to install ${nv_LIBNAME}"
|
||||
|
||||
# If the library has a SONAME and SONAME does not match the library name,
|
||||
# then we need to create a symlink
|
||||
if [[ ${nv_SOVER} ]] && ! [[ "${nv_SOVER}" = "${nv_LIBNAME}" ]]; then
|
||||
dosym ${nv_LIBNAME} ${nv_DEST}/${nv_SOVER} \
|
||||
|| die "failed to create ${nv_DEST}/${nv_SOVER} symlink"
|
||||
fi
|
||||
|
||||
dosym ${nv_LIBNAME} ${nv_DEST}/${nv_LIBNAME/.so*/.so} \
|
||||
|| die "failed to create ${nv_LIBNAME/.so*/.so} symlink"
|
||||
}
|
||||
|
||||
src_install() {
|
||||
if use driver && 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
|
||||
doins "${FILESDIR}"/nvidia-rmmod.conf
|
||||
|
||||
# Ensures that our device nodes are created when not using X
|
||||
exeinto "$(get_udevdir)"
|
||||
newexe "${FILESDIR}"/nvidia-udev.sh-r1 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 framebuffer capture library
|
||||
donvidia ${NV_OBJ}/libnvidia-fbc.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
|
||||
|
||||
# Xorg nvidia.conf
|
||||
if has_version '>=x11-base/xorg-server-1.16'; then
|
||||
insinto /usr/share/X11/xorg.conf.d
|
||||
newins {,50-}nvidia-drm-outputclass.conf
|
||||
fi
|
||||
|
||||
insinto /usr/share/glvnd/egl_vendor.d
|
||||
doins ${NV_X11}/10_nvidia.json
|
||||
fi
|
||||
|
||||
if use wayland; then
|
||||
insinto /usr/share/egl/egl_external_platform.d
|
||||
doins ${NV_X11}/10_nvidia_wayland.json
|
||||
fi
|
||||
|
||||
# OpenCL ICD for NVIDIA
|
||||
if use kernel_linux; then
|
||||
insinto /etc/OpenCL/vendors
|
||||
doins ${NV_OBJ}/nvidia.icd
|
||||
fi
|
||||
|
||||
# Documentation
|
||||
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
|
||||
use X && doman "${NV_MAN}"/nvidia-xconfig.1
|
||||
use tools && doman "${NV_MAN}"/nvidia-settings.1
|
||||
doman "${NV_MAN}"/nvidia-cuda-mps-control.1
|
||||
fi
|
||||
|
||||
docinto html
|
||||
dodoc -r ${NV_DOC}/html/*
|
||||
|
||||
# Helper Apps
|
||||
exeinto /opt/bin/
|
||||
|
||||
if use X; then
|
||||
doexe ${NV_OBJ}/nvidia-xconfig
|
||||
|
||||
insinto /etc/vulkan/icd.d
|
||||
doins nvidia_icd.json
|
||||
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-persistenced
|
||||
doexe ${NV_OBJ}/nvidia-smi
|
||||
|
||||
# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
|
||||
doexe ${NV_OBJ}/nvidia-modprobe
|
||||
fowners root:video /opt/bin/nvidia-modprobe
|
||||
fperms 4710 /opt/bin/nvidia-modprobe
|
||||
dosym /{opt,usr}/bin/nvidia-modprobe
|
||||
|
||||
doman nvidia-cuda-mps-control.1
|
||||
doman nvidia-modprobe.1
|
||||
doman nvidia-persistenced.1
|
||||
newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
|
||||
newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
|
||||
newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
|
||||
fi
|
||||
|
||||
if use tools; then
|
||||
emake -C "${S}"/nvidia-settings-${PV}/src/ \
|
||||
DESTDIR="${D}" \
|
||||
GTK3_AVAILABLE=$(usex gtk3 1 0) \
|
||||
LIBDIR="${D}/usr/$(get_libdir)" \
|
||||
NV_USE_BUNDLED_LIBJANSSON=0 \
|
||||
NV_VERBOSE=1 \
|
||||
PREFIX=/usr \
|
||||
DO_STRIP= \
|
||||
install
|
||||
|
||||
if use static-libs; then
|
||||
dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
|
||||
|
||||
insinto /usr/include/NVCtrl
|
||||
doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
|
||||
fi
|
||||
|
||||
insinto /usr/share/nvidia/
|
||||
doins nvidia-application-profiles-${PV}-key-documentation
|
||||
|
||||
insinto /etc/nvidia
|
||||
newins \
|
||||
nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
|
||||
|
||||
# There is no icon in the FreeBSD tarball.
|
||||
use kernel_FreeBSD || \
|
||||
doicon ${NV_OBJ}/nvidia-settings.png
|
||||
|
||||
domenu "${FILESDIR}"/nvidia-settings.desktop
|
||||
|
||||
exeinto /etc/X11/xinit/xinitrc.d
|
||||
newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
|
||||
fi
|
||||
|
||||
dobin ${NV_OBJ}/nvidia-bug-report.sh
|
||||
|
||||
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 nv_libdir="${NV_OBJ}"
|
||||
|
||||
if use kernel_linux && has_multilib_profile && [[ ${ABI} == "x86" ]]; then
|
||||
nv_libdir="${NV_OBJ}"/32
|
||||
fi
|
||||
|
||||
if use X; then
|
||||
NV_GLX_LIBRARIES=(
|
||||
"libEGL.so.$(usex compat ${NV_SOVER} 1.1.0) ${GL_ROOT}"
|
||||
"libEGL_nvidia.so.${NV_SOVER} ${GL_ROOT}"
|
||||
"libGL.so.$(usex compat ${NV_SOVER} 1.7.0) ${GL_ROOT}"
|
||||
"libGLESv1_CM.so.$(usex compat ${NV_SOVER} 1.2.0) ${GL_ROOT}"
|
||||
"libGLESv1_CM_nvidia.so.${NV_SOVER} ${GL_ROOT}"
|
||||
"libGLESv2.so.$(usex compat ${NV_SOVER} 2.1.0) ${GL_ROOT}"
|
||||
"libGLESv2_nvidia.so.${NV_SOVER} ${GL_ROOT}"
|
||||
"libGLX.so.0 ${GL_ROOT}"
|
||||
"libGLX_nvidia.so.${NV_SOVER} ${GL_ROOT}"
|
||||
"libGLdispatch.so.0 ${GL_ROOT}"
|
||||
"libOpenCL.so.1.0.0 ${CL_ROOT}"
|
||||
"libOpenGL.so.0 ${GL_ROOT}"
|
||||
"libcuda.so.${NV_SOVER}"
|
||||
"libnvcuvid.so.${NV_SOVER}"
|
||||
"libnvidia-compiler.so.${NV_SOVER}"
|
||||
"libnvidia-eglcore.so.${NV_SOVER}"
|
||||
"libnvidia-encode.so.${NV_SOVER}"
|
||||
"libnvidia-fatbinaryloader.so.${NV_SOVER}"
|
||||
"libnvidia-fbc.so.${NV_SOVER}"
|
||||
"libnvidia-glcore.so.${NV_SOVER}"
|
||||
"libnvidia-glsi.so.${NV_SOVER}"
|
||||
"libnvidia-ifr.so.${NV_SOVER}"
|
||||
"libnvidia-opencl.so.${NV_SOVER}"
|
||||
"libnvidia-ptxjitcompiler.so.${NV_SOVER}"
|
||||
"libvdpau_nvidia.so.${NV_SOVER}"
|
||||
)
|
||||
|
||||
if use wayland && has_multilib_profile && [[ ${ABI} == "amd64" ]];
|
||||
then
|
||||
NV_GLX_LIBRARIES+=(
|
||||
"libnvidia-egl-wayland.so.1.0.1"
|
||||
)
|
||||
fi
|
||||
|
||||
if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
|
||||
then
|
||||
NV_GLX_LIBRARIES+=(
|
||||
"libnvidia-wfb.so.${NV_SOVER}"
|
||||
)
|
||||
fi
|
||||
|
||||
if use kernel_FreeBSD; then
|
||||
NV_GLX_LIBRARIES+=(
|
||||
"libnvidia-tls.so.${NV_SOVER}"
|
||||
)
|
||||
fi
|
||||
|
||||
if use kernel_linux; then
|
||||
NV_GLX_LIBRARIES+=(
|
||||
"libnvidia-ml.so.${NV_SOVER}"
|
||||
"tls/libnvidia-tls.so.${NV_SOVER}"
|
||||
)
|
||||
fi
|
||||
|
||||
for NV_LIB in "${NV_GLX_LIBRARIES[@]}"; do
|
||||
donvidia "${nv_libdir}"/${NV_LIB}
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
pkg_preinst() {
|
||||
if use driver && 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 driver && 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 driver && use kernel_linux && linux-mod_pkg_postrm
|
||||
use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
|
||||
}
|
||||
@@ -1,586 +0,0 @@
|
||||
# Copyright 1999-2018 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=6
|
||||
inherit eutils flag-o-matic linux-info linux-mod multilib-minimal nvidia-driver \
|
||||
portability toolchain-funcs unpacker user udev
|
||||
|
||||
NV_URI="https://us.download.nvidia.com/XFree86/"
|
||||
X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
|
||||
AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
|
||||
ARM_NV_PACKAGE="NVIDIA-Linux-armv7l-gnueabihf-${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/ http://www.nvidia.com/Download/Find.aspx"
|
||||
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 )
|
||||
arm? ( https://download.nvidia.com/XFree86/Linux-32bit-ARM/${PV}/${ARM_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 )
|
||||
tools? (
|
||||
https://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2
|
||||
)
|
||||
"
|
||||
|
||||
LICENSE="GPL-2 NVIDIA-r2"
|
||||
SLOT="0/${PV%.*}"
|
||||
KEYWORDS="-* amd64 x86 ~amd64-fbsd ~x86-fbsd"
|
||||
RESTRICT="bindist mirror"
|
||||
EMULTILIB_PKG="true"
|
||||
|
||||
IUSE="acpi compat +driver gtk3 kernel_FreeBSD kernel_linux +kms multilib pax_kernel static-libs +tools uvm wayland +X"
|
||||
REQUIRED_USE="
|
||||
tools? ( X )
|
||||
static-libs? ( tools )
|
||||
"
|
||||
|
||||
COMMON="
|
||||
app-eselect/eselect-opencl
|
||||
kernel_linux? ( >=sys-libs/glibc-2.6.1 )
|
||||
tools? (
|
||||
dev-libs/atk
|
||||
dev-libs/glib:2
|
||||
dev-libs/jansson
|
||||
gtk3? (
|
||||
x11-libs/gtk+:3
|
||||
)
|
||||
x11-libs/cairo
|
||||
x11-libs/gdk-pixbuf[X]
|
||||
x11-libs/gtk+:2
|
||||
x11-libs/libX11
|
||||
x11-libs/libXext
|
||||
x11-libs/libXrandr
|
||||
x11-libs/libXv
|
||||
x11-libs/libXxf86vm
|
||||
x11-libs/pango[X]
|
||||
)
|
||||
X? (
|
||||
>=app-eselect/eselect-opengl-1.0.9
|
||||
app-misc/pax-utils
|
||||
)
|
||||
"
|
||||
DEPEND="
|
||||
${COMMON}
|
||||
kernel_linux? ( virtual/linux-sources )
|
||||
tools? ( sys-apps/dbus )
|
||||
"
|
||||
RDEPEND="
|
||||
${COMMON}
|
||||
acpi? ( sys-power/acpid )
|
||||
tools? ( !media-video/nvidia-settings )
|
||||
wayland? ( dev-libs/wayland[${MULTILIB_USEDEP}] )
|
||||
X? (
|
||||
<x11-base/xorg-server-1.19.99:=
|
||||
>=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
|
||||
>=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
|
||||
>=x11-libs/libvdpau-1.0[${MULTILIB_USEDEP}]
|
||||
sys-libs/zlib[${MULTILIB_USEDEP}]
|
||||
)
|
||||
"
|
||||
QA_PREBUILT="opt/* usr/lib*"
|
||||
S=${WORKDIR}/
|
||||
|
||||
nvidia_drivers_versions_check() {
|
||||
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 15; then
|
||||
ewarn "Gentoo supports kernels which are supported by NVIDIA"
|
||||
ewarn "which are limited to the following kernels:"
|
||||
ewarn "<sys-kernel/gentoo-sources-4.15"
|
||||
ewarn "<sys-kernel/vanilla-sources-4.15"
|
||||
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."
|
||||
ewarn ""
|
||||
fi
|
||||
|
||||
# Since Nvidia ships many 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="!DEBUG_MUTEXES ~!LOCKDEP ~MTRR ~SYSVIPC ~ZONE_DMA"
|
||||
use x86 && CONFIG_CHECK+=" ~HIGHMEM"
|
||||
|
||||
# Now do the above checks
|
||||
use kernel_linux && check_extra_config
|
||||
}
|
||||
|
||||
pkg_pretend() {
|
||||
nvidia_drivers_versions_check
|
||||
}
|
||||
|
||||
pkg_setup() {
|
||||
nvidia_drivers_versions_check
|
||||
|
||||
# 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 driver && use kernel_linux; then
|
||||
MODULE_NAMES="nvidia(video:${S}/kernel)"
|
||||
use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel)"
|
||||
use kms && MODULE_NAMES+=" nvidia-modeset(video:${S}/kernel) nvidia-drm(video:${S}/kernel)"
|
||||
|
||||
# This needs to run after MODULE_NAMES (so that the eclass checks
|
||||
# whether the kernel supports loadable modules) but before BUILD_PARAMS
|
||||
# is set (so that KV_DIR is populated).
|
||||
linux-mod_pkg_setup
|
||||
|
||||
BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
|
||||
SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC) NV_VERBOSE=1"
|
||||
|
||||
# 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
|
||||
|
||||
if use kernel_linux && kernel_is lt 2 6 9; then
|
||||
eerror "You must build this against 2.6.9 or higher kernels."
|
||||
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_prepare() {
|
||||
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."
|
||||
eapply "${FILESDIR}"/${PN}-375.20-pax.patch
|
||||
fi
|
||||
|
||||
local man_file
|
||||
for man_file in "${NV_MAN}"/*1.gz; do
|
||||
gunzip $man_file || die
|
||||
done
|
||||
|
||||
if use tools; then
|
||||
cp "${FILESDIR}"/nvidia-settings-linker.patch "${WORKDIR}" || die
|
||||
sed -i \
|
||||
-e "s:@PV@:${PV}:g" \
|
||||
"${WORKDIR}"/nvidia-settings-linker.patch || die
|
||||
eapply "${WORKDIR}"/nvidia-settings-linker.patch
|
||||
fi
|
||||
|
||||
default
|
||||
|
||||
if ! [ -f nvidia_icd.json ]; then
|
||||
cp nvidia_icd.json.template nvidia_icd.json || die
|
||||
sed -i -e 's:__NV_VK_ICD__:libGLX_nvidia.so.0:g' nvidia_icd.json || die
|
||||
fi
|
||||
}
|
||||
|
||||
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 driver && use kernel_linux; then
|
||||
linux-mod_src_compile src="${KERNEL_DIR}" KERNELRELEASE="${KV_FULL}"
|
||||
fi
|
||||
|
||||
if use tools; then
|
||||
emake -C "${S}"/nvidia-settings-${PV}/src \
|
||||
AR="$(tc-getAR)" \
|
||||
CC="$(tc-getCC)" \
|
||||
DO_STRIP= \
|
||||
LD="$(tc-getCC)" \
|
||||
LIBDIR="$(get_libdir)" \
|
||||
NVLD="$(tc-getLD)" \
|
||||
NV_VERBOSE=1 \
|
||||
RANLIB="$(tc-getRANLIB)" \
|
||||
build-xnvctrl
|
||||
|
||||
emake -C "${S}"/nvidia-settings-${PV}/src \
|
||||
CC="$(tc-getCC)" \
|
||||
DO_STRIP= \
|
||||
GTK3_AVAILABLE=$(usex gtk3 1 0) \
|
||||
LD="$(tc-getCC)" \
|
||||
LIBDIR="$(get_libdir)" \
|
||||
NVLD="$(tc-getLD)" \
|
||||
NVML_ENABLED=0 \
|
||||
NV_USE_BUNDLED_LIBJANSSON=0 \
|
||||
NV_VERBOSE=1
|
||||
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 it is not /usr/lib
|
||||
donvidia() {
|
||||
# Full path to library
|
||||
nv_LIB="${1}"
|
||||
|
||||
# SOVER to use
|
||||
nv_SOVER="$(scanelf -qF'%S#F' ${nv_LIB})"
|
||||
|
||||
# Where to install
|
||||
nv_DEST="${2}"
|
||||
|
||||
# Get just the library name
|
||||
nv_LIBNAME=$(basename "${nv_LIB}")
|
||||
|
||||
if [[ "${nv_DEST}" ]]; then
|
||||
exeinto ${nv_DEST}
|
||||
action="doexe"
|
||||
else
|
||||
nv_DEST="/usr/$(get_libdir)"
|
||||
action="dolib.so"
|
||||
fi
|
||||
|
||||
# Install the library
|
||||
${action} ${nv_LIB} || die "failed to install ${nv_LIBNAME}"
|
||||
|
||||
# If the library has a SONAME and SONAME does not match the library name,
|
||||
# then we need to create a symlink
|
||||
if [[ ${nv_SOVER} ]] && ! [[ "${nv_SOVER}" = "${nv_LIBNAME}" ]]; then
|
||||
dosym ${nv_LIBNAME} ${nv_DEST}/${nv_SOVER} \
|
||||
|| die "failed to create ${nv_DEST}/${nv_SOVER} symlink"
|
||||
fi
|
||||
|
||||
dosym ${nv_LIBNAME} ${nv_DEST}/${nv_LIBNAME/.so*/.so} \
|
||||
|| die "failed to create ${nv_LIBNAME/.so*/.so} symlink"
|
||||
}
|
||||
|
||||
src_install() {
|
||||
if use driver && 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
|
||||
doins "${FILESDIR}"/nvidia-rmmod.conf
|
||||
|
||||
# Ensures that our device nodes are created when not using X
|
||||
exeinto "$(get_udevdir)"
|
||||
newexe "${FILESDIR}"/nvidia-udev.sh-r1 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 framebuffer capture library
|
||||
donvidia ${NV_OBJ}/libnvidia-fbc.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
|
||||
|
||||
# Xorg nvidia.conf
|
||||
if has_version '>=x11-base/xorg-server-1.16'; then
|
||||
insinto /usr/share/X11/xorg.conf.d
|
||||
newins {,50-}nvidia-drm-outputclass.conf
|
||||
fi
|
||||
|
||||
insinto /usr/share/glvnd/egl_vendor.d
|
||||
doins ${NV_X11}/10_nvidia.json
|
||||
fi
|
||||
|
||||
if use wayland; then
|
||||
insinto /usr/share/egl/egl_external_platform.d
|
||||
doins ${NV_X11}/10_nvidia_wayland.json
|
||||
fi
|
||||
|
||||
# OpenCL ICD for NVIDIA
|
||||
if use kernel_linux; then
|
||||
insinto /etc/OpenCL/vendors
|
||||
doins ${NV_OBJ}/nvidia.icd
|
||||
fi
|
||||
|
||||
# Documentation
|
||||
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
|
||||
use X && doman "${NV_MAN}"/nvidia-xconfig.1
|
||||
use tools && doman "${NV_MAN}"/nvidia-settings.1
|
||||
doman "${NV_MAN}"/nvidia-cuda-mps-control.1
|
||||
fi
|
||||
|
||||
docinto html
|
||||
dodoc -r ${NV_DOC}/html/*
|
||||
|
||||
# Helper Apps
|
||||
exeinto /opt/bin/
|
||||
|
||||
if use X; then
|
||||
doexe ${NV_OBJ}/nvidia-xconfig
|
||||
|
||||
insinto /etc/vulkan/icd.d
|
||||
doins nvidia_icd.json
|
||||
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-persistenced
|
||||
doexe ${NV_OBJ}/nvidia-smi
|
||||
|
||||
# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
|
||||
doexe ${NV_OBJ}/nvidia-modprobe
|
||||
fowners root:video /opt/bin/nvidia-modprobe
|
||||
fperms 4710 /opt/bin/nvidia-modprobe
|
||||
dosym /{opt,usr}/bin/nvidia-modprobe
|
||||
|
||||
doman nvidia-cuda-mps-control.1
|
||||
doman nvidia-modprobe.1
|
||||
doman nvidia-persistenced.1
|
||||
newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
|
||||
newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
|
||||
newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
|
||||
fi
|
||||
|
||||
if use tools; then
|
||||
emake -C "${S}"/nvidia-settings-${PV}/src/ \
|
||||
DESTDIR="${D}" \
|
||||
GTK3_AVAILABLE=$(usex gtk3 1 0) \
|
||||
LIBDIR="${D}/usr/$(get_libdir)" \
|
||||
NV_USE_BUNDLED_LIBJANSSON=0 \
|
||||
NV_VERBOSE=1 \
|
||||
PREFIX=/usr \
|
||||
DO_STRIP= \
|
||||
install
|
||||
|
||||
if use static-libs; then
|
||||
dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
|
||||
|
||||
insinto /usr/include/NVCtrl
|
||||
doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
|
||||
fi
|
||||
|
||||
insinto /usr/share/nvidia/
|
||||
doins nvidia-application-profiles-${PV}-key-documentation
|
||||
|
||||
insinto /etc/nvidia
|
||||
newins \
|
||||
nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
|
||||
|
||||
# There is no icon in the FreeBSD tarball.
|
||||
use kernel_FreeBSD || \
|
||||
doicon ${NV_OBJ}/nvidia-settings.png
|
||||
|
||||
domenu "${FILESDIR}"/nvidia-settings.desktop
|
||||
|
||||
exeinto /etc/X11/xinit/xinitrc.d
|
||||
newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
|
||||
fi
|
||||
|
||||
dobin ${NV_OBJ}/nvidia-bug-report.sh
|
||||
|
||||
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 nv_libdir="${NV_OBJ}"
|
||||
|
||||
if use kernel_linux && has_multilib_profile && [[ ${ABI} == "x86" ]]; then
|
||||
nv_libdir="${NV_OBJ}"/32
|
||||
fi
|
||||
|
||||
if use X; then
|
||||
NV_GLX_LIBRARIES=(
|
||||
"libEGL.so.$(usex compat ${NV_SOVER} 1) ${GL_ROOT}"
|
||||
"libEGL_nvidia.so.${NV_SOVER} ${GL_ROOT}"
|
||||
"libGL.so.$(usex compat ${NV_SOVER} 1.0.0) ${GL_ROOT}"
|
||||
"libGLESv1_CM.so.1 ${GL_ROOT}"
|
||||
"libGLESv1_CM_nvidia.so.${NV_SOVER} ${GL_ROOT}"
|
||||
"libGLESv2.so.2 ${GL_ROOT}"
|
||||
"libGLESv2_nvidia.so.${NV_SOVER} ${GL_ROOT}"
|
||||
"libGLX.so.0 ${GL_ROOT}"
|
||||
"libGLX_nvidia.so.${NV_SOVER} ${GL_ROOT}"
|
||||
"libGLdispatch.so.0 ${GL_ROOT}"
|
||||
"libOpenCL.so.1.0.0 ${CL_ROOT}"
|
||||
"libOpenGL.so.0 ${GL_ROOT}"
|
||||
"libcuda.so.${NV_SOVER}"
|
||||
"libnvcuvid.so.${NV_SOVER}"
|
||||
"libnvidia-compiler.so.${NV_SOVER}"
|
||||
"libnvidia-eglcore.so.${NV_SOVER}"
|
||||
"libnvidia-encode.so.${NV_SOVER}"
|
||||
"libnvidia-fatbinaryloader.so.${NV_SOVER}"
|
||||
"libnvidia-fbc.so.${NV_SOVER}"
|
||||
"libnvidia-glcore.so.${NV_SOVER}"
|
||||
"libnvidia-glsi.so.${NV_SOVER}"
|
||||
"libnvidia-ifr.so.${NV_SOVER}"
|
||||
"libnvidia-opencl.so.${NV_SOVER}"
|
||||
"libnvidia-ptxjitcompiler.so.${NV_SOVER}"
|
||||
"libvdpau_nvidia.so.${NV_SOVER}"
|
||||
)
|
||||
|
||||
if use wayland && has_multilib_profile && [[ ${ABI} == "amd64" ]];
|
||||
then
|
||||
NV_GLX_LIBRARIES+=(
|
||||
"libnvidia-egl-wayland.so.1.0.2"
|
||||
)
|
||||
fi
|
||||
|
||||
if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
|
||||
then
|
||||
NV_GLX_LIBRARIES+=(
|
||||
"libnvidia-wfb.so.${NV_SOVER}"
|
||||
)
|
||||
fi
|
||||
|
||||
if use kernel_FreeBSD; then
|
||||
NV_GLX_LIBRARIES+=(
|
||||
"libnvidia-tls.so.${NV_SOVER}"
|
||||
)
|
||||
fi
|
||||
|
||||
if use kernel_linux; then
|
||||
NV_GLX_LIBRARIES+=(
|
||||
"libnvidia-ml.so.${NV_SOVER}"
|
||||
"tls/libnvidia-tls.so.${NV_SOVER}"
|
||||
)
|
||||
fi
|
||||
|
||||
for NV_LIB in "${NV_GLX_LIBRARIES[@]}"; do
|
||||
donvidia "${nv_libdir}"/${NV_LIB}
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
pkg_preinst() {
|
||||
if use driver && 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 driver && 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 driver && use kernel_linux && linux-mod_pkg_postrm
|
||||
use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
|
||||
}
|
||||
@@ -1,581 +0,0 @@
|
||||
# Copyright 1999-2018 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=6
|
||||
inherit eutils flag-o-matic linux-info linux-mod multilib-minimal nvidia-driver \
|
||||
portability toolchain-funcs unpacker user udev
|
||||
|
||||
DESCRIPTION="NVIDIA Accelerated Graphics Driver"
|
||||
HOMEPAGE="http://www.nvidia.com/ http://www.nvidia.com/Download/Find.aspx"
|
||||
|
||||
AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
|
||||
AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
|
||||
ARM_NV_PACKAGE="NVIDIA-Linux-armv7l-gnueabihf-${PV}"
|
||||
|
||||
NV_URI="https://us.download.nvidia.com/XFree86/"
|
||||
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 )
|
||||
tools? (
|
||||
https://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2
|
||||
)
|
||||
"
|
||||
|
||||
LICENSE="GPL-2 NVIDIA-r2"
|
||||
SLOT="0/${PV%.*}"
|
||||
KEYWORDS="-* amd64 ~amd64-fbsd"
|
||||
RESTRICT="bindist mirror"
|
||||
EMULTILIB_PKG="true"
|
||||
|
||||
IUSE="acpi compat +driver gtk3 kernel_FreeBSD kernel_linux +kms multilib pax_kernel static-libs +tools uvm wayland +X"
|
||||
REQUIRED_USE="
|
||||
tools? ( X )
|
||||
static-libs? ( tools )
|
||||
"
|
||||
|
||||
COMMON="
|
||||
app-eselect/eselect-opencl
|
||||
kernel_linux? ( >=sys-libs/glibc-2.6.1 )
|
||||
tools? (
|
||||
dev-libs/atk
|
||||
dev-libs/glib:2
|
||||
dev-libs/jansson
|
||||
gtk3? (
|
||||
x11-libs/gtk+:3
|
||||
)
|
||||
x11-libs/cairo
|
||||
x11-libs/gdk-pixbuf[X]
|
||||
x11-libs/gtk+:2
|
||||
x11-libs/libX11
|
||||
x11-libs/libXext
|
||||
x11-libs/libXrandr
|
||||
x11-libs/libXv
|
||||
x11-libs/libXxf86vm
|
||||
x11-libs/pango[X]
|
||||
)
|
||||
X? (
|
||||
>=app-eselect/eselect-opengl-1.0.9
|
||||
app-misc/pax-utils
|
||||
)
|
||||
"
|
||||
DEPEND="
|
||||
${COMMON}
|
||||
kernel_linux? ( virtual/linux-sources )
|
||||
tools? ( sys-apps/dbus )
|
||||
"
|
||||
RDEPEND="
|
||||
${COMMON}
|
||||
acpi? ( sys-power/acpid )
|
||||
tools? ( !media-video/nvidia-settings )
|
||||
wayland? ( dev-libs/wayland[${MULTILIB_USEDEP}] )
|
||||
X? (
|
||||
<x11-base/xorg-server-1.20.99:=
|
||||
>=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
|
||||
>=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
|
||||
>=x11-libs/libvdpau-1.0[${MULTILIB_USEDEP}]
|
||||
sys-libs/zlib[${MULTILIB_USEDEP}]
|
||||
)
|
||||
"
|
||||
QA_PREBUILT="opt/* usr/lib*"
|
||||
S=${WORKDIR}/
|
||||
|
||||
nvidia_drivers_versions_check() {
|
||||
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 19; then
|
||||
ewarn "Gentoo supports kernels which are supported by NVIDIA"
|
||||
ewarn "which are limited to the following kernels:"
|
||||
ewarn "<sys-kernel/gentoo-sources-4.19"
|
||||
ewarn "<sys-kernel/vanilla-sources-4.19"
|
||||
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."
|
||||
ewarn ""
|
||||
fi
|
||||
|
||||
# Since Nvidia ships many 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="!DEBUG_MUTEXES ~!LOCKDEP ~MTRR ~SYSVIPC ~ZONE_DMA"
|
||||
|
||||
# Now do the above checks
|
||||
use kernel_linux && check_extra_config
|
||||
}
|
||||
|
||||
pkg_pretend() {
|
||||
nvidia_drivers_versions_check
|
||||
}
|
||||
|
||||
pkg_setup() {
|
||||
nvidia_drivers_versions_check
|
||||
|
||||
# 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 driver && use kernel_linux; then
|
||||
MODULE_NAMES="nvidia(video:${S}/kernel)"
|
||||
use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel)"
|
||||
use kms && MODULE_NAMES+=" nvidia-modeset(video:${S}/kernel) nvidia-drm(video:${S}/kernel)"
|
||||
|
||||
# This needs to run after MODULE_NAMES (so that the eclass checks
|
||||
# whether the kernel supports loadable modules) but before BUILD_PARAMS
|
||||
# is set (so that KV_DIR is populated).
|
||||
linux-mod_pkg_setup
|
||||
|
||||
BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
|
||||
SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC) NV_VERBOSE=1"
|
||||
|
||||
# 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
|
||||
|
||||
if use kernel_linux && kernel_is lt 2 6 9; then
|
||||
eerror "You must build this against 2.6.9 or higher kernels."
|
||||
fi
|
||||
|
||||
# set variables to where files are in the package structure
|
||||
if use kernel_FreeBSD; then
|
||||
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_prepare() {
|
||||
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."
|
||||
eapply "${FILESDIR}"/${PN}-375.20-pax.patch
|
||||
fi
|
||||
|
||||
local man_file
|
||||
for man_file in "${NV_MAN}"/*1.gz; do
|
||||
gunzip $man_file || die
|
||||
done
|
||||
|
||||
if use tools; then
|
||||
cp "${FILESDIR}"/nvidia-settings-linker.patch "${WORKDIR}" || die
|
||||
sed -i \
|
||||
-e "s:@PV@:${PV}:g" \
|
||||
"${WORKDIR}"/nvidia-settings-linker.patch || die
|
||||
eapply "${WORKDIR}"/nvidia-settings-linker.patch
|
||||
fi
|
||||
|
||||
default
|
||||
|
||||
if ! [ -f nvidia_icd.json ]; then
|
||||
cp nvidia_icd.json.template nvidia_icd.json || die
|
||||
sed -i -e 's:__NV_VK_ICD__:libGLX_nvidia.so.0:g' nvidia_icd.json || die
|
||||
fi
|
||||
}
|
||||
|
||||
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 driver && use kernel_linux; then
|
||||
linux-mod_src_compile src="${KERNEL_DIR}" KERNELRELEASE="${KV_FULL}"
|
||||
fi
|
||||
|
||||
if use tools; then
|
||||
emake -C "${S}"/nvidia-settings-${PV}/src \
|
||||
AR="$(tc-getAR)" \
|
||||
CC="$(tc-getCC)" \
|
||||
DO_STRIP= \
|
||||
LD="$(tc-getCC)" \
|
||||
LIBDIR="$(get_libdir)" \
|
||||
NVLD="$(tc-getLD)" \
|
||||
NV_VERBOSE=1 \
|
||||
RANLIB="$(tc-getRANLIB)" \
|
||||
build-xnvctrl
|
||||
|
||||
emake -C "${S}"/nvidia-settings-${PV}/src \
|
||||
CC="$(tc-getCC)" \
|
||||
DO_STRIP= \
|
||||
GTK3_AVAILABLE=$(usex gtk3 1 0) \
|
||||
LD="$(tc-getCC)" \
|
||||
LIBDIR="$(get_libdir)" \
|
||||
NVLD="$(tc-getLD)" \
|
||||
NVML_ENABLED=0 \
|
||||
NV_USE_BUNDLED_LIBJANSSON=0 \
|
||||
NV_VERBOSE=1
|
||||
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 it is not /usr/lib
|
||||
donvidia() {
|
||||
# Full path to library
|
||||
nv_LIB="${1}"
|
||||
|
||||
# SOVER to use
|
||||
nv_SOVER="$(scanelf -qF'%S#F' ${nv_LIB})"
|
||||
|
||||
# Where to install
|
||||
nv_DEST="${2}"
|
||||
|
||||
# Get just the library name
|
||||
nv_LIBNAME=$(basename "${nv_LIB}")
|
||||
|
||||
if [[ "${nv_DEST}" ]]; then
|
||||
exeinto ${nv_DEST}
|
||||
action="doexe"
|
||||
else
|
||||
nv_DEST="/usr/$(get_libdir)"
|
||||
action="dolib.so"
|
||||
fi
|
||||
|
||||
# Install the library
|
||||
${action} ${nv_LIB} || die "failed to install ${nv_LIBNAME}"
|
||||
|
||||
# If the library has a SONAME and SONAME does not match the library name,
|
||||
# then we need to create a symlink
|
||||
if [[ ${nv_SOVER} ]] && ! [[ "${nv_SOVER}" = "${nv_LIBNAME}" ]]; then
|
||||
dosym ${nv_LIBNAME} ${nv_DEST}/${nv_SOVER} \
|
||||
|| die "failed to create ${nv_DEST}/${nv_SOVER} symlink"
|
||||
fi
|
||||
|
||||
dosym ${nv_LIBNAME} ${nv_DEST}/${nv_LIBNAME/.so*/.so} \
|
||||
|| die "failed to create ${nv_LIBNAME/.so*/.so} symlink"
|
||||
}
|
||||
|
||||
src_install() {
|
||||
if use driver && 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
|
||||
doins "${FILESDIR}"/nvidia-rmmod.conf
|
||||
|
||||
# Ensures that our device nodes are created when not using X
|
||||
exeinto "$(get_udevdir)"
|
||||
newexe "${FILESDIR}"/nvidia-udev.sh-r1 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 framebuffer capture library
|
||||
donvidia ${NV_OBJ}/libnvidia-fbc.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
|
||||
|
||||
# Xorg nvidia.conf
|
||||
if has_version '>=x11-base/xorg-server-1.16'; then
|
||||
insinto /usr/share/X11/xorg.conf.d
|
||||
newins {,50-}nvidia-drm-outputclass.conf
|
||||
fi
|
||||
|
||||
insinto /usr/share/glvnd/egl_vendor.d
|
||||
doins ${NV_X11}/10_nvidia.json
|
||||
fi
|
||||
|
||||
if use wayland; then
|
||||
insinto /usr/share/egl/egl_external_platform.d
|
||||
doins ${NV_X11}/10_nvidia_wayland.json
|
||||
fi
|
||||
|
||||
# OpenCL ICD for NVIDIA
|
||||
if use kernel_linux; then
|
||||
insinto /etc/OpenCL/vendors
|
||||
doins ${NV_OBJ}/nvidia.icd
|
||||
fi
|
||||
|
||||
# Documentation
|
||||
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
|
||||
use X && doman "${NV_MAN}"/nvidia-xconfig.1
|
||||
use tools && doman "${NV_MAN}"/nvidia-settings.1
|
||||
doman "${NV_MAN}"/nvidia-cuda-mps-control.1
|
||||
fi
|
||||
|
||||
docinto html
|
||||
dodoc -r ${NV_DOC}/html/*
|
||||
|
||||
# Helper Apps
|
||||
exeinto /opt/bin/
|
||||
|
||||
if use X; then
|
||||
doexe ${NV_OBJ}/nvidia-xconfig
|
||||
|
||||
insinto /etc/vulkan/icd.d
|
||||
doins nvidia_icd.json
|
||||
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-persistenced
|
||||
doexe ${NV_OBJ}/nvidia-smi
|
||||
|
||||
# install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
|
||||
doexe ${NV_OBJ}/nvidia-modprobe
|
||||
fowners root:video /opt/bin/nvidia-modprobe
|
||||
fperms 4710 /opt/bin/nvidia-modprobe
|
||||
dosym /{opt,usr}/bin/nvidia-modprobe
|
||||
|
||||
doman nvidia-cuda-mps-control.1
|
||||
doman nvidia-modprobe.1
|
||||
doman nvidia-persistenced.1
|
||||
newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
|
||||
newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
|
||||
newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
|
||||
fi
|
||||
|
||||
if use tools; then
|
||||
emake -C "${S}"/nvidia-settings-${PV}/src/ \
|
||||
DESTDIR="${D}" \
|
||||
GTK3_AVAILABLE=$(usex gtk3 1 0) \
|
||||
LIBDIR="${D}/usr/$(get_libdir)" \
|
||||
NV_USE_BUNDLED_LIBJANSSON=0 \
|
||||
NV_VERBOSE=1 \
|
||||
PREFIX=/usr \
|
||||
DO_STRIP= \
|
||||
install
|
||||
|
||||
if use static-libs; then
|
||||
dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
|
||||
|
||||
insinto /usr/include/NVCtrl
|
||||
doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
|
||||
fi
|
||||
|
||||
insinto /usr/share/nvidia/
|
||||
doins nvidia-application-profiles-${PV}-key-documentation
|
||||
|
||||
insinto /etc/nvidia
|
||||
newins \
|
||||
nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
|
||||
|
||||
# There is no icon in the FreeBSD tarball.
|
||||
use kernel_FreeBSD || \
|
||||
doicon ${NV_OBJ}/nvidia-settings.png
|
||||
|
||||
domenu "${FILESDIR}"/nvidia-settings.desktop
|
||||
|
||||
exeinto /etc/X11/xinit/xinitrc.d
|
||||
newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
|
||||
fi
|
||||
|
||||
dobin ${NV_OBJ}/nvidia-bug-report.sh
|
||||
|
||||
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 nv_libdir="${NV_OBJ}"
|
||||
|
||||
if use kernel_linux && has_multilib_profile && [[ ${ABI} == "x86" ]]; then
|
||||
nv_libdir="${NV_OBJ}"/32
|
||||
fi
|
||||
|
||||
if use X; then
|
||||
NV_GLX_LIBRARIES=(
|
||||
"libEGL.so.$(usex compat ${NV_SOVER} 1.1.0) ${GL_ROOT}"
|
||||
"libEGL_nvidia.so.${NV_SOVER} ${GL_ROOT}"
|
||||
"libGL.so.$(usex compat ${NV_SOVER} 1.7.0) ${GL_ROOT}"
|
||||
"libGLESv1_CM.so.1.2.0 ${GL_ROOT}"
|
||||
"libGLESv1_CM_nvidia.so.${NV_SOVER} ${GL_ROOT}"
|
||||
"libGLESv2.so.2.1.0 ${GL_ROOT}"
|
||||
"libGLESv2_nvidia.so.${NV_SOVER} ${GL_ROOT}"
|
||||
"libGLX.so.0 ${GL_ROOT}"
|
||||
"libGLX_nvidia.so.${NV_SOVER} ${GL_ROOT}"
|
||||
"libGLdispatch.so.0 ${GL_ROOT}"
|
||||
"libOpenCL.so.1.0.0 ${CL_ROOT}"
|
||||
"libOpenGL.so.0 ${GL_ROOT}"
|
||||
"libcuda.so.${NV_SOVER}"
|
||||
"libnvcuvid.so.${NV_SOVER}"
|
||||
"libnvidia-compiler.so.${NV_SOVER}"
|
||||
"libnvidia-eglcore.so.${NV_SOVER}"
|
||||
"libnvidia-encode.so.${NV_SOVER}"
|
||||
"libnvidia-fatbinaryloader.so.${NV_SOVER}"
|
||||
"libnvidia-fbc.so.${NV_SOVER}"
|
||||
"libnvidia-glcore.so.${NV_SOVER}"
|
||||
"libnvidia-glsi.so.${NV_SOVER}"
|
||||
"libnvidia-glvkspirv.so.${NV_SOVER}"
|
||||
"libnvidia-ifr.so.${NV_SOVER}"
|
||||
"libnvidia-opencl.so.${NV_SOVER}"
|
||||
"libnvidia-ptxjitcompiler.so.${NV_SOVER}"
|
||||
"libvdpau_nvidia.so.${NV_SOVER}"
|
||||
)
|
||||
|
||||
if use wayland && has_multilib_profile && [[ ${ABI} == "amd64" ]];
|
||||
then
|
||||
NV_GLX_LIBRARIES+=(
|
||||
"libnvidia-egl-wayland.so.1.0.3"
|
||||
)
|
||||
fi
|
||||
|
||||
if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
|
||||
then
|
||||
NV_GLX_LIBRARIES+=(
|
||||
"libnvidia-wfb.so.${NV_SOVER}"
|
||||
)
|
||||
fi
|
||||
|
||||
if use kernel_FreeBSD; then
|
||||
NV_GLX_LIBRARIES+=(
|
||||
"libnvidia-tls.so.${NV_SOVER}"
|
||||
)
|
||||
fi
|
||||
|
||||
if use kernel_linux; then
|
||||
NV_GLX_LIBRARIES+=(
|
||||
"libnvidia-ml.so.${NV_SOVER}"
|
||||
"tls/libnvidia-tls.so.${NV_SOVER}"
|
||||
)
|
||||
fi
|
||||
|
||||
for NV_LIB in "${NV_GLX_LIBRARIES[@]}"; do
|
||||
donvidia "${nv_libdir}"/${NV_LIB}
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
pkg_preinst() {
|
||||
if use driver && 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 driver && 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 driver && use kernel_linux && linux-mod_pkg_postrm
|
||||
use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
|
||||
}
|
||||
Reference in New Issue
Block a user