diff options
author | BlackNoxis <steven.darklight@gmail.com> | 2014-02-15 23:24:26 +0200 |
---|---|---|
committer | BlackNoxis <steven.darklight@gmail.com> | 2014-02-15 23:24:26 +0200 |
commit | 7224c1253228e5c29c78cb3f0f26ce34770f2356 (patch) | |
tree | 1684924656132935256e034f35f92abee6623265 /x11-drivers/nvidia-userspace |
Added ebuilds for kogaion desktop
Diffstat (limited to 'x11-drivers/nvidia-userspace')
37 files changed, 9221 insertions, 0 deletions
diff --git a/x11-drivers/nvidia-userspace/Manifest b/x11-drivers/nvidia-userspace/Manifest new file mode 100644 index 00000000..ff0bcb08 --- /dev/null +++ b/x11-drivers/nvidia-userspace/Manifest @@ -0,0 +1,104 @@ +AUX 09nvidia 61 SHA256 14702d6726cc9f0ad832a3cc90059999eb956f9e3a35397cb63cfa6347b33e39 SHA512 14c47fa164bde3422b64224e3e46e0a6097599de6193b6d36eb162271d41130f0498f6aee09f5cb60fe43727bf74051f9127afa1b4af42efc28d40af2e4fa86f WHIRLPOOL 34bc9975d132da84506a61a119a5d8d8b5be35af5c1511b5e3228fa3d9f0f3b7f84821c0ab09252054d1471ac7901522309d440c82342d6dfdd2beb73f680460 +AUX 90mutter-disable-culling 110 SHA256 1002661324e8a958574a92c411c554d6f002d3faeac5d60d3b6602580c266b69 SHA512 c3d61f276cc7520c99d493764df24bfa0f4e0d41763057c8d53b221ca2767e062ad79fa7125195bf520054e33645350a227b5dd6120134e1fcba86fa4986a969 WHIRLPOOL c408a20e5f06b574413543466be7d2c584020ce1c2087fe961e427f9d65561c9164a2fa41debc10cdc31006661b0af3d6a87f76c50778b9659bebee5e00c41d9 +AUX NVIDIA_glx-defines.patch 437 SHA256 0007f3d962edb87da4788ce58869679c1b10f28223a6bf1c23696fede57305da SHA512 a9cbbe5d5d362db0eb92d5b9fe87f28cccb600df9b44ae2b323ed08da97c32d6a4a0553c7c82ea3777ab91a1a4bf6b74f04d89b6ec28e60565e677cc4af48351 WHIRLPOOL a826b11c86803530346a65612ebd1a12f77f6c6ba1d93af597435993086451648b825fbc245a2c5850e0680c58129924843744d7e29013d5087c3b4dd9fefb14 +AUX NVIDIA_glx-glheader.patch 380 SHA256 f630e24067bf6199a64f8fe8c5d6fc158cb4b153bda65ffc3f97b36a9cb08faf SHA512 366ebbe967001f4d694e9d6ae61fbd8b57e2946bba495894936809634bb87bd6ba6b10689969977e4d0eaba6983c16fe8d78830112b5b28f01c78381a0a095d6 WHIRLPOOL 8609fcedb439299189d9d05606a290a63de8b207bab855f874faa36e892396f41159d26e505dfead89fdac9d7e61aeeb50b16877aa14ad62dc3cd617353d7d60 +AUX eblits/donvidia.eblit 695 SHA256 d404dd7e5657d83ccf3687720fb978030a3716e47957fb8bb80dea3ed57b3672 SHA512 606d2a496ddae2ac89d3ac0ce5b80bac90cabfe74d6b29c577ab047c3b83ce8965bb4b91b29f37bf55d4f34eaab623ac886760920efb9d306d3904cb3b51291c WHIRLPOOL e0a945c4cbaa0514e19eecf8faa4daaa76c8fc6392fb9a2a607e011e7994c535a3ba4b024de9ee9f4f34c7d4e0d48a0c3315f4cf9687be05fb577ec8dd3c0fe2 +AUX eblits/mtrr_check.eblit 629 SHA256 ae1b8fb37985fc3e42a4a776779b3fe3d70be2c826df5c3f99d03ba7209ca0b1 SHA512 db1bcee808c616536e21f98d65cd0c2b64b26b8b0db827decfc8fe12b031431bf961f1f2016a22170b9400672aeb508f548a66c15018570b44fe1cd535692f86 WHIRLPOOL 4f4961dc5aa71f273871f9171f485aaf5dd27906a564e1967b9298362b2302d9b137a757c6e6918b4b3d1efef75b0ed266f08d83c898e0a1f2b47653e1ca7335 +AUX eblits/src_install-libs.eblit 3472 SHA256 6f301de374736cec316794bf1935a15de025b3c505981f24e06e3df75818ad6a SHA512 f3dd0cb69276cec6f2b7cbb452c77c8e0a82fc37514c31a21fb9a251e38027e4adfdda6ca8b1897635897608a0e70c81f03ff88466a7db1387ed7a4241924ce8 WHIRLPOOL a2e84fba09347bec9b27129f02311696938ad5ca61fa7ff8d9efa10ad9c63a01a622cba1d08b1e166c737e88b50add234c7c0d59b88e5b64442269a7dd47cbf8 +AUX eblits/want_tls.eblit 952 SHA256 e5ce767a2e9a5c0682e764b9ba42a20e721a093f4c0626605570c8b5e3afecd0 SHA512 eafa21a324f095e3d80ac0385c1a5159011a57e3aa2465927c71524c6329147f2ee804f6b0772d4ad97083637451df397be0da748d8674d5be42b308fb25ae2d WHIRLPOOL 8291d0fa548518926252fafabaa0ebbfd7ac165b380650beeed17c86918f95d658a3daadab6c4bde0adbdf1ce7b63a88ed6135cfcf9dceb4798f0b1ccefc8fcc +AUX libGL.la-r2 733 SHA256 4856e7a2c31763ade41c93a395f3e80a2705ac2ab4dbd73e5161cdba132f407b SHA512 52fbc3d704274fc5403b95a5d696824684302f4a77e0b08d5a59850435b12d9bdc4cf931f346f91e950f246cc342e0a673e7657cc2cea95e991ed3aab8c1c928 WHIRLPOOL 6a0006277a8444b4b5191a7e07c972efde43c3a9ff8a7286d1d1f78c69c3ba394572f31716b684f1e28355572a6e9f9cbd5437bb9dba127d727f8789fbd2a980 +AUX nvidia 1510 SHA256 b193cc3f6d6f39138720a2282d9f161fc8f2e8a15bc43d183a30eb879add06c5 SHA512 4ffdf49c2634b261be122a0016b0f69d30db6fe4b4a29767cfeee2e1d60671e7e6fc5e5c3a237b351a4def64404db121cf296a0cdb6e1bbd4f8e78ab40587000 WHIRLPOOL faab4c87940e4703b2a30f284cae34bdf4ac486cb1d402b5bd91ef65c23f443c2c961ad914fbcbd5258dd5bbaeee583f189fcf5fc14f2b9925c8ccfa0fc422c7 +AUX nvidia-169.07 639 SHA256 a8c4860f008d53776fda7a17b59524f271236559af688e9a2c9845cbbcba1577 SHA512 3af295c026280dc3a2b73c2cc7772254686b09cad15f1333ab0b4de8cb0ccf78e725ced2a399b10edcf8af6ba42ab1485dc0661af67461b0c3789f786357772f WHIRLPOOL 626ae3c01c879e0cfe05bd373e0b9dfd6f462dd9ef6ae94a7d60276fe2d17c57fbb20aaa4d2a186a0ffc2a860076692aac854d00a3545bc9736e7bb8d0581055 +AUX nvidia-smi.init 671 SHA256 5776a661b510e072d34e779c23dfc710a13d04c49acc22772d2aeb0e415820d6 SHA512 f71bcdf2fcaf4aac69056a04f3e57c9f5e4d6c210fe571704d3f9a0798cc9615cd0560840ae336744f43563528db5b9a7b67730895eff438be330b13ab863ed6 WHIRLPOOL db48549b0d2b02d2f9ca6a86f38229dae67853939ac1c2147d5066b9b8958c2e0fb8539f70ddf5c92ae6ad642bb48ea8b1119d1779c80dd66bb450240fd0b40a +AUX nvidia-udev.sh 185 SHA256 120c0af2b64fbcbd7032217a78eec8b104874c1ca68726367bce22c57944e07e SHA512 166df3a4e7c1862ca2e0f634bf5eed7aad1bdd7e55764ca42371b91a7077c59f0bc243de5616fd38dac9694159d1695d54fbd08ac89d4d3f3649c70c7db5977e WHIRLPOOL cb9995029cdb2fe1bc7fe5ae54041ee5de8da86bf5eb3616d062475e56c44d436e1e66683ecddd986fc5bca5723d88da4b1a42f65f3cd7e15636928bd21fce14 +AUX nvidia.udev-rule 462 SHA256 37b152a5055a16d1947171567178e2841679ddf03dba9d48e7d30f1e3b469ac6 SHA512 96f9edaa0b46bea5fce17596f868bea5265b303d7185af6ba81527bbd7b8fdf92de9311317cbde51a29d222083d451c25ab77c3d6837cbc4072a50d9af89aa86 WHIRLPOOL 89ed95f33db7485a3a1acd91df33ecdfb7d0a249db2d7674f134fb85b35a54653d0458e478503315ce506ae5d3c8dcd4ac20420711fdbdd087ea4bd779627d13 +DIST NVIDIA-FreeBSD-x86-173.14.31.tar.gz 17991684 SHA256 98699bc8dc1dad86cebc2ed067b4fc5cd37b8540e897bb218f38ac80c4b4d875 SHA512 4e6fbbeaff54563a135346e60372046cb2cd2562cc606836dc3169d4f50c0b112095b1f0f3f14f2f0facf2be1235064c13766432a04b927f2ab81ef50c8f4f34 WHIRLPOOL 0cc4f196d7ccbdd45f8584fef9f98dd1af2fa260a8e694a6000e5436ae2ab35df6ba5f8967261e36f0107962744423fc73eef9d0e59807f78536ecf8de0f5963 +DIST NVIDIA-FreeBSD-x86-173.14.34.tar.gz 18792829 SHA256 44368464ad72addb999aa7bf3a1d684d4cddd1bba08d7bca9e45a825cb8865ae +DIST NVIDIA-FreeBSD-x86-173.14.35.tar.gz 18748428 SHA256 51e82a12db81b5af4ae5ee59612875c0dbef52cb641d61a44c72f2e1cd7f4c78 +DIST NVIDIA-FreeBSD-x86-275.09.07.tar.gz 30304023 SHA256 d5d119c2f066539da0f2d1926193f6bc2bfbf2a1dcdff77322a23b42c5df91d9 +DIST NVIDIA-FreeBSD-x86-280.13.tar.gz 29589886 SHA256 2ad1882467a2d8a0b65dfa15e710e4938786e51f688e1d02d4d3343868b9239e +DIST NVIDIA-FreeBSD-x86-285.05.09.tar.gz 30697710 SHA256 d3ad51145cd57c70678ee659112a0973187b1b02e3062addadd0fe094b3c46fb +DIST NVIDIA-FreeBSD-x86-290.10.tar.gz 32042469 SHA256 f5accbdac0b231a8073f76c1d1d8ace7cb98ebe167888c31183a2752a669ee92 +DIST NVIDIA-FreeBSD-x86-295.20.tar.gz 31993959 SHA256 fea6d5552a50e2aedc4726944fea85ac8baf0d0b26661fc3b1f97f54ebec6736 +DIST NVIDIA-FreeBSD-x86-295.33.tar.gz 32039170 SHA256 e3f8052fdac78defafcef495febea2a77f820f2c4c9ecbe47fb92bf630321afc +DIST NVIDIA-FreeBSD-x86-295.40.tar.gz 32029253 SHA256 f47b603f39dfd2e405949aab6fbc7abd4b24f43c6fb47b4f23d7618f32021364 +DIST NVIDIA-FreeBSD-x86-295.49.tar.gz 32078716 SHA256 aa7c9a13931a55e358c542e1d18feb0aeaa7b18550e9675698b152265134d938 +DIST NVIDIA-FreeBSD-x86-295.53.tar.gz 32085530 SHA256 ecb637754ec31a0c058017e04b363abb831b96584ca9684b676a93ecb5af93ca +DIST NVIDIA-FreeBSD-x86-295.59.tar.gz 32092806 SHA256 9a3e1794418add03ad97aad93608d1bc1f2f9c5a82e0321a2a8ba1c9db7d41dd +DIST NVIDIA-FreeBSD-x86-302.17.tar.gz 32072917 SHA256 b0d50c3333ee7c485bfd5287b37e253ed358dd5d205997f0c50e16f04b7714c5 +DIST NVIDIA-FreeBSD-x86-304.22.tar.gz 32975645 SHA256 20a84c23339695fe73d9be977662b19572360d8d87b54aeca428f73e2510c1e5 SHA512 15788983073427a9729b61a37b684c37bafd57618bbacec40fe8f9bd0a3f6f30d417297dee5e3ca287f0b71c74bbe03163edef048f8ad38cf2493124820244dd WHIRLPOOL f823ce885ebcd8ab9af427487c8dfffe5cc7adc61e1c4af31371b808df449584df1f571310610e901bc83c4e52cb553d2a71d0ae5e3fadfadf56ce1a97447484 +DIST NVIDIA-FreeBSD-x86-304.37.tar.gz 33291575 SHA256 e6c3a1d4a757b5d4f2ab54a43d5d7008fcb1b481f14515f58adcd31f3edc6576 +DIST NVIDIA-FreeBSD-x86-304.88.tar.gz 33651825 SHA256 739325b26a93d934d015159c420ef1875a24ccd62a5bb482e688cf918d4fa33d SHA512 6dab929d2d2bacfc3a96ab24ff02996938613851e2b3c050ed3a1d0cca3751c574f12508e21119f2b43ff0421c3f88bf4edd51a37f3374c72c6337bcb8d6bcdb WHIRLPOOL b9be513a8dd8ce4cd6eeb23a24e725c751bb2cce0745477df2b4b84d7d03ad557d0b16bcdfb8d642168de09d59b057cb2955fca11f50b281ebad92f30a7dc4e1 +DIST NVIDIA-FreeBSD-x86-310.19.tar.gz 32264033 SHA256 29635a45e87fd240d472868dcd1ff9030f7eb85d78ffe85dea0f420be390d3e0 SHA512 77fd63c0c2cca5462c7e969e300f027dff9cb60f4234868f42317604d537a7bccb2631958f2a0cf74f46ee685d8f2a25f3dab2792be00a5c638d9756deb5a582 WHIRLPOOL bc896389ed9ad32e8e2e087476a3bafac9f828b8a1167c7b99cd58688d56d5454717dbe99b83fa1eca3111a80ffa9f721332364c8fdf95c02f4c5e05f989248f +DIST NVIDIA-FreeBSD-x86-313.30.tar.gz 32591892 SHA256 1e02831fbaddf2f27808ea26352d835417f59bcf54ddb3e9c0f1d7b76dcb4666 SHA512 68cf61fabf707dfa1225011cab3749959ab29f09f611347eb9f9bd55065012d04382998e67091c4d3c1af9be21be6381aef9b6414448ee15f9a36d44448f5bf8 WHIRLPOOL 71ded70f45e880db2c2850c596cebafd004adf89f7131adaf324d1d38abbb5457a700bfa9e671bfa144515556f011df8a37fdf22b78b879f39007be6487f060a +DIST NVIDIA-FreeBSD-x86-325.15.tar.gz 34164781 SHA256 745d8454833d1ad59f6480ac2d1ca744862e4e711e16deeebc0d04ff86925c4d SHA512 b1ce1041d7f3a926c3e62e398a618063e24675cdd919206c11e556f38d3b0078233ba31207d04e9d94e26bbf5eae4d43f8db457e7ac4fecfb8d407d2dbbf3040 WHIRLPOOL 9a37ecaa745ab9ff80755f01100610f85467fdfb55f5568dd358cb39302c0951edd91d518f1027bb0d43628e575ff9c1799ad956b9e673a31d38f7f3db125c63 +DIST NVIDIA-FreeBSD-x86-96.43.20.tar.gz 14060884 SHA256 e75fce272e72644d53e6ad3c0957fe173735a4b621726ce227ba8ecf9bd9c5cf +DIST NVIDIA-FreeBSD-x86_64-304.37.tar.gz 34210803 SHA256 0d00046c8463954b6c8e13e245b2619758e947389161a113aa005ef7566e5dd3 +DIST NVIDIA-FreeBSD-x86_64-304.88.tar.gz 34597351 SHA256 be0e20a543fa14a8f91481dd64b080093b19edf951bf631c62365a64dadb1934 SHA512 143af863aef72962d83c6f77160512d0860a62964e92043400674b0be95735ae6f2dbdd25c42fa96b4511cece9c73b7072f829a88d46ab6b79aa750b65e64748 WHIRLPOOL 74b5014736065e178b261716e81f367395252efb3aa3b84faab6b6d26f561caa129e1d9bc0e02ce98f83dcaa3603fddd155de4b50e760bf2ea8df4c176b21e76 +DIST NVIDIA-FreeBSD-x86_64-310.19.tar.gz 33184883 SHA256 82607fdd14c666867b842205be3ec8b8095fb0c9da1cb2286b0bf85a769eb9ae SHA512 5f112a4dbb379977c9b1417536964d02498cb9d4a4ff3c35291dfaa5c90fcc8b2073ec75a1db9358c98686661d525db5e7e42036500281d09a1be608f9c2b851 WHIRLPOOL 3b629c57cc63319b18805fb67ebf75d07907a52b2c1d7cad12cca8837c29e6557c772c416d52d15f1e8f7b01b65b8a7728bd4cf5c0da890644e3151421fb901d +DIST NVIDIA-FreeBSD-x86_64-313.30.tar.gz 33557658 SHA256 192ad1bb8a0cd649e12bcccf97c5f4d2002d6695126fea81586991d9e95248d3 SHA512 79b3b47bdcbc99f724f8c424733c11f1b2653103bbe0ba9849587628611d9da08ea434c786cc7d3d891bde3dfe4068298a7377ce5b1a3484fb64ef4d28c896da WHIRLPOOL 7307d6adb04b47b8403134e7394bf9af4f90839d1fb62aa3b7b7c6d8e367392829fb249dc8d444e66158fa5b5b15cf5b6c16e1f5659a22a15c17f55eda026660 +DIST NVIDIA-FreeBSD-x86_64-325.15.tar.gz 34590166 SHA256 92429119ca8e50baa06c6681ed2b9eb6c37cdf256a19ba4e1827be4b202a0569 SHA512 c9e4d41a5dcb02a280fb323fd4578bc7851d4242890f1d8e69a59e083a2a76cccdaba3ed55f8eb8f983e9c89326f0a9d7152bd7770230fbe45fc7b5865c486b6 WHIRLPOOL c54638af7fb6aaf63222ea75cc377e5e449dfaa80dd47a23aed2eec8da1c460c9e3c24627a2853287585a65b0f562e3efc7916fe985a4816d82aebc12bf7021b +DIST NVIDIA-Linux-x86-173.14.31-pkg0.run 13407481 SHA256 e855a62f16a9d0eff1bf470a8fcedd48cd1b718e969ad5ebe89a557d039d1924 SHA512 bb58aa1ee84c71311a7b5cd3d87fa2827b6b41bb4645849611381ce7e255516da66fff9cc9a295a39ea185668d7f91fde0eaf56a18b04ae67ae468e1e509bc46 WHIRLPOOL d9a28dd96bf77051e6cf91a1b29c59fac716e14f3d3726867ecd9e43ac90d62d4ace0f0add7aff619f4933a8dc9e87734df3fcb5483db62bf99a77320d4e2f33 +DIST NVIDIA-Linux-x86-173.14.34-pkg0.run 14071464 SHA256 a873b7a28b1d83fcb7a97e4d5fcb471bb96bb5094bcd5e86c728ec22b49b258e +DIST NVIDIA-Linux-x86-173.14.35-pkg0.run 14028887 SHA256 2d26100f7691047e424e1614deca0f1d862da5fa69e04e967f0c1dbb84ec729a +DIST NVIDIA-Linux-x86-275.09.07.run 30930605 SHA256 27d1b2073c11bd56e423ed80bd22773f1f282c39ab3b76773144cfa680a1ff0c +DIST NVIDIA-Linux-x86-280.13.run 32704856 SHA256 b222afe19c6310f1aa2a2574f27fa9e2b877738177daa60162bb5705758bac9b +DIST NVIDIA-Linux-x86-285.05.09.run 33592492 SHA256 ce03fa99b62081b52bd5dae3594ac5942413ed530cda3d76a82f4ab0afd36f96 +DIST NVIDIA-Linux-x86-290.10.run 34691272 SHA256 99be8f53aa1f777445e5a4cac27acd7d85990db712b5c29caac865145fc5adaa +DIST NVIDIA-Linux-x86-295.20.run 34641353 SHA256 0f9dc3d493053cffe37f72b6783edc6c14afd31532b43a7cf0bfce763cf2d500 +DIST NVIDIA-Linux-x86-295.33.run 34675369 SHA256 90a866c9c2f3904bc25b7a5829f8b40a419e60a79ad13c980b48d3bf89625a47 +DIST NVIDIA-Linux-x86-295.40.run 34668138 SHA256 ccd46574dd843a50327f50daa6f0b635ad7eca4a5b9a5fa963d0871bfa74ce2a +DIST NVIDIA-Linux-x86-295.49.run 34716936 SHA256 f13b44725f4904ed3f5250d733b45b5815f54e8b588dfe6c6180918e80f35c6a +DIST NVIDIA-Linux-x86-295.53.run 34718461 SHA256 0040096216ac6f8695743c9124a067787d30947f7c64f2734bac474f5af0b0a0 +DIST NVIDIA-Linux-x86-295.59.run 34730118 SHA256 084bbb76c57d5c2a5b780322a95dcc230ec6e25b4f6c176574a93621399ce5a0 +DIST NVIDIA-Linux-x86-302.17.run 34598956 SHA256 3525d3814361bd202998cea2962bb3d1bb3419206d02fd8ac30d61358c1a284f +DIST NVIDIA-Linux-x86-304.22.run 35433519 SHA256 174be68a403f234cadd6dbac785459f7a7463989050fa4e6c92ed65b638ededb SHA512 885a0a8a7ecc387a9bbb806b2f36942d7bee2bdfdb784169490b72667db4218b76e19b4ebdecf107e1498f8e1d5544e3d44ae6b02cc6d6855431602e4afc3064 WHIRLPOOL ab691f2aded714b38afad1f6ff966dcb016cb409e4b78c37137aac439c06d2df112b74d72abf205526b65cae7d90a7e5f5081426d29e1cd310139511b77794c4 +DIST NVIDIA-Linux-x86-304.37.run 39349097 SHA256 ab3174a0c9ab37a8fc3f4a8fc1121d72fbdd5e00ddecf44f7dbd84bb8d51b337 +DIST NVIDIA-Linux-x86-304.88.run 39682604 SHA256 71e10294f073e31a387da4282b95cdde5fbfc996cb1c564f290eb0df1289b7cb SHA512 ba6f0236aead2f5161c94c7eaffb2497815ba1a7cbf872ae37d620d66533d4847acb6dfcc230e2b751aa9717ae552940ed6d3da1a9209aa54f6a810e3f551e49 WHIRLPOOL 9c2e0438630e86ca8c7aa2f26928113e5f15dcf808be8a4c2e937fd04b8d1aa7304bda714580834cc5ef4dc57304f41be62b55ee75545b9cfca3533b6db737e6 +DIST NVIDIA-Linux-x86-310.19.run 38581112 SHA256 85d082c06a1ea07f514d22c0de4d5d2af065bcac37c377c3d755904bbf780c2f SHA512 ef24e695b76b57cee1d13601c5856fe723da9da678e0f78739f0e291c5d00cea9e0da5b110f4125a79edd420127fed0a48883eaad591ed16e6660b139b7cb289 WHIRLPOOL 064bf26184b644210f565ad9b1b400abb26b9c8b61b519d2831ce04128fcc58c57e9474bb2ec5f3d935799857a1ca4c3273b68a36aca1d2285318f2679251f5e +DIST NVIDIA-Linux-x86-313.30.run 38845860 SHA256 0a0f10979b1bca8e4a244e204b58aeb9a580924a9dd7b11b21d15abfe1ad49ad SHA512 c3b07e7186fcf5a1f3e73f4e9510dddff2a42c0202bc471a946e38e636af27b2d17206b7105a7a80179fc17ebceab6c2802ff6ddaabae9e16a930dfa1252a2db WHIRLPOOL 2d4402883a480ae3050af18f3fe1aec4110132aa4eda0ce9675f79471a526e8b90b9ebe6a0a5c76321474be6ace963520b903cf809835472649b095be757ec52 +DIST NVIDIA-Linux-x86-325.15.run 27409286 SHA256 3d790e4bfed24641f7cc76879144ab5d52b12271012ba381b0d33aa1a2e08775 SHA512 48052c3daa8748a7c43de1c24e00fdd3f94cebbe7f5efbb185a0472a1d0bbab8adfe377359ccdc6cd8e437a80506fdd551408237b0842c194a3497c43cf3487e WHIRLPOOL 387fb8af1a31cc295abe7b15fee7d5bc01c515603b178abe7f50864dbbf0685ca50f88e67359adc4af8e90caaeb1fba95aa6af9f54e6fced46c82c5cfc094390 +DIST NVIDIA-Linux-x86-96.43.20-pkg0.run 10323541 SHA256 bc778062cf745ee4916de77a702f702312d33eeb3b6f379b63e4366fa5197517 +DIST NVIDIA-Linux-x86_64-173.14.31-pkg2.run 18967067 SHA256 c56cfe43c4fa95102d099e4f1c4e75e58b57d73b4b36a858d54a2a339aad56d9 SHA512 fcb3f004495c8e3ef93b4229b2b64e8ee83a12f2cc5ba1c33bf486b6bf8687e1e1d5b45c2da8721422f6c2190150f7f86bd4b9ec0987d4440343fafb9e18c208 WHIRLPOOL 585728e3d03b1a9cf90fd80c413f2dd432870f49df60bd1335ec0c7143b59005819b4fd655587b0f76d19c28eaa946d6893c4358b8ec7e33000486429684cd1f +DIST NVIDIA-Linux-x86_64-173.14.34-pkg2.run 19769116 SHA256 30dcdd3cfba4f7d2b5f4977faea573463700b44252e46fb43402e269183dec3e +DIST NVIDIA-Linux-x86_64-173.14.35-pkg2.run 19767039 SHA256 5af64646b098021b550242fe8eb03817f862af0442023545d1295027f589595f +DIST NVIDIA-Linux-x86_64-275.09.07.run 51646025 SHA256 747c09b0a0a8d60e1b5fee49fb1ea07ee5812f8e85a87b2403011af6de58164d +DIST NVIDIA-Linux-x86_64-280.13.run 55011572 SHA256 98a08c7d943912a178a9bbe419db60634088e5262ae9053bf2fe730984e5a012 +DIST NVIDIA-Linux-x86_64-285.05.09.run 56674677 SHA256 7159a1f7e898b50dd49ea2273ac6facb870546ad5496bf70c6fbe1642d2c4970 +DIST NVIDIA-Linux-x86_64-290.10.run 58334192 SHA256 34a2ab07f4ae7afdeb2c8415f3f37c1099e6690eb25f3dbef92eca771f7ce4cd +DIST NVIDIA-Linux-x86_64-295.20.run 58403208 SHA256 3b84fdeae335c047193f68a1da26f2a736461c35cfe94566fc7ace1e5762d34c +DIST NVIDIA-Linux-x86_64-295.33.run 58435170 SHA256 4e939bac1ebc03c6439969d638540b99900b0fe4e4799b4186e5ff9521d37b73 +DIST NVIDIA-Linux-x86_64-295.40.run 58446405 SHA256 f6d5ae338b3b8ac6c512d06b335010934a62728f181a1fa5253aa84b7bf45e7a +DIST NVIDIA-Linux-x86_64-295.49.run 58521195 SHA256 61dc9623ea1981f801d97de7c67c32b7e4f7ef4aaa6744910967cb634d9ace62 +DIST NVIDIA-Linux-x86_64-295.53.run 58522001 SHA256 4525e994a0d0a8cd776415401423e7de3985923637642955c3fe50a3d047d4ca +DIST NVIDIA-Linux-x86_64-295.59.run 58529480 SHA256 4b1d96389abd2b804ad470c5189142a02ee4c82c1ac56cea37ecb45e8051313e +DIST NVIDIA-Linux-x86_64-302.17.run 58653717 SHA256 5cf9059ebb70ade99e5621c0a605ed5bbb6c274f7c52a7ef40342ceb41b381fc +DIST NVIDIA-Linux-x86_64-304.22.run 60141600 SHA256 4c1b6f7dcda007622bb5e243b858abdb3881d5d5befdc617b23393545d9c96fd SHA512 06dac9e042baa836b1f2d9cd360b2ca3545dcff4b382ed9d29e8e442ab5e9dc241b5f75250c3dce73e0e7958bccaa16ac48415ae5f2fc7cbc65689bd7a6e7640 WHIRLPOOL a7d1a1abe5cdedc743b43fa1627dc9094ab32cea3645cdd5cfd53a33929d0a48f4d3efaa7311ff6f0ba99d31a112e6872cb4cad3d1cafbd996646020d8dd7f40 +DIST NVIDIA-Linux-x86_64-304.37.run 64075318 SHA256 cae75158047d0b97ea48f269fd2903a6731f53b978a1065720343436c97ca9c2 +DIST NVIDIA-Linux-x86_64-304.88.run 68041437 SHA256 c1a73211566b085214b0ad1824733aa56d09c6139f729feebd0eff44f6113da3 SHA512 8a907f9ed307b1e4b5563a9aba9d6c1c036885cd64a4a229d6831eb7a855921971e652b7940333e366d5088f97cf3596fb739853b3c3cf94446ee0cea6164ab2 WHIRLPOOL 2e43479bb52d1dcbe1007cda779ab21ed064883769358a09bdd765e55f6b35a855a51006e070d33ddd2a3808802cdb4fa2ae63cc7cc189561934d00574492ca8 +DIST NVIDIA-Linux-x86_64-310.19.run 68022245 SHA256 3326cf9eb432a10fee5cb663132cd6c175813d0225750ef237dcc7feefd20fca SHA512 035a0cb62f4d307683ada7fff380fbe8a9433cee0ee6a8b1986e9d59b55a23484305903f84e77fb6a7440e06efce012feae1da658a304e790e2022c028541a69 WHIRLPOOL 523a9ca07d18cfa1afb1f4e527cecf1c4778650eaa81d1e627fd1c65b4ab459d02e5ce726d0190c57e677c6ef3c22afef8c6aaa99892731faf3415138e9e7635 +DIST NVIDIA-Linux-x86_64-313.30.run 68379307 SHA256 72317f2e4c459c33c764e3283deb3e1615b1852ead1f9bfad82148e120506022 SHA512 ae4439697e47eff98e06e5f77de979bdce096f95efa8bdee9c6fc939b42b5ce3b11c23d7691e974cf0f6f783eeb0fb694670636538352a0e8979f88d687f1f86 WHIRLPOOL c12a68fcc4d78f3856d87a86cef43c3632c0db1b6c5799b6482584d4d83a7cc863b9b394a501b96534175e11663c602d72f6ffa49f85461eaf4324dc61e654ff +DIST NVIDIA-Linux-x86_64-325.15.run 48034648 SHA256 01446fbd94f6eb3b2e1b3d3f2b06970bf470c3ee2cb1838b3d0c2416e6c74500 SHA512 323cbd8e6f3ce29a1556b83b2fb3456f919964ede1cbee4ddaa3539ab75eda7abe26b96ba500462eed2ade4163b8de20d1db6ea987af923710f0e1a60e432e83 WHIRLPOOL 7c05717a2cfcb003a8c1f9fc5f5e24cfd5216aca7167ee8f29b60c43262fc61afab9619147ee07cb2541aa1d55b13a730b52c90979b7970df709fb659fe782ff +DIST NVIDIA-Linux-x86_64-96.43.20-pkg2.run 14572507 SHA256 562107a262e250b836966e29851628f6162ee2857d53252221c780d9b201de18 +EBUILD nvidia-userspace-173.14.31.ebuild 12005 SHA256 833741ccdcd472cc91db8da97226dd9c51ee4afa825e788f6f2db811211fea02 SHA512 17bdea337e4c2ce3beac8ffbb9a80e064cb24a35a73816454ae1dffde3d09ae166f572c486c5bf861a4e690920562004d50eaf7d2e651d6b96589495072af5b8 WHIRLPOOL 6fa4e0f0c61f1ddb62768b994bb55d519b3e64d790cd29eb8b89e1d2d91785a030a0678074a3e0369abaa7dbb6463af5f992b3a47b6c11d3040ccab0b7619f1d +EBUILD nvidia-userspace-173.14.34.ebuild 12005 SHA256 833741ccdcd472cc91db8da97226dd9c51ee4afa825e788f6f2db811211fea02 SHA512 17bdea337e4c2ce3beac8ffbb9a80e064cb24a35a73816454ae1dffde3d09ae166f572c486c5bf861a4e690920562004d50eaf7d2e651d6b96589495072af5b8 WHIRLPOOL 6fa4e0f0c61f1ddb62768b994bb55d519b3e64d790cd29eb8b89e1d2d91785a030a0678074a3e0369abaa7dbb6463af5f992b3a47b6c11d3040ccab0b7619f1d +EBUILD nvidia-userspace-173.14.35.ebuild 12005 SHA256 833741ccdcd472cc91db8da97226dd9c51ee4afa825e788f6f2db811211fea02 SHA512 17bdea337e4c2ce3beac8ffbb9a80e064cb24a35a73816454ae1dffde3d09ae166f572c486c5bf861a4e690920562004d50eaf7d2e651d6b96589495072af5b8 WHIRLPOOL 6fa4e0f0c61f1ddb62768b994bb55d519b3e64d790cd29eb8b89e1d2d91785a030a0678074a3e0369abaa7dbb6463af5f992b3a47b6c11d3040ccab0b7619f1d +EBUILD nvidia-userspace-275.09.07.ebuild 12387 SHA256 4f5982dd02fd6e76cf39691facb4b3a184ed863c1b4dc3670af07daf7e460ece SHA512 c836db66711a5b6259e02d9e1cd7ef6ccb67fd9b2b96f5f8688ebb9e94867f2dd278a7cad06ec43c6412f7b8ef1e04a4d01ec096efe8483af0e9f3f00fda6b61 WHIRLPOOL 613e80cb3b0969753291b44ef4a19e93aa0d5d4f148cbb3c1e316e2abab8a272b72ccbbbc5d89cf187ff3882d14a4c8e1c2081c334227c532ac7c9e09a3011f2 +EBUILD nvidia-userspace-280.13.ebuild 12387 SHA256 4f5982dd02fd6e76cf39691facb4b3a184ed863c1b4dc3670af07daf7e460ece SHA512 c836db66711a5b6259e02d9e1cd7ef6ccb67fd9b2b96f5f8688ebb9e94867f2dd278a7cad06ec43c6412f7b8ef1e04a4d01ec096efe8483af0e9f3f00fda6b61 WHIRLPOOL 613e80cb3b0969753291b44ef4a19e93aa0d5d4f148cbb3c1e316e2abab8a272b72ccbbbc5d89cf187ff3882d14a4c8e1c2081c334227c532ac7c9e09a3011f2 +EBUILD nvidia-userspace-285.05.09.ebuild 12387 SHA256 4f5982dd02fd6e76cf39691facb4b3a184ed863c1b4dc3670af07daf7e460ece SHA512 c836db66711a5b6259e02d9e1cd7ef6ccb67fd9b2b96f5f8688ebb9e94867f2dd278a7cad06ec43c6412f7b8ef1e04a4d01ec096efe8483af0e9f3f00fda6b61 WHIRLPOOL 613e80cb3b0969753291b44ef4a19e93aa0d5d4f148cbb3c1e316e2abab8a272b72ccbbbc5d89cf187ff3882d14a4c8e1c2081c334227c532ac7c9e09a3011f2 +EBUILD nvidia-userspace-290.10.ebuild 13317 SHA256 5e296159aefb2e9d847b93a4b28db035a887156167cd87741258e8fc9e246ea9 SHA512 d75cf9feb623afd772733ce749841aa472fb18e5e090482df0b8444645c9da59d0d7410787ffbcb670dae013d87a9d5744cf887a07a647cba4feedc53f83414e WHIRLPOOL 58ab3ecc1acb51d0bcb74165d13738a825aaaa059c962ea52e5f40a1f0d7591a747d3e0afeae4e0d6b42795d389c3e804cd8de93addc7250fc4544470a55b6f6 +EBUILD nvidia-userspace-295.20.ebuild 13317 SHA256 5e296159aefb2e9d847b93a4b28db035a887156167cd87741258e8fc9e246ea9 SHA512 d75cf9feb623afd772733ce749841aa472fb18e5e090482df0b8444645c9da59d0d7410787ffbcb670dae013d87a9d5744cf887a07a647cba4feedc53f83414e WHIRLPOOL 58ab3ecc1acb51d0bcb74165d13738a825aaaa059c962ea52e5f40a1f0d7591a747d3e0afeae4e0d6b42795d389c3e804cd8de93addc7250fc4544470a55b6f6 +EBUILD nvidia-userspace-295.33.ebuild 13821 SHA256 e3048a55ccf9cf7c8310b225885dbaae713b5fd51fa67059f372a347a1d90c35 SHA512 758f5f1a618c5baf98087175ff4c00bc63aa96955317dcfca40f8b25e66fd6a294809b203e6834fc9080f43f005f2728f1c4689bea0cdefab52d8c50cbf87547 WHIRLPOOL 8872b9c1779343196e0129310820d2d91bef47f06b1156149fbf52dacca83e0f3b048d19cbb4ed5af2b2487acd057fbf5b3bc6b3ceb5f1bafd4034301652d805 +EBUILD nvidia-userspace-295.40.ebuild 13975 SHA256 aebd97275f8ce491ca6e962d6e956982ae04ca803e9abbc4623b3f623f3b50f4 SHA512 fe0f3ebaff68517938d00e270f3bae0f5ab964933e0065e6226a93181b2e4dc2c06a9242c8788b6795c0e6cbfcd25b1cc7f8f8567243c8c2fadb6f61c952d383 WHIRLPOOL b31d65669984e41fb35747253fdfd6f23efee54fec07b9fdd58106d48fbed074e8a2be5381305f3aff14d01e5190c9d85472be91026876f50563cbb76ef65c69 +EBUILD nvidia-userspace-295.49.ebuild 13911 SHA256 a0d5b8a573e41a10b8201a6a4ecb854c6fca20107c28cdc298b59dd506ac28c9 SHA512 4ba775bcec98b8f4b9150bf3127884c422a8263918fc2c06983895622e70d9a603672cfdc29afe01d8c449b9c6ee49408066205194795bd59cd6e9493fc40f77 WHIRLPOOL d745cd7dce11da262472d0ba749002cd799241b4529b57ecdabf6f29ef13751e33b751fda2563e30b8f26d8cf3d040d36880af60171f1aacd5fbe7ab2098122e +EBUILD nvidia-userspace-295.53.ebuild 13914 SHA256 cfbcdd6c3e928bf3d0f2ed4c501d491707d338c43d7080aed9dc781188a065c3 SHA512 d8bd0b9af6b44254448814ddc477c2cadffdc5e6a8b70b50ca65b203d97cf94910a50c6b39861550754b9ef1f4ea7edbf2fc0e466c04993459aecb5db631ea09 WHIRLPOOL d503f8302d652a715d2c52077629f9560fa3012694b1ae6410c815ea461f242d95dbafa2248224e15dc0d5353bc1afd5cb8f9540f19428332c184a10e1028a6b +EBUILD nvidia-userspace-295.59.ebuild 13914 SHA256 cfbcdd6c3e928bf3d0f2ed4c501d491707d338c43d7080aed9dc781188a065c3 SHA512 d8bd0b9af6b44254448814ddc477c2cadffdc5e6a8b70b50ca65b203d97cf94910a50c6b39861550754b9ef1f4ea7edbf2fc0e466c04993459aecb5db631ea09 WHIRLPOOL d503f8302d652a715d2c52077629f9560fa3012694b1ae6410c815ea461f242d95dbafa2248224e15dc0d5353bc1afd5cb8f9540f19428332c184a10e1028a6b +EBUILD nvidia-userspace-302.17.ebuild 13914 SHA256 cfbcdd6c3e928bf3d0f2ed4c501d491707d338c43d7080aed9dc781188a065c3 SHA512 d8bd0b9af6b44254448814ddc477c2cadffdc5e6a8b70b50ca65b203d97cf94910a50c6b39861550754b9ef1f4ea7edbf2fc0e466c04993459aecb5db631ea09 WHIRLPOOL d503f8302d652a715d2c52077629f9560fa3012694b1ae6410c815ea461f242d95dbafa2248224e15dc0d5353bc1afd5cb8f9540f19428332c184a10e1028a6b +EBUILD nvidia-userspace-304.22.ebuild 13914 SHA256 cfbcdd6c3e928bf3d0f2ed4c501d491707d338c43d7080aed9dc781188a065c3 SHA512 d8bd0b9af6b44254448814ddc477c2cadffdc5e6a8b70b50ca65b203d97cf94910a50c6b39861550754b9ef1f4ea7edbf2fc0e466c04993459aecb5db631ea09 WHIRLPOOL d503f8302d652a715d2c52077629f9560fa3012694b1ae6410c815ea461f242d95dbafa2248224e15dc0d5353bc1afd5cb8f9540f19428332c184a10e1028a6b +EBUILD nvidia-userspace-304.37.ebuild 11033 SHA256 c565684dab4d781f3359d8f318a96136121aeb9e41120018e750e7ee9e3686af SHA512 e9e624f8bbfbdb3d6d82dbcd5f5c159e928089336ac7fef8b9f65add102906898ffd1c75072d740afacad13a09bbb083b7c1d6b225589fffc35b96b2eb7d7557 WHIRLPOOL 52622805e659098dc498ca35410614233a49dda9b00bd573cc8ad04e3885121a3263023af89619ad53d09f6f97c07fde43bc1a0402ae1e91fa36e92c181da78c +EBUILD nvidia-userspace-304.88.ebuild 10889 SHA256 3d9cfe556bd0ebdf02852cf35722ca20cf2d190aee5fc50ae96983969a7d4fae SHA512 88f12c3172891dce3c28e52c75a07009a8c82afc3ed90ca6102bde0f07d67539460ac47e0c4dff8965461c3d7ccbbab0df8e2ff1bde71fb71c29c0e4209f07ce WHIRLPOOL 10b6737f18948e097a36fddd24d2d524db4e107088f1087fb5f2fe40951381b2eedccd818c21d46364cc0d28881c8ff0de84bb7156d237e69809c694ee098979 +EBUILD nvidia-userspace-310.19.ebuild 11033 SHA256 c565684dab4d781f3359d8f318a96136121aeb9e41120018e750e7ee9e3686af SHA512 e9e624f8bbfbdb3d6d82dbcd5f5c159e928089336ac7fef8b9f65add102906898ffd1c75072d740afacad13a09bbb083b7c1d6b225589fffc35b96b2eb7d7557 WHIRLPOOL 52622805e659098dc498ca35410614233a49dda9b00bd573cc8ad04e3885121a3263023af89619ad53d09f6f97c07fde43bc1a0402ae1e91fa36e92c181da78c +EBUILD nvidia-userspace-313.30.ebuild 10536 SHA256 9fd2bd062749c4664e40c535c3faeeccef873bdaaf2c00654c2e9be409f900e0 SHA512 20c97cfe5e65725227841e5114aeebd95c27724fe12534866ad3f5144a0ea95fab9ab366c3181004927754bf7b05053cfd01532593edb186210cf129ab3ee1bb WHIRLPOOL 50e8356b1d5ad963fc1ce1cb55ccc1ebca1c306745efddcf6c2be41f45e01446ae13bd174a217efa84aad9b2c40dbc207a420e13eec7a6dbf36bd0697ce23cee +EBUILD nvidia-userspace-325.15.ebuild 10292 SHA256 4a36898b9a90f6ae417d0ca30f07f0f5d040053d6b8573710c3c2774bf299ffb SHA512 9b4107c282fefbe65f7d8681e1a31c3a8b6761586222a3fa5f278f50e02f1406a118318522d997fef876b0d7404b17aec664733f49338b37a47fd2ba9414abbe WHIRLPOOL 6ac6f63d94be18f745bdcd53735a9e11cd3a4a3bba291043667a892b15d37481c2d576dd6508d6a033c8ccc0a685e9c8f0fae60e0f2e32bf14b968e0f938ad9c +EBUILD nvidia-userspace-96.43.20.ebuild 12041 SHA256 d4e32f4ad2a2500bc633c64ec5c31c2b02dfc6219b5a57e9dfb66e0e3ab4bf29 SHA512 05b98b39db9d27f31401d744ee2f986beb31a260317ac07503a1b1e5fc5abdd0762c75989d60d343c9d2f6afa76d224015f12fd0aaf40ffe4fcf5f36f8f67c8f WHIRLPOOL 55801e45401d10015a0fad112eafdd7aa7ebd99bdb3ccc31cf202e657788e2bddef09f7c635f62590deb060222cd0bcde24e622da65a3e986bfbe501582f3ea0 +MISC metadata.xml 340 SHA256 a8c83e426e095e92dc8d7553bde38172a3bb73717ec0469c78dba0a46f86194d SHA512 757fe60892996ee752008276a385ed2ba785837723beac28744e414d19e2312f956e300559519005ff3d465db2593e61804e6b7907e1faaf551d2633cf09c6aa WHIRLPOOL 483042f678dacfba03244f676d5b47035de23751c6cf306c87d0ff12856ca3dd8ce10bc826bdc90bcb1b9be8a673cc68fbe506998bac564f0a55d7bf64481fe8 diff --git a/x11-drivers/nvidia-userspace/files/09nvidia b/x11-drivers/nvidia-userspace/files/09nvidia new file mode 100644 index 00000000..1fcbef41 --- /dev/null +++ b/x11-drivers/nvidia-userspace/files/09nvidia @@ -0,0 +1,2 @@ +# Has to precede X11's own libraries! +LDPATH=/opt/nvidia/lib diff --git a/x11-drivers/nvidia-userspace/files/90mutter-disable-culling b/x11-drivers/nvidia-userspace/files/90mutter-disable-culling new file mode 100644 index 00000000..d9b64408 --- /dev/null +++ b/x11-drivers/nvidia-userspace/files/90mutter-disable-culling @@ -0,0 +1,2 @@ +# See https://bugzilla.gnome.org/show_bug.cgi?id=664858 +CLUTTER_PAINT=disable-clipped-redraws:disable-culling diff --git a/x11-drivers/nvidia-userspace/files/NVIDIA_glx-defines.patch b/x11-drivers/nvidia-userspace/files/NVIDIA_glx-defines.patch new file mode 100644 index 00000000..da9933f6 --- /dev/null +++ b/x11-drivers/nvidia-userspace/files/NVIDIA_glx-defines.patch @@ -0,0 +1,11 @@ +diff -ur NVIDIA_GLX-1.0-4191/usr/include/GL/glx.h NVIDIA_GLX-1.0-4191.new/usr/include/GL/glx.h +--- NVIDIA_GLX-1.0-4191/usr/include/GL/glx.h 2002-12-09 21:26:55.000000000 +0100 ++++ NVIDIA_GLX-1.0-4191.new/usr/include/GL/glx.h 2003-01-30 18:20:23.000000000 +0100 +@@ -39,6 +39,7 @@ + typedef XID GLXPixmap; + typedef XID GLXDrawable; + typedef XID GLXPbuffer; ++typedef XID GLXPbufferSGIX; + typedef XID GLXWindow; + typedef XID GLXFBConfigID; + diff --git a/x11-drivers/nvidia-userspace/files/NVIDIA_glx-glheader.patch b/x11-drivers/nvidia-userspace/files/NVIDIA_glx-glheader.patch new file mode 100644 index 00000000..e0393e1b --- /dev/null +++ b/x11-drivers/nvidia-userspace/files/NVIDIA_glx-glheader.patch @@ -0,0 +1,13 @@ +--- usr/include/GL/gl.g.orig 2004-07-17 19:56:59.789410584 +1000 ++++ usr/include/GL/gl.h 2004-07-17 19:59:08.844791184 +1000 +@@ -66,6 +66,10 @@ + typedef double GLclampd; + typedef void GLvoid; + ++/* Patching for some better defines in the global system */ ++#ifndef GL_GLEXT_LEGACY ++#include <GL/glext.h> ++#endif + + /*************************************************************/ + diff --git a/x11-drivers/nvidia-userspace/files/eblits/donvidia.eblit b/x11-drivers/nvidia-userspace/files/eblits/donvidia.eblit new file mode 100644 index 00000000..75b39cfb --- /dev/null +++ b/x11-drivers/nvidia-userspace/files/eblits/donvidia.eblit @@ -0,0 +1,21 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/files/eblits/donvidia.eblit,v 1.1 2008/12/18 18:27:35 cardoe Exp $ + +# Install nvidia library: +# the first parameter is the place where to install it +# the second parameter is the base name of the library +# the third parameter is the provided soversion +donvidia() { + dodir $1 + exeinto $1 + + libname=$(basename $2) + + # libnvidia-cfg.so is no longer supplied in lib32; step over it gracefully + if [ -e $2.$3 ] ; then + doexe $2.$3 + dosym ${libname}.$3 $1/${libname} + [[ $3 != "1" ]] && dosym ${libname}.$3 $1/${libname}.1 + fi +} diff --git a/x11-drivers/nvidia-userspace/files/eblits/mtrr_check.eblit b/x11-drivers/nvidia-userspace/files/eblits/mtrr_check.eblit new file mode 100644 index 00000000..b14df34b --- /dev/null +++ b/x11-drivers/nvidia-userspace/files/eblits/mtrr_check.eblit @@ -0,0 +1,19 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/files/eblits/mtrr_check.eblit,v 1.1 2008/12/18 18:27:35 cardoe Exp $ + +mtrr_check() { + ebegin "Checking for MTRR support" + linux_chkconfig_present MTRR + eend $? + + if [[ $? -ne 0 ]] ; then + eerror "Please enable MTRR support in your kernel config, found at:" + eerror + eerror " Processor type and features" + eerror " [*] MTRR (Memory Type Range Register) support" + eerror + eerror "and recompile your kernel ..." + die "MTRR support not detected!" + fi +} diff --git a/x11-drivers/nvidia-userspace/files/eblits/src_install-libs.eblit b/x11-drivers/nvidia-userspace/files/eblits/src_install-libs.eblit new file mode 100644 index 00000000..e48d11ce --- /dev/null +++ b/x11-drivers/nvidia-userspace/files/eblits/src_install-libs.eblit @@ -0,0 +1,116 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distribnuted under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/files/eblits/src_install-libs.eblit,v 1.1 2008/12/18 18:27:35 cardoe Exp $ +# +src_install-libs() { + local pkglibdir=lib + local inslibdir=$(get_libdir) + + if [[ ${#} -eq 2 ]] ; then + pkglibdir=${1} + inslibdir=${2} + elif has_multilib_profile && [[ ${ABI} == "x86" ]] ; then + pkglibdir=lib32 + fi + + local usrpkglibdir=usr/${pkglibdir} + local libdir=usr/X11R6/${pkglibdir} + local drvdir=${libdir}/modules/drivers + local extdir=${libdir}/modules/extensions + local incdir=usr/include/GL + local sover=${PV} + local NV_ROOT="/usr/${inslibdir}/opengl/nvidia" + local NO_TLS_ROOT="${NV_ROOT}/no-tls" + local TLS_ROOT="${NV_ROOT}/tls" + local X11_LIB_DIR="/usr/${inslibdir}/xorg" + + if use x86-fbsd; then + # on FreeBSD everything is on obj/ + pkglibdir=obj + usrpkglibdir=obj + x11pkglibdir=obj + drvdir=obj + extdir=obj + + # don't ask me why the headers are there.. glxext.h is missing + incdir=doc + + # on FreeBSD it has just .1 suffix + sover=1 + fi + + # The GLX libraries + donvidia ${NV_ROOT}/lib ${usrpkglibdir}/libGL.so ${sover} + donvidia ${NV_ROOT}/lib ${usrpkglibdir}/libGLcore.so ${sover} + + donvidia ${NV_ROOT}/lib ${usrpkglibdir}/libnvidia-cfg.so ${sover} + + dodir ${NO_TLS_ROOT} + donvidia ${NO_TLS_ROOT} ${usrpkglibdir}/libnvidia-tls.so ${sover} + + if ! use x86-fbsd; then + donvidia ${TLS_ROOT} ${usrpkglibdir}/tls/libnvidia-tls.so ${sover} + fi + + if want_tls ; then + dosym ../tls/libnvidia-tls.so ${NV_ROOT}/lib + dosym ../tls/libnvidia-tls.so.1 ${NV_ROOT}/lib + dosym ../tls/libnvidia-tls.so.${sover} ${NV_ROOT}/lib + else + dosym ../no-tls/libnvidia-tls.so ${NV_ROOT}/lib + dosym ../no-tls/libnvidia-tls.so.1 ${NV_ROOT}/lib + dosym ../no-tls/libnvidia-tls.so.${sover} ${NV_ROOT}/lib + fi + + if ! use x86-fbsd; then + # Install the .la file for libtool, to prevent e.g. bug #176423 + [ -f "${FILESDIR}/libGL.la-r2" ] || die "libGL.la-r2 missing in FILESDIR" + local ver1=$(get_version_component_range 1) + local ver2=$(get_version_component_range 2) + local ver3=$(get_version_component_range 3) + sed -e "s:\${PV}:${PV}:" \ + -e "s:\${ver1}:${ver1}:" \ + -e "s:\${ver2}:${ver2}:" \ + -e "s:\${ver3}:${ver3}:" \ + -e "s:\${libdir}:${inslibdir}:" \ + "${FILESDIR}"/libGL.la-r2 > "${D}"/${NV_ROOT}/lib/libGL.la + fi + + exeinto ${X11_LIB_DIR}/modules/drivers + + [[ -f ${drvdir}/nvidia_drv.so ]] && \ + doexe ${drvdir}/nvidia_drv.so + + insinto /usr/${inslibdir} + [[ -f ${libdir}/libXvMCNVIDIA.a ]] && \ + doins ${libdir}/libXvMCNVIDIA.a + exeinto /usr/${inslibdir} + # fix Bug 131315 + [[ -f ${libdir}/libXvMCNVIDIA.so.${PV} ]] && \ + doexe ${libdir}/libXvMCNVIDIA.so.${PV} && \ + dosym libXvMCNVIDIA.so.${PV} \ + /usr/${inslibdir}/libXvMCNVIDIA.so + + exeinto ${NV_ROOT}/extensions + [[ -f ${libdir}/modules/libnvidia-wfb.so.${sover} ]] && \ + newexe ${libdir}/modules/libnvidia-wfb.so.${sover} libwfb.so + [[ -f ${extdir}/libglx.so.${sover} ]] && \ + newexe ${extdir}/libglx.so.${sover} libglx.so + + # Includes + insinto ${NV_ROOT}/include + doins ${incdir}/*.h + + #cuda + if [[ -f usr/include/cuda/cuda.h ]]; then + dodir /usr/include/cuda + insinto /usr/include/cuda + doins usr/include/cuda/*.h + + if [[ -f usr/${pkglibdir}/libcuda.so.${PV} ]]; then + dolib.so usr/${pkglibdir}/libcuda.so.${PV} + dosym libcuda.so.${PV} /usr/${inslibdir}/libcuda.so.1 + dosym libcuda.so.1 /usr/${inslibdir}/libcuda.so + fi + fi +} diff --git a/x11-drivers/nvidia-userspace/files/eblits/want_tls.eblit b/x11-drivers/nvidia-userspace/files/eblits/want_tls.eblit new file mode 100644 index 00000000..4debb85d --- /dev/null +++ b/x11-drivers/nvidia-userspace/files/eblits/want_tls.eblit @@ -0,0 +1,33 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/files/eblits/want_tls.eblit,v 1.1 2008/12/18 18:27:35 cardoe Exp $ + +want_tls() { + # For uclibc or anything non glibc, return false + has_version sys-libs/glibc || return 1 + + # Old versions of glibc were lt/no-tls only + has_version '<sys-libs/glibc-2.3.2' && return 1 + + if use x86 ; then + case ${CHOST/-*} in + i486|i586|i686) ;; + *) return 1 ;; + esac + fi + + # If we've got nptl, we've got tls + built_with_use --missing true sys-libs/glibc nptl && return 0 + + # 2.3.5 turned off tls for linuxthreads glibc on i486 and i586 + if use x86 && has_version '>=sys-libs/glibc-2.3.5' ; then + case ${CHOST/-*} in + i486|i586) return 1 ;; + esac + fi + + # These versions built linuxthreads version to support tls, too + has_version '>=sys-libs/glibc-2.3.4.20040619-r2' && return 0 + + return 1 +} diff --git a/x11-drivers/nvidia-userspace/files/libGL.la-r2 b/x11-drivers/nvidia-userspace/files/libGL.la-r2 new file mode 100644 index 00000000..863d1844 --- /dev/null +++ b/x11-drivers/nvidia-userspace/files/libGL.la-r2 @@ -0,0 +1,32 @@ +# libGL.la - a libtool library file +# Generated by ltmain.sh - GNU libtool 1.4 (1.920 2001/04/24 23:26:18) +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='libGL.so.1' + +# Names of this library. +library_names='libGL.so.${PV} libGL.so.1 libGL.so' + +# The name of the static archive. +old_library='' + +# Libraries that this one depends upon. +dependency_libs='-L/usr/${libdir} -lm -lX11 -lXext -ldl' + +# Version information for libGL. +current=${ver1} +age=${ver2} +revision=${ver3} + +# Is this an already installed library? +installed=yes + +# Files to dlopen/dlpreopen +dlopen='' +dlpreopen='' + +# Directory that this library needs to be installed in: +libdir='/usr/${libdir}' diff --git a/x11-drivers/nvidia-userspace/files/nvidia b/x11-drivers/nvidia-userspace/files/nvidia new file mode 100644 index 00000000..7cf0f7c0 --- /dev/null +++ b/x11-drivers/nvidia-userspace/files/nvidia @@ -0,0 +1,40 @@ +# Nvidia drivers support +alias char-major-195 nvidia +alias /dev/nvidiactl char-major-195 + +# To tweak the driver the following options can be used, note that +# you should be careful, as it could cause instability!! For more +# options see /usr/share/doc/PACKAGE/README +# +# To enable Side Band Adressing: NVreg_EnableAGPSBA=1 +# +# To enable Fast Writes: NVreg_EnableAGPFW=1 +# +# To enable both for instance, uncomment following line: +# +#options nvidia NVreg_EnableAGPSBA=1 NVreg_EnableAGPFW=1 +# If you have a mobile chip, you may need to enable this option +# if you have hard lockups when starting X. +# +# See: Appendix I. Configuring your laptop +# In /usr/share/doc/PACKAGE/README for full details +# +# Choose the appropriate value for NVreg_Mobile from the table: +# Value Meaning +# ---------- -------------------------------------------------- +# 0xFFFFFFFF let the kernel module autodetect the correct value +# 1 Dell laptops +# 2 non-Compal Toshiba laptops +# 3 all other laptops +# 4 Compal Toshiba laptops +# 5 Gateway laptops +# +#options nvidia NVreg_SoftEDIDs=0 NVreg_Mobile=3 + + +# !!! SECURITY WARNING !!! +# DO NOT MODIFY OR REMOVE THE DEVICE FILE RELATED OPTIONS UNLESS YOU KNOW +# WHAT YOU ARE DOING. +# ONLY ADD TRUSTED USERS TO THE VIDEO GROUP, THESE USERS MAY BE ABLE TO CRASH, +# COMPROMISE, OR IRREPARABLY DAMAGE THE MACHINE. +options nvidia NVreg_DeviceFileMode=432 NVreg_DeviceFileUID=0 NVreg_DeviceFileGID=VIDEOGID NVreg_ModifyDeviceFiles=1 diff --git a/x11-drivers/nvidia-userspace/files/nvidia-169.07 b/x11-drivers/nvidia-userspace/files/nvidia-169.07 new file mode 100644 index 00000000..a96b0cd1 --- /dev/null +++ b/x11-drivers/nvidia-userspace/files/nvidia-169.07 @@ -0,0 +1,14 @@ +# Nvidia drivers support +alias char-major-195 nvidia +alias /dev/nvidiactl char-major-195 + +# To tweak the driver the following options can be used, note that +# you should be careful, as it could cause instability!! For more +# options see /usr/share/doc/PACKAGE/README +# +# !!! SECURITY WARNING !!! +# DO NOT MODIFY OR REMOVE THE DEVICE FILE RELATED OPTIONS UNLESS YOU KNOW +# WHAT YOU ARE DOING. +# ONLY ADD TRUSTED USERS TO THE VIDEO GROUP, THESE USERS MAY BE ABLE TO CRASH, +# COMPROMISE, OR IRREPARABLY DAMAGE THE MACHINE. +options nvidia NVreg_DeviceFileMode=432 NVreg_DeviceFileUID=0 NVreg_DeviceFileGID=VIDEOGID NVreg_ModifyDeviceFiles=1 diff --git a/x11-drivers/nvidia-userspace/files/nvidia-smi.init b/x11-drivers/nvidia-userspace/files/nvidia-smi.init new file mode 100644 index 00000000..2cfd4c43 --- /dev/null +++ b/x11-drivers/nvidia-userspace/files/nvidia-smi.init @@ -0,0 +1,25 @@ +#!/sbin/runscript +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/files/nvidia-smi.init,v 1.1 2012/07/22 21:08:43 cardoe Exp $ + +pidfile="/var/run/nvidia-smi.pid" + +depend() { + after modules +} + +start() { + ebegin "Starting NVIDIA System Management Interface" + rm -f ${pidfile} + start-stop-daemon --start --quiet --pidfile ${pidfile} \ + --make-pidfile --background --exec /opt/bin/nvidia-smi -- \ + -q -l 300 + eend $? +} + +stop() { + ebegin "Stopping NVIDIA System Management Interface" + start-stop-daemon --stop --quiet --pidfile ${pidfile} + eend $? +} diff --git a/x11-drivers/nvidia-userspace/files/nvidia-udev.sh b/x11-drivers/nvidia-userspace/files/nvidia-udev.sh new file mode 100644 index 00000000..9487b08e --- /dev/null +++ b/x11-drivers/nvidia-userspace/files/nvidia-udev.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +if [ $# -ne 1 ]; then + echo "Invalid args" >&2 + exit 1 +fi + +case $1 in + add|ADD) + /opt/bin/nvidia-smi > /dev/null + ;; + remove|REMOVE) + rm -f /dev/nvidia* + ;; +esac + +exit 0 diff --git a/x11-drivers/nvidia-userspace/files/nvidia.udev-rule b/x11-drivers/nvidia-userspace/files/nvidia.udev-rule new file mode 100644 index 00000000..2eb30bb0 --- /dev/null +++ b/x11-drivers/nvidia-userspace/files/nvidia.udev-rule @@ -0,0 +1,6 @@ +ACTION=="add", DEVPATH=="/module/nvidia", SUBSYSTEM=="module", RUN+="nvidia-udev.sh $env{ACTION}" +# Previously the ACTION was "add|remove" but one user on bug #376527 had a +# problem until he recompiled udev-171-r5, which is one of the versions I +# tested with and it was fine. I'm breaking the rules out just to be safe +# so someone else doesn't have an issue +ACTION=="remove", DEVPATH=="/module/nvidia", SUBSYSTEM=="module", RUN+="nvidia-udev.sh $env{ACTION}" diff --git a/x11-drivers/nvidia-userspace/metadata.xml b/x11-drivers/nvidia-userspace/metadata.xml new file mode 100644 index 00000000..b4cf3e70 --- /dev/null +++ b/x11-drivers/nvidia-userspace/metadata.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<herd>no-herd</herd> +<maintainer> + <email>lxnay@gentoo.org</email> + <description>General maintainer</description> +</maintainer> +<longdescription>NVIDIA X11 driver and GLX libraries</longdescription> +</pkgmetadata> diff --git a/x11-drivers/nvidia-userspace/nvidia-userspace-173.14.31.ebuild b/x11-drivers/nvidia-userspace/nvidia-userspace-173.14.31.ebuild new file mode 100644 index 00000000..dc517c8c --- /dev/null +++ b/x11-drivers/nvidia-userspace/nvidia-userspace-173.14.31.ebuild @@ -0,0 +1,395 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI="2" + +inherit eutils unpacker multilib portability versionator flag-o-matic + +X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}" +AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}" +X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}" + +DESCRIPTION="NVIDIA X11 userspace libraries and applications" +HOMEPAGE="http://www.nvidia.com/" +SRC_URI="x86? ( ftp://download.nvidia.com/XFree86/Linux-x86/${PV}/${X86_NV_PACKAGE}-pkg0.run ) + amd64? ( ftp://download.nvidia.com/XFree86/Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}-pkg2.run ) + x86-fbsd? ( ftp://download.nvidia.com/freebsd/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )" + +LICENSE="NVIDIA" +SLOT="0" +KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd" +IUSE="multilib kernel_linux" +RESTRICT="strip" +EMULTILIB_PKG="true" + +COMMON="x11-base/xorg-server + kernel_linux? ( >=sys-libs/glibc-2.6.1 ) + multilib? ( app-emulation/emul-linux-x86-opengl ) + >=app-admin/eselect-opengl-1.0.9" +DEPEND="${COMMON} + kernel_linux? ( virtual/linux-sources )" +RDEPEND="${COMMON} + !<x11-drivers/nvidia-userspace-${PV} + !>x11-drivers/nvidia-userspace-${PV}" +PDEPEND="" + +QA_TEXTRELS_x86="usr/lib/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/xorg/modules/drivers/nvidia_drv.so + usr/lib/libcuda.so.${PV} + usr/lib/libnvidia-cfg.so.${PV} + usr/lib/libvdpau_nvidia.so.${PV} + usr/lib/libXvMCNVIDIA.so.${PV}" + +QA_TEXTRELS_x86_fbsd="boot/modules/nvidia.ko + usr/lib/opengl/nvidia/lib/libGL.so.1 + usr/lib/opengl/nvidia/lib/libGLcore.so.1 + usr/lib/libnvidia-cfg.so.1 + usr/lib/opengl/nvidia/extensions/libglx.so.1 + usr/lib/xorg/modules/drivers/nvidia_drv.so" + +QA_TEXTRELS_amd64="usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib32/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/libcuda.so.${PV} + usr/lib32/libvdpau_nvidia.so.${PV}" + +QA_EXECSTACK_x86="usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/xorg/modules/drivers/nvidia_drv.so + usr/lib/libXvMCNVIDIA.a:NVXVMC.o" + +QA_EXECSTACK_amd64="usr/lib32/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/libnvcompiler.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV} + usr/lib64/libXvMCNVIDIA.a:NVXVMC.o + usr/lib64/libnvidia-cfg.so.${PV} + usr/lib64/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/xorg/modules/drivers/nvidia_drv.so + usr/bin/nvidia-smi + usr/bin/nvidia-xconfig" + +QA_WX_LOAD_x86="usr/lib/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/libXvMCNVIDIA.a" + +QA_WX_LOAD_amd64="usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so.${PV}" + +QA_SONAME_amd64="usr/lib64/libnvcompiler.so.${PV}" + +QA_DT_HASH_amd64="usr/lib32/libcuda.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib32/libvdpau_nvidia.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV} + usr/lib64/libcuda.so.${PV} + usr/lib64/libnvidia-cfg.so.${PV} + usr/lib64/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/xorg/modules/drivers/nvidia_drv.so + usr/lib64/libvdpau_nvidia.so.${PV} + usr/bin/nvidia-smi + usr/bin/nvidia-xconfig" + +QA_DT_HASH_x86="usr/lib/libcuda.so.${PV} + usr/lib/libnvidia-cfg.so.${PV} + usr/lib/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/xorg/modules/drivers/nvidia_drv.so + usr/lib/libXvMCNVIDIA.so.${PV} + usr/lib/libvdpau_nvidia.so.${PV} + usr/bin/nvidia-smi + usr/bin/nvidia-xconfig" + +if use x86; then + PKG_V="-pkg0" + NV_PACKAGE="${X86_NV_PACKAGE}" +elif use amd64; then + PKG_V="-pkg2" + NV_PACKAGE="${AMD64_NV_PACKAGE}" +elif use x86-fbsd; then + PKG_V="" + NV_PACKAGE="${X86_FBSD_NV_PACKAGE}" +fi + +S="${WORKDIR}/${NV_PACKAGE}${PKG_V}" + +pkg_setup() { + # try to turn off distcc and ccache for people that have a problem with it + export DISTCC_DISABLE=1 + export CCACHE_DISABLE=1 + + if use amd64 && has_multilib_profile && [ "${DEFAULT_ABI}" != "amd64" ]; then + eerror "This ebuild doesn't currently support changing your default abi." + die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}" + fi + + # On BSD userland it wants real make command + use userland_BSD && MAKE="$(get_bmake)" + + export _POSIX2_VERSION="199209" + + # set variables to where files are in the package structure + if use kernel_FreeBSD; then + NV_DOC="${S}/doc" + NV_EXEC="${S}/obj" + NV_LIB="${S}/obj" + NV_SRC="${S}/src" + NV_MAN="${S}/x11/man" + NV_X11="${S}/obj" + NV_X11_DRV="${NV_X11}" + NV_X11_EXT="${NV_X11}" + NV_SOVER=1 + elif use kernel_linux; then + NV_DOC="${S}/usr/share/doc" + NV_EXEC="${S}/usr/bin" + NV_LIB="${S}/usr/lib" + NV_SRC="${S}/usr/src/nv" + NV_MAN="${S}/usr/share/man/man1" + NV_X11="${S}/usr/X11R6/lib" + NV_X11_DRV="${NV_X11}/modules/drivers" + NV_X11_EXT="${NV_X11}/modules/extensions" + NV_SOVER=${PV} + else + die "Could not determine proper NVIDIA package" + fi +} + +src_unpack() { + if ! use x86-fbsd; then + mkdir "${S}" + cd "${S}" + unpack_makeself + else + unpack ${A} + fi +} + +src_prepare() { + # Please add a brief description for every added patch + use x86-fbsd && cd doc + + # Use the correct defines to make gtkglext build work + epatch "${FILESDIR}"/NVIDIA_glx-defines.patch + # Use some more sensible gl headers and make way for new glext.h + epatch "${FILESDIR}"/NVIDIA_glx-glheader.patch +} + +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 x86-fbsd; then + MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \ + LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die + fi +} + +src_install() { + if use kernel_linux; then + VIDEOGROUP="$(egetent group video | cut -d ':' -f 3)" + if [ -z "$VIDEOGROUP" ]; then + eerror "Failed to determine the video group gid." + die "Failed to determine the video group gid." + fi + + # Add the aliases + [ -f "${FILESDIR}/nvidia-169.07" ] || die "nvidia missing in FILESDIR" + sed -e 's:PACKAGE:'${PF}':g' \ + -e 's:VIDEOGID:'${VIDEOGROUP}':' "${FILESDIR}"/nvidia-169.07 > \ + "${WORKDIR}"/nvidia + insinto /etc/modprobe.d + newins "${WORKDIR}"/nvidia nvidia.conf || die + fi + + # NVIDIA kernel <-> userspace driver config lib + dolib.so ${NV_LIB}/libnvidia-cfg.so.${NV_SOVER} || \ + die "failed to install libnvidia-cfg" + + # Xorg DDX driver + insinto /usr/$(get_libdir)/xorg/modules/drivers + doins ${NV_X11_DRV}/nvidia_drv.so || die "failed to install nvidia_drv.so" + + # Xorg GLX driver + insinto /usr/$(get_libdir)/opengl/nvidia/extensions + doins ${NV_X11_EXT}/libglx.so.${NV_SOVER} || \ + die "failed to install libglx.so" + dosym /usr/$(get_libdir)/opengl/nvidia/extensions/libglx.so.${NV_SOVER} \ + /usr/$(get_libdir)/opengl/nvidia/extensions/libglx.so || \ + die "failed to create libglx.so symlink" + + # XvMC driver + dolib.a ${NV_X11}/libXvMCNVIDIA.a || \ + die "failed to install libXvMCNVIDIA.so" + dolib.so ${NV_X11}/libXvMCNVIDIA.so.${NV_SOVER} || \ + die "failed to install libXvMCNVIDIA.so" + dosym libXvMCNVIDIA.so.${NV_SOVER} /usr/$(get_libdir)/libXvMCNVIDIA.so || \ + die "failed to create libXvMCNVIDIA.so symlink" + + # CUDA headers (driver to come) + if use kernel_linux && [[ -d ${S}/usr/include/cuda ]]; then + dodir /usr/include/cuda + insinto /usr/include/cuda + doins usr/include/cuda/*.h || die "failed to install cuda headers" + fi + + # OpenCL headers (driver to come) + if [[ -d ${S}/usr/include/CL ]]; then + dodir /usr/include/CL + insinto /usr/include/CL + doins usr/include/CL/*.h || die "failed to install OpenCL headers" + fi + + # Documentation + dodoc ${NV_DOC}/XF86Config.sample + dohtml ${NV_DOC}/html/* + if use x86-fbsd; then + dodoc "${NV_DOC}/README" + doman "${NV_MAN}/nvidia-xconfig.1" + else + # Docs + newdoc "${NV_DOC}/README.txt" README + dodoc "${NV_DOC}/NVIDIA_Changelog" +# doman "${NV_MAN}/nvidia-smi.1.gz" + doman "${NV_MAN}/nvidia-xconfig.1.gz" + fi + + # Helper Apps + dobin ${NV_EXEC}/nvidia-xconfig || die + dobin ${NV_EXEC}/nvidia-bug-report.sh || die + if use kernel_linux; then + dobin ${NV_EXEC}/nvidia-smi || die + fi + + if has_multilib_profile ; then + local OABI=${ABI} + for ABI in $(get_install_abis) ; do + src_install-libs + done + ABI=${OABI} + unset OABI + else + src_install-libs + fi + + is_final_abi || die "failed to iterate through all ABIs" +} + +# Install nvidia library: +# the first parameter is the place where to install it +# the second parameter is the base name of the library +# the third parameter is the provided soversion +donvidia() { + dodir $1 + exeinto $1 + + libname=$(basename $2) + + doexe $2.$3 || die "failed to install $2" + dosym ${libname}.$3 $1/${libname} || die "failed to symlink $2" + [[ $3 != "1" ]] && dosym ${libname}.$3 $1/${libname}.1 +} + +src_install-libs() { + local inslibdir=$(get_libdir) + local NV_ROOT="/usr/${inslibdir}/opengl/nvidia" + local libdir= sover= + + if use kernel_linux; then + if has_multilib_profile && [[ ${ABI} == "x86" ]] ; then + libdir=usr/lib32 + else + libdir=usr/lib + fi + sover=${PV} + else + libdir=obj + # on FreeBSD it has just .1 suffix + sover=1 + fi + + # The GLX libraries + donvidia ${NV_ROOT}/lib ${libdir}/libGL.so ${sover} + donvidia ${NV_ROOT}/lib ${libdir}/libGLcore.so ${sover} + if use x86-fbsd; then + donvidia ${NV_ROOT}/lib ${libdir}/libnvidia-tls.so ${sover} + else + donvidia ${NV_ROOT}/lib ${libdir}/tls/libnvidia-tls.so ${sover} + fi + + #cuda + if [[ -f ${libdir}/libcuda.so.${sover} ]]; then + dolib.so ${libdir}/libcuda.so.${sover} + [[ "${sover}" != "1" ]] && dosym libcuda.so.${sover} /usr/${inslibdir}/libcuda.so.1 + dosym libcuda.so.1 /usr/${inslibdir}/libcuda.so + fi + + #vdpau + if [[ -f ${libdir}/libvdpau_nvidia.so.${sover} ]]; then + dolib.so ${libdir}/libvdpau_nvidia.so.${sover} + dosym libvdpau_nvidia.so.${sover} /usr/${inslibdir}/libvdpau_nvidia.so + fi + + # OpenCL + # NOTE: This isn't currently available in the publicly released drivers. + if [[ -f ${libdir}/libOpenCL.so.1.0.0 ]]; then + + dolib.so ${libdir}/libnvcompiler.so.${sover} + [[ "${sover}" != "1" ]] && dosym libnvcompiler.so.${sover} /usr/${inslibdir}/libnvcompiler.so.1 + dosym libnvcompiler.so.1 /usr/${inslibdir}/libnvcompiler.so + + dolib.so ${libdir}/libOpenCL.so.1.0.0 + dosym libOpenCL.so.1.0.0 /usr/${inslibdir}/libOpenCL.so.1 + dosym libOpenCL.so.1 /usr/${inslibdir}/libOpenCL.so + fi +} + +pkg_preinst() { + # Clean the dynamic libGL stuff's home to ensure + # we dont have stale libs floating around + if [ -d "${ROOT}"/usr/lib/opengl/nvidia ] ; then + rm -rf "${ROOT}"/usr/lib/opengl/nvidia/* + fi + # Make sure we nuke the old nvidia-glx's env.d file + if [ -e "${ROOT}"/etc/env.d/09nvidia ] ; then + rm -f "${ROOT}"/etc/env.d/09nvidia + fi +} + +pkg_postinst() { + # Switch to the nvidia implementation + eselect opengl set --use-old nvidia + + elog "To use the NVIDIA GLX, run \"eselect opengl set nvidia\"" + elog + elog "NVIDIA has requested that any bug reports submitted have the" + elog "output of /usr/bin/nvidia-bug-report.sh included." + elog + elog "To work with compiz, you must enable the AddARGBGLXVisuals option." + elog + elog "If you are having resolution problems, try disabling DynamicTwinView." +} + +pkg_postrm() { + eselect opengl set --use-old xorg-x11 +} diff --git a/x11-drivers/nvidia-userspace/nvidia-userspace-173.14.34.ebuild b/x11-drivers/nvidia-userspace/nvidia-userspace-173.14.34.ebuild new file mode 100644 index 00000000..dc517c8c --- /dev/null +++ b/x11-drivers/nvidia-userspace/nvidia-userspace-173.14.34.ebuild @@ -0,0 +1,395 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI="2" + +inherit eutils unpacker multilib portability versionator flag-o-matic + +X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}" +AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}" +X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}" + +DESCRIPTION="NVIDIA X11 userspace libraries and applications" +HOMEPAGE="http://www.nvidia.com/" +SRC_URI="x86? ( ftp://download.nvidia.com/XFree86/Linux-x86/${PV}/${X86_NV_PACKAGE}-pkg0.run ) + amd64? ( ftp://download.nvidia.com/XFree86/Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}-pkg2.run ) + x86-fbsd? ( ftp://download.nvidia.com/freebsd/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )" + +LICENSE="NVIDIA" +SLOT="0" +KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd" +IUSE="multilib kernel_linux" +RESTRICT="strip" +EMULTILIB_PKG="true" + +COMMON="x11-base/xorg-server + kernel_linux? ( >=sys-libs/glibc-2.6.1 ) + multilib? ( app-emulation/emul-linux-x86-opengl ) + >=app-admin/eselect-opengl-1.0.9" +DEPEND="${COMMON} + kernel_linux? ( virtual/linux-sources )" +RDEPEND="${COMMON} + !<x11-drivers/nvidia-userspace-${PV} + !>x11-drivers/nvidia-userspace-${PV}" +PDEPEND="" + +QA_TEXTRELS_x86="usr/lib/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/xorg/modules/drivers/nvidia_drv.so + usr/lib/libcuda.so.${PV} + usr/lib/libnvidia-cfg.so.${PV} + usr/lib/libvdpau_nvidia.so.${PV} + usr/lib/libXvMCNVIDIA.so.${PV}" + +QA_TEXTRELS_x86_fbsd="boot/modules/nvidia.ko + usr/lib/opengl/nvidia/lib/libGL.so.1 + usr/lib/opengl/nvidia/lib/libGLcore.so.1 + usr/lib/libnvidia-cfg.so.1 + usr/lib/opengl/nvidia/extensions/libglx.so.1 + usr/lib/xorg/modules/drivers/nvidia_drv.so" + +QA_TEXTRELS_amd64="usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib32/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/libcuda.so.${PV} + usr/lib32/libvdpau_nvidia.so.${PV}" + +QA_EXECSTACK_x86="usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/xorg/modules/drivers/nvidia_drv.so + usr/lib/libXvMCNVIDIA.a:NVXVMC.o" + +QA_EXECSTACK_amd64="usr/lib32/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/libnvcompiler.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV} + usr/lib64/libXvMCNVIDIA.a:NVXVMC.o + usr/lib64/libnvidia-cfg.so.${PV} + usr/lib64/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/xorg/modules/drivers/nvidia_drv.so + usr/bin/nvidia-smi + usr/bin/nvidia-xconfig" + +QA_WX_LOAD_x86="usr/lib/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/libXvMCNVIDIA.a" + +QA_WX_LOAD_amd64="usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so.${PV}" + +QA_SONAME_amd64="usr/lib64/libnvcompiler.so.${PV}" + +QA_DT_HASH_amd64="usr/lib32/libcuda.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib32/libvdpau_nvidia.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV} + usr/lib64/libcuda.so.${PV} + usr/lib64/libnvidia-cfg.so.${PV} + usr/lib64/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/xorg/modules/drivers/nvidia_drv.so + usr/lib64/libvdpau_nvidia.so.${PV} + usr/bin/nvidia-smi + usr/bin/nvidia-xconfig" + +QA_DT_HASH_x86="usr/lib/libcuda.so.${PV} + usr/lib/libnvidia-cfg.so.${PV} + usr/lib/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/xorg/modules/drivers/nvidia_drv.so + usr/lib/libXvMCNVIDIA.so.${PV} + usr/lib/libvdpau_nvidia.so.${PV} + usr/bin/nvidia-smi + usr/bin/nvidia-xconfig" + +if use x86; then + PKG_V="-pkg0" + NV_PACKAGE="${X86_NV_PACKAGE}" +elif use amd64; then + PKG_V="-pkg2" + NV_PACKAGE="${AMD64_NV_PACKAGE}" +elif use x86-fbsd; then + PKG_V="" + NV_PACKAGE="${X86_FBSD_NV_PACKAGE}" +fi + +S="${WORKDIR}/${NV_PACKAGE}${PKG_V}" + +pkg_setup() { + # try to turn off distcc and ccache for people that have a problem with it + export DISTCC_DISABLE=1 + export CCACHE_DISABLE=1 + + if use amd64 && has_multilib_profile && [ "${DEFAULT_ABI}" != "amd64" ]; then + eerror "This ebuild doesn't currently support changing your default abi." + die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}" + fi + + # On BSD userland it wants real make command + use userland_BSD && MAKE="$(get_bmake)" + + export _POSIX2_VERSION="199209" + + # set variables to where files are in the package structure + if use kernel_FreeBSD; then + NV_DOC="${S}/doc" + NV_EXEC="${S}/obj" + NV_LIB="${S}/obj" + NV_SRC="${S}/src" + NV_MAN="${S}/x11/man" + NV_X11="${S}/obj" + NV_X11_DRV="${NV_X11}" + NV_X11_EXT="${NV_X11}" + NV_SOVER=1 + elif use kernel_linux; then + NV_DOC="${S}/usr/share/doc" + NV_EXEC="${S}/usr/bin" + NV_LIB="${S}/usr/lib" + NV_SRC="${S}/usr/src/nv" + NV_MAN="${S}/usr/share/man/man1" + NV_X11="${S}/usr/X11R6/lib" + NV_X11_DRV="${NV_X11}/modules/drivers" + NV_X11_EXT="${NV_X11}/modules/extensions" + NV_SOVER=${PV} + else + die "Could not determine proper NVIDIA package" + fi +} + +src_unpack() { + if ! use x86-fbsd; then + mkdir "${S}" + cd "${S}" + unpack_makeself + else + unpack ${A} + fi +} + +src_prepare() { + # Please add a brief description for every added patch + use x86-fbsd && cd doc + + # Use the correct defines to make gtkglext build work + epatch "${FILESDIR}"/NVIDIA_glx-defines.patch + # Use some more sensible gl headers and make way for new glext.h + epatch "${FILESDIR}"/NVIDIA_glx-glheader.patch +} + +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 x86-fbsd; then + MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \ + LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die + fi +} + +src_install() { + if use kernel_linux; then + VIDEOGROUP="$(egetent group video | cut -d ':' -f 3)" + if [ -z "$VIDEOGROUP" ]; then + eerror "Failed to determine the video group gid." + die "Failed to determine the video group gid." + fi + + # Add the aliases + [ -f "${FILESDIR}/nvidia-169.07" ] || die "nvidia missing in FILESDIR" + sed -e 's:PACKAGE:'${PF}':g' \ + -e 's:VIDEOGID:'${VIDEOGROUP}':' "${FILESDIR}"/nvidia-169.07 > \ + "${WORKDIR}"/nvidia + insinto /etc/modprobe.d + newins "${WORKDIR}"/nvidia nvidia.conf || die + fi + + # NVIDIA kernel <-> userspace driver config lib + dolib.so ${NV_LIB}/libnvidia-cfg.so.${NV_SOVER} || \ + die "failed to install libnvidia-cfg" + + # Xorg DDX driver + insinto /usr/$(get_libdir)/xorg/modules/drivers + doins ${NV_X11_DRV}/nvidia_drv.so || die "failed to install nvidia_drv.so" + + # Xorg GLX driver + insinto /usr/$(get_libdir)/opengl/nvidia/extensions + doins ${NV_X11_EXT}/libglx.so.${NV_SOVER} || \ + die "failed to install libglx.so" + dosym /usr/$(get_libdir)/opengl/nvidia/extensions/libglx.so.${NV_SOVER} \ + /usr/$(get_libdir)/opengl/nvidia/extensions/libglx.so || \ + die "failed to create libglx.so symlink" + + # XvMC driver + dolib.a ${NV_X11}/libXvMCNVIDIA.a || \ + die "failed to install libXvMCNVIDIA.so" + dolib.so ${NV_X11}/libXvMCNVIDIA.so.${NV_SOVER} || \ + die "failed to install libXvMCNVIDIA.so" + dosym libXvMCNVIDIA.so.${NV_SOVER} /usr/$(get_libdir)/libXvMCNVIDIA.so || \ + die "failed to create libXvMCNVIDIA.so symlink" + + # CUDA headers (driver to come) + if use kernel_linux && [[ -d ${S}/usr/include/cuda ]]; then + dodir /usr/include/cuda + insinto /usr/include/cuda + doins usr/include/cuda/*.h || die "failed to install cuda headers" + fi + + # OpenCL headers (driver to come) + if [[ -d ${S}/usr/include/CL ]]; then + dodir /usr/include/CL + insinto /usr/include/CL + doins usr/include/CL/*.h || die "failed to install OpenCL headers" + fi + + # Documentation + dodoc ${NV_DOC}/XF86Config.sample + dohtml ${NV_DOC}/html/* + if use x86-fbsd; then + dodoc "${NV_DOC}/README" + doman "${NV_MAN}/nvidia-xconfig.1" + else + # Docs + newdoc "${NV_DOC}/README.txt" README + dodoc "${NV_DOC}/NVIDIA_Changelog" +# doman "${NV_MAN}/nvidia-smi.1.gz" + doman "${NV_MAN}/nvidia-xconfig.1.gz" + fi + + # Helper Apps + dobin ${NV_EXEC}/nvidia-xconfig || die + dobin ${NV_EXEC}/nvidia-bug-report.sh || die + if use kernel_linux; then + dobin ${NV_EXEC}/nvidia-smi || die + fi + + if has_multilib_profile ; then + local OABI=${ABI} + for ABI in $(get_install_abis) ; do + src_install-libs + done + ABI=${OABI} + unset OABI + else + src_install-libs + fi + + is_final_abi || die "failed to iterate through all ABIs" +} + +# Install nvidia library: +# the first parameter is the place where to install it +# the second parameter is the base name of the library +# the third parameter is the provided soversion +donvidia() { + dodir $1 + exeinto $1 + + libname=$(basename $2) + + doexe $2.$3 || die "failed to install $2" + dosym ${libname}.$3 $1/${libname} || die "failed to symlink $2" + [[ $3 != "1" ]] && dosym ${libname}.$3 $1/${libname}.1 +} + +src_install-libs() { + local inslibdir=$(get_libdir) + local NV_ROOT="/usr/${inslibdir}/opengl/nvidia" + local libdir= sover= + + if use kernel_linux; then + if has_multilib_profile && [[ ${ABI} == "x86" ]] ; then + libdir=usr/lib32 + else + libdir=usr/lib + fi + sover=${PV} + else + libdir=obj + # on FreeBSD it has just .1 suffix + sover=1 + fi + + # The GLX libraries + donvidia ${NV_ROOT}/lib ${libdir}/libGL.so ${sover} + donvidia ${NV_ROOT}/lib ${libdir}/libGLcore.so ${sover} + if use x86-fbsd; then + donvidia ${NV_ROOT}/lib ${libdir}/libnvidia-tls.so ${sover} + else + donvidia ${NV_ROOT}/lib ${libdir}/tls/libnvidia-tls.so ${sover} + fi + + #cuda + if [[ -f ${libdir}/libcuda.so.${sover} ]]; then + dolib.so ${libdir}/libcuda.so.${sover} + [[ "${sover}" != "1" ]] && dosym libcuda.so.${sover} /usr/${inslibdir}/libcuda.so.1 + dosym libcuda.so.1 /usr/${inslibdir}/libcuda.so + fi + + #vdpau + if [[ -f ${libdir}/libvdpau_nvidia.so.${sover} ]]; then + dolib.so ${libdir}/libvdpau_nvidia.so.${sover} + dosym libvdpau_nvidia.so.${sover} /usr/${inslibdir}/libvdpau_nvidia.so + fi + + # OpenCL + # NOTE: This isn't currently available in the publicly released drivers. + if [[ -f ${libdir}/libOpenCL.so.1.0.0 ]]; then + + dolib.so ${libdir}/libnvcompiler.so.${sover} + [[ "${sover}" != "1" ]] && dosym libnvcompiler.so.${sover} /usr/${inslibdir}/libnvcompiler.so.1 + dosym libnvcompiler.so.1 /usr/${inslibdir}/libnvcompiler.so + + dolib.so ${libdir}/libOpenCL.so.1.0.0 + dosym libOpenCL.so.1.0.0 /usr/${inslibdir}/libOpenCL.so.1 + dosym libOpenCL.so.1 /usr/${inslibdir}/libOpenCL.so + fi +} + +pkg_preinst() { + # Clean the dynamic libGL stuff's home to ensure + # we dont have stale libs floating around + if [ -d "${ROOT}"/usr/lib/opengl/nvidia ] ; then + rm -rf "${ROOT}"/usr/lib/opengl/nvidia/* + fi + # Make sure we nuke the old nvidia-glx's env.d file + if [ -e "${ROOT}"/etc/env.d/09nvidia ] ; then + rm -f "${ROOT}"/etc/env.d/09nvidia + fi +} + +pkg_postinst() { + # Switch to the nvidia implementation + eselect opengl set --use-old nvidia + + elog "To use the NVIDIA GLX, run \"eselect opengl set nvidia\"" + elog + elog "NVIDIA has requested that any bug reports submitted have the" + elog "output of /usr/bin/nvidia-bug-report.sh included." + elog + elog "To work with compiz, you must enable the AddARGBGLXVisuals option." + elog + elog "If you are having resolution problems, try disabling DynamicTwinView." +} + +pkg_postrm() { + eselect opengl set --use-old xorg-x11 +} diff --git a/x11-drivers/nvidia-userspace/nvidia-userspace-173.14.35.ebuild b/x11-drivers/nvidia-userspace/nvidia-userspace-173.14.35.ebuild new file mode 100644 index 00000000..dc517c8c --- /dev/null +++ b/x11-drivers/nvidia-userspace/nvidia-userspace-173.14.35.ebuild @@ -0,0 +1,395 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI="2" + +inherit eutils unpacker multilib portability versionator flag-o-matic + +X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}" +AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}" +X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}" + +DESCRIPTION="NVIDIA X11 userspace libraries and applications" +HOMEPAGE="http://www.nvidia.com/" +SRC_URI="x86? ( ftp://download.nvidia.com/XFree86/Linux-x86/${PV}/${X86_NV_PACKAGE}-pkg0.run ) + amd64? ( ftp://download.nvidia.com/XFree86/Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}-pkg2.run ) + x86-fbsd? ( ftp://download.nvidia.com/freebsd/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )" + +LICENSE="NVIDIA" +SLOT="0" +KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd" +IUSE="multilib kernel_linux" +RESTRICT="strip" +EMULTILIB_PKG="true" + +COMMON="x11-base/xorg-server + kernel_linux? ( >=sys-libs/glibc-2.6.1 ) + multilib? ( app-emulation/emul-linux-x86-opengl ) + >=app-admin/eselect-opengl-1.0.9" +DEPEND="${COMMON} + kernel_linux? ( virtual/linux-sources )" +RDEPEND="${COMMON} + !<x11-drivers/nvidia-userspace-${PV} + !>x11-drivers/nvidia-userspace-${PV}" +PDEPEND="" + +QA_TEXTRELS_x86="usr/lib/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/xorg/modules/drivers/nvidia_drv.so + usr/lib/libcuda.so.${PV} + usr/lib/libnvidia-cfg.so.${PV} + usr/lib/libvdpau_nvidia.so.${PV} + usr/lib/libXvMCNVIDIA.so.${PV}" + +QA_TEXTRELS_x86_fbsd="boot/modules/nvidia.ko + usr/lib/opengl/nvidia/lib/libGL.so.1 + usr/lib/opengl/nvidia/lib/libGLcore.so.1 + usr/lib/libnvidia-cfg.so.1 + usr/lib/opengl/nvidia/extensions/libglx.so.1 + usr/lib/xorg/modules/drivers/nvidia_drv.so" + +QA_TEXTRELS_amd64="usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib32/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/libcuda.so.${PV} + usr/lib32/libvdpau_nvidia.so.${PV}" + +QA_EXECSTACK_x86="usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/xorg/modules/drivers/nvidia_drv.so + usr/lib/libXvMCNVIDIA.a:NVXVMC.o" + +QA_EXECSTACK_amd64="usr/lib32/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/libnvcompiler.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV} + usr/lib64/libXvMCNVIDIA.a:NVXVMC.o + usr/lib64/libnvidia-cfg.so.${PV} + usr/lib64/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/xorg/modules/drivers/nvidia_drv.so + usr/bin/nvidia-smi + usr/bin/nvidia-xconfig" + +QA_WX_LOAD_x86="usr/lib/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/libXvMCNVIDIA.a" + +QA_WX_LOAD_amd64="usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so.${PV}" + +QA_SONAME_amd64="usr/lib64/libnvcompiler.so.${PV}" + +QA_DT_HASH_amd64="usr/lib32/libcuda.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib32/libvdpau_nvidia.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV} + usr/lib64/libcuda.so.${PV} + usr/lib64/libnvidia-cfg.so.${PV} + usr/lib64/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/xorg/modules/drivers/nvidia_drv.so + usr/lib64/libvdpau_nvidia.so.${PV} + usr/bin/nvidia-smi + usr/bin/nvidia-xconfig" + +QA_DT_HASH_x86="usr/lib/libcuda.so.${PV} + usr/lib/libnvidia-cfg.so.${PV} + usr/lib/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/xorg/modules/drivers/nvidia_drv.so + usr/lib/libXvMCNVIDIA.so.${PV} + usr/lib/libvdpau_nvidia.so.${PV} + usr/bin/nvidia-smi + usr/bin/nvidia-xconfig" + +if use x86; then + PKG_V="-pkg0" + NV_PACKAGE="${X86_NV_PACKAGE}" +elif use amd64; then + PKG_V="-pkg2" + NV_PACKAGE="${AMD64_NV_PACKAGE}" +elif use x86-fbsd; then + PKG_V="" + NV_PACKAGE="${X86_FBSD_NV_PACKAGE}" +fi + +S="${WORKDIR}/${NV_PACKAGE}${PKG_V}" + +pkg_setup() { + # try to turn off distcc and ccache for people that have a problem with it + export DISTCC_DISABLE=1 + export CCACHE_DISABLE=1 + + if use amd64 && has_multilib_profile && [ "${DEFAULT_ABI}" != "amd64" ]; then + eerror "This ebuild doesn't currently support changing your default abi." + die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}" + fi + + # On BSD userland it wants real make command + use userland_BSD && MAKE="$(get_bmake)" + + export _POSIX2_VERSION="199209" + + # set variables to where files are in the package structure + if use kernel_FreeBSD; then + NV_DOC="${S}/doc" + NV_EXEC="${S}/obj" + NV_LIB="${S}/obj" + NV_SRC="${S}/src" + NV_MAN="${S}/x11/man" + NV_X11="${S}/obj" + NV_X11_DRV="${NV_X11}" + NV_X11_EXT="${NV_X11}" + NV_SOVER=1 + elif use kernel_linux; then + NV_DOC="${S}/usr/share/doc" + NV_EXEC="${S}/usr/bin" + NV_LIB="${S}/usr/lib" + NV_SRC="${S}/usr/src/nv" + NV_MAN="${S}/usr/share/man/man1" + NV_X11="${S}/usr/X11R6/lib" + NV_X11_DRV="${NV_X11}/modules/drivers" + NV_X11_EXT="${NV_X11}/modules/extensions" + NV_SOVER=${PV} + else + die "Could not determine proper NVIDIA package" + fi +} + +src_unpack() { + if ! use x86-fbsd; then + mkdir "${S}" + cd "${S}" + unpack_makeself + else + unpack ${A} + fi +} + +src_prepare() { + # Please add a brief description for every added patch + use x86-fbsd && cd doc + + # Use the correct defines to make gtkglext build work + epatch "${FILESDIR}"/NVIDIA_glx-defines.patch + # Use some more sensible gl headers and make way for new glext.h + epatch "${FILESDIR}"/NVIDIA_glx-glheader.patch +} + +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 x86-fbsd; then + MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \ + LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die + fi +} + +src_install() { + if use kernel_linux; then + VIDEOGROUP="$(egetent group video | cut -d ':' -f 3)" + if [ -z "$VIDEOGROUP" ]; then + eerror "Failed to determine the video group gid." + die "Failed to determine the video group gid." + fi + + # Add the aliases + [ -f "${FILESDIR}/nvidia-169.07" ] || die "nvidia missing in FILESDIR" + sed -e 's:PACKAGE:'${PF}':g' \ + -e 's:VIDEOGID:'${VIDEOGROUP}':' "${FILESDIR}"/nvidia-169.07 > \ + "${WORKDIR}"/nvidia + insinto /etc/modprobe.d + newins "${WORKDIR}"/nvidia nvidia.conf || die + fi + + # NVIDIA kernel <-> userspace driver config lib + dolib.so ${NV_LIB}/libnvidia-cfg.so.${NV_SOVER} || \ + die "failed to install libnvidia-cfg" + + # Xorg DDX driver + insinto /usr/$(get_libdir)/xorg/modules/drivers + doins ${NV_X11_DRV}/nvidia_drv.so || die "failed to install nvidia_drv.so" + + # Xorg GLX driver + insinto /usr/$(get_libdir)/opengl/nvidia/extensions + doins ${NV_X11_EXT}/libglx.so.${NV_SOVER} || \ + die "failed to install libglx.so" + dosym /usr/$(get_libdir)/opengl/nvidia/extensions/libglx.so.${NV_SOVER} \ + /usr/$(get_libdir)/opengl/nvidia/extensions/libglx.so || \ + die "failed to create libglx.so symlink" + + # XvMC driver + dolib.a ${NV_X11}/libXvMCNVIDIA.a || \ + die "failed to install libXvMCNVIDIA.so" + dolib.so ${NV_X11}/libXvMCNVIDIA.so.${NV_SOVER} || \ + die "failed to install libXvMCNVIDIA.so" + dosym libXvMCNVIDIA.so.${NV_SOVER} /usr/$(get_libdir)/libXvMCNVIDIA.so || \ + die "failed to create libXvMCNVIDIA.so symlink" + + # CUDA headers (driver to come) + if use kernel_linux && [[ -d ${S}/usr/include/cuda ]]; then + dodir /usr/include/cuda + insinto /usr/include/cuda + doins usr/include/cuda/*.h || die "failed to install cuda headers" + fi + + # OpenCL headers (driver to come) + if [[ -d ${S}/usr/include/CL ]]; then + dodir /usr/include/CL + insinto /usr/include/CL + doins usr/include/CL/*.h || die "failed to install OpenCL headers" + fi + + # Documentation + dodoc ${NV_DOC}/XF86Config.sample + dohtml ${NV_DOC}/html/* + if use x86-fbsd; then + dodoc "${NV_DOC}/README" + doman "${NV_MAN}/nvidia-xconfig.1" + else + # Docs + newdoc "${NV_DOC}/README.txt" README + dodoc "${NV_DOC}/NVIDIA_Changelog" +# doman "${NV_MAN}/nvidia-smi.1.gz" + doman "${NV_MAN}/nvidia-xconfig.1.gz" + fi + + # Helper Apps + dobin ${NV_EXEC}/nvidia-xconfig || die + dobin ${NV_EXEC}/nvidia-bug-report.sh || die + if use kernel_linux; then + dobin ${NV_EXEC}/nvidia-smi || die + fi + + if has_multilib_profile ; then + local OABI=${ABI} + for ABI in $(get_install_abis) ; do + src_install-libs + done + ABI=${OABI} + unset OABI + else + src_install-libs + fi + + is_final_abi || die "failed to iterate through all ABIs" +} + +# Install nvidia library: +# the first parameter is the place where to install it +# the second parameter is the base name of the library +# the third parameter is the provided soversion +donvidia() { + dodir $1 + exeinto $1 + + libname=$(basename $2) + + doexe $2.$3 || die "failed to install $2" + dosym ${libname}.$3 $1/${libname} || die "failed to symlink $2" + [[ $3 != "1" ]] && dosym ${libname}.$3 $1/${libname}.1 +} + +src_install-libs() { + local inslibdir=$(get_libdir) + local NV_ROOT="/usr/${inslibdir}/opengl/nvidia" + local libdir= sover= + + if use kernel_linux; then + if has_multilib_profile && [[ ${ABI} == "x86" ]] ; then + libdir=usr/lib32 + else + libdir=usr/lib + fi + sover=${PV} + else + libdir=obj + # on FreeBSD it has just .1 suffix + sover=1 + fi + + # The GLX libraries + donvidia ${NV_ROOT}/lib ${libdir}/libGL.so ${sover} + donvidia ${NV_ROOT}/lib ${libdir}/libGLcore.so ${sover} + if use x86-fbsd; then + donvidia ${NV_ROOT}/lib ${libdir}/libnvidia-tls.so ${sover} + else + donvidia ${NV_ROOT}/lib ${libdir}/tls/libnvidia-tls.so ${sover} + fi + + #cuda + if [[ -f ${libdir}/libcuda.so.${sover} ]]; then + dolib.so ${libdir}/libcuda.so.${sover} + [[ "${sover}" != "1" ]] && dosym libcuda.so.${sover} /usr/${inslibdir}/libcuda.so.1 + dosym libcuda.so.1 /usr/${inslibdir}/libcuda.so + fi + + #vdpau + if [[ -f ${libdir}/libvdpau_nvidia.so.${sover} ]]; then + dolib.so ${libdir}/libvdpau_nvidia.so.${sover} + dosym libvdpau_nvidia.so.${sover} /usr/${inslibdir}/libvdpau_nvidia.so + fi + + # OpenCL + # NOTE: This isn't currently available in the publicly released drivers. + if [[ -f ${libdir}/libOpenCL.so.1.0.0 ]]; then + + dolib.so ${libdir}/libnvcompiler.so.${sover} + [[ "${sover}" != "1" ]] && dosym libnvcompiler.so.${sover} /usr/${inslibdir}/libnvcompiler.so.1 + dosym libnvcompiler.so.1 /usr/${inslibdir}/libnvcompiler.so + + dolib.so ${libdir}/libOpenCL.so.1.0.0 + dosym libOpenCL.so.1.0.0 /usr/${inslibdir}/libOpenCL.so.1 + dosym libOpenCL.so.1 /usr/${inslibdir}/libOpenCL.so + fi +} + +pkg_preinst() { + # Clean the dynamic libGL stuff's home to ensure + # we dont have stale libs floating around + if [ -d "${ROOT}"/usr/lib/opengl/nvidia ] ; then + rm -rf "${ROOT}"/usr/lib/opengl/nvidia/* + fi + # Make sure we nuke the old nvidia-glx's env.d file + if [ -e "${ROOT}"/etc/env.d/09nvidia ] ; then + rm -f "${ROOT}"/etc/env.d/09nvidia + fi +} + +pkg_postinst() { + # Switch to the nvidia implementation + eselect opengl set --use-old nvidia + + elog "To use the NVIDIA GLX, run \"eselect opengl set nvidia\"" + elog + elog "NVIDIA has requested that any bug reports submitted have the" + elog "output of /usr/bin/nvidia-bug-report.sh included." + elog + elog "To work with compiz, you must enable the AddARGBGLXVisuals option." + elog + elog "If you are having resolution problems, try disabling DynamicTwinView." +} + +pkg_postrm() { + eselect opengl set --use-old xorg-x11 +} diff --git a/x11-drivers/nvidia-userspace/nvidia-userspace-275.09.07.ebuild b/x11-drivers/nvidia-userspace/nvidia-userspace-275.09.07.ebuild new file mode 100644 index 00000000..6e988b89 --- /dev/null +++ b/x11-drivers/nvidia-userspace/nvidia-userspace-275.09.07.ebuild @@ -0,0 +1,414 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI="2" + +inherit eutils unpacker multilib portability versionator flag-o-matic + +X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}" +AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}" +X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}" + +DESCRIPTION="NVIDIA X11 userspace libraries and applications" +HOMEPAGE="http://www.nvidia.com/" +SRC_URI="x86? ( http://download.nvidia.com/XFree86/Linux-x86/${PV}/${X86_NV_PACKAGE}.run ) + amd64? ( http://download.nvidia.com/XFree86/Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run ) + x86-fbsd? ( http://download.nvidia.com/XFree86/FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )" + +LICENSE="NVIDIA" +SLOT="0" +KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd" +IUSE="multilib kernel_linux" +RESTRICT="strip" +EMULTILIB_PKG="true" + +COMMON="<x11-base/xorg-server-1.10.99 + kernel_linux? ( >=sys-libs/glibc-2.6.1 ) + multilib? ( app-emulation/emul-linux-x86-xlibs ) + >=app-admin/eselect-opengl-1.0.9 + !<media-video/nvidia-settings-256.52" +DEPEND="${COMMON}" +RDEPEND="${COMMON} + x11-libs/libXvMC + !<x11-drivers/nvidia-userspace-${PV} + !>x11-drivers/nvidia-userspace-${PV}" +PDEPEND=">=x11-libs/libvdpau-0.3-r1" + +QA_TEXTRELS_x86=" + usr/lib/libOpenCL.so.1.0.0 + usr/lib/libXvMCNVIDIA.so.${PV} + usr/lib/libcuda.so.${PV} + usr/lib/libnvcuvid.so.${PV} + usr/lib/libnvidia-cfg.so.${PV} + usr/lib/libnvidia-compiler.so.${PV} + usr/lib/libnvidia-glcore.so.${PV} + usr/lib/libnvidia-ml.so.${PV} + usr/lib/libvdpau_nvidia.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib/xorg/modules/drivers/nvidia_drv.so" + +QA_TEXTRELS_x86_fbsd="boot/modules/nvidia.ko + usr/lib/opengl/nvidia/lib/libGL.so.1 + usr/lib/libnvidia-glcore.so.1 + usr/lib/libnvidia-cfg.so.1 + usr/lib/libnvidia-ml.so.1 + usr/lib/opengl/nvidia/extensions/libglx.so.1 + usr/lib/xorg/modules/drivers/nvidia_drv.so" + +QA_TEXTRELS_amd64="usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib32/libnvidia-glcore.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/libcuda.so.${PV} + usr/lib32/libvdpau_nvidia.so.${PV} + usr/lib32/libOpenCL.so.1.0.0 + usr/lib32/libnvidia-compiler.so.${PV}" + +QA_EXECSTACK_x86="usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/libnvidia-glcore.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV} + usr/lib/libXvMCNVIDIA.a:NVXVMC.o + usr/lib/libnvidia-compiler.so.${PV} + usr/lib/libvdpau_nvidia.so.${PV} + usr/lib/libcuda.so.${PV} + usr/lib/libOpenCL.so.1.0.0" + +QA_EXECSTACK_amd64="usr/lib32/libnvidia-glcore.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/libnvidia-compiler.so.${PV} + usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib32/libvdpau_nvidia.so.${PV} + usr/lib32/libcuda.so.${PV} + usr/lib32/libOpenCL.so.1.0.0 + usr/lib64/libnvidia-compiler.so.${PV} + usr/lib64/libXvMCNVIDIA.a:NVXVMC.o + usr/lib64/libnvidia-cfg.so.${PV} + usr/lib64/libnvidia-ml.so.${PV} + usr/lib64/libvdpau_nvidia.so.${PV} + usr/lib64/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/libnvidia-glcore.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV} + usr/lib64/libcuda.so.${PV} + usr/lib64/libOpenCL.so.1.0.0 + usr/lib64/xorg/modules/drivers/nvidia_drv.so + usr/bin/nvidia-smi + usr/bin/nvidia-xconfig + usr/bin/nvidia-settings" + +QA_WX_LOAD_x86="usr/lib/libnvidia-glcore.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/libXvMCNVIDIA.a + usr/lib64/libXvMCNVIDIA.so.${PV}" + +QA_WX_LOAD_amd64="usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/libnvidia-glcore.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/libnvidia-glcore.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV}" + +QA_SONAME_x86="usr/lib/libnvidia-compiler.so.${PV}" + +QA_SONAME_amd64="usr/lib64/libnvidia-compiler.so.${PV} + usr/lib32/libnvidia-compiler.so.${PV}" + +QA_DT_HASH_amd64="usr/lib32/libcuda.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/libnvidia-glcore.so.${PV} + usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib32/libvdpau_nvidia.so.${PV} + usr/lib32/libOpenCL.so.1.0.0 + usr/lib32/libnvidia-compiler.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV} + usr/lib64/libcuda.so.${PV} + usr/lib64/libnvidia-cfg.so.${PV} + usr/lib64/libnvidia-glcore.so.${PV} + usr/lib64/libnvidia-ml.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/xorg/modules/drivers/nvidia_drv.so + usr/lib64/libvdpau_nvidia.so.${PV} + usr/lib64/libOpenCL.so.1.0.0 + usr/lib64/libnvidia-compiler.so.${PV} + usr/lib64/libnvcuvid.so.${PV} + usr/bin/nvidia-smi + usr/bin/nvidia-xconfig + usr/bin/nvidia-settings" + +QA_DT_HASH_x86="usr/lib/libcuda.so.${PV} + usr/lib/libnvidia-cfg.so.${PV} + usr/lib/libnvidia-glcore.so.${PV} + usr/lib/libnvidia-ml.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/xorg/modules/drivers/nvidia_drv.so + usr/lib/libXvMCNVIDIA.so.${PV} + usr/lib/libvdpau_nvidia.so.${PV} + usr/lib/libOpenCL.so.1.0.0 + usr/lib/libnvidia-compiler.so.${PV} + usr/lib/libnvcuvid.so.${PV} + usr/bin/nvidia-smi + usr/bin/nvidia-xconfig + usr/bin/nvidia-settings" + + +S="${WORKDIR}/" + +pkg_setup() { + # try to turn off distcc and ccache for people that have a problem with it + export DISTCC_DISABLE=1 + export CCACHE_DISABLE=1 + + if use amd64 && has_multilib_profile && [ "${DEFAULT_ABI}" != "amd64" ]; then + eerror "This ebuild doesn't currently support changing your default abi." + die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}" + fi + + # On BSD userland it wants real make command + use userland_BSD && MAKE="$(get_bmake)" + + export _POSIX2_VERSION="199209" + + # set variables to where files are in the package structure + if use kernel_FreeBSD; then + NV_DOC="${S}/doc" + NV_EXEC="${S}/obj" + NV_LIB="${S}/obj" + NV_SRC="${S}/src" + NV_MAN="${S}/x11/man" + NV_X11="${S}/obj" + NV_X11_DRV="${NV_X11}" + NV_X11_EXT="${NV_X11}" + NV_SOVER=1 + elif use kernel_linux; then + NV_DOC="${S}" + NV_EXEC="${S}" + NV_LIB="${S}" + NV_SRC="${S}/kernel" + NV_MAN="${S}" + NV_X11="${S}" + NV_X11_DRV="${NV_X11}" + NV_X11_EXT="${NV_X11}" + NV_SOVER=${PV} + else + die "Could not determine proper NVIDIA package" + fi +} + +src_unpack() { + if ! use x86-fbsd; then + cd "${S}" + unpack_makeself + else + unpack ${A} + fi +} + +src_prepare() { + # Please add a brief description for every added patch + use x86-fbsd && cd doc +} + +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 x86-fbsd; then + MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \ + LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die + fi +} + +src_install() { + if use kernel_linux; then + VIDEOGROUP="$(egetent group video | cut -d ':' -f 3)" + if [ -z "$VIDEOGROUP" ]; then + eerror "Failed to determine the video group gid." + die "Failed to determine the video group gid." + fi + + # Add the aliases + [ -f "${FILESDIR}/nvidia-169.07" ] || die "nvidia missing in FILESDIR" + sed -e 's:PACKAGE:'${PF}':g' \ + -e 's:VIDEOGID:'${VIDEOGROUP}':' "${FILESDIR}"/nvidia-169.07 > \ + "${WORKDIR}"/nvidia + insinto /etc/modprobe.d + newins "${WORKDIR}"/nvidia nvidia.conf || die + fi + + # NVIDIA kernel <-> userspace driver config lib + dolib.so ${NV_LIB}/libnvidia-cfg.so.${NV_SOVER} || \ + die "failed to install libnvidia-cfg" + dosym /usr/$(get_libdir)/libnvidia-cfg.so.${NV_SOVER} \ + /usr/$(get_libdir)/libnvidia-cfg.so || \ + die "failed to create libnvidia-cfg.so symlink" + + # NVIDIA monitoring library + dolib.so ${NV_LIB}/libnvidia-ml.so.${NV_SOVER} || \ + die "failed to install libnvidia-ml" + dosym /usr/$(get_libdir)/libnvidia-ml.so.${NV_SOVER} \ + /usr/$(get_libdir)/libnvidia-ml.so || \ + die "failed to create libnvidia-ml.so symlink" + + # NVIDIA video decode <-> CUDA + dolib.so ${NV_LIB}/libnvcuvid.so.${NV_SOVER} || \ + die "failed to install libnvcuvid.so" + dosym /usr/$(get_libdir)/libnvcuvid.so.${NV_SOVER} \ + /usr/$(get_libdir)/libnvcuvid.so || \ + die "failed to create libnvcuvid.so symlink" + + # Xorg DDX driver + insinto /usr/$(get_libdir)/xorg/modules/drivers + doins ${NV_X11_DRV}/nvidia_drv.so || die "failed to install nvidia_drv.so" + + # Xorg GLX driver + insinto /usr/$(get_libdir)/opengl/nvidia/extensions + doins ${NV_X11_EXT}/libglx.so.${NV_SOVER} || \ + die "failed to install libglx.so" + dosym /usr/$(get_libdir)/opengl/nvidia/extensions/libglx.so.${NV_SOVER} \ + /usr/$(get_libdir)/opengl/nvidia/extensions/libglx.so || \ + die "failed to create libglx.so symlink" + + # XvMC driver + dolib.a ${NV_X11}/libXvMCNVIDIA.a || \ + die "failed to install libXvMCNVIDIA.so" + dolib.so ${NV_X11}/libXvMCNVIDIA.so.${NV_SOVER} || \ + die "failed to install libXvMCNVIDIA.so" + dosym libXvMCNVIDIA.so.${NV_SOVER} /usr/$(get_libdir)/libXvMCNVIDIA.so || \ + die "failed to create libXvMCNVIDIA.so symlink" + + # OpenCL ICD for NVIDIA + if use kernel_linux; then + dodir /etc/OpenCL/vendors + insinto /etc/OpenCL/vendors + doins nvidia.icd + fi + + # Documentation + dohtml ${NV_DOC}/html/* + if use x86-fbsd; then + dodoc "${NV_DOC}/README" + doman "${NV_MAN}/nvidia-xconfig.1" + else + # Docs + newdoc "${NV_DOC}/README.txt" README + dodoc "${NV_DOC}/NVIDIA_Changelog" + doman "${NV_MAN}/nvidia-smi.1.gz" + doman "${NV_MAN}/nvidia-xconfig.1.gz" + fi + + # Helper Apps + dobin ${NV_EXEC}/nvidia-xconfig || die + dobin ${NV_EXEC}/nvidia-bug-report.sh || die + if use kernel_linux; then + dobin ${NV_EXEC}/nvidia-smi || die + fi + + if has_multilib_profile ; then + local OABI=${ABI} + for ABI in $(get_install_abis) ; do + src_install-libs + done + ABI=${OABI} + unset OABI + else + src_install-libs + fi + + is_final_abi || die "failed to iterate through all ABIs" +} + +# Install nvidia library: +# the first parameter is the place where to install it +# the second parameter is the base name of the library +# the third parameter is the provided soversion +donvidia() { + dodir $1 + exeinto $1 + + libname=$(basename $2) + + doexe $2.$3 || die "failed to install $2" + dosym ${libname}.$3 $1/${libname} || die "failed to symlink $2" + [[ $3 != "1" ]] && dosym ${libname}.$3 $1/${libname}.1 +} + +src_install-libs() { + local inslibdir=$(get_libdir) + local NV_ROOT="/usr/${inslibdir}/opengl/nvidia" + local libdir= sover= + + if use kernel_linux; then + if has_multilib_profile && [[ ${ABI} == "x86" ]] ; then + libdir=32 + else + libdir=. + fi + sover=${PV} + else + libdir=obj + # on FreeBSD it has just .1 suffix + sover=1 + fi + + # The GLX libraries + donvidia ${NV_ROOT}/lib ${libdir}/libGL.so ${sover} + donvidia /usr/${inslibdir} ${libdir}/libnvidia-glcore.so ${sover} + if use x86-fbsd; then + donvidia ${NV_ROOT}/lib ${libdir}/libnvidia-tls.so ${sover} + else + donvidia ${NV_ROOT}/lib ${libdir}/tls/libnvidia-tls.so ${sover} + fi + + # VDPAU + donvidia /usr/${inslibdir} ${libdir}/libvdpau_nvidia.so ${sover} + + # CUDA & OpenCL + if use kernel_linux; then + donvidia /usr/${inslibdir} ${libdir}/libcuda.so ${sover} + donvidia /usr/${inslibdir} ${libdir}/libnvidia-compiler.so ${sover} + donvidia /usr/${inslibdir} ${libdir}/libOpenCL.so 1.0.0 + dosym libOpenCL.so.1 /usr/${inslibdir}/libOpenCL.so + fi +} + +pkg_preinst() { + # Clean the dynamic libGL stuff's home to ensure + # we dont have stale libs floating around + if [ -d "${ROOT}"/usr/lib/opengl/nvidia ] ; then + rm -rf "${ROOT}"/usr/lib/opengl/nvidia/* + fi + # Make sure we nuke the old nvidia-glx's env.d file + if [ -e "${ROOT}"/etc/env.d/09nvidia ] ; then + rm -f "${ROOT}"/etc/env.d/09nvidia + fi +} + +pkg_postinst() { + # Switch to the nvidia implementation + eselect opengl set --use-old nvidia + + elog "To use the NVIDIA GLX, run \"eselect opengl set nvidia\"" + elog + elog "NVIDIA has requested that any bug reports submitted have the" + elog "output of /usr/bin/nvidia-bug-report.sh included." + elog + elog "To work with compiz, you must enable the AddARGBGLXVisuals option." + elog + elog "If you are having resolution problems, try disabling DynamicTwinView." + elog +} + +pkg_postrm() { + eselect opengl set --use-old xorg-x11 +} diff --git a/x11-drivers/nvidia-userspace/nvidia-userspace-280.13.ebuild b/x11-drivers/nvidia-userspace/nvidia-userspace-280.13.ebuild new file mode 100644 index 00000000..6e988b89 --- /dev/null +++ b/x11-drivers/nvidia-userspace/nvidia-userspace-280.13.ebuild @@ -0,0 +1,414 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI="2" + +inherit eutils unpacker multilib portability versionator flag-o-matic + +X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}" +AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}" +X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}" + +DESCRIPTION="NVIDIA X11 userspace libraries and applications" +HOMEPAGE="http://www.nvidia.com/" +SRC_URI="x86? ( http://download.nvidia.com/XFree86/Linux-x86/${PV}/${X86_NV_PACKAGE}.run ) + amd64? ( http://download.nvidia.com/XFree86/Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run ) + x86-fbsd? ( http://download.nvidia.com/XFree86/FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )" + +LICENSE="NVIDIA" +SLOT="0" +KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd" +IUSE="multilib kernel_linux" +RESTRICT="strip" +EMULTILIB_PKG="true" + +COMMON="<x11-base/xorg-server-1.10.99 + kernel_linux? ( >=sys-libs/glibc-2.6.1 ) + multilib? ( app-emulation/emul-linux-x86-xlibs ) + >=app-admin/eselect-opengl-1.0.9 + !<media-video/nvidia-settings-256.52" +DEPEND="${COMMON}" +RDEPEND="${COMMON} + x11-libs/libXvMC + !<x11-drivers/nvidia-userspace-${PV} + !>x11-drivers/nvidia-userspace-${PV}" +PDEPEND=">=x11-libs/libvdpau-0.3-r1" + +QA_TEXTRELS_x86=" + usr/lib/libOpenCL.so.1.0.0 + usr/lib/libXvMCNVIDIA.so.${PV} + usr/lib/libcuda.so.${PV} + usr/lib/libnvcuvid.so.${PV} + usr/lib/libnvidia-cfg.so.${PV} + usr/lib/libnvidia-compiler.so.${PV} + usr/lib/libnvidia-glcore.so.${PV} + usr/lib/libnvidia-ml.so.${PV} + usr/lib/libvdpau_nvidia.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib/xorg/modules/drivers/nvidia_drv.so" + +QA_TEXTRELS_x86_fbsd="boot/modules/nvidia.ko + usr/lib/opengl/nvidia/lib/libGL.so.1 + usr/lib/libnvidia-glcore.so.1 + usr/lib/libnvidia-cfg.so.1 + usr/lib/libnvidia-ml.so.1 + usr/lib/opengl/nvidia/extensions/libglx.so.1 + usr/lib/xorg/modules/drivers/nvidia_drv.so" + +QA_TEXTRELS_amd64="usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib32/libnvidia-glcore.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/libcuda.so.${PV} + usr/lib32/libvdpau_nvidia.so.${PV} + usr/lib32/libOpenCL.so.1.0.0 + usr/lib32/libnvidia-compiler.so.${PV}" + +QA_EXECSTACK_x86="usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/libnvidia-glcore.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV} + usr/lib/libXvMCNVIDIA.a:NVXVMC.o + usr/lib/libnvidia-compiler.so.${PV} + usr/lib/libvdpau_nvidia.so.${PV} + usr/lib/libcuda.so.${PV} + usr/lib/libOpenCL.so.1.0.0" + +QA_EXECSTACK_amd64="usr/lib32/libnvidia-glcore.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/libnvidia-compiler.so.${PV} + usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib32/libvdpau_nvidia.so.${PV} + usr/lib32/libcuda.so.${PV} + usr/lib32/libOpenCL.so.1.0.0 + usr/lib64/libnvidia-compiler.so.${PV} + usr/lib64/libXvMCNVIDIA.a:NVXVMC.o + usr/lib64/libnvidia-cfg.so.${PV} + usr/lib64/libnvidia-ml.so.${PV} + usr/lib64/libvdpau_nvidia.so.${PV} + usr/lib64/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/libnvidia-glcore.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV} + usr/lib64/libcuda.so.${PV} + usr/lib64/libOpenCL.so.1.0.0 + usr/lib64/xorg/modules/drivers/nvidia_drv.so + usr/bin/nvidia-smi + usr/bin/nvidia-xconfig + usr/bin/nvidia-settings" + +QA_WX_LOAD_x86="usr/lib/libnvidia-glcore.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/libXvMCNVIDIA.a + usr/lib64/libXvMCNVIDIA.so.${PV}" + +QA_WX_LOAD_amd64="usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/libnvidia-glcore.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/libnvidia-glcore.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV}" + +QA_SONAME_x86="usr/lib/libnvidia-compiler.so.${PV}" + +QA_SONAME_amd64="usr/lib64/libnvidia-compiler.so.${PV} + usr/lib32/libnvidia-compiler.so.${PV}" + +QA_DT_HASH_amd64="usr/lib32/libcuda.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/libnvidia-glcore.so.${PV} + usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib32/libvdpau_nvidia.so.${PV} + usr/lib32/libOpenCL.so.1.0.0 + usr/lib32/libnvidia-compiler.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV} + usr/lib64/libcuda.so.${PV} + usr/lib64/libnvidia-cfg.so.${PV} + usr/lib64/libnvidia-glcore.so.${PV} + usr/lib64/libnvidia-ml.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/xorg/modules/drivers/nvidia_drv.so + usr/lib64/libvdpau_nvidia.so.${PV} + usr/lib64/libOpenCL.so.1.0.0 + usr/lib64/libnvidia-compiler.so.${PV} + usr/lib64/libnvcuvid.so.${PV} + usr/bin/nvidia-smi + usr/bin/nvidia-xconfig + usr/bin/nvidia-settings" + +QA_DT_HASH_x86="usr/lib/libcuda.so.${PV} + usr/lib/libnvidia-cfg.so.${PV} + usr/lib/libnvidia-glcore.so.${PV} + usr/lib/libnvidia-ml.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/xorg/modules/drivers/nvidia_drv.so + usr/lib/libXvMCNVIDIA.so.${PV} + usr/lib/libvdpau_nvidia.so.${PV} + usr/lib/libOpenCL.so.1.0.0 + usr/lib/libnvidia-compiler.so.${PV} + usr/lib/libnvcuvid.so.${PV} + usr/bin/nvidia-smi + usr/bin/nvidia-xconfig + usr/bin/nvidia-settings" + + +S="${WORKDIR}/" + +pkg_setup() { + # try to turn off distcc and ccache for people that have a problem with it + export DISTCC_DISABLE=1 + export CCACHE_DISABLE=1 + + if use amd64 && has_multilib_profile && [ "${DEFAULT_ABI}" != "amd64" ]; then + eerror "This ebuild doesn't currently support changing your default abi." + die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}" + fi + + # On BSD userland it wants real make command + use userland_BSD && MAKE="$(get_bmake)" + + export _POSIX2_VERSION="199209" + + # set variables to where files are in the package structure + if use kernel_FreeBSD; then + NV_DOC="${S}/doc" + NV_EXEC="${S}/obj" + NV_LIB="${S}/obj" + NV_SRC="${S}/src" + NV_MAN="${S}/x11/man" + NV_X11="${S}/obj" + NV_X11_DRV="${NV_X11}" + NV_X11_EXT="${NV_X11}" + NV_SOVER=1 + elif use kernel_linux; then + NV_DOC="${S}" + NV_EXEC="${S}" + NV_LIB="${S}" + NV_SRC="${S}/kernel" + NV_MAN="${S}" + NV_X11="${S}" + NV_X11_DRV="${NV_X11}" + NV_X11_EXT="${NV_X11}" + NV_SOVER=${PV} + else + die "Could not determine proper NVIDIA package" + fi +} + +src_unpack() { + if ! use x86-fbsd; then + cd "${S}" + unpack_makeself + else + unpack ${A} + fi +} + +src_prepare() { + # Please add a brief description for every added patch + use x86-fbsd && cd doc +} + +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 x86-fbsd; then + MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \ + LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die + fi +} + +src_install() { + if use kernel_linux; then + VIDEOGROUP="$(egetent group video | cut -d ':' -f 3)" + if [ -z "$VIDEOGROUP" ]; then + eerror "Failed to determine the video group gid." + die "Failed to determine the video group gid." + fi + + # Add the aliases + [ -f "${FILESDIR}/nvidia-169.07" ] || die "nvidia missing in FILESDIR" + sed -e 's:PACKAGE:'${PF}':g' \ + -e 's:VIDEOGID:'${VIDEOGROUP}':' "${FILESDIR}"/nvidia-169.07 > \ + "${WORKDIR}"/nvidia + insinto /etc/modprobe.d + newins "${WORKDIR}"/nvidia nvidia.conf || die + fi + + # NVIDIA kernel <-> userspace driver config lib + dolib.so ${NV_LIB}/libnvidia-cfg.so.${NV_SOVER} || \ + die "failed to install libnvidia-cfg" + dosym /usr/$(get_libdir)/libnvidia-cfg.so.${NV_SOVER} \ + /usr/$(get_libdir)/libnvidia-cfg.so || \ + die "failed to create libnvidia-cfg.so symlink" + + # NVIDIA monitoring library + dolib.so ${NV_LIB}/libnvidia-ml.so.${NV_SOVER} || \ + die "failed to install libnvidia-ml" + dosym /usr/$(get_libdir)/libnvidia-ml.so.${NV_SOVER} \ + /usr/$(get_libdir)/libnvidia-ml.so || \ + die "failed to create libnvidia-ml.so symlink" + + # NVIDIA video decode <-> CUDA + dolib.so ${NV_LIB}/libnvcuvid.so.${NV_SOVER} || \ + die "failed to install libnvcuvid.so" + dosym /usr/$(get_libdir)/libnvcuvid.so.${NV_SOVER} \ + /usr/$(get_libdir)/libnvcuvid.so || \ + die "failed to create libnvcuvid.so symlink" + + # Xorg DDX driver + insinto /usr/$(get_libdir)/xorg/modules/drivers + doins ${NV_X11_DRV}/nvidia_drv.so || die "failed to install nvidia_drv.so" + + # Xorg GLX driver + insinto /usr/$(get_libdir)/opengl/nvidia/extensions + doins ${NV_X11_EXT}/libglx.so.${NV_SOVER} || \ + die "failed to install libglx.so" + dosym /usr/$(get_libdir)/opengl/nvidia/extensions/libglx.so.${NV_SOVER} \ + /usr/$(get_libdir)/opengl/nvidia/extensions/libglx.so || \ + die "failed to create libglx.so symlink" + + # XvMC driver + dolib.a ${NV_X11}/libXvMCNVIDIA.a || \ + die "failed to install libXvMCNVIDIA.so" + dolib.so ${NV_X11}/libXvMCNVIDIA.so.${NV_SOVER} || \ + die "failed to install libXvMCNVIDIA.so" + dosym libXvMCNVIDIA.so.${NV_SOVER} /usr/$(get_libdir)/libXvMCNVIDIA.so || \ + die "failed to create libXvMCNVIDIA.so symlink" + + # OpenCL ICD for NVIDIA + if use kernel_linux; then + dodir /etc/OpenCL/vendors + insinto /etc/OpenCL/vendors + doins nvidia.icd + fi + + # Documentation + dohtml ${NV_DOC}/html/* + if use x86-fbsd; then + dodoc "${NV_DOC}/README" + doman "${NV_MAN}/nvidia-xconfig.1" + else + # Docs + newdoc "${NV_DOC}/README.txt" README + dodoc "${NV_DOC}/NVIDIA_Changelog" + doman "${NV_MAN}/nvidia-smi.1.gz" + doman "${NV_MAN}/nvidia-xconfig.1.gz" + fi + + # Helper Apps + dobin ${NV_EXEC}/nvidia-xconfig || die + dobin ${NV_EXEC}/nvidia-bug-report.sh || die + if use kernel_linux; then + dobin ${NV_EXEC}/nvidia-smi || die + fi + + if has_multilib_profile ; then + local OABI=${ABI} + for ABI in $(get_install_abis) ; do + src_install-libs + done + ABI=${OABI} + unset OABI + else + src_install-libs + fi + + is_final_abi || die "failed to iterate through all ABIs" +} + +# Install nvidia library: +# the first parameter is the place where to install it +# the second parameter is the base name of the library +# the third parameter is the provided soversion +donvidia() { + dodir $1 + exeinto $1 + + libname=$(basename $2) + + doexe $2.$3 || die "failed to install $2" + dosym ${libname}.$3 $1/${libname} || die "failed to symlink $2" + [[ $3 != "1" ]] && dosym ${libname}.$3 $1/${libname}.1 +} + +src_install-libs() { + local inslibdir=$(get_libdir) + local NV_ROOT="/usr/${inslibdir}/opengl/nvidia" + local libdir= sover= + + if use kernel_linux; then + if has_multilib_profile && [[ ${ABI} == "x86" ]] ; then + libdir=32 + else + libdir=. + fi + sover=${PV} + else + libdir=obj + # on FreeBSD it has just .1 suffix + sover=1 + fi + + # The GLX libraries + donvidia ${NV_ROOT}/lib ${libdir}/libGL.so ${sover} + donvidia /usr/${inslibdir} ${libdir}/libnvidia-glcore.so ${sover} + if use x86-fbsd; then + donvidia ${NV_ROOT}/lib ${libdir}/libnvidia-tls.so ${sover} + else + donvidia ${NV_ROOT}/lib ${libdir}/tls/libnvidia-tls.so ${sover} + fi + + # VDPAU + donvidia /usr/${inslibdir} ${libdir}/libvdpau_nvidia.so ${sover} + + # CUDA & OpenCL + if use kernel_linux; then + donvidia /usr/${inslibdir} ${libdir}/libcuda.so ${sover} + donvidia /usr/${inslibdir} ${libdir}/libnvidia-compiler.so ${sover} + donvidia /usr/${inslibdir} ${libdir}/libOpenCL.so 1.0.0 + dosym libOpenCL.so.1 /usr/${inslibdir}/libOpenCL.so + fi +} + +pkg_preinst() { + # Clean the dynamic libGL stuff's home to ensure + # we dont have stale libs floating around + if [ -d "${ROOT}"/usr/lib/opengl/nvidia ] ; then + rm -rf "${ROOT}"/usr/lib/opengl/nvidia/* + fi + # Make sure we nuke the old nvidia-glx's env.d file + if [ -e "${ROOT}"/etc/env.d/09nvidia ] ; then + rm -f "${ROOT}"/etc/env.d/09nvidia + fi +} + +pkg_postinst() { + # Switch to the nvidia implementation + eselect opengl set --use-old nvidia + + elog "To use the NVIDIA GLX, run \"eselect opengl set nvidia\"" + elog + elog "NVIDIA has requested that any bug reports submitted have the" + elog "output of /usr/bin/nvidia-bug-report.sh included." + elog + elog "To work with compiz, you must enable the AddARGBGLXVisuals option." + elog + elog "If you are having resolution problems, try disabling DynamicTwinView." + elog +} + +pkg_postrm() { + eselect opengl set --use-old xorg-x11 +} diff --git a/x11-drivers/nvidia-userspace/nvidia-userspace-285.05.09.ebuild b/x11-drivers/nvidia-userspace/nvidia-userspace-285.05.09.ebuild new file mode 100644 index 00000000..6e988b89 --- /dev/null +++ b/x11-drivers/nvidia-userspace/nvidia-userspace-285.05.09.ebuild @@ -0,0 +1,414 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI="2" + +inherit eutils unpacker multilib portability versionator flag-o-matic + +X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}" +AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}" +X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}" + +DESCRIPTION="NVIDIA X11 userspace libraries and applications" +HOMEPAGE="http://www.nvidia.com/" +SRC_URI="x86? ( http://download.nvidia.com/XFree86/Linux-x86/${PV}/${X86_NV_PACKAGE}.run ) + amd64? ( http://download.nvidia.com/XFree86/Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run ) + x86-fbsd? ( http://download.nvidia.com/XFree86/FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )" + +LICENSE="NVIDIA" +SLOT="0" +KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd" +IUSE="multilib kernel_linux" +RESTRICT="strip" +EMULTILIB_PKG="true" + +COMMON="<x11-base/xorg-server-1.10.99 + kernel_linux? ( >=sys-libs/glibc-2.6.1 ) + multilib? ( app-emulation/emul-linux-x86-xlibs ) + >=app-admin/eselect-opengl-1.0.9 + !<media-video/nvidia-settings-256.52" +DEPEND="${COMMON}" +RDEPEND="${COMMON} + x11-libs/libXvMC + !<x11-drivers/nvidia-userspace-${PV} + !>x11-drivers/nvidia-userspace-${PV}" +PDEPEND=">=x11-libs/libvdpau-0.3-r1" + +QA_TEXTRELS_x86=" + usr/lib/libOpenCL.so.1.0.0 + usr/lib/libXvMCNVIDIA.so.${PV} + usr/lib/libcuda.so.${PV} + usr/lib/libnvcuvid.so.${PV} + usr/lib/libnvidia-cfg.so.${PV} + usr/lib/libnvidia-compiler.so.${PV} + usr/lib/libnvidia-glcore.so.${PV} + usr/lib/libnvidia-ml.so.${PV} + usr/lib/libvdpau_nvidia.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib/xorg/modules/drivers/nvidia_drv.so" + +QA_TEXTRELS_x86_fbsd="boot/modules/nvidia.ko + usr/lib/opengl/nvidia/lib/libGL.so.1 + usr/lib/libnvidia-glcore.so.1 + usr/lib/libnvidia-cfg.so.1 + usr/lib/libnvidia-ml.so.1 + usr/lib/opengl/nvidia/extensions/libglx.so.1 + usr/lib/xorg/modules/drivers/nvidia_drv.so" + +QA_TEXTRELS_amd64="usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib32/libnvidia-glcore.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/libcuda.so.${PV} + usr/lib32/libvdpau_nvidia.so.${PV} + usr/lib32/libOpenCL.so.1.0.0 + usr/lib32/libnvidia-compiler.so.${PV}" + +QA_EXECSTACK_x86="usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/libnvidia-glcore.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV} + usr/lib/libXvMCNVIDIA.a:NVXVMC.o + usr/lib/libnvidia-compiler.so.${PV} + usr/lib/libvdpau_nvidia.so.${PV} + usr/lib/libcuda.so.${PV} + usr/lib/libOpenCL.so.1.0.0" + +QA_EXECSTACK_amd64="usr/lib32/libnvidia-glcore.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/libnvidia-compiler.so.${PV} + usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib32/libvdpau_nvidia.so.${PV} + usr/lib32/libcuda.so.${PV} + usr/lib32/libOpenCL.so.1.0.0 + usr/lib64/libnvidia-compiler.so.${PV} + usr/lib64/libXvMCNVIDIA.a:NVXVMC.o + usr/lib64/libnvidia-cfg.so.${PV} + usr/lib64/libnvidia-ml.so.${PV} + usr/lib64/libvdpau_nvidia.so.${PV} + usr/lib64/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/libnvidia-glcore.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV} + usr/lib64/libcuda.so.${PV} + usr/lib64/libOpenCL.so.1.0.0 + usr/lib64/xorg/modules/drivers/nvidia_drv.so + usr/bin/nvidia-smi + usr/bin/nvidia-xconfig + usr/bin/nvidia-settings" + +QA_WX_LOAD_x86="usr/lib/libnvidia-glcore.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/libXvMCNVIDIA.a + usr/lib64/libXvMCNVIDIA.so.${PV}" + +QA_WX_LOAD_amd64="usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/libnvidia-glcore.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/libnvidia-glcore.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV}" + +QA_SONAME_x86="usr/lib/libnvidia-compiler.so.${PV}" + +QA_SONAME_amd64="usr/lib64/libnvidia-compiler.so.${PV} + usr/lib32/libnvidia-compiler.so.${PV}" + +QA_DT_HASH_amd64="usr/lib32/libcuda.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/libnvidia-glcore.so.${PV} + usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib32/libvdpau_nvidia.so.${PV} + usr/lib32/libOpenCL.so.1.0.0 + usr/lib32/libnvidia-compiler.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV} + usr/lib64/libcuda.so.${PV} + usr/lib64/libnvidia-cfg.so.${PV} + usr/lib64/libnvidia-glcore.so.${PV} + usr/lib64/libnvidia-ml.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/xorg/modules/drivers/nvidia_drv.so + usr/lib64/libvdpau_nvidia.so.${PV} + usr/lib64/libOpenCL.so.1.0.0 + usr/lib64/libnvidia-compiler.so.${PV} + usr/lib64/libnvcuvid.so.${PV} + usr/bin/nvidia-smi + usr/bin/nvidia-xconfig + usr/bin/nvidia-settings" + +QA_DT_HASH_x86="usr/lib/libcuda.so.${PV} + usr/lib/libnvidia-cfg.so.${PV} + usr/lib/libnvidia-glcore.so.${PV} + usr/lib/libnvidia-ml.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/xorg/modules/drivers/nvidia_drv.so + usr/lib/libXvMCNVIDIA.so.${PV} + usr/lib/libvdpau_nvidia.so.${PV} + usr/lib/libOpenCL.so.1.0.0 + usr/lib/libnvidia-compiler.so.${PV} + usr/lib/libnvcuvid.so.${PV} + usr/bin/nvidia-smi + usr/bin/nvidia-xconfig + usr/bin/nvidia-settings" + + +S="${WORKDIR}/" + +pkg_setup() { + # try to turn off distcc and ccache for people that have a problem with it + export DISTCC_DISABLE=1 + export CCACHE_DISABLE=1 + + if use amd64 && has_multilib_profile && [ "${DEFAULT_ABI}" != "amd64" ]; then + eerror "This ebuild doesn't currently support changing your default abi." + die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}" + fi + + # On BSD userland it wants real make command + use userland_BSD && MAKE="$(get_bmake)" + + export _POSIX2_VERSION="199209" + + # set variables to where files are in the package structure + if use kernel_FreeBSD; then + NV_DOC="${S}/doc" + NV_EXEC="${S}/obj" + NV_LIB="${S}/obj" + NV_SRC="${S}/src" + NV_MAN="${S}/x11/man" + NV_X11="${S}/obj" + NV_X11_DRV="${NV_X11}" + NV_X11_EXT="${NV_X11}" + NV_SOVER=1 + elif use kernel_linux; then + NV_DOC="${S}" + NV_EXEC="${S}" + NV_LIB="${S}" + NV_SRC="${S}/kernel" + NV_MAN="${S}" + NV_X11="${S}" + NV_X11_DRV="${NV_X11}" + NV_X11_EXT="${NV_X11}" + NV_SOVER=${PV} + else + die "Could not determine proper NVIDIA package" + fi +} + +src_unpack() { + if ! use x86-fbsd; then + cd "${S}" + unpack_makeself + else + unpack ${A} + fi +} + +src_prepare() { + # Please add a brief description for every added patch + use x86-fbsd && cd doc +} + +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 x86-fbsd; then + MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \ + LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die + fi +} + +src_install() { + if use kernel_linux; then + VIDEOGROUP="$(egetent group video | cut -d ':' -f 3)" + if [ -z "$VIDEOGROUP" ]; then + eerror "Failed to determine the video group gid." + die "Failed to determine the video group gid." + fi + + # Add the aliases + [ -f "${FILESDIR}/nvidia-169.07" ] || die "nvidia missing in FILESDIR" + sed -e 's:PACKAGE:'${PF}':g' \ + -e 's:VIDEOGID:'${VIDEOGROUP}':' "${FILESDIR}"/nvidia-169.07 > \ + "${WORKDIR}"/nvidia + insinto /etc/modprobe.d + newins "${WORKDIR}"/nvidia nvidia.conf || die + fi + + # NVIDIA kernel <-> userspace driver config lib + dolib.so ${NV_LIB}/libnvidia-cfg.so.${NV_SOVER} || \ + die "failed to install libnvidia-cfg" + dosym /usr/$(get_libdir)/libnvidia-cfg.so.${NV_SOVER} \ + /usr/$(get_libdir)/libnvidia-cfg.so || \ + die "failed to create libnvidia-cfg.so symlink" + + # NVIDIA monitoring library + dolib.so ${NV_LIB}/libnvidia-ml.so.${NV_SOVER} || \ + die "failed to install libnvidia-ml" + dosym /usr/$(get_libdir)/libnvidia-ml.so.${NV_SOVER} \ + /usr/$(get_libdir)/libnvidia-ml.so || \ + die "failed to create libnvidia-ml.so symlink" + + # NVIDIA video decode <-> CUDA + dolib.so ${NV_LIB}/libnvcuvid.so.${NV_SOVER} || \ + die "failed to install libnvcuvid.so" + dosym /usr/$(get_libdir)/libnvcuvid.so.${NV_SOVER} \ + /usr/$(get_libdir)/libnvcuvid.so || \ + die "failed to create libnvcuvid.so symlink" + + # Xorg DDX driver + insinto /usr/$(get_libdir)/xorg/modules/drivers + doins ${NV_X11_DRV}/nvidia_drv.so || die "failed to install nvidia_drv.so" + + # Xorg GLX driver + insinto /usr/$(get_libdir)/opengl/nvidia/extensions + doins ${NV_X11_EXT}/libglx.so.${NV_SOVER} || \ + die "failed to install libglx.so" + dosym /usr/$(get_libdir)/opengl/nvidia/extensions/libglx.so.${NV_SOVER} \ + /usr/$(get_libdir)/opengl/nvidia/extensions/libglx.so || \ + die "failed to create libglx.so symlink" + + # XvMC driver + dolib.a ${NV_X11}/libXvMCNVIDIA.a || \ + die "failed to install libXvMCNVIDIA.so" + dolib.so ${NV_X11}/libXvMCNVIDIA.so.${NV_SOVER} || \ + die "failed to install libXvMCNVIDIA.so" + dosym libXvMCNVIDIA.so.${NV_SOVER} /usr/$(get_libdir)/libXvMCNVIDIA.so || \ + die "failed to create libXvMCNVIDIA.so symlink" + + # OpenCL ICD for NVIDIA + if use kernel_linux; then + dodir /etc/OpenCL/vendors + insinto /etc/OpenCL/vendors + doins nvidia.icd + fi + + # Documentation + dohtml ${NV_DOC}/html/* + if use x86-fbsd; then + dodoc "${NV_DOC}/README" + doman "${NV_MAN}/nvidia-xconfig.1" + else + # Docs + newdoc "${NV_DOC}/README.txt" README + dodoc "${NV_DOC}/NVIDIA_Changelog" + doman "${NV_MAN}/nvidia-smi.1.gz" + doman "${NV_MAN}/nvidia-xconfig.1.gz" + fi + + # Helper Apps + dobin ${NV_EXEC}/nvidia-xconfig || die + dobin ${NV_EXEC}/nvidia-bug-report.sh || die + if use kernel_linux; then + dobin ${NV_EXEC}/nvidia-smi || die + fi + + if has_multilib_profile ; then + local OABI=${ABI} + for ABI in $(get_install_abis) ; do + src_install-libs + done + ABI=${OABI} + unset OABI + else + src_install-libs + fi + + is_final_abi || die "failed to iterate through all ABIs" +} + +# Install nvidia library: +# the first parameter is the place where to install it +# the second parameter is the base name of the library +# the third parameter is the provided soversion +donvidia() { + dodir $1 + exeinto $1 + + libname=$(basename $2) + + doexe $2.$3 || die "failed to install $2" + dosym ${libname}.$3 $1/${libname} || die "failed to symlink $2" + [[ $3 != "1" ]] && dosym ${libname}.$3 $1/${libname}.1 +} + +src_install-libs() { + local inslibdir=$(get_libdir) + local NV_ROOT="/usr/${inslibdir}/opengl/nvidia" + local libdir= sover= + + if use kernel_linux; then + if has_multilib_profile && [[ ${ABI} == "x86" ]] ; then + libdir=32 + else + libdir=. + fi + sover=${PV} + else + libdir=obj + # on FreeBSD it has just .1 suffix + sover=1 + fi + + # The GLX libraries + donvidia ${NV_ROOT}/lib ${libdir}/libGL.so ${sover} + donvidia /usr/${inslibdir} ${libdir}/libnvidia-glcore.so ${sover} + if use x86-fbsd; then + donvidia ${NV_ROOT}/lib ${libdir}/libnvidia-tls.so ${sover} + else + donvidia ${NV_ROOT}/lib ${libdir}/tls/libnvidia-tls.so ${sover} + fi + + # VDPAU + donvidia /usr/${inslibdir} ${libdir}/libvdpau_nvidia.so ${sover} + + # CUDA & OpenCL + if use kernel_linux; then + donvidia /usr/${inslibdir} ${libdir}/libcuda.so ${sover} + donvidia /usr/${inslibdir} ${libdir}/libnvidia-compiler.so ${sover} + donvidia /usr/${inslibdir} ${libdir}/libOpenCL.so 1.0.0 + dosym libOpenCL.so.1 /usr/${inslibdir}/libOpenCL.so + fi +} + +pkg_preinst() { + # Clean the dynamic libGL stuff's home to ensure + # we dont have stale libs floating around + if [ -d "${ROOT}"/usr/lib/opengl/nvidia ] ; then + rm -rf "${ROOT}"/usr/lib/opengl/nvidia/* + fi + # Make sure we nuke the old nvidia-glx's env.d file + if [ -e "${ROOT}"/etc/env.d/09nvidia ] ; then + rm -f "${ROOT}"/etc/env.d/09nvidia + fi +} + +pkg_postinst() { + # Switch to the nvidia implementation + eselect opengl set --use-old nvidia + + elog "To use the NVIDIA GLX, run \"eselect opengl set nvidia\"" + elog + elog "NVIDIA has requested that any bug reports submitted have the" + elog "output of /usr/bin/nvidia-bug-report.sh included." + elog + elog "To work with compiz, you must enable the AddARGBGLXVisuals option." + elog + elog "If you are having resolution problems, try disabling DynamicTwinView." + elog +} + +pkg_postrm() { + eselect opengl set --use-old xorg-x11 +} diff --git a/x11-drivers/nvidia-userspace/nvidia-userspace-290.10.ebuild b/x11-drivers/nvidia-userspace/nvidia-userspace-290.10.ebuild new file mode 100644 index 00000000..b893f2d7 --- /dev/null +++ b/x11-drivers/nvidia-userspace/nvidia-userspace-290.10.ebuild @@ -0,0 +1,436 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI="2" + +inherit eutils unpacker multilib portability versionator flag-o-matic + +X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}" +AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}" +X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}" + +DESCRIPTION="NVIDIA X11 userspace libraries and applications" +HOMEPAGE="http://www.nvidia.com/" +SRC_URI="x86? ( http://download.nvidia.com/XFree86/Linux-x86/${PV}/${X86_NV_PACKAGE}.run ) + amd64? ( http://download.nvidia.com/XFree86/Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run ) + x86-fbsd? ( http://download.nvidia.com/XFree86/FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )" + +LICENSE="NVIDIA" +SLOT="0" +KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd" +IUSE="multilib kernel_linux" +RESTRICT="strip" +EMULTILIB_PKG="true" + +COMMON="<x11-base/xorg-server-1.11.99 + kernel_linux? ( >=sys-libs/glibc-2.6.1 ) + multilib? ( app-emulation/emul-linux-x86-xlibs ) + >=app-admin/eselect-opengl-1.0.9 + app-admin/eselect-opencl + !<media-video/nvidia-settings-256.52" +DEPEND="${COMMON}" +RDEPEND="${COMMON} + x11-libs/libXvMC + !<x11-drivers/nvidia-userspace-${PV} + !>x11-drivers/nvidia-userspace-${PV}" +PDEPEND=">=x11-libs/libvdpau-0.3-r1" + +QA_TEXTRELS_x86=" + usr/lib/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib/libXvMCNVIDIA.so.${PV} + usr/lib/libcuda.so.${PV} + usr/lib/libnvcuvid.so.${PV} + usr/lib/libnvidia-cfg.so.${PV} + usr/lib/libnvidia-compiler.so.${PV} + usr/lib/libnvidia-glcore.so.${PV} + usr/lib/libnvidia-ml.so.${PV} + usr/lib/libvdpau_nvidia.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib/xorg/modules/drivers/nvidia_drv.so" + +QA_TEXTRELS_x86_fbsd="boot/modules/nvidia.ko + usr/lib/opengl/nvidia/lib/libGL.so.1 + usr/lib/libnvidia-glcore.so.1 + usr/lib/libnvidia-cfg.so.1 + usr/lib/libnvidia-ml.so.1 + usr/lib/opengl/nvidia/extensions/libglx.so.1 + usr/lib/xorg/modules/drivers/nvidia_drv.so" + +QA_TEXTRELS_amd64="usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib32/libnvidia-glcore.so.${PV} + usr/lib32/libvdpau_nvidia.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/libcuda.so.${PV} + usr/lib32/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib32/libnvidia-compiler.so.${PV}" + +QA_EXECSTACK_x86="usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/libnvidia-glcore.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV} + usr/lib/libXvMCNVIDIA.a:NVXVMC.o + usr/lib/libvdpau_nvidia.so.${PV} + usr/lib/libnvidia-compiler.so.${PV} + usr/lib/libcuda.so.${PV} + usr/lib/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0" + +QA_EXECSTACK_amd64="usr/lib32/libnvidia-glcore.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib32/libvdpau_nvidia.so.${PV} + usr/lib32/libcuda.so.${PV} + usr/lib32/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib32/libnvidia-compiler.so.${PV} + usr/lib64/libXvMCNVIDIA.a:NVXVMC.o + usr/lib64/libnvidia-cfg.so.${PV} + usr/lib64/libnvidia-ml.so.${PV} + usr/lib64/libvdpau_nvidia.so.${PV} + usr/lib64/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/libnvidia-glcore.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV} + usr/lib64/libcuda.so.${PV} + usr/lib64/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib64/libnvidia-compiler.so.${PV} + usr/lib64/xorg/modules/drivers/nvidia_drv.so + usr/bin/nvidia-smi + usr/bin/nvidia-xconfig + usr/bin/nvidia-settings" + +QA_WX_LOAD_x86="usr/lib/libnvidia-glcore.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/libXvMCNVIDIA.a + usr/lib64/libXvMCNVIDIA.so.${PV}" + +QA_WX_LOAD_amd64="usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/libnvidia-glcore.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/libnvidia-glcore.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV}" + +QA_SONAME_x86="usr/lib/libnvidia-compiler.so.${PV}" + +QA_SONAME_amd64="usr/lib64/libnvidia-compiler.so.${PV} + usr/lib32/libnvidia-compiler.so.${PV}" + +QA_DT_HASH_amd64="usr/lib32/libcuda.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/libnvidia-glcore.so.${PV} + usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib32/libvdpau_nvidia.so.${PV} + usr/lib32/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib32/libnvidia-compiler.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV} + usr/lib64/libcuda.so.${PV} + usr/lib64/libnvidia-cfg.so.${PV} + usr/lib64/libnvidia-glcore.so.${PV} + usr/lib64/libnvidia-ml.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/xorg/modules/drivers/nvidia_drv.so + usr/lib64/libvdpau_nvidia.so.${PV} + usr/lib64/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib64/libnvidia-compiler.so.${PV} + usr/lib64/libnvcuvid.so.${PV} + usr/bin/nvidia-smi + usr/bin/nvidia-xconfig + usr/bin/nvidia-settings" + +QA_DT_HASH_x86="usr/lib/libcuda.so.${PV} + usr/lib/libnvidia-cfg.so.${PV} + usr/lib/libnvidia-glcore.so.${PV} + usr/lib/libnvidia-ml.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/xorg/modules/drivers/nvidia_drv.so + usr/lib/libXvMCNVIDIA.so.${PV} + usr/lib/libvdpau_nvidia.so.${PV} + usr/lib/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib/libnvidia-compiler.so.${PV} + usr/lib/libnvcuvid.so.${PV} + usr/bin/nvidia-smi + usr/bin/nvidia-xconfig + usr/bin/nvidia-settings" + + +S="${WORKDIR}/" + +pkg_setup() { + # try to turn off distcc and ccache for people that have a problem with it + export DISTCC_DISABLE=1 + export CCACHE_DISABLE=1 + + if use amd64 && has_multilib_profile && [ "${DEFAULT_ABI}" != "amd64" ]; then + eerror "This ebuild doesn't currently support changing your default abi." + die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}" + fi + + # On BSD userland it wants real make command + use userland_BSD && MAKE="$(get_bmake)" + + export _POSIX2_VERSION="199209" + + # set variables to where files are in the package structure + if use kernel_FreeBSD; then + NV_DOC="${S}/doc" + NV_EXEC="${S}/obj" + NV_LIB="${S}/obj" + NV_SRC="${S}/src" + NV_MAN="${S}/x11/man" + NV_X11="${S}/obj" + NV_X11_DRV="${NV_X11}" + NV_X11_EXT="${NV_X11}" + NV_SOVER=1 + elif use kernel_linux; then + NV_DOC="${S}" + NV_EXEC="${S}" + NV_LIB="${S}" + NV_SRC="${S}/kernel" + NV_MAN="${S}" + NV_X11="${S}" + NV_X11_DRV="${NV_X11}" + NV_X11_EXT="${NV_X11}" + NV_SOVER=${PV} + else + die "Could not determine proper NVIDIA package" + fi +} + +src_unpack() { + if ! use x86-fbsd; then + cd "${S}" + unpack_makeself + else + unpack ${A} + fi +} + +src_prepare() { + # Please add a brief description for every added patch + use x86-fbsd && cd doc +} + +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 x86-fbsd; then + MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \ + LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die + fi + cat <<- EOF > "${S}"/nvidia.icd + /usr/$(get_libdir)/libcuda.so + EOF +} + +src_install() { + if use kernel_linux; then + VIDEOGROUP="$(egetent group video | cut -d ':' -f 3)" + if [ -z "$VIDEOGROUP" ]; then + eerror "Failed to determine the video group gid." + die "Failed to determine the video group gid." + fi + + # Add the aliases + [ -f "${FILESDIR}/nvidia-169.07" ] || die "nvidia missing in FILESDIR" + sed -e 's:PACKAGE:'${PF}':g' \ + -e 's:VIDEOGID:'${VIDEOGROUP}':' "${FILESDIR}"/nvidia-169.07 > \ + "${WORKDIR}"/nvidia + insinto /etc/modprobe.d + newins "${WORKDIR}"/nvidia nvidia.conf || die + fi + + # NVIDIA kernel <-> userspace driver config lib + dolib.so ${NV_LIB}/libnvidia-cfg.so.${NV_SOVER} || \ + die "failed to install libnvidia-cfg" + dosym libnvidia-cfg.so.${NV_SOVER} \ + /usr/$(get_libdir)/libnvidia-cfg.so.1 || \ + die "failed to create libnvidia-cfg.so symlink" + dosym libnvidia-cfg.so.1 \ + /usr/$(get_libdir)/libnvidia-cfg.so || \ + die "failed to create libnvidia-cfg.so symlink" + + # NVIDIA monitoring library + dolib.so ${NV_LIB}/libnvidia-ml.so.${NV_SOVER} || \ + die "failed to install libnvidia-ml" + dosym libnvidia-ml.so.${NV_SOVER} \ + /usr/$(get_libdir)/libnvidia-ml.so.1 || \ + die "failed to create libnvidia-ml.so symlink" + dosym libnvidia-ml.so.1 \ + /usr/$(get_libdir)/libnvidia-ml.so || \ + die "failed to create libnvidia-ml.so symlink" + + # NVIDIA video decode <-> CUDA + dolib.so ${NV_LIB}/libnvcuvid.so.${NV_SOVER} || \ + die "failed to install libnvcuvid.so" + dosym libnvcuvid.so.${NV_SOVER} \ + /usr/$(get_libdir)/libnvcuvid.so.1 || \ + die "failed to create libnvcuvid.so symlink" + dosym libnvcuvid.so.1 \ + /usr/$(get_libdir)/libnvcuvid.so || \ + die "failed to create libnvcuvid.so symlink" + + # Xorg DDX driver + insinto /usr/$(get_libdir)/xorg/modules/drivers + doins ${NV_X11_DRV}/nvidia_drv.so || die "failed to install nvidia_drv.so" + + # Xorg GLX driver + insinto /usr/$(get_libdir)/opengl/nvidia/extensions + doins ${NV_X11_EXT}/libglx.so.${NV_SOVER} || \ + die "failed to install libglx.so" + dosym libglx.so.${NV_SOVER} \ + /usr/$(get_libdir)/opengl/nvidia/extensions/libglx.so || \ + die "failed to create libglx.so symlink" + + # XvMC driver + dolib.a ${NV_X11}/libXvMCNVIDIA.a || \ + die "failed to install libXvMCNVIDIA.so" + dolib.so ${NV_X11}/libXvMCNVIDIA.so.${NV_SOVER} || \ + die "failed to install libXvMCNVIDIA.so" + dosym libXvMCNVIDIA.so.${NV_SOVER} \ + /usr/$(get_libdir)/libXvMCNVIDIA.so.1 || \ + die "failed to create libXvMCNVIDIA.so symlink" + dosym libXvMCNVIDIA.so.1 /usr/$(get_libdir)/libXvMCNVIDIA.so || \ + die "failed to create libXvMCNVIDIA.so symlink" + dosym libXvMCNVIDIA.so.${NV_SOVER} \ + /usr/$(get_libdir)/libXvMCNVIDIA_dynamic.so.1 || \ + die "failed to create libXvMCNVIDIA_dynamic.so symlink" + + # OpenCL ICD for NVIDIA + if use kernel_linux; then + insinto /etc/OpenCL/vendors + doins nvidia.icd + fi + + # Documentation + dohtml ${NV_DOC}/html/* + if use x86-fbsd; then + dodoc "${NV_DOC}/README" + doman "${NV_MAN}/nvidia-xconfig.1" + else + # Docs + newdoc "${NV_DOC}/README.txt" README + dodoc "${NV_DOC}/NVIDIA_Changelog" + doman "${NV_MAN}/nvidia-smi.1.gz" + doman "${NV_MAN}/nvidia-xconfig.1.gz" + fi + + # Helper Apps + dobin ${NV_EXEC}/nvidia-xconfig || die + dobin ${NV_EXEC}/nvidia-bug-report.sh || die + if use kernel_linux; then + dobin ${NV_EXEC}/nvidia-smi || die + fi + + if has_multilib_profile ; then + local OABI=${ABI} + for ABI in $(get_install_abis) ; do + src_install-libs + done + ABI=${OABI} + unset OABI + else + src_install-libs + fi + + is_final_abi || die "failed to iterate through all ABIs" +} + +# Install nvidia library: +# the first parameter is the place where to install it +# the second parameter is the base name of the library +# the third parameter is the provided soversion +donvidia() { + dodir $1 + exeinto $1 + + libname=$(basename $2) + + doexe $2.$3 || die "failed to install $2" + dosym ${libname}.$3 $1/${libname} || die "failed to symlink $2" + [[ $3 != "1" ]] && dosym ${libname}.$3 $1/${libname}.1 +} + +src_install-libs() { + local inslibdir=$(get_libdir) + local NV_ROOT="/usr/${inslibdir}/opengl/nvidia" + local CL_ROOT=/usr/${inslibdir}/OpenCL/vendors/nvidia + local libdir= sover= + + if use kernel_linux; then + if has_multilib_profile && [[ ${ABI} == "x86" ]] ; then + libdir=32 + else + libdir=. + fi + sover=${PV} + else + libdir=obj + # on FreeBSD it has just .1 suffix + sover=1 + fi + + # The GLX libraries + donvidia ${NV_ROOT}/lib ${libdir}/libGL.so ${sover} + donvidia /usr/${inslibdir} ${libdir}/libnvidia-glcore.so ${sover} + if use x86-fbsd; then + donvidia ${NV_ROOT}/lib ${libdir}/libnvidia-tls.so ${sover} + else + donvidia ${NV_ROOT}/lib ${libdir}/tls/libnvidia-tls.so ${sover} + fi + + # VDPAU + donvidia /usr/${inslibdir} ${libdir}/libvdpau_nvidia.so ${sover} + + # CUDA & OpenCL + if use kernel_linux; then + donvidia /usr/${inslibdir} ${libdir}/libcuda.so ${sover} + donvidia /usr/${inslibdir} ${libdir}/libnvidia-compiler.so ${sover} + donvidia ${CL_ROOT} ${libdir}/libOpenCL.so 1.0.0 + #dosym libOpenCL.so.1 ${CL_ROOT}/libOpenCL.so + fi +} + +pkg_preinst() { + # 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() { + # Switch to the nvidia implementation + eselect opengl set --use-old nvidia + eselect opencl set --use-old nvidia + + elog "To use the NVIDIA GLX, run \"eselect opengl set nvidia\"" + elog + elog "To use the NVIDIA CUDA/OpenCL, run \"eselect opencl set nvidia\"" + elog + elog "NVIDIA has requested that any bug reports submitted have the" + elog "output of /usr/bin/nvidia-bug-report.sh included." + elog + elog "To work with compiz, you must enable the AddARGBGLXVisuals option." + elog + elog "If you are having resolution problems, try disabling DynamicTwinView." + elog +} + +pkg_postrm() { + eselect opengl set --use-old xorg-x11 +} diff --git a/x11-drivers/nvidia-userspace/nvidia-userspace-295.20.ebuild b/x11-drivers/nvidia-userspace/nvidia-userspace-295.20.ebuild new file mode 100644 index 00000000..b893f2d7 --- /dev/null +++ b/x11-drivers/nvidia-userspace/nvidia-userspace-295.20.ebuild @@ -0,0 +1,436 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI="2" + +inherit eutils unpacker multilib portability versionator flag-o-matic + +X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}" +AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}" +X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}" + +DESCRIPTION="NVIDIA X11 userspace libraries and applications" +HOMEPAGE="http://www.nvidia.com/" +SRC_URI="x86? ( http://download.nvidia.com/XFree86/Linux-x86/${PV}/${X86_NV_PACKAGE}.run ) + amd64? ( http://download.nvidia.com/XFree86/Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run ) + x86-fbsd? ( http://download.nvidia.com/XFree86/FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )" + +LICENSE="NVIDIA" +SLOT="0" +KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd" +IUSE="multilib kernel_linux" +RESTRICT="strip" +EMULTILIB_PKG="true" + +COMMON="<x11-base/xorg-server-1.11.99 + kernel_linux? ( >=sys-libs/glibc-2.6.1 ) + multilib? ( app-emulation/emul-linux-x86-xlibs ) + >=app-admin/eselect-opengl-1.0.9 + app-admin/eselect-opencl + !<media-video/nvidia-settings-256.52" +DEPEND="${COMMON}" +RDEPEND="${COMMON} + x11-libs/libXvMC + !<x11-drivers/nvidia-userspace-${PV} + !>x11-drivers/nvidia-userspace-${PV}" +PDEPEND=">=x11-libs/libvdpau-0.3-r1" + +QA_TEXTRELS_x86=" + usr/lib/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib/libXvMCNVIDIA.so.${PV} + usr/lib/libcuda.so.${PV} + usr/lib/libnvcuvid.so.${PV} + usr/lib/libnvidia-cfg.so.${PV} + usr/lib/libnvidia-compiler.so.${PV} + usr/lib/libnvidia-glcore.so.${PV} + usr/lib/libnvidia-ml.so.${PV} + usr/lib/libvdpau_nvidia.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib/xorg/modules/drivers/nvidia_drv.so" + +QA_TEXTRELS_x86_fbsd="boot/modules/nvidia.ko + usr/lib/opengl/nvidia/lib/libGL.so.1 + usr/lib/libnvidia-glcore.so.1 + usr/lib/libnvidia-cfg.so.1 + usr/lib/libnvidia-ml.so.1 + usr/lib/opengl/nvidia/extensions/libglx.so.1 + usr/lib/xorg/modules/drivers/nvidia_drv.so" + +QA_TEXTRELS_amd64="usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib32/libnvidia-glcore.so.${PV} + usr/lib32/libvdpau_nvidia.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/libcuda.so.${PV} + usr/lib32/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib32/libnvidia-compiler.so.${PV}" + +QA_EXECSTACK_x86="usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/libnvidia-glcore.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV} + usr/lib/libXvMCNVIDIA.a:NVXVMC.o + usr/lib/libvdpau_nvidia.so.${PV} + usr/lib/libnvidia-compiler.so.${PV} + usr/lib/libcuda.so.${PV} + usr/lib/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0" + +QA_EXECSTACK_amd64="usr/lib32/libnvidia-glcore.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib32/libvdpau_nvidia.so.${PV} + usr/lib32/libcuda.so.${PV} + usr/lib32/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib32/libnvidia-compiler.so.${PV} + usr/lib64/libXvMCNVIDIA.a:NVXVMC.o + usr/lib64/libnvidia-cfg.so.${PV} + usr/lib64/libnvidia-ml.so.${PV} + usr/lib64/libvdpau_nvidia.so.${PV} + usr/lib64/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/libnvidia-glcore.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV} + usr/lib64/libcuda.so.${PV} + usr/lib64/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib64/libnvidia-compiler.so.${PV} + usr/lib64/xorg/modules/drivers/nvidia_drv.so + usr/bin/nvidia-smi + usr/bin/nvidia-xconfig + usr/bin/nvidia-settings" + +QA_WX_LOAD_x86="usr/lib/libnvidia-glcore.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/libXvMCNVIDIA.a + usr/lib64/libXvMCNVIDIA.so.${PV}" + +QA_WX_LOAD_amd64="usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/libnvidia-glcore.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/libnvidia-glcore.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV}" + +QA_SONAME_x86="usr/lib/libnvidia-compiler.so.${PV}" + +QA_SONAME_amd64="usr/lib64/libnvidia-compiler.so.${PV} + usr/lib32/libnvidia-compiler.so.${PV}" + +QA_DT_HASH_amd64="usr/lib32/libcuda.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/libnvidia-glcore.so.${PV} + usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib32/libvdpau_nvidia.so.${PV} + usr/lib32/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib32/libnvidia-compiler.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV} + usr/lib64/libcuda.so.${PV} + usr/lib64/libnvidia-cfg.so.${PV} + usr/lib64/libnvidia-glcore.so.${PV} + usr/lib64/libnvidia-ml.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/xorg/modules/drivers/nvidia_drv.so + usr/lib64/libvdpau_nvidia.so.${PV} + usr/lib64/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib64/libnvidia-compiler.so.${PV} + usr/lib64/libnvcuvid.so.${PV} + usr/bin/nvidia-smi + usr/bin/nvidia-xconfig + usr/bin/nvidia-settings" + +QA_DT_HASH_x86="usr/lib/libcuda.so.${PV} + usr/lib/libnvidia-cfg.so.${PV} + usr/lib/libnvidia-glcore.so.${PV} + usr/lib/libnvidia-ml.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/xorg/modules/drivers/nvidia_drv.so + usr/lib/libXvMCNVIDIA.so.${PV} + usr/lib/libvdpau_nvidia.so.${PV} + usr/lib/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib/libnvidia-compiler.so.${PV} + usr/lib/libnvcuvid.so.${PV} + usr/bin/nvidia-smi + usr/bin/nvidia-xconfig + usr/bin/nvidia-settings" + + +S="${WORKDIR}/" + +pkg_setup() { + # try to turn off distcc and ccache for people that have a problem with it + export DISTCC_DISABLE=1 + export CCACHE_DISABLE=1 + + if use amd64 && has_multilib_profile && [ "${DEFAULT_ABI}" != "amd64" ]; then + eerror "This ebuild doesn't currently support changing your default abi." + die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}" + fi + + # On BSD userland it wants real make command + use userland_BSD && MAKE="$(get_bmake)" + + export _POSIX2_VERSION="199209" + + # set variables to where files are in the package structure + if use kernel_FreeBSD; then + NV_DOC="${S}/doc" + NV_EXEC="${S}/obj" + NV_LIB="${S}/obj" + NV_SRC="${S}/src" + NV_MAN="${S}/x11/man" + NV_X11="${S}/obj" + NV_X11_DRV="${NV_X11}" + NV_X11_EXT="${NV_X11}" + NV_SOVER=1 + elif use kernel_linux; then + NV_DOC="${S}" + NV_EXEC="${S}" + NV_LIB="${S}" + NV_SRC="${S}/kernel" + NV_MAN="${S}" + NV_X11="${S}" + NV_X11_DRV="${NV_X11}" + NV_X11_EXT="${NV_X11}" + NV_SOVER=${PV} + else + die "Could not determine proper NVIDIA package" + fi +} + +src_unpack() { + if ! use x86-fbsd; then + cd "${S}" + unpack_makeself + else + unpack ${A} + fi +} + +src_prepare() { + # Please add a brief description for every added patch + use x86-fbsd && cd doc +} + +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 x86-fbsd; then + MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \ + LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die + fi + cat <<- EOF > "${S}"/nvidia.icd + /usr/$(get_libdir)/libcuda.so + EOF +} + +src_install() { + if use kernel_linux; then + VIDEOGROUP="$(egetent group video | cut -d ':' -f 3)" + if [ -z "$VIDEOGROUP" ]; then + eerror "Failed to determine the video group gid." + die "Failed to determine the video group gid." + fi + + # Add the aliases + [ -f "${FILESDIR}/nvidia-169.07" ] || die "nvidia missing in FILESDIR" + sed -e 's:PACKAGE:'${PF}':g' \ + -e 's:VIDEOGID:'${VIDEOGROUP}':' "${FILESDIR}"/nvidia-169.07 > \ + "${WORKDIR}"/nvidia + insinto /etc/modprobe.d + newins "${WORKDIR}"/nvidia nvidia.conf || die + fi + + # NVIDIA kernel <-> userspace driver config lib + dolib.so ${NV_LIB}/libnvidia-cfg.so.${NV_SOVER} || \ + die "failed to install libnvidia-cfg" + dosym libnvidia-cfg.so.${NV_SOVER} \ + /usr/$(get_libdir)/libnvidia-cfg.so.1 || \ + die "failed to create libnvidia-cfg.so symlink" + dosym libnvidia-cfg.so.1 \ + /usr/$(get_libdir)/libnvidia-cfg.so || \ + die "failed to create libnvidia-cfg.so symlink" + + # NVIDIA monitoring library + dolib.so ${NV_LIB}/libnvidia-ml.so.${NV_SOVER} || \ + die "failed to install libnvidia-ml" + dosym libnvidia-ml.so.${NV_SOVER} \ + /usr/$(get_libdir)/libnvidia-ml.so.1 || \ + die "failed to create libnvidia-ml.so symlink" + dosym libnvidia-ml.so.1 \ + /usr/$(get_libdir)/libnvidia-ml.so || \ + die "failed to create libnvidia-ml.so symlink" + + # NVIDIA video decode <-> CUDA + dolib.so ${NV_LIB}/libnvcuvid.so.${NV_SOVER} || \ + die "failed to install libnvcuvid.so" + dosym libnvcuvid.so.${NV_SOVER} \ + /usr/$(get_libdir)/libnvcuvid.so.1 || \ + die "failed to create libnvcuvid.so symlink" + dosym libnvcuvid.so.1 \ + /usr/$(get_libdir)/libnvcuvid.so || \ + die "failed to create libnvcuvid.so symlink" + + # Xorg DDX driver + insinto /usr/$(get_libdir)/xorg/modules/drivers + doins ${NV_X11_DRV}/nvidia_drv.so || die "failed to install nvidia_drv.so" + + # Xorg GLX driver + insinto /usr/$(get_libdir)/opengl/nvidia/extensions + doins ${NV_X11_EXT}/libglx.so.${NV_SOVER} || \ + die "failed to install libglx.so" + dosym libglx.so.${NV_SOVER} \ + /usr/$(get_libdir)/opengl/nvidia/extensions/libglx.so || \ + die "failed to create libglx.so symlink" + + # XvMC driver + dolib.a ${NV_X11}/libXvMCNVIDIA.a || \ + die "failed to install libXvMCNVIDIA.so" + dolib.so ${NV_X11}/libXvMCNVIDIA.so.${NV_SOVER} || \ + die "failed to install libXvMCNVIDIA.so" + dosym libXvMCNVIDIA.so.${NV_SOVER} \ + /usr/$(get_libdir)/libXvMCNVIDIA.so.1 || \ + die "failed to create libXvMCNVIDIA.so symlink" + dosym libXvMCNVIDIA.so.1 /usr/$(get_libdir)/libXvMCNVIDIA.so || \ + die "failed to create libXvMCNVIDIA.so symlink" + dosym libXvMCNVIDIA.so.${NV_SOVER} \ + /usr/$(get_libdir)/libXvMCNVIDIA_dynamic.so.1 || \ + die "failed to create libXvMCNVIDIA_dynamic.so symlink" + + # OpenCL ICD for NVIDIA + if use kernel_linux; then + insinto /etc/OpenCL/vendors + doins nvidia.icd + fi + + # Documentation + dohtml ${NV_DOC}/html/* + if use x86-fbsd; then + dodoc "${NV_DOC}/README" + doman "${NV_MAN}/nvidia-xconfig.1" + else + # Docs + newdoc "${NV_DOC}/README.txt" README + dodoc "${NV_DOC}/NVIDIA_Changelog" + doman "${NV_MAN}/nvidia-smi.1.gz" + doman "${NV_MAN}/nvidia-xconfig.1.gz" + fi + + # Helper Apps + dobin ${NV_EXEC}/nvidia-xconfig || die + dobin ${NV_EXEC}/nvidia-bug-report.sh || die + if use kernel_linux; then + dobin ${NV_EXEC}/nvidia-smi || die + fi + + if has_multilib_profile ; then + local OABI=${ABI} + for ABI in $(get_install_abis) ; do + src_install-libs + done + ABI=${OABI} + unset OABI + else + src_install-libs + fi + + is_final_abi || die "failed to iterate through all ABIs" +} + +# Install nvidia library: +# the first parameter is the place where to install it +# the second parameter is the base name of the library +# the third parameter is the provided soversion +donvidia() { + dodir $1 + exeinto $1 + + libname=$(basename $2) + + doexe $2.$3 || die "failed to install $2" + dosym ${libname}.$3 $1/${libname} || die "failed to symlink $2" + [[ $3 != "1" ]] && dosym ${libname}.$3 $1/${libname}.1 +} + +src_install-libs() { + local inslibdir=$(get_libdir) + local NV_ROOT="/usr/${inslibdir}/opengl/nvidia" + local CL_ROOT=/usr/${inslibdir}/OpenCL/vendors/nvidia + local libdir= sover= + + if use kernel_linux; then + if has_multilib_profile && [[ ${ABI} == "x86" ]] ; then + libdir=32 + else + libdir=. + fi + sover=${PV} + else + libdir=obj + # on FreeBSD it has just .1 suffix + sover=1 + fi + + # The GLX libraries + donvidia ${NV_ROOT}/lib ${libdir}/libGL.so ${sover} + donvidia /usr/${inslibdir} ${libdir}/libnvidia-glcore.so ${sover} + if use x86-fbsd; then + donvidia ${NV_ROOT}/lib ${libdir}/libnvidia-tls.so ${sover} + else + donvidia ${NV_ROOT}/lib ${libdir}/tls/libnvidia-tls.so ${sover} + fi + + # VDPAU + donvidia /usr/${inslibdir} ${libdir}/libvdpau_nvidia.so ${sover} + + # CUDA & OpenCL + if use kernel_linux; then + donvidia /usr/${inslibdir} ${libdir}/libcuda.so ${sover} + donvidia /usr/${inslibdir} ${libdir}/libnvidia-compiler.so ${sover} + donvidia ${CL_ROOT} ${libdir}/libOpenCL.so 1.0.0 + #dosym libOpenCL.so.1 ${CL_ROOT}/libOpenCL.so + fi +} + +pkg_preinst() { + # 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() { + # Switch to the nvidia implementation + eselect opengl set --use-old nvidia + eselect opencl set --use-old nvidia + + elog "To use the NVIDIA GLX, run \"eselect opengl set nvidia\"" + elog + elog "To use the NVIDIA CUDA/OpenCL, run \"eselect opencl set nvidia\"" + elog + elog "NVIDIA has requested that any bug reports submitted have the" + elog "output of /usr/bin/nvidia-bug-report.sh included." + elog + elog "To work with compiz, you must enable the AddARGBGLXVisuals option." + elog + elog "If you are having resolution problems, try disabling DynamicTwinView." + elog +} + +pkg_postrm() { + eselect opengl set --use-old xorg-x11 +} diff --git a/x11-drivers/nvidia-userspace/nvidia-userspace-295.33.ebuild b/x11-drivers/nvidia-userspace/nvidia-userspace-295.33.ebuild new file mode 100644 index 00000000..b8e99462 --- /dev/null +++ b/x11-drivers/nvidia-userspace/nvidia-userspace-295.33.ebuild @@ -0,0 +1,452 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI="2" + +inherit eutils unpacker multilib portability versionator flag-o-matic + +X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}" +AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}" +X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}" + +DESCRIPTION="NVIDIA X11 userspace libraries and applications" +HOMEPAGE="http://www.nvidia.com/" +SRC_URI="x86? ( http://us.download.nvidia.com/XFree86/Linux-x86/${PV}/${X86_NV_PACKAGE}.run ) + amd64? ( http://us.download.nvidia.com/XFree86/Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run ) + x86-fbsd? ( http://us.download.nvidia.com/XFree86/FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )" + +LICENSE="NVIDIA" +SLOT="0" +KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd" +IUSE="acpi multilib kernel_linux" +RESTRICT="strip" +EMULTILIB_PKG="true" + +COMMON="<x11-base/xorg-server-1.12.99 + kernel_linux? ( >=sys-libs/glibc-2.6.1 ) + multilib? ( app-emulation/emul-linux-x86-xlibs ) + >=app-admin/eselect-opengl-1.0.9 + app-admin/eselect-opencl + !<media-video/nvidia-settings-256.52" +DEPEND="${COMMON}" +RDEPEND="${COMMON} + x11-libs/libXvMC + !<x11-drivers/nvidia-userspace-${PV} + !>x11-drivers/nvidia-userspace-${PV} + acpi? ( sys-power/acpid )" +PDEPEND=">=x11-libs/libvdpau-0.3-r1" + +QA_TEXTRELS_x86=" + usr/lib/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib/libXvMCNVIDIA.so.${PV} + usr/lib/libcuda.so.${PV} + usr/lib/libnvcuvid.so.${PV} + usr/lib/libnvidia-cfg.so.${PV} + usr/lib/libnvidia-compiler.so.${PV} + usr/lib/libnvidia-glcore.so.${PV} + usr/lib/libnvidia-ml.so.${PV} + usr/lib/libvdpau_nvidia.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib/xorg/modules/drivers/nvidia_drv.so" + +QA_TEXTRELS_x86_fbsd="boot/modules/nvidia.ko + usr/lib/opengl/nvidia/lib/libGL.so.1 + usr/lib/libnvidia-glcore.so.1 + usr/lib/libnvidia-cfg.so.1 + usr/lib/libnvidia-ml.so.1 + usr/lib/opengl/nvidia/extensions/libglx.so.1 + usr/lib/xorg/modules/drivers/nvidia_drv.so" + +QA_TEXTRELS_amd64="usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib32/libnvidia-glcore.so.${PV} + usr/lib32/libvdpau_nvidia.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/libcuda.so.${PV} + usr/lib32/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib32/libnvidia-compiler.so.${PV}" + +QA_EXECSTACK_x86="usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/libnvidia-glcore.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV} + usr/lib/libXvMCNVIDIA.a:NVXVMC.o + usr/lib/libvdpau_nvidia.so.${PV} + usr/lib/libnvidia-compiler.so.${PV} + usr/lib/libcuda.so.${PV} + usr/lib/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0" + +QA_EXECSTACK_amd64="usr/lib32/libnvidia-glcore.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib32/libvdpau_nvidia.so.${PV} + usr/lib32/libcuda.so.${PV} + usr/lib32/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib32/libnvidia-compiler.so.${PV} + usr/lib64/libXvMCNVIDIA.a:NVXVMC.o + usr/lib64/libnvidia-cfg.so.${PV} + usr/lib64/libnvidia-ml.so.${PV} + usr/lib64/libvdpau_nvidia.so.${PV} + usr/lib64/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/libnvidia-glcore.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV} + usr/lib64/libcuda.so.${PV} + usr/lib64/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib64/libnvidia-compiler.so.${PV} + usr/lib64/xorg/modules/drivers/nvidia_drv.so + opt/bin/nvidia-smi + opt/bin/nvidia-xconfig + opt/bin/nvidia-debugdump + opt/bin/nvidia-settings" + +QA_WX_LOAD_x86="usr/lib/libnvidia-glcore.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/libXvMCNVIDIA.a + usr/lib64/libXvMCNVIDIA.so.${PV}" + +QA_WX_LOAD_amd64="usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/libnvidia-glcore.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/libnvidia-glcore.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV}" + +QA_SONAME_x86="usr/lib/libnvidia-compiler.so.${PV}" + +QA_SONAME_amd64="usr/lib64/libnvidia-compiler.so.${PV} + usr/lib32/libnvidia-compiler.so.${PV}" + +QA_DT_HASH_amd64="usr/lib32/libcuda.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/libnvidia-glcore.so.${PV} + usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib32/libvdpau_nvidia.so.${PV} + usr/lib32/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib32/libnvidia-compiler.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV} + usr/lib64/libcuda.so.${PV} + usr/lib64/libnvidia-cfg.so.${PV} + usr/lib64/libnvidia-glcore.so.${PV} + usr/lib64/libnvidia-ml.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/xorg/modules/drivers/nvidia_drv.so + usr/lib64/libvdpau_nvidia.so.${PV} + usr/lib64/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib64/libnvidia-compiler.so.${PV} + usr/lib64/libnvcuvid.so.${PV} + opt/bin/nvidia-smi + opt/bin/nvidia-xconfig + opt/bin/nvidia-debugdump + opt/bin/nvidia-settings" + +QA_DT_HASH_x86="usr/lib/libcuda.so.${PV} + usr/lib/libnvidia-cfg.so.${PV} + usr/lib/libnvidia-glcore.so.${PV} + usr/lib/libnvidia-ml.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/xorg/modules/drivers/nvidia_drv.so + usr/lib/libXvMCNVIDIA.so.${PV} + usr/lib/libvdpau_nvidia.so.${PV} + usr/lib/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib/libnvidia-compiler.so.${PV} + usr/lib/libnvcuvid.so.${PV} + opt/bin/nvidia-smi + opt/bin/nvidia-xconfig + opt/bin/nvidia-debugdump + opt/bin/nvidia-settings" + + +S="${WORKDIR}/" + +pkg_setup() { + # try to turn off distcc and ccache for people that have a problem with it + export DISTCC_DISABLE=1 + export CCACHE_DISABLE=1 + + if use amd64 && has_multilib_profile && [ "${DEFAULT_ABI}" != "amd64" ]; then + eerror "This ebuild doesn't currently support changing your default abi." + die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}" + fi + + # On BSD userland it wants real make command + use userland_BSD && MAKE="$(get_bmake)" + + export _POSIX2_VERSION="199209" + + # set variables to where files are in the package structure + if use kernel_FreeBSD; then + NV_DOC="${S}/doc" + NV_EXEC="${S}/obj" + NV_LIB="${S}/obj" + NV_SRC="${S}/src" + NV_MAN="${S}/x11/man" + NV_X11="${S}/obj" + NV_X11_DRV="${NV_X11}" + NV_X11_EXT="${NV_X11}" + NV_SOVER=1 + elif use kernel_linux; then + NV_DOC="${S}" + NV_EXEC="${S}" + NV_LIB="${S}" + NV_SRC="${S}/kernel" + NV_MAN="${S}" + NV_X11="${S}" + NV_X11_DRV="${NV_X11}" + NV_X11_EXT="${NV_X11}" + NV_SOVER=${PV} + else + die "Could not determine proper NVIDIA package" + fi +} + +src_unpack() { + if ! use x86-fbsd; then + cd "${S}" + unpack_makeself + else + unpack ${A} + fi +} + +src_prepare() { + # Please add a brief description for every added patch + use x86-fbsd && cd doc + cat <<- EOF > "${S}"/nvidia.icd + /usr/$(get_libdir)/libcuda.so + EOF +} + +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 x86-fbsd; then + MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \ + LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die + fi +} + +src_install() { + if use kernel_linux; then + VIDEOGROUP="$(egetent group video | cut -d ':' -f 3)" + if [ -z "$VIDEOGROUP" ]; then + eerror "Failed to determine the video group gid." + die "Failed to determine the video group gid." + fi + + # Add the aliases + [ -f "${FILESDIR}/nvidia-169.07" ] || die "nvidia missing in FILESDIR" + sed -e 's:PACKAGE:'${PF}':g' \ + -e 's:VIDEOGID:'${VIDEOGROUP}':' "${FILESDIR}"/nvidia-169.07 > \ + "${WORKDIR}"/nvidia + insinto /etc/modprobe.d + newins "${WORKDIR}"/nvidia nvidia.conf || die + + # Ensures that our device nodes are created when not using X + exeinto /lib/udev + doexe "${FILESDIR}"/nvidia-udev.sh + + insinto /lib/udev/rules.d + newins "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules + fi + + # NVIDIA kernel <-> userspace driver config lib + dolib.so ${NV_LIB}/libnvidia-cfg.so.${NV_SOVER} || \ + die "failed to install libnvidia-cfg" + dosym libnvidia-cfg.so.${NV_SOVER} \ + /usr/$(get_libdir)/libnvidia-cfg.so.1 || \ + die "failed to create libnvidia-cfg.so symlink" + dosym libnvidia-cfg.so.1 \ + /usr/$(get_libdir)/libnvidia-cfg.so || \ + die "failed to create libnvidia-cfg.so symlink" + + # NVIDIA monitoring library + dolib.so ${NV_LIB}/libnvidia-ml.so.${NV_SOVER} || \ + die "failed to install libnvidia-ml" + dosym libnvidia-ml.so.${NV_SOVER} \ + /usr/$(get_libdir)/libnvidia-ml.so.1 || \ + die "failed to create libnvidia-ml.so symlink" + dosym libnvidia-ml.so.1 \ + /usr/$(get_libdir)/libnvidia-ml.so || \ + die "failed to create libnvidia-ml.so symlink" + + # NVIDIA video decode <-> CUDA + dolib.so ${NV_LIB}/libnvcuvid.so.${NV_SOVER} || \ + die "failed to install libnvcuvid.so" + dosym libnvcuvid.so.${NV_SOVER} \ + /usr/$(get_libdir)/libnvcuvid.so.1 || \ + die "failed to create libnvcuvid.so symlink" + dosym libnvcuvid.so.1 \ + /usr/$(get_libdir)/libnvcuvid.so || \ + die "failed to create libnvcuvid.so symlink" + + # Xorg DDX driver + insinto /usr/$(get_libdir)/xorg/modules/drivers + doins ${NV_X11_DRV}/nvidia_drv.so || die "failed to install nvidia_drv.so" + + # Xorg GLX driver + insinto /usr/$(get_libdir)/opengl/nvidia/extensions + doins ${NV_X11_EXT}/libglx.so.${NV_SOVER} || \ + die "failed to install libglx.so" + dosym libglx.so.${NV_SOVER} \ + /usr/$(get_libdir)/opengl/nvidia/extensions/libglx.so || \ + die "failed to create libglx.so symlink" + + # XvMC driver + dolib.a ${NV_X11}/libXvMCNVIDIA.a || \ + die "failed to install libXvMCNVIDIA.so" + dolib.so ${NV_X11}/libXvMCNVIDIA.so.${NV_SOVER} || \ + die "failed to install libXvMCNVIDIA.so" + dosym libXvMCNVIDIA.so.${NV_SOVER} \ + /usr/$(get_libdir)/libXvMCNVIDIA.so.1 || \ + die "failed to create libXvMCNVIDIA.so symlink" + dosym libXvMCNVIDIA.so.1 /usr/$(get_libdir)/libXvMCNVIDIA.so || \ + die "failed to create libXvMCNVIDIA.so symlink" + dosym libXvMCNVIDIA.so.${NV_SOVER} \ + /usr/$(get_libdir)/libXvMCNVIDIA_dynamic.so.1 || \ + die "failed to create libXvMCNVIDIA_dynamic.so symlink" + + # OpenCL ICD for NVIDIA + if use kernel_linux; then + insinto /etc/OpenCL/vendors + doins nvidia.icd + fi + + # Documentation + dohtml ${NV_DOC}/html/* + if use x86-fbsd; then + dodoc "${NV_DOC}/README" + doman "${NV_MAN}/nvidia-xconfig.1" + else + # Docs + newdoc "${NV_DOC}/README.txt" README + dodoc "${NV_DOC}/NVIDIA_Changelog" + doman "${NV_MAN}/nvidia-smi.1.gz" + doman "${NV_MAN}/nvidia-xconfig.1.gz" + fi + + # Helper Apps + exeinto /opt/bin/ + doexe ${NV_EXEC}/nvidia-xconfig || die + doexe ${NV_EXEC}/nvidia-debugdump || die + if use gtk; then + doexe ${NV_EXEC}/nvidia-settings || die + fi + doexe ${NV_EXEC}/nvidia-bug-report.sh || die + if use kernel_linux; then + doexe ${NV_EXEC}/nvidia-smi || die + fi + + if has_multilib_profile ; then + local OABI=${ABI} + for ABI in $(get_install_abis) ; do + src_install-libs + done + ABI=${OABI} + unset OABI + else + src_install-libs + fi + + is_final_abi || die "failed to iterate through all ABIs" +} + +# Install nvidia library: +# the first parameter is the place where to install it +# the second parameter is the base name of the library +# the third parameter is the provided soversion +donvidia() { + dodir $1 + exeinto $1 + + libname=$(basename $2) + + doexe $2.$3 || die "failed to install $2" + dosym ${libname}.$3 $1/${libname} || die "failed to symlink $2" + [[ $3 != "1" ]] && dosym ${libname}.$3 $1/${libname}.1 +} + +src_install-libs() { + local inslibdir=$(get_libdir) + local NV_ROOT="/usr/${inslibdir}/opengl/nvidia" + local CL_ROOT=/usr/${inslibdir}/OpenCL/vendors/nvidia + local libdir= sover= + + if use kernel_linux; then + if has_multilib_profile && [[ ${ABI} == "x86" ]] ; then + libdir=32 + else + libdir=. + fi + sover=${PV} + else + libdir=obj + # on FreeBSD it has just .1 suffix + sover=1 + fi + + # The GLX libraries + donvidia ${NV_ROOT}/lib ${libdir}/libGL.so ${sover} + donvidia /usr/${inslibdir} ${libdir}/libnvidia-glcore.so ${sover} + if use x86-fbsd; then + donvidia ${NV_ROOT}/lib ${libdir}/libnvidia-tls.so ${sover} + else + donvidia ${NV_ROOT}/lib ${libdir}/tls/libnvidia-tls.so ${sover} + fi + + # VDPAU + donvidia /usr/${inslibdir} ${libdir}/libvdpau_nvidia.so ${sover} + + # CUDA & OpenCL + if use kernel_linux; then + donvidia /usr/${inslibdir} ${libdir}/libcuda.so ${sover} + donvidia /usr/${inslibdir} ${libdir}/libnvidia-compiler.so ${sover} + donvidia ${CL_ROOT} ${libdir}/libOpenCL.so 1.0.0 + #dosym libOpenCL.so.1 ${CL_ROOT}/libOpenCL.so + fi +} + +pkg_preinst() { + # 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() { + # Switch to the nvidia implementation + "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia + "${ROOT}"/usr/bin/eselect opencl set --use-old nvidia + + elog "To use the NVIDIA GLX, run \"eselect opengl set nvidia\"" + elog + elog "To use the NVIDIA CUDA/OpenCL, run \"eselect opencl set nvidia\"" + elog + elog "NVIDIA has requested that any bug reports submitted have the" + elog "output of /opt/bin/nvidia-bug-report.sh included." + elog + elog "To work with compiz, you must enable the AddARGBGLXVisuals option." + elog + elog "If you are having resolution problems, try disabling DynamicTwinView." + elog +} + +pkg_postrm() { + "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11 +} diff --git a/x11-drivers/nvidia-userspace/nvidia-userspace-295.40.ebuild b/x11-drivers/nvidia-userspace/nvidia-userspace-295.40.ebuild new file mode 100644 index 00000000..72cf90fd --- /dev/null +++ b/x11-drivers/nvidia-userspace/nvidia-userspace-295.40.ebuild @@ -0,0 +1,456 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI="2" + +inherit eutils unpacker multilib portability versionator flag-o-matic + +X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}" +AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}" +X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}" + +DESCRIPTION="NVIDIA X11 userspace libraries and applications" +HOMEPAGE="http://www.nvidia.com/" +SRC_URI="x86? ( http://us.download.nvidia.com/XFree86/Linux-x86/${PV}/${X86_NV_PACKAGE}.run ) + amd64? ( http://us.download.nvidia.com/XFree86/Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run ) + x86-fbsd? ( http://us.download.nvidia.com/XFree86/FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )" + +LICENSE="NVIDIA" +SLOT="0" +KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd" +IUSE="acpi multilib kernel_linux" +RESTRICT="strip" +EMULTILIB_PKG="true" + +COMMON="<x11-base/xorg-server-1.12.99 + kernel_linux? ( >=sys-libs/glibc-2.6.1 ) + multilib? ( app-emulation/emul-linux-x86-xlibs ) + >=app-admin/eselect-opengl-1.0.9 + app-admin/eselect-opencl + !<media-video/nvidia-settings-256.52" +DEPEND="${COMMON}" +RDEPEND="${COMMON} + x11-libs/libXvMC + !<x11-drivers/nvidia-userspace-${PV} + !>x11-drivers/nvidia-userspace-${PV} + acpi? ( sys-power/acpid )" +PDEPEND=">=x11-libs/libvdpau-0.3-r1" + +QA_TEXTRELS_x86=" + usr/lib/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib/libXvMCNVIDIA.so.${PV} + usr/lib/libcuda.so.${PV} + usr/lib/libnvcuvid.so.${PV} + usr/lib/libnvidia-cfg.so.${PV} + usr/lib/libnvidia-compiler.so.${PV} + usr/lib/libnvidia-glcore.so.${PV} + usr/lib/libnvidia-ml.so.${PV} + usr/lib/libvdpau_nvidia.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib/xorg/modules/drivers/nvidia_drv.so" + +QA_TEXTRELS_x86_fbsd="boot/modules/nvidia.ko + usr/lib/opengl/nvidia/lib/libGL.so.1 + usr/lib/libnvidia-glcore.so.1 + usr/lib/libnvidia-cfg.so.1 + usr/lib/libnvidia-ml.so.1 + usr/lib/opengl/nvidia/extensions/libglx.so.1 + usr/lib/xorg/modules/drivers/nvidia_drv.so" + +QA_TEXTRELS_amd64="usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib32/libnvidia-glcore.so.${PV} + usr/lib32/libvdpau_nvidia.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/libcuda.so.${PV} + usr/lib32/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib32/libnvidia-compiler.so.${PV}" + +QA_EXECSTACK_x86="usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/libnvidia-glcore.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV} + usr/lib/libXvMCNVIDIA.a:NVXVMC.o + usr/lib/libvdpau_nvidia.so.${PV} + usr/lib/libnvidia-compiler.so.${PV} + usr/lib/libcuda.so.${PV} + usr/lib/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0" + +QA_EXECSTACK_amd64="usr/lib32/libnvidia-glcore.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib32/libvdpau_nvidia.so.${PV} + usr/lib32/libcuda.so.${PV} + usr/lib32/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib32/libnvidia-compiler.so.${PV} + usr/lib64/libXvMCNVIDIA.a:NVXVMC.o + usr/lib64/libnvidia-cfg.so.${PV} + usr/lib64/libnvidia-ml.so.${PV} + usr/lib64/libvdpau_nvidia.so.${PV} + usr/lib64/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/libnvidia-glcore.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV} + usr/lib64/libcuda.so.${PV} + usr/lib64/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib64/libnvidia-compiler.so.${PV} + usr/lib64/xorg/modules/drivers/nvidia_drv.so + opt/bin/nvidia-smi + opt/bin/nvidia-xconfig + opt/bin/nvidia-debugdump + opt/bin/nvidia-settings" + +QA_WX_LOAD_x86="usr/lib/libnvidia-glcore.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/libXvMCNVIDIA.a + usr/lib64/libXvMCNVIDIA.so.${PV}" + +QA_WX_LOAD_amd64="usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/libnvidia-glcore.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/libnvidia-glcore.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV}" + +QA_SONAME_x86="usr/lib/libnvidia-compiler.so.${PV}" + +QA_SONAME_amd64="usr/lib64/libnvidia-compiler.so.${PV} + usr/lib32/libnvidia-compiler.so.${PV}" + +QA_DT_HASH_amd64="usr/lib32/libcuda.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/libnvidia-glcore.so.${PV} + usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib32/libvdpau_nvidia.so.${PV} + usr/lib32/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib32/libnvidia-compiler.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV} + usr/lib64/libcuda.so.${PV} + usr/lib64/libnvidia-cfg.so.${PV} + usr/lib64/libnvidia-glcore.so.${PV} + usr/lib64/libnvidia-ml.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/xorg/modules/drivers/nvidia_drv.so + usr/lib64/libvdpau_nvidia.so.${PV} + usr/lib64/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib64/libnvidia-compiler.so.${PV} + usr/lib64/libnvcuvid.so.${PV} + opt/bin/nvidia-smi + opt/bin/nvidia-xconfig + opt/bin/nvidia-debugdump + opt/bin/nvidia-settings" + +QA_DT_HASH_x86="usr/lib/libcuda.so.${PV} + usr/lib/libnvidia-cfg.so.${PV} + usr/lib/libnvidia-glcore.so.${PV} + usr/lib/libnvidia-ml.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/xorg/modules/drivers/nvidia_drv.so + usr/lib/libXvMCNVIDIA.so.${PV} + usr/lib/libvdpau_nvidia.so.${PV} + usr/lib/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib/libnvidia-compiler.so.${PV} + usr/lib/libnvcuvid.so.${PV} + opt/bin/nvidia-smi + opt/bin/nvidia-xconfig + opt/bin/nvidia-debugdump + opt/bin/nvidia-settings" + + +S="${WORKDIR}/" + +pkg_setup() { + # try to turn off distcc and ccache for people that have a problem with it + export DISTCC_DISABLE=1 + export CCACHE_DISABLE=1 + + if use amd64 && has_multilib_profile && [ "${DEFAULT_ABI}" != "amd64" ]; then + eerror "This ebuild doesn't currently support changing your default abi." + die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}" + fi + + # On BSD userland it wants real make command + use userland_BSD && MAKE="$(get_bmake)" + + export _POSIX2_VERSION="199209" + + # set variables to where files are in the package structure + if use kernel_FreeBSD; then + NV_DOC="${S}/doc" + NV_EXEC="${S}/obj" + NV_LIB="${S}/obj" + NV_SRC="${S}/src" + NV_MAN="${S}/x11/man" + NV_X11="${S}/obj" + NV_X11_DRV="${NV_X11}" + NV_X11_EXT="${NV_X11}" + NV_SOVER=1 + elif use kernel_linux; then + NV_DOC="${S}" + NV_EXEC="${S}" + NV_LIB="${S}" + NV_SRC="${S}/kernel" + NV_MAN="${S}" + NV_X11="${S}" + NV_X11_DRV="${NV_X11}" + NV_X11_EXT="${NV_X11}" + NV_SOVER=${PV} + else + die "Could not determine proper NVIDIA package" + fi +} + +src_unpack() { + if ! use x86-fbsd; then + cd "${S}" + unpack_makeself + else + unpack ${A} + fi +} + +src_prepare() { + # Please add a brief description for every added patch + use x86-fbsd && cd doc + cat <<- EOF > "${S}"/nvidia.icd + /usr/$(get_libdir)/libcuda.so + EOF +} + +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 x86-fbsd; then + MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \ + LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die + fi +} + +src_install() { + if use kernel_linux; then + VIDEOGROUP="$(egetent group video | cut -d ':' -f 3)" + if [ -z "$VIDEOGROUP" ]; then + eerror "Failed to determine the video group gid." + die "Failed to determine the video group gid." + fi + + # Add the aliases + [ -f "${FILESDIR}/nvidia-169.07" ] || die "nvidia missing in FILESDIR" + sed -e 's:PACKAGE:'${PF}':g' \ + -e 's:VIDEOGID:'${VIDEOGROUP}':' "${FILESDIR}"/nvidia-169.07 > \ + "${WORKDIR}"/nvidia + insinto /etc/modprobe.d + newins "${WORKDIR}"/nvidia nvidia.conf || die + + # Ensures that our device nodes are created when not using X + exeinto /lib/udev + doexe "${FILESDIR}"/nvidia-udev.sh + + insinto /lib/udev/rules.d + newins "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules + fi + + # NVIDIA kernel <-> userspace driver config lib + dolib.so ${NV_LIB}/libnvidia-cfg.so.${NV_SOVER} || \ + die "failed to install libnvidia-cfg" + dosym libnvidia-cfg.so.${NV_SOVER} \ + /usr/$(get_libdir)/libnvidia-cfg.so.1 || \ + die "failed to create libnvidia-cfg.so symlink" + dosym libnvidia-cfg.so.1 \ + /usr/$(get_libdir)/libnvidia-cfg.so || \ + die "failed to create libnvidia-cfg.so symlink" + + # NVIDIA monitoring library + dolib.so ${NV_LIB}/libnvidia-ml.so.${NV_SOVER} || \ + die "failed to install libnvidia-ml" + dosym libnvidia-ml.so.${NV_SOVER} \ + /usr/$(get_libdir)/libnvidia-ml.so.1 || \ + die "failed to create libnvidia-ml.so symlink" + dosym libnvidia-ml.so.1 \ + /usr/$(get_libdir)/libnvidia-ml.so || \ + die "failed to create libnvidia-ml.so symlink" + + # NVIDIA video decode <-> CUDA + dolib.so ${NV_LIB}/libnvcuvid.so.${NV_SOVER} || \ + die "failed to install libnvcuvid.so" + dosym libnvcuvid.so.${NV_SOVER} \ + /usr/$(get_libdir)/libnvcuvid.so.1 || \ + die "failed to create libnvcuvid.so symlink" + dosym libnvcuvid.so.1 \ + /usr/$(get_libdir)/libnvcuvid.so || \ + die "failed to create libnvcuvid.so symlink" + + # Xorg DDX driver + insinto /usr/$(get_libdir)/xorg/modules/drivers + doins ${NV_X11_DRV}/nvidia_drv.so || die "failed to install nvidia_drv.so" + + # Xorg GLX driver + insinto /usr/$(get_libdir)/opengl/nvidia/extensions + doins ${NV_X11_EXT}/libglx.so.${NV_SOVER} || \ + die "failed to install libglx.so" + dosym libglx.so.${NV_SOVER} \ + /usr/$(get_libdir)/opengl/nvidia/extensions/libglx.so || \ + die "failed to create libglx.so symlink" + + # XvMC driver + dolib.a ${NV_X11}/libXvMCNVIDIA.a || \ + die "failed to install libXvMCNVIDIA.so" + dolib.so ${NV_X11}/libXvMCNVIDIA.so.${NV_SOVER} || \ + die "failed to install libXvMCNVIDIA.so" + dosym libXvMCNVIDIA.so.${NV_SOVER} \ + /usr/$(get_libdir)/libXvMCNVIDIA.so.1 || \ + die "failed to create libXvMCNVIDIA.so symlink" + dosym libXvMCNVIDIA.so.1 /usr/$(get_libdir)/libXvMCNVIDIA.so || \ + die "failed to create libXvMCNVIDIA.so symlink" + dosym libXvMCNVIDIA.so.${NV_SOVER} \ + /usr/$(get_libdir)/libXvMCNVIDIA_dynamic.so.1 || \ + die "failed to create libXvMCNVIDIA_dynamic.so symlink" + + # OpenCL ICD for NVIDIA + if use kernel_linux; then + insinto /etc/OpenCL/vendors + doins nvidia.icd + fi + + # Documentation + dohtml ${NV_DOC}/html/* + if use x86-fbsd; then + dodoc "${NV_DOC}/README" + doman "${NV_MAN}/nvidia-xconfig.1" + else + # Docs + newdoc "${NV_DOC}/README.txt" README + dodoc "${NV_DOC}/NVIDIA_Changelog" + doman "${NV_MAN}/nvidia-smi.1.gz" + doman "${NV_MAN}/nvidia-xconfig.1.gz" + fi + + # Helper Apps + exeinto /opt/bin/ + doexe ${NV_EXEC}/nvidia-xconfig || die + doexe ${NV_EXEC}/nvidia-debugdump || die + if use gtk; then + doexe ${NV_EXEC}/nvidia-settings || die + fi + doexe ${NV_EXEC}/nvidia-bug-report.sh || die + if use kernel_linux; then + doexe ${NV_EXEC}/nvidia-smi || die + fi + + if has_multilib_profile ; 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" + + # GNOME3 gnome-terminal redraw bug workaround, + # see: https://bugzilla.gnome.org/show_bug.cgi?id=664858 + doenvd "${FILESDIR}/90mutter-disable-culling" +} + +# Install nvidia library: +# the first parameter is the place where to install it +# the second parameter is the base name of the library +# the third parameter is the provided soversion +donvidia() { + dodir $1 + exeinto $1 + + libname=$(basename $2) + + doexe $2.$3 || die "failed to install $2" + dosym ${libname}.$3 $1/${libname} || die "failed to symlink $2" + [[ $3 != "1" ]] && dosym ${libname}.$3 $1/${libname}.1 +} + +src_install-libs() { + local inslibdir=$(get_libdir) + local NV_ROOT="/usr/${inslibdir}/opengl/nvidia" + local CL_ROOT=/usr/${inslibdir}/OpenCL/vendors/nvidia + local libdir= sover= + + if use kernel_linux; then + if has_multilib_profile && [[ ${ABI} == "x86" ]] ; then + libdir=32 + else + libdir=. + fi + sover=${PV} + else + libdir=obj + # on FreeBSD it has just .1 suffix + sover=1 + fi + + # The GLX libraries + donvidia ${NV_ROOT}/lib ${libdir}/libGL.so ${sover} + donvidia /usr/${inslibdir} ${libdir}/libnvidia-glcore.so ${sover} + if use x86-fbsd; then + donvidia ${NV_ROOT}/lib ${libdir}/libnvidia-tls.so ${sover} + else + donvidia ${NV_ROOT}/lib ${libdir}/tls/libnvidia-tls.so ${sover} + fi + + # VDPAU + donvidia /usr/${inslibdir} ${libdir}/libvdpau_nvidia.so ${sover} + + # CUDA & OpenCL + if use kernel_linux; then + donvidia /usr/${inslibdir} ${libdir}/libcuda.so ${sover} + donvidia /usr/${inslibdir} ${libdir}/libnvidia-compiler.so ${sover} + donvidia ${CL_ROOT} ${libdir}/libOpenCL.so 1.0.0 + #dosym libOpenCL.so.1 ${CL_ROOT}/libOpenCL.so + fi +} + +pkg_preinst() { + # 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() { + # Switch to the nvidia implementation + "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia + "${ROOT}"/usr/bin/eselect opencl set --use-old nvidia + + elog "To use the NVIDIA GLX, run \"eselect opengl set nvidia\"" + elog + elog "To use the NVIDIA CUDA/OpenCL, run \"eselect opencl set nvidia\"" + elog + elog "NVIDIA has requested that any bug reports submitted have the" + elog "output of /opt/bin/nvidia-bug-report.sh included." + elog + elog "To work with compiz, you must enable the AddARGBGLXVisuals option." + elog + elog "If you are having resolution problems, try disabling DynamicTwinView." + elog +} + +pkg_postrm() { + "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11 +} diff --git a/x11-drivers/nvidia-userspace/nvidia-userspace-295.49.ebuild b/x11-drivers/nvidia-userspace/nvidia-userspace-295.49.ebuild new file mode 100644 index 00000000..df7bcaea --- /dev/null +++ b/x11-drivers/nvidia-userspace/nvidia-userspace-295.49.ebuild @@ -0,0 +1,453 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI="2" + +inherit eutils unpacker multilib portability versionator flag-o-matic + +X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}" +AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}" +X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}" + +DESCRIPTION="NVIDIA X11 userspace libraries and applications" +HOMEPAGE="http://www.nvidia.com/" +SRC_URI="x86? ( http://us.download.nvidia.com/XFree86/Linux-x86/${PV}/${X86_NV_PACKAGE}.run ) + amd64? ( http://us.download.nvidia.com/XFree86/Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run ) + x86-fbsd? ( http://us.download.nvidia.com/XFree86/FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )" + +LICENSE="NVIDIA" +SLOT="0" +KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd" +IUSE="acpi multilib kernel_linux" +RESTRICT="strip" +EMULTILIB_PKG="true" + +COMMON="<x11-base/xorg-server-1.12.99 + kernel_linux? ( >=sys-libs/glibc-2.6.1 ) + multilib? ( app-emulation/emul-linux-x86-xlibs ) + >=app-admin/eselect-opengl-1.0.9 + app-admin/eselect-opencl + !<media-video/nvidia-settings-256.52" +DEPEND="${COMMON}" +RDEPEND="${COMMON} + x11-libs/libXvMC + !<x11-drivers/nvidia-userspace-${PV} + !>x11-drivers/nvidia-userspace-${PV} + acpi? ( sys-power/acpid )" +PDEPEND=">=x11-libs/libvdpau-0.3-r1" + +QA_TEXTRELS_x86=" + usr/lib/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib/libXvMCNVIDIA.so.${PV} + usr/lib/libcuda.so.${PV} + usr/lib/libnvcuvid.so.${PV} + usr/lib/libnvidia-cfg.so.${PV} + usr/lib/libnvidia-compiler.so.${PV} + usr/lib/libnvidia-glcore.so.${PV} + usr/lib/libnvidia-ml.so.${PV} + usr/lib/libvdpau_nvidia.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib/xorg/modules/drivers/nvidia_drv.so" + +QA_TEXTRELS_x86_fbsd="boot/modules/nvidia.ko + usr/lib/opengl/nvidia/lib/libGL.so.1 + usr/lib/libnvidia-glcore.so.1 + usr/lib/libnvidia-cfg.so.1 + usr/lib/libnvidia-ml.so.1 + usr/lib/opengl/nvidia/extensions/libglx.so.1 + usr/lib/xorg/modules/drivers/nvidia_drv.so" + +QA_TEXTRELS_amd64="usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib32/libnvidia-glcore.so.${PV} + usr/lib32/libvdpau_nvidia.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/libcuda.so.${PV} + usr/lib32/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib32/libnvidia-compiler.so.${PV}" + +QA_EXECSTACK_x86="usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/libnvidia-glcore.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV} + usr/lib/libXvMCNVIDIA.a:NVXVMC.o + usr/lib/libvdpau_nvidia.so.${PV} + usr/lib/libnvidia-compiler.so.${PV} + usr/lib/libcuda.so.${PV} + usr/lib/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0" + +QA_EXECSTACK_amd64="usr/lib32/libnvidia-glcore.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib32/libvdpau_nvidia.so.${PV} + usr/lib32/libcuda.so.${PV} + usr/lib32/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib32/libnvidia-compiler.so.${PV} + usr/lib64/libXvMCNVIDIA.a:NVXVMC.o + usr/lib64/libnvidia-cfg.so.${PV} + usr/lib64/libnvidia-ml.so.${PV} + usr/lib64/libvdpau_nvidia.so.${PV} + usr/lib64/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/libnvidia-glcore.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV} + usr/lib64/libcuda.so.${PV} + usr/lib64/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib64/libnvidia-compiler.so.${PV} + usr/lib64/xorg/modules/drivers/nvidia_drv.so + opt/bin/nvidia-smi + opt/bin/nvidia-xconfig + opt/bin/nvidia-debugdump + opt/bin/nvidia-settings" + +QA_WX_LOAD_x86="usr/lib/libnvidia-glcore.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/libXvMCNVIDIA.a + usr/lib64/libXvMCNVIDIA.so.${PV}" + +QA_WX_LOAD_amd64="usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/libnvidia-glcore.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/libnvidia-glcore.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV}" + +QA_SONAME_x86="usr/lib/libnvidia-compiler.so.${PV}" + +QA_SONAME_amd64="usr/lib64/libnvidia-compiler.so.${PV} + usr/lib32/libnvidia-compiler.so.${PV}" + +QA_DT_HASH_amd64="usr/lib32/libcuda.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/libnvidia-glcore.so.${PV} + usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib32/libvdpau_nvidia.so.${PV} + usr/lib32/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib32/libnvidia-compiler.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV} + usr/lib64/libcuda.so.${PV} + usr/lib64/libnvidia-cfg.so.${PV} + usr/lib64/libnvidia-glcore.so.${PV} + usr/lib64/libnvidia-ml.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/xorg/modules/drivers/nvidia_drv.so + usr/lib64/libvdpau_nvidia.so.${PV} + usr/lib64/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib64/libnvidia-compiler.so.${PV} + usr/lib64/libnvcuvid.so.${PV} + opt/bin/nvidia-smi + opt/bin/nvidia-xconfig + opt/bin/nvidia-debugdump + opt/bin/nvidia-settings" + +QA_DT_HASH_x86="usr/lib/libcuda.so.${PV} + usr/lib/libnvidia-cfg.so.${PV} + usr/lib/libnvidia-glcore.so.${PV} + usr/lib/libnvidia-ml.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/xorg/modules/drivers/nvidia_drv.so + usr/lib/libXvMCNVIDIA.so.${PV} + usr/lib/libvdpau_nvidia.so.${PV} + usr/lib/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib/libnvidia-compiler.so.${PV} + usr/lib/libnvcuvid.so.${PV} + opt/bin/nvidia-smi + opt/bin/nvidia-xconfig + opt/bin/nvidia-debugdump + opt/bin/nvidia-settings" + + +S="${WORKDIR}/" + +pkg_setup() { + # try to turn off distcc and ccache for people that have a problem with it + export DISTCC_DISABLE=1 + export CCACHE_DISABLE=1 + + if use amd64 && has_multilib_profile && [ "${DEFAULT_ABI}" != "amd64" ]; then + eerror "This ebuild doesn't currently support changing your default abi." + die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}" + fi + + # On BSD userland it wants real make command + use userland_BSD && MAKE="$(get_bmake)" + + export _POSIX2_VERSION="199209" + + # set variables to where files are in the package structure + if use kernel_FreeBSD; then + NV_DOC="${S}/doc" + NV_EXEC="${S}/obj" + NV_LIB="${S}/obj" + NV_SRC="${S}/src" + NV_MAN="${S}/x11/man" + NV_X11="${S}/obj" + NV_X11_DRV="${NV_X11}" + NV_X11_EXT="${NV_X11}" + NV_SOVER=1 + elif use kernel_linux; then + NV_DOC="${S}" + NV_EXEC="${S}" + NV_LIB="${S}" + NV_SRC="${S}/kernel" + NV_MAN="${S}" + NV_X11="${S}" + NV_X11_DRV="${NV_X11}" + NV_X11_EXT="${NV_X11}" + NV_SOVER=${PV} + else + die "Could not determine proper NVIDIA package" + fi +} + +src_unpack() { + if ! use x86-fbsd; then + cd "${S}" + unpack_makeself + else + unpack ${A} + fi +} + +src_prepare() { + # Please add a brief description for every added patch + use x86-fbsd && cd doc + cat <<- EOF > "${S}"/nvidia.icd + /usr/$(get_libdir)/libcuda.so + EOF +} + +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 x86-fbsd; then + MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \ + LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die + fi +} + +src_install() { + if use kernel_linux; then + VIDEOGROUP="$(egetent group video | cut -d ':' -f 3)" + if [ -z "$VIDEOGROUP" ]; then + eerror "Failed to determine the video group gid." + die "Failed to determine the video group gid." + fi + + # Add the aliases + [ -f "${FILESDIR}/nvidia-169.07" ] || die "nvidia missing in FILESDIR" + sed -e 's:PACKAGE:'${PF}':g' \ + -e 's:VIDEOGID:'${VIDEOGROUP}':' "${FILESDIR}"/nvidia-169.07 > \ + "${WORKDIR}"/nvidia + insinto /etc/modprobe.d + newins "${WORKDIR}"/nvidia nvidia.conf || die + + # Ensures that our device nodes are created when not using X + exeinto /lib/udev + doexe "${FILESDIR}"/nvidia-udev.sh + + insinto /lib/udev/rules.d + newins "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules + fi + + # NVIDIA kernel <-> userspace driver config lib + dolib.so ${NV_LIB}/libnvidia-cfg.so.${NV_SOVER} || \ + die "failed to install libnvidia-cfg" + dosym libnvidia-cfg.so.${NV_SOVER} \ + /usr/$(get_libdir)/libnvidia-cfg.so.1 || \ + die "failed to create libnvidia-cfg.so symlink" + dosym libnvidia-cfg.so.1 \ + /usr/$(get_libdir)/libnvidia-cfg.so || \ + die "failed to create libnvidia-cfg.so symlink" + + # NVIDIA monitoring library + dolib.so ${NV_LIB}/libnvidia-ml.so.${NV_SOVER} || \ + die "failed to install libnvidia-ml" + dosym libnvidia-ml.so.${NV_SOVER} \ + /usr/$(get_libdir)/libnvidia-ml.so.1 || \ + die "failed to create libnvidia-ml.so symlink" + dosym libnvidia-ml.so.1 \ + /usr/$(get_libdir)/libnvidia-ml.so || \ + die "failed to create libnvidia-ml.so symlink" + + # NVIDIA video decode <-> CUDA + dolib.so ${NV_LIB}/libnvcuvid.so.${NV_SOVER} || \ + die "failed to install libnvcuvid.so" + dosym libnvcuvid.so.${NV_SOVER} \ + /usr/$(get_libdir)/libnvcuvid.so.1 || \ + die "failed to create libnvcuvid.so symlink" + dosym libnvcuvid.so.1 \ + /usr/$(get_libdir)/libnvcuvid.so || \ + die "failed to create libnvcuvid.so symlink" + + # Xorg DDX driver + insinto /usr/$(get_libdir)/xorg/modules/drivers + doins ${NV_X11_DRV}/nvidia_drv.so || die "failed to install nvidia_drv.so" + + # Xorg GLX driver + insinto /usr/$(get_libdir)/opengl/nvidia/extensions + doins ${NV_X11_EXT}/libglx.so.${NV_SOVER} || \ + die "failed to install libglx.so" + dosym libglx.so.${NV_SOVER} \ + /usr/$(get_libdir)/opengl/nvidia/extensions/libglx.so || \ + die "failed to create libglx.so symlink" + + # XvMC driver + dolib.a ${NV_X11}/libXvMCNVIDIA.a || \ + die "failed to install libXvMCNVIDIA.so" + dolib.so ${NV_X11}/libXvMCNVIDIA.so.${NV_SOVER} || \ + die "failed to install libXvMCNVIDIA.so" + dosym libXvMCNVIDIA.so.${NV_SOVER} \ + /usr/$(get_libdir)/libXvMCNVIDIA.so.1 || \ + die "failed to create libXvMCNVIDIA.so symlink" + dosym libXvMCNVIDIA.so.1 /usr/$(get_libdir)/libXvMCNVIDIA.so || \ + die "failed to create libXvMCNVIDIA.so symlink" + dosym libXvMCNVIDIA.so.${NV_SOVER} \ + /usr/$(get_libdir)/libXvMCNVIDIA_dynamic.so.1 || \ + die "failed to create libXvMCNVIDIA_dynamic.so symlink" + + # OpenCL ICD for NVIDIA + if use kernel_linux; then + insinto /etc/OpenCL/vendors + doins nvidia.icd + fi + + # Documentation + dohtml ${NV_DOC}/html/* + if use x86-fbsd; then + dodoc "${NV_DOC}/README" + doman "${NV_MAN}/nvidia-xconfig.1" + else + # Docs + newdoc "${NV_DOC}/README.txt" README + dodoc "${NV_DOC}/NVIDIA_Changelog" + doman "${NV_MAN}/nvidia-smi.1.gz" + doman "${NV_MAN}/nvidia-xconfig.1.gz" + fi + + # Helper Apps + exeinto /opt/bin/ + doexe ${NV_EXEC}/nvidia-xconfig || die + doexe ${NV_EXEC}/nvidia-debugdump || die + doexe ${NV_EXEC}/nvidia-bug-report.sh || die + if use kernel_linux; then + doexe ${NV_EXEC}/nvidia-smi || die + fi + + if has_multilib_profile ; 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" + + # GNOME3 gnome-terminal redraw bug workaround, + # see: https://bugzilla.gnome.org/show_bug.cgi?id=664858 + doenvd "${FILESDIR}/90mutter-disable-culling" +} + +# Install nvidia library: +# the first parameter is the place where to install it +# the second parameter is the base name of the library +# the third parameter is the provided soversion +donvidia() { + dodir $1 + exeinto $1 + + libname=$(basename $2) + + doexe $2.$3 || die "failed to install $2" + dosym ${libname}.$3 $1/${libname} || die "failed to symlink $2" + [[ $3 != "1" ]] && dosym ${libname}.$3 $1/${libname}.1 +} + +src_install-libs() { + local inslibdir=$(get_libdir) + local NV_ROOT="/usr/${inslibdir}/opengl/nvidia" + local CL_ROOT=/usr/${inslibdir}/OpenCL/vendors/nvidia + local libdir= sover= + + if use kernel_linux; then + if has_multilib_profile && [[ ${ABI} == "x86" ]] ; then + libdir=32 + else + libdir=. + fi + sover=${PV} + else + libdir=obj + # on FreeBSD it has just .1 suffix + sover=1 + fi + + # The GLX libraries + donvidia ${NV_ROOT}/lib ${libdir}/libGL.so ${sover} + donvidia /usr/${inslibdir} ${libdir}/libnvidia-glcore.so ${sover} + if use x86-fbsd; then + donvidia ${NV_ROOT}/lib ${libdir}/libnvidia-tls.so ${sover} + else + donvidia ${NV_ROOT}/lib ${libdir}/tls/libnvidia-tls.so ${sover} + fi + + # VDPAU + donvidia /usr/${inslibdir} ${libdir}/libvdpau_nvidia.so ${sover} + + # CUDA & OpenCL + if use kernel_linux; then + donvidia /usr/${inslibdir} ${libdir}/libcuda.so ${sover} + donvidia /usr/${inslibdir} ${libdir}/libnvidia-compiler.so ${sover} + donvidia ${CL_ROOT} ${libdir}/libOpenCL.so 1.0.0 + #dosym libOpenCL.so.1 ${CL_ROOT}/libOpenCL.so + fi +} + +pkg_preinst() { + # 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() { + # Switch to the nvidia implementation + "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia + "${ROOT}"/usr/bin/eselect opencl set --use-old nvidia + + elog "To use the NVIDIA GLX, run \"eselect opengl set nvidia\"" + elog + elog "To use the NVIDIA CUDA/OpenCL, run \"eselect opencl set nvidia\"" + elog + elog "NVIDIA has requested that any bug reports submitted have the" + elog "output of /opt/bin/nvidia-bug-report.sh included." + elog + elog "To work with compiz, you must enable the AddARGBGLXVisuals option." + elog + elog "If you are having resolution problems, try disabling DynamicTwinView." + elog +} + +pkg_postrm() { + "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11 +} diff --git a/x11-drivers/nvidia-userspace/nvidia-userspace-295.53.ebuild b/x11-drivers/nvidia-userspace/nvidia-userspace-295.53.ebuild new file mode 100644 index 00000000..301d8462 --- /dev/null +++ b/x11-drivers/nvidia-userspace/nvidia-userspace-295.53.ebuild @@ -0,0 +1,453 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI="2" + +inherit eutils unpacker multilib portability versionator flag-o-matic + +X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}" +AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}" +X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}" + +DESCRIPTION="NVIDIA X11 userspace libraries and applications" +HOMEPAGE="http://www.nvidia.com/" +SRC_URI="x86? ( http://us.download.nvidia.com/XFree86/Linux-x86/${PV}/${X86_NV_PACKAGE}.run ) + amd64? ( http://us.download.nvidia.com/XFree86/Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run ) + x86-fbsd? ( http://us.download.nvidia.com/XFree86/FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )" + +LICENSE="NVIDIA" +SLOT="0" +KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd" +IUSE="acpi multilib kernel_linux" +RESTRICT="strip" +EMULTILIB_PKG="true" + +COMMON="<x11-base/xorg-server-1.12.99 + kernel_linux? ( >=sys-libs/glibc-2.6.1 ) + multilib? ( app-emulation/emul-linux-x86-xlibs ) + >=app-admin/eselect-opengl-1.0.9 + app-admin/eselect-opencl + !<media-video/nvidia-settings-256.52" +DEPEND="${COMMON}" +RDEPEND="${COMMON} + x11-libs/libXvMC + !<x11-drivers/nvidia-userspace-${PV} + !>x11-drivers/nvidia-userspace-${PV} + acpi? ( sys-power/acpid )" +PDEPEND=">=x11-libs/libvdpau-0.3-r1" + +QA_TEXTRELS_x86=" + usr/lib/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib/libXvMCNVIDIA.so.${PV} + usr/lib/libcuda.so.${PV} + usr/lib/libnvcuvid.so.${PV} + usr/lib/libnvidia-cfg.so.${PV} + usr/lib/libnvidia-compiler.so.${PV} + usr/lib/libnvidia-glcore.so.${PV} + usr/lib/libnvidia-ml.so.${PV} + usr/lib/libvdpau_nvidia.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib/xorg/modules/drivers/nvidia_drv.so" + +QA_TEXTRELS_x86_fbsd="boot/modules/nvidia.ko + usr/lib/opengl/nvidia/lib/libGL.so.1 + usr/lib/libnvidia-glcore.so.1 + usr/lib/libvdpau_nvidia.so.1 + usr/lib/libnvidia-cfg.so.1 + usr/lib/opengl/nvidia/extensions/libglx.so.1 + usr/lib/xorg/modules/drivers/nvidia_drv.so" + +QA_TEXTRELS_amd64="usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib32/libnvidia-glcore.so.${PV} + usr/lib32/libvdpau_nvidia.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/libcuda.so.${PV} + usr/lib32/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib32/libnvidia-compiler.so.${PV}" + +QA_EXECSTACK_x86="usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/libnvidia-glcore.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV} + usr/lib/libXvMCNVIDIA.a:NVXVMC.o + usr/lib/libvdpau_nvidia.so.${PV} + usr/lib/libnvidia-compiler.so.${PV} + usr/lib/libcuda.so.${PV} + usr/lib/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0" + +QA_EXECSTACK_amd64="usr/lib32/libnvidia-glcore.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib32/libvdpau_nvidia.so.${PV} + usr/lib32/libcuda.so.${PV} + usr/lib32/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib32/libnvidia-compiler.so.${PV} + usr/lib64/libXvMCNVIDIA.a:NVXVMC.o + usr/lib64/libnvidia-cfg.so.${PV} + usr/lib64/libnvidia-ml.so.${PV} + usr/lib64/libvdpau_nvidia.so.${PV} + usr/lib64/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/libnvidia-glcore.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV} + usr/lib64/libcuda.so.${PV} + usr/lib64/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib64/libnvidia-compiler.so.${PV} + usr/lib64/xorg/modules/drivers/nvidia_drv.so + opt/bin/nvidia-smi + opt/bin/nvidia-xconfig + opt/bin/nvidia-debugdump + opt/bin/nvidia-settings" + +QA_WX_LOAD_x86="usr/lib/libnvidia-glcore.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/libXvMCNVIDIA.a + usr/lib64/libXvMCNVIDIA.so.${PV}" + +QA_WX_LOAD_amd64="usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/libnvidia-glcore.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/libnvidia-glcore.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV}" + +QA_SONAME_x86="usr/lib/libnvidia-compiler.so.${PV}" + +QA_SONAME_amd64="usr/lib64/libnvidia-compiler.so.${PV} + usr/lib32/libnvidia-compiler.so.${PV}" + +QA_DT_HASH_amd64="usr/lib32/libcuda.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/libnvidia-glcore.so.${PV} + usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib32/libvdpau_nvidia.so.${PV} + usr/lib32/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib32/libnvidia-compiler.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV} + usr/lib64/libcuda.so.${PV} + usr/lib64/libnvidia-cfg.so.${PV} + usr/lib64/libnvidia-glcore.so.${PV} + usr/lib64/libnvidia-ml.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/xorg/modules/drivers/nvidia_drv.so + usr/lib64/libvdpau_nvidia.so.${PV} + usr/lib64/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib64/libnvidia-compiler.so.${PV} + usr/lib64/libnvcuvid.so.${PV} + opt/bin/nvidia-smi + opt/bin/nvidia-xconfig + opt/bin/nvidia-debugdump + opt/bin/nvidia-settings" + +QA_DT_HASH_x86="usr/lib/libcuda.so.${PV} + usr/lib/libnvidia-cfg.so.${PV} + usr/lib/libnvidia-glcore.so.${PV} + usr/lib/libnvidia-ml.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/xorg/modules/drivers/nvidia_drv.so + usr/lib/libXvMCNVIDIA.so.${PV} + usr/lib/libvdpau_nvidia.so.${PV} + usr/lib/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib/libnvidia-compiler.so.${PV} + usr/lib/libnvcuvid.so.${PV} + opt/bin/nvidia-smi + opt/bin/nvidia-xconfig + opt/bin/nvidia-debugdump + opt/bin/nvidia-settings" + + +S="${WORKDIR}/" + +pkg_setup() { + # try to turn off distcc and ccache for people that have a problem with it + export DISTCC_DISABLE=1 + export CCACHE_DISABLE=1 + + if use amd64 && has_multilib_profile && [ "${DEFAULT_ABI}" != "amd64" ]; then + eerror "This ebuild doesn't currently support changing your default abi." + die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}" + fi + + # On BSD userland it wants real make command + use userland_BSD && MAKE="$(get_bmake)" + + export _POSIX2_VERSION="199209" + + # set variables to where files are in the package structure + if use kernel_FreeBSD; then + NV_DOC="${S}/doc" + NV_EXEC="${S}/obj" + NV_LIB="${S}/obj" + NV_SRC="${S}/src" + NV_MAN="${S}/x11/man" + NV_X11="${S}/obj" + NV_X11_DRV="${NV_X11}" + NV_X11_EXT="${NV_X11}" + NV_SOVER=1 + elif use kernel_linux; then + NV_DOC="${S}" + NV_EXEC="${S}" + NV_LIB="${S}" + NV_SRC="${S}/kernel" + NV_MAN="${S}" + NV_X11="${S}" + NV_X11_DRV="${NV_X11}" + NV_X11_EXT="${NV_X11}" + NV_SOVER=${PV} + else + die "Could not determine proper NVIDIA package" + fi +} + +src_unpack() { + if ! use x86-fbsd; then + cd "${S}" + unpack_makeself + else + unpack ${A} + fi +} + +src_prepare() { + # Please add a brief description for every added patch + use x86-fbsd && cd doc + cat <<- EOF > "${S}"/nvidia.icd + /usr/$(get_libdir)/libcuda.so + EOF +} + +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 x86-fbsd; then + MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \ + LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die + fi +} + +src_install() { + if use kernel_linux; then + VIDEOGROUP="$(egetent group video | cut -d ':' -f 3)" + if [ -z "$VIDEOGROUP" ]; then + eerror "Failed to determine the video group gid." + die "Failed to determine the video group gid." + fi + + # Add the aliases + [ -f "${FILESDIR}/nvidia-169.07" ] || die "nvidia missing in FILESDIR" + sed -e 's:PACKAGE:'${PF}':g' \ + -e 's:VIDEOGID:'${VIDEOGROUP}':' "${FILESDIR}"/nvidia-169.07 > \ + "${WORKDIR}"/nvidia + insinto /etc/modprobe.d + newins "${WORKDIR}"/nvidia nvidia.conf || die + + # Ensures that our device nodes are created when not using X + exeinto /lib/udev + doexe "${FILESDIR}"/nvidia-udev.sh + + insinto /lib/udev/rules.d + newins "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules + fi + + # NVIDIA kernel <-> userspace driver config lib + dolib.so ${NV_LIB}/libnvidia-cfg.so.${NV_SOVER} || \ + die "failed to install libnvidia-cfg" + dosym libnvidia-cfg.so.${NV_SOVER} \ + /usr/$(get_libdir)/libnvidia-cfg.so.1 || \ + die "failed to create libnvidia-cfg.so symlink" + dosym libnvidia-cfg.so.1 \ + /usr/$(get_libdir)/libnvidia-cfg.so || \ + die "failed to create libnvidia-cfg.so symlink" + + # NVIDIA monitoring library + dolib.so ${NV_LIB}/libnvidia-ml.so.${NV_SOVER} || \ + die "failed to install libnvidia-ml" + dosym libnvidia-ml.so.${NV_SOVER} \ + /usr/$(get_libdir)/libnvidia-ml.so.1 || \ + die "failed to create libnvidia-ml.so symlink" + dosym libnvidia-ml.so.1 \ + /usr/$(get_libdir)/libnvidia-ml.so || \ + die "failed to create libnvidia-ml.so symlink" + + # NVIDIA video decode <-> CUDA + dolib.so ${NV_LIB}/libnvcuvid.so.${NV_SOVER} || \ + die "failed to install libnvcuvid.so" + dosym libnvcuvid.so.${NV_SOVER} \ + /usr/$(get_libdir)/libnvcuvid.so.1 || \ + die "failed to create libnvcuvid.so symlink" + dosym libnvcuvid.so.1 \ + /usr/$(get_libdir)/libnvcuvid.so || \ + die "failed to create libnvcuvid.so symlink" + + # Xorg DDX driver + insinto /usr/$(get_libdir)/xorg/modules/drivers + doins ${NV_X11_DRV}/nvidia_drv.so || die "failed to install nvidia_drv.so" + + # Xorg GLX driver + insinto /usr/$(get_libdir)/opengl/nvidia/extensions + doins ${NV_X11_EXT}/libglx.so.${NV_SOVER} || \ + die "failed to install libglx.so" + dosym libglx.so.${NV_SOVER} \ + /usr/$(get_libdir)/opengl/nvidia/extensions/libglx.so || \ + die "failed to create libglx.so symlink" + + # XvMC driver + dolib.a ${NV_X11}/libXvMCNVIDIA.a || \ + die "failed to install libXvMCNVIDIA.so" + dolib.so ${NV_X11}/libXvMCNVIDIA.so.${NV_SOVER} || \ + die "failed to install libXvMCNVIDIA.so" + dosym libXvMCNVIDIA.so.${NV_SOVER} \ + /usr/$(get_libdir)/libXvMCNVIDIA.so.1 || \ + die "failed to create libXvMCNVIDIA.so symlink" + dosym libXvMCNVIDIA.so.1 /usr/$(get_libdir)/libXvMCNVIDIA.so || \ + die "failed to create libXvMCNVIDIA.so symlink" + dosym libXvMCNVIDIA.so.${NV_SOVER} \ + /usr/$(get_libdir)/libXvMCNVIDIA_dynamic.so.1 || \ + die "failed to create libXvMCNVIDIA_dynamic.so symlink" + + # OpenCL ICD for NVIDIA + if use kernel_linux; then + insinto /etc/OpenCL/vendors + doins nvidia.icd + fi + + # Documentation + dohtml ${NV_DOC}/html/* + if use x86-fbsd; then + dodoc "${NV_DOC}/README" + doman "${NV_MAN}/nvidia-xconfig.1" + else + # Docs + newdoc "${NV_DOC}/README.txt" README + dodoc "${NV_DOC}/NVIDIA_Changelog" + doman "${NV_MAN}/nvidia-smi.1.gz" + doman "${NV_MAN}/nvidia-xconfig.1.gz" + fi + + # Helper Apps + exeinto /opt/bin/ + doexe ${NV_EXEC}/nvidia-xconfig || die + doexe ${NV_EXEC}/nvidia-debugdump || die + doexe ${NV_EXEC}/nvidia-bug-report.sh || die + if use kernel_linux; then + doexe ${NV_EXEC}/nvidia-smi || die + fi + + if has_multilib_profile ; 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" + + # GNOME3 gnome-terminal redraw bug workaround, + # see: https://bugzilla.gnome.org/show_bug.cgi?id=664858 + doenvd "${FILESDIR}/90mutter-disable-culling" +} + +# Install nvidia library: +# the first parameter is the place where to install it +# the second parameter is the base name of the library +# the third parameter is the provided soversion +donvidia() { + dodir $1 + exeinto $1 + + libname=$(basename $2) + + doexe $2.$3 || die "failed to install $2" + dosym ${libname}.$3 $1/${libname} || die "failed to symlink $2" + [[ $3 != "1" ]] && dosym ${libname}.$3 $1/${libname}.1 +} + +src_install-libs() { + local inslibdir=$(get_libdir) + local NV_ROOT="/usr/${inslibdir}/opengl/nvidia" + local CL_ROOT=/usr/${inslibdir}/OpenCL/vendors/nvidia + local libdir= sover= + + if use kernel_linux; then + if has_multilib_profile && [[ ${ABI} == "x86" ]] ; then + libdir=32 + else + libdir=. + fi + sover=${PV} + else + libdir=obj + # on FreeBSD it has just .1 suffix + sover=1 + fi + + # The GLX libraries + donvidia ${NV_ROOT}/lib ${libdir}/libGL.so ${sover} + donvidia /usr/${inslibdir} ${libdir}/libnvidia-glcore.so ${sover} + if use x86-fbsd; then + donvidia ${NV_ROOT}/lib ${libdir}/libnvidia-tls.so ${sover} + else + donvidia ${NV_ROOT}/lib ${libdir}/tls/libnvidia-tls.so ${sover} + fi + + # VDPAU + donvidia /usr/${inslibdir} ${libdir}/libvdpau_nvidia.so ${sover} + + # CUDA & OpenCL + if use kernel_linux; then + donvidia /usr/${inslibdir} ${libdir}/libcuda.so ${sover} + donvidia /usr/${inslibdir} ${libdir}/libnvidia-compiler.so ${sover} + donvidia ${CL_ROOT} ${libdir}/libOpenCL.so 1.0.0 + #dosym libOpenCL.so.1 ${CL_ROOT}/libOpenCL.so + fi +} + +pkg_preinst() { + # 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() { + # Switch to the nvidia implementation + "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia + "${ROOT}"/usr/bin/eselect opencl set --use-old nvidia + + elog "To use the NVIDIA GLX, run \"eselect opengl set nvidia\"" + elog + elog "To use the NVIDIA CUDA/OpenCL, run \"eselect opencl set nvidia\"" + elog + elog "NVIDIA has requested that any bug reports submitted have the" + elog "output of /opt/bin/nvidia-bug-report.sh included." + elog + elog "To work with compiz, you must enable the AddARGBGLXVisuals option." + elog + elog "If you are having resolution problems, try disabling DynamicTwinView." + elog +} + +pkg_postrm() { + "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11 +} diff --git a/x11-drivers/nvidia-userspace/nvidia-userspace-295.59.ebuild b/x11-drivers/nvidia-userspace/nvidia-userspace-295.59.ebuild new file mode 100644 index 00000000..301d8462 --- /dev/null +++ b/x11-drivers/nvidia-userspace/nvidia-userspace-295.59.ebuild @@ -0,0 +1,453 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI="2" + +inherit eutils unpacker multilib portability versionator flag-o-matic + +X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}" +AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}" +X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}" + +DESCRIPTION="NVIDIA X11 userspace libraries and applications" +HOMEPAGE="http://www.nvidia.com/" +SRC_URI="x86? ( http://us.download.nvidia.com/XFree86/Linux-x86/${PV}/${X86_NV_PACKAGE}.run ) + amd64? ( http://us.download.nvidia.com/XFree86/Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run ) + x86-fbsd? ( http://us.download.nvidia.com/XFree86/FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )" + +LICENSE="NVIDIA" +SLOT="0" +KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd" +IUSE="acpi multilib kernel_linux" +RESTRICT="strip" +EMULTILIB_PKG="true" + +COMMON="<x11-base/xorg-server-1.12.99 + kernel_linux? ( >=sys-libs/glibc-2.6.1 ) + multilib? ( app-emulation/emul-linux-x86-xlibs ) + >=app-admin/eselect-opengl-1.0.9 + app-admin/eselect-opencl + !<media-video/nvidia-settings-256.52" +DEPEND="${COMMON}" +RDEPEND="${COMMON} + x11-libs/libXvMC + !<x11-drivers/nvidia-userspace-${PV} + !>x11-drivers/nvidia-userspace-${PV} + acpi? ( sys-power/acpid )" +PDEPEND=">=x11-libs/libvdpau-0.3-r1" + +QA_TEXTRELS_x86=" + usr/lib/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib/libXvMCNVIDIA.so.${PV} + usr/lib/libcuda.so.${PV} + usr/lib/libnvcuvid.so.${PV} + usr/lib/libnvidia-cfg.so.${PV} + usr/lib/libnvidia-compiler.so.${PV} + usr/lib/libnvidia-glcore.so.${PV} + usr/lib/libnvidia-ml.so.${PV} + usr/lib/libvdpau_nvidia.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib/xorg/modules/drivers/nvidia_drv.so" + +QA_TEXTRELS_x86_fbsd="boot/modules/nvidia.ko + usr/lib/opengl/nvidia/lib/libGL.so.1 + usr/lib/libnvidia-glcore.so.1 + usr/lib/libvdpau_nvidia.so.1 + usr/lib/libnvidia-cfg.so.1 + usr/lib/opengl/nvidia/extensions/libglx.so.1 + usr/lib/xorg/modules/drivers/nvidia_drv.so" + +QA_TEXTRELS_amd64="usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib32/libnvidia-glcore.so.${PV} + usr/lib32/libvdpau_nvidia.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/libcuda.so.${PV} + usr/lib32/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib32/libnvidia-compiler.so.${PV}" + +QA_EXECSTACK_x86="usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/libnvidia-glcore.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV} + usr/lib/libXvMCNVIDIA.a:NVXVMC.o + usr/lib/libvdpau_nvidia.so.${PV} + usr/lib/libnvidia-compiler.so.${PV} + usr/lib/libcuda.so.${PV} + usr/lib/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0" + +QA_EXECSTACK_amd64="usr/lib32/libnvidia-glcore.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib32/libvdpau_nvidia.so.${PV} + usr/lib32/libcuda.so.${PV} + usr/lib32/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib32/libnvidia-compiler.so.${PV} + usr/lib64/libXvMCNVIDIA.a:NVXVMC.o + usr/lib64/libnvidia-cfg.so.${PV} + usr/lib64/libnvidia-ml.so.${PV} + usr/lib64/libvdpau_nvidia.so.${PV} + usr/lib64/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/libnvidia-glcore.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV} + usr/lib64/libcuda.so.${PV} + usr/lib64/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib64/libnvidia-compiler.so.${PV} + usr/lib64/xorg/modules/drivers/nvidia_drv.so + opt/bin/nvidia-smi + opt/bin/nvidia-xconfig + opt/bin/nvidia-debugdump + opt/bin/nvidia-settings" + +QA_WX_LOAD_x86="usr/lib/libnvidia-glcore.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/libXvMCNVIDIA.a + usr/lib64/libXvMCNVIDIA.so.${PV}" + +QA_WX_LOAD_amd64="usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/libnvidia-glcore.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/libnvidia-glcore.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV}" + +QA_SONAME_x86="usr/lib/libnvidia-compiler.so.${PV}" + +QA_SONAME_amd64="usr/lib64/libnvidia-compiler.so.${PV} + usr/lib32/libnvidia-compiler.so.${PV}" + +QA_DT_HASH_amd64="usr/lib32/libcuda.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/libnvidia-glcore.so.${PV} + usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib32/libvdpau_nvidia.so.${PV} + usr/lib32/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib32/libnvidia-compiler.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV} + usr/lib64/libcuda.so.${PV} + usr/lib64/libnvidia-cfg.so.${PV} + usr/lib64/libnvidia-glcore.so.${PV} + usr/lib64/libnvidia-ml.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/xorg/modules/drivers/nvidia_drv.so + usr/lib64/libvdpau_nvidia.so.${PV} + usr/lib64/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib64/libnvidia-compiler.so.${PV} + usr/lib64/libnvcuvid.so.${PV} + opt/bin/nvidia-smi + opt/bin/nvidia-xconfig + opt/bin/nvidia-debugdump + opt/bin/nvidia-settings" + +QA_DT_HASH_x86="usr/lib/libcuda.so.${PV} + usr/lib/libnvidia-cfg.so.${PV} + usr/lib/libnvidia-glcore.so.${PV} + usr/lib/libnvidia-ml.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/xorg/modules/drivers/nvidia_drv.so + usr/lib/libXvMCNVIDIA.so.${PV} + usr/lib/libvdpau_nvidia.so.${PV} + usr/lib/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib/libnvidia-compiler.so.${PV} + usr/lib/libnvcuvid.so.${PV} + opt/bin/nvidia-smi + opt/bin/nvidia-xconfig + opt/bin/nvidia-debugdump + opt/bin/nvidia-settings" + + +S="${WORKDIR}/" + +pkg_setup() { + # try to turn off distcc and ccache for people that have a problem with it + export DISTCC_DISABLE=1 + export CCACHE_DISABLE=1 + + if use amd64 && has_multilib_profile && [ "${DEFAULT_ABI}" != "amd64" ]; then + eerror "This ebuild doesn't currently support changing your default abi." + die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}" + fi + + # On BSD userland it wants real make command + use userland_BSD && MAKE="$(get_bmake)" + + export _POSIX2_VERSION="199209" + + # set variables to where files are in the package structure + if use kernel_FreeBSD; then + NV_DOC="${S}/doc" + NV_EXEC="${S}/obj" + NV_LIB="${S}/obj" + NV_SRC="${S}/src" + NV_MAN="${S}/x11/man" + NV_X11="${S}/obj" + NV_X11_DRV="${NV_X11}" + NV_X11_EXT="${NV_X11}" + NV_SOVER=1 + elif use kernel_linux; then + NV_DOC="${S}" + NV_EXEC="${S}" + NV_LIB="${S}" + NV_SRC="${S}/kernel" + NV_MAN="${S}" + NV_X11="${S}" + NV_X11_DRV="${NV_X11}" + NV_X11_EXT="${NV_X11}" + NV_SOVER=${PV} + else + die "Could not determine proper NVIDIA package" + fi +} + +src_unpack() { + if ! use x86-fbsd; then + cd "${S}" + unpack_makeself + else + unpack ${A} + fi +} + +src_prepare() { + # Please add a brief description for every added patch + use x86-fbsd && cd doc + cat <<- EOF > "${S}"/nvidia.icd + /usr/$(get_libdir)/libcuda.so + EOF +} + +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 x86-fbsd; then + MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \ + LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die + fi +} + +src_install() { + if use kernel_linux; then + VIDEOGROUP="$(egetent group video | cut -d ':' -f 3)" + if [ -z "$VIDEOGROUP" ]; then + eerror "Failed to determine the video group gid." + die "Failed to determine the video group gid." + fi + + # Add the aliases + [ -f "${FILESDIR}/nvidia-169.07" ] || die "nvidia missing in FILESDIR" + sed -e 's:PACKAGE:'${PF}':g' \ + -e 's:VIDEOGID:'${VIDEOGROUP}':' "${FILESDIR}"/nvidia-169.07 > \ + "${WORKDIR}"/nvidia + insinto /etc/modprobe.d + newins "${WORKDIR}"/nvidia nvidia.conf || die + + # Ensures that our device nodes are created when not using X + exeinto /lib/udev + doexe "${FILESDIR}"/nvidia-udev.sh + + insinto /lib/udev/rules.d + newins "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules + fi + + # NVIDIA kernel <-> userspace driver config lib + dolib.so ${NV_LIB}/libnvidia-cfg.so.${NV_SOVER} || \ + die "failed to install libnvidia-cfg" + dosym libnvidia-cfg.so.${NV_SOVER} \ + /usr/$(get_libdir)/libnvidia-cfg.so.1 || \ + die "failed to create libnvidia-cfg.so symlink" + dosym libnvidia-cfg.so.1 \ + /usr/$(get_libdir)/libnvidia-cfg.so || \ + die "failed to create libnvidia-cfg.so symlink" + + # NVIDIA monitoring library + dolib.so ${NV_LIB}/libnvidia-ml.so.${NV_SOVER} || \ + die "failed to install libnvidia-ml" + dosym libnvidia-ml.so.${NV_SOVER} \ + /usr/$(get_libdir)/libnvidia-ml.so.1 || \ + die "failed to create libnvidia-ml.so symlink" + dosym libnvidia-ml.so.1 \ + /usr/$(get_libdir)/libnvidia-ml.so || \ + die "failed to create libnvidia-ml.so symlink" + + # NVIDIA video decode <-> CUDA + dolib.so ${NV_LIB}/libnvcuvid.so.${NV_SOVER} || \ + die "failed to install libnvcuvid.so" + dosym libnvcuvid.so.${NV_SOVER} \ + /usr/$(get_libdir)/libnvcuvid.so.1 || \ + die "failed to create libnvcuvid.so symlink" + dosym libnvcuvid.so.1 \ + /usr/$(get_libdir)/libnvcuvid.so || \ + die "failed to create libnvcuvid.so symlink" + + # Xorg DDX driver + insinto /usr/$(get_libdir)/xorg/modules/drivers + doins ${NV_X11_DRV}/nvidia_drv.so || die "failed to install nvidia_drv.so" + + # Xorg GLX driver + insinto /usr/$(get_libdir)/opengl/nvidia/extensions + doins ${NV_X11_EXT}/libglx.so.${NV_SOVER} || \ + die "failed to install libglx.so" + dosym libglx.so.${NV_SOVER} \ + /usr/$(get_libdir)/opengl/nvidia/extensions/libglx.so || \ + die "failed to create libglx.so symlink" + + # XvMC driver + dolib.a ${NV_X11}/libXvMCNVIDIA.a || \ + die "failed to install libXvMCNVIDIA.so" + dolib.so ${NV_X11}/libXvMCNVIDIA.so.${NV_SOVER} || \ + die "failed to install libXvMCNVIDIA.so" + dosym libXvMCNVIDIA.so.${NV_SOVER} \ + /usr/$(get_libdir)/libXvMCNVIDIA.so.1 || \ + die "failed to create libXvMCNVIDIA.so symlink" + dosym libXvMCNVIDIA.so.1 /usr/$(get_libdir)/libXvMCNVIDIA.so || \ + die "failed to create libXvMCNVIDIA.so symlink" + dosym libXvMCNVIDIA.so.${NV_SOVER} \ + /usr/$(get_libdir)/libXvMCNVIDIA_dynamic.so.1 || \ + die "failed to create libXvMCNVIDIA_dynamic.so symlink" + + # OpenCL ICD for NVIDIA + if use kernel_linux; then + insinto /etc/OpenCL/vendors + doins nvidia.icd + fi + + # Documentation + dohtml ${NV_DOC}/html/* + if use x86-fbsd; then + dodoc "${NV_DOC}/README" + doman "${NV_MAN}/nvidia-xconfig.1" + else + # Docs + newdoc "${NV_DOC}/README.txt" README + dodoc "${NV_DOC}/NVIDIA_Changelog" + doman "${NV_MAN}/nvidia-smi.1.gz" + doman "${NV_MAN}/nvidia-xconfig.1.gz" + fi + + # Helper Apps + exeinto /opt/bin/ + doexe ${NV_EXEC}/nvidia-xconfig || die + doexe ${NV_EXEC}/nvidia-debugdump || die + doexe ${NV_EXEC}/nvidia-bug-report.sh || die + if use kernel_linux; then + doexe ${NV_EXEC}/nvidia-smi || die + fi + + if has_multilib_profile ; 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" + + # GNOME3 gnome-terminal redraw bug workaround, + # see: https://bugzilla.gnome.org/show_bug.cgi?id=664858 + doenvd "${FILESDIR}/90mutter-disable-culling" +} + +# Install nvidia library: +# the first parameter is the place where to install it +# the second parameter is the base name of the library +# the third parameter is the provided soversion +donvidia() { + dodir $1 + exeinto $1 + + libname=$(basename $2) + + doexe $2.$3 || die "failed to install $2" + dosym ${libname}.$3 $1/${libname} || die "failed to symlink $2" + [[ $3 != "1" ]] && dosym ${libname}.$3 $1/${libname}.1 +} + +src_install-libs() { + local inslibdir=$(get_libdir) + local NV_ROOT="/usr/${inslibdir}/opengl/nvidia" + local CL_ROOT=/usr/${inslibdir}/OpenCL/vendors/nvidia + local libdir= sover= + + if use kernel_linux; then + if has_multilib_profile && [[ ${ABI} == "x86" ]] ; then + libdir=32 + else + libdir=. + fi + sover=${PV} + else + libdir=obj + # on FreeBSD it has just .1 suffix + sover=1 + fi + + # The GLX libraries + donvidia ${NV_ROOT}/lib ${libdir}/libGL.so ${sover} + donvidia /usr/${inslibdir} ${libdir}/libnvidia-glcore.so ${sover} + if use x86-fbsd; then + donvidia ${NV_ROOT}/lib ${libdir}/libnvidia-tls.so ${sover} + else + donvidia ${NV_ROOT}/lib ${libdir}/tls/libnvidia-tls.so ${sover} + fi + + # VDPAU + donvidia /usr/${inslibdir} ${libdir}/libvdpau_nvidia.so ${sover} + + # CUDA & OpenCL + if use kernel_linux; then + donvidia /usr/${inslibdir} ${libdir}/libcuda.so ${sover} + donvidia /usr/${inslibdir} ${libdir}/libnvidia-compiler.so ${sover} + donvidia ${CL_ROOT} ${libdir}/libOpenCL.so 1.0.0 + #dosym libOpenCL.so.1 ${CL_ROOT}/libOpenCL.so + fi +} + +pkg_preinst() { + # 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() { + # Switch to the nvidia implementation + "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia + "${ROOT}"/usr/bin/eselect opencl set --use-old nvidia + + elog "To use the NVIDIA GLX, run \"eselect opengl set nvidia\"" + elog + elog "To use the NVIDIA CUDA/OpenCL, run \"eselect opencl set nvidia\"" + elog + elog "NVIDIA has requested that any bug reports submitted have the" + elog "output of /opt/bin/nvidia-bug-report.sh included." + elog + elog "To work with compiz, you must enable the AddARGBGLXVisuals option." + elog + elog "If you are having resolution problems, try disabling DynamicTwinView." + elog +} + +pkg_postrm() { + "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11 +} diff --git a/x11-drivers/nvidia-userspace/nvidia-userspace-302.17.ebuild b/x11-drivers/nvidia-userspace/nvidia-userspace-302.17.ebuild new file mode 100644 index 00000000..301d8462 --- /dev/null +++ b/x11-drivers/nvidia-userspace/nvidia-userspace-302.17.ebuild @@ -0,0 +1,453 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI="2" + +inherit eutils unpacker multilib portability versionator flag-o-matic + +X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}" +AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}" +X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}" + +DESCRIPTION="NVIDIA X11 userspace libraries and applications" +HOMEPAGE="http://www.nvidia.com/" +SRC_URI="x86? ( http://us.download.nvidia.com/XFree86/Linux-x86/${PV}/${X86_NV_PACKAGE}.run ) + amd64? ( http://us.download.nvidia.com/XFree86/Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run ) + x86-fbsd? ( http://us.download.nvidia.com/XFree86/FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )" + +LICENSE="NVIDIA" +SLOT="0" +KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd" +IUSE="acpi multilib kernel_linux" +RESTRICT="strip" +EMULTILIB_PKG="true" + +COMMON="<x11-base/xorg-server-1.12.99 + kernel_linux? ( >=sys-libs/glibc-2.6.1 ) + multilib? ( app-emulation/emul-linux-x86-xlibs ) + >=app-admin/eselect-opengl-1.0.9 + app-admin/eselect-opencl + !<media-video/nvidia-settings-256.52" +DEPEND="${COMMON}" +RDEPEND="${COMMON} + x11-libs/libXvMC + !<x11-drivers/nvidia-userspace-${PV} + !>x11-drivers/nvidia-userspace-${PV} + acpi? ( sys-power/acpid )" +PDEPEND=">=x11-libs/libvdpau-0.3-r1" + +QA_TEXTRELS_x86=" + usr/lib/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib/libXvMCNVIDIA.so.${PV} + usr/lib/libcuda.so.${PV} + usr/lib/libnvcuvid.so.${PV} + usr/lib/libnvidia-cfg.so.${PV} + usr/lib/libnvidia-compiler.so.${PV} + usr/lib/libnvidia-glcore.so.${PV} + usr/lib/libnvidia-ml.so.${PV} + usr/lib/libvdpau_nvidia.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib/xorg/modules/drivers/nvidia_drv.so" + +QA_TEXTRELS_x86_fbsd="boot/modules/nvidia.ko + usr/lib/opengl/nvidia/lib/libGL.so.1 + usr/lib/libnvidia-glcore.so.1 + usr/lib/libvdpau_nvidia.so.1 + usr/lib/libnvidia-cfg.so.1 + usr/lib/opengl/nvidia/extensions/libglx.so.1 + usr/lib/xorg/modules/drivers/nvidia_drv.so" + +QA_TEXTRELS_amd64="usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib32/libnvidia-glcore.so.${PV} + usr/lib32/libvdpau_nvidia.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/libcuda.so.${PV} + usr/lib32/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib32/libnvidia-compiler.so.${PV}" + +QA_EXECSTACK_x86="usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/libnvidia-glcore.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV} + usr/lib/libXvMCNVIDIA.a:NVXVMC.o + usr/lib/libvdpau_nvidia.so.${PV} + usr/lib/libnvidia-compiler.so.${PV} + usr/lib/libcuda.so.${PV} + usr/lib/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0" + +QA_EXECSTACK_amd64="usr/lib32/libnvidia-glcore.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib32/libvdpau_nvidia.so.${PV} + usr/lib32/libcuda.so.${PV} + usr/lib32/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib32/libnvidia-compiler.so.${PV} + usr/lib64/libXvMCNVIDIA.a:NVXVMC.o + usr/lib64/libnvidia-cfg.so.${PV} + usr/lib64/libnvidia-ml.so.${PV} + usr/lib64/libvdpau_nvidia.so.${PV} + usr/lib64/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/libnvidia-glcore.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV} + usr/lib64/libcuda.so.${PV} + usr/lib64/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib64/libnvidia-compiler.so.${PV} + usr/lib64/xorg/modules/drivers/nvidia_drv.so + opt/bin/nvidia-smi + opt/bin/nvidia-xconfig + opt/bin/nvidia-debugdump + opt/bin/nvidia-settings" + +QA_WX_LOAD_x86="usr/lib/libnvidia-glcore.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/libXvMCNVIDIA.a + usr/lib64/libXvMCNVIDIA.so.${PV}" + +QA_WX_LOAD_amd64="usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/libnvidia-glcore.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/libnvidia-glcore.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV}" + +QA_SONAME_x86="usr/lib/libnvidia-compiler.so.${PV}" + +QA_SONAME_amd64="usr/lib64/libnvidia-compiler.so.${PV} + usr/lib32/libnvidia-compiler.so.${PV}" + +QA_DT_HASH_amd64="usr/lib32/libcuda.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/libnvidia-glcore.so.${PV} + usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib32/libvdpau_nvidia.so.${PV} + usr/lib32/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib32/libnvidia-compiler.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV} + usr/lib64/libcuda.so.${PV} + usr/lib64/libnvidia-cfg.so.${PV} + usr/lib64/libnvidia-glcore.so.${PV} + usr/lib64/libnvidia-ml.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/xorg/modules/drivers/nvidia_drv.so + usr/lib64/libvdpau_nvidia.so.${PV} + usr/lib64/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib64/libnvidia-compiler.so.${PV} + usr/lib64/libnvcuvid.so.${PV} + opt/bin/nvidia-smi + opt/bin/nvidia-xconfig + opt/bin/nvidia-debugdump + opt/bin/nvidia-settings" + +QA_DT_HASH_x86="usr/lib/libcuda.so.${PV} + usr/lib/libnvidia-cfg.so.${PV} + usr/lib/libnvidia-glcore.so.${PV} + usr/lib/libnvidia-ml.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/xorg/modules/drivers/nvidia_drv.so + usr/lib/libXvMCNVIDIA.so.${PV} + usr/lib/libvdpau_nvidia.so.${PV} + usr/lib/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib/libnvidia-compiler.so.${PV} + usr/lib/libnvcuvid.so.${PV} + opt/bin/nvidia-smi + opt/bin/nvidia-xconfig + opt/bin/nvidia-debugdump + opt/bin/nvidia-settings" + + +S="${WORKDIR}/" + +pkg_setup() { + # try to turn off distcc and ccache for people that have a problem with it + export DISTCC_DISABLE=1 + export CCACHE_DISABLE=1 + + if use amd64 && has_multilib_profile && [ "${DEFAULT_ABI}" != "amd64" ]; then + eerror "This ebuild doesn't currently support changing your default abi." + die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}" + fi + + # On BSD userland it wants real make command + use userland_BSD && MAKE="$(get_bmake)" + + export _POSIX2_VERSION="199209" + + # set variables to where files are in the package structure + if use kernel_FreeBSD; then + NV_DOC="${S}/doc" + NV_EXEC="${S}/obj" + NV_LIB="${S}/obj" + NV_SRC="${S}/src" + NV_MAN="${S}/x11/man" + NV_X11="${S}/obj" + NV_X11_DRV="${NV_X11}" + NV_X11_EXT="${NV_X11}" + NV_SOVER=1 + elif use kernel_linux; then + NV_DOC="${S}" + NV_EXEC="${S}" + NV_LIB="${S}" + NV_SRC="${S}/kernel" + NV_MAN="${S}" + NV_X11="${S}" + NV_X11_DRV="${NV_X11}" + NV_X11_EXT="${NV_X11}" + NV_SOVER=${PV} + else + die "Could not determine proper NVIDIA package" + fi +} + +src_unpack() { + if ! use x86-fbsd; then + cd "${S}" + unpack_makeself + else + unpack ${A} + fi +} + +src_prepare() { + # Please add a brief description for every added patch + use x86-fbsd && cd doc + cat <<- EOF > "${S}"/nvidia.icd + /usr/$(get_libdir)/libcuda.so + EOF +} + +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 x86-fbsd; then + MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \ + LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die + fi +} + +src_install() { + if use kernel_linux; then + VIDEOGROUP="$(egetent group video | cut -d ':' -f 3)" + if [ -z "$VIDEOGROUP" ]; then + eerror "Failed to determine the video group gid." + die "Failed to determine the video group gid." + fi + + # Add the aliases + [ -f "${FILESDIR}/nvidia-169.07" ] || die "nvidia missing in FILESDIR" + sed -e 's:PACKAGE:'${PF}':g' \ + -e 's:VIDEOGID:'${VIDEOGROUP}':' "${FILESDIR}"/nvidia-169.07 > \ + "${WORKDIR}"/nvidia + insinto /etc/modprobe.d + newins "${WORKDIR}"/nvidia nvidia.conf || die + + # Ensures that our device nodes are created when not using X + exeinto /lib/udev + doexe "${FILESDIR}"/nvidia-udev.sh + + insinto /lib/udev/rules.d + newins "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules + fi + + # NVIDIA kernel <-> userspace driver config lib + dolib.so ${NV_LIB}/libnvidia-cfg.so.${NV_SOVER} || \ + die "failed to install libnvidia-cfg" + dosym libnvidia-cfg.so.${NV_SOVER} \ + /usr/$(get_libdir)/libnvidia-cfg.so.1 || \ + die "failed to create libnvidia-cfg.so symlink" + dosym libnvidia-cfg.so.1 \ + /usr/$(get_libdir)/libnvidia-cfg.so || \ + die "failed to create libnvidia-cfg.so symlink" + + # NVIDIA monitoring library + dolib.so ${NV_LIB}/libnvidia-ml.so.${NV_SOVER} || \ + die "failed to install libnvidia-ml" + dosym libnvidia-ml.so.${NV_SOVER} \ + /usr/$(get_libdir)/libnvidia-ml.so.1 || \ + die "failed to create libnvidia-ml.so symlink" + dosym libnvidia-ml.so.1 \ + /usr/$(get_libdir)/libnvidia-ml.so || \ + die "failed to create libnvidia-ml.so symlink" + + # NVIDIA video decode <-> CUDA + dolib.so ${NV_LIB}/libnvcuvid.so.${NV_SOVER} || \ + die "failed to install libnvcuvid.so" + dosym libnvcuvid.so.${NV_SOVER} \ + /usr/$(get_libdir)/libnvcuvid.so.1 || \ + die "failed to create libnvcuvid.so symlink" + dosym libnvcuvid.so.1 \ + /usr/$(get_libdir)/libnvcuvid.so || \ + die "failed to create libnvcuvid.so symlink" + + # Xorg DDX driver + insinto /usr/$(get_libdir)/xorg/modules/drivers + doins ${NV_X11_DRV}/nvidia_drv.so || die "failed to install nvidia_drv.so" + + # Xorg GLX driver + insinto /usr/$(get_libdir)/opengl/nvidia/extensions + doins ${NV_X11_EXT}/libglx.so.${NV_SOVER} || \ + die "failed to install libglx.so" + dosym libglx.so.${NV_SOVER} \ + /usr/$(get_libdir)/opengl/nvidia/extensions/libglx.so || \ + die "failed to create libglx.so symlink" + + # XvMC driver + dolib.a ${NV_X11}/libXvMCNVIDIA.a || \ + die "failed to install libXvMCNVIDIA.so" + dolib.so ${NV_X11}/libXvMCNVIDIA.so.${NV_SOVER} || \ + die "failed to install libXvMCNVIDIA.so" + dosym libXvMCNVIDIA.so.${NV_SOVER} \ + /usr/$(get_libdir)/libXvMCNVIDIA.so.1 || \ + die "failed to create libXvMCNVIDIA.so symlink" + dosym libXvMCNVIDIA.so.1 /usr/$(get_libdir)/libXvMCNVIDIA.so || \ + die "failed to create libXvMCNVIDIA.so symlink" + dosym libXvMCNVIDIA.so.${NV_SOVER} \ + /usr/$(get_libdir)/libXvMCNVIDIA_dynamic.so.1 || \ + die "failed to create libXvMCNVIDIA_dynamic.so symlink" + + # OpenCL ICD for NVIDIA + if use kernel_linux; then + insinto /etc/OpenCL/vendors + doins nvidia.icd + fi + + # Documentation + dohtml ${NV_DOC}/html/* + if use x86-fbsd; then + dodoc "${NV_DOC}/README" + doman "${NV_MAN}/nvidia-xconfig.1" + else + # Docs + newdoc "${NV_DOC}/README.txt" README + dodoc "${NV_DOC}/NVIDIA_Changelog" + doman "${NV_MAN}/nvidia-smi.1.gz" + doman "${NV_MAN}/nvidia-xconfig.1.gz" + fi + + # Helper Apps + exeinto /opt/bin/ + doexe ${NV_EXEC}/nvidia-xconfig || die + doexe ${NV_EXEC}/nvidia-debugdump || die + doexe ${NV_EXEC}/nvidia-bug-report.sh || die + if use kernel_linux; then + doexe ${NV_EXEC}/nvidia-smi || die + fi + + if has_multilib_profile ; 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" + + # GNOME3 gnome-terminal redraw bug workaround, + # see: https://bugzilla.gnome.org/show_bug.cgi?id=664858 + doenvd "${FILESDIR}/90mutter-disable-culling" +} + +# Install nvidia library: +# the first parameter is the place where to install it +# the second parameter is the base name of the library +# the third parameter is the provided soversion +donvidia() { + dodir $1 + exeinto $1 + + libname=$(basename $2) + + doexe $2.$3 || die "failed to install $2" + dosym ${libname}.$3 $1/${libname} || die "failed to symlink $2" + [[ $3 != "1" ]] && dosym ${libname}.$3 $1/${libname}.1 +} + +src_install-libs() { + local inslibdir=$(get_libdir) + local NV_ROOT="/usr/${inslibdir}/opengl/nvidia" + local CL_ROOT=/usr/${inslibdir}/OpenCL/vendors/nvidia + local libdir= sover= + + if use kernel_linux; then + if has_multilib_profile && [[ ${ABI} == "x86" ]] ; then + libdir=32 + else + libdir=. + fi + sover=${PV} + else + libdir=obj + # on FreeBSD it has just .1 suffix + sover=1 + fi + + # The GLX libraries + donvidia ${NV_ROOT}/lib ${libdir}/libGL.so ${sover} + donvidia /usr/${inslibdir} ${libdir}/libnvidia-glcore.so ${sover} + if use x86-fbsd; then + donvidia ${NV_ROOT}/lib ${libdir}/libnvidia-tls.so ${sover} + else + donvidia ${NV_ROOT}/lib ${libdir}/tls/libnvidia-tls.so ${sover} + fi + + # VDPAU + donvidia /usr/${inslibdir} ${libdir}/libvdpau_nvidia.so ${sover} + + # CUDA & OpenCL + if use kernel_linux; then + donvidia /usr/${inslibdir} ${libdir}/libcuda.so ${sover} + donvidia /usr/${inslibdir} ${libdir}/libnvidia-compiler.so ${sover} + donvidia ${CL_ROOT} ${libdir}/libOpenCL.so 1.0.0 + #dosym libOpenCL.so.1 ${CL_ROOT}/libOpenCL.so + fi +} + +pkg_preinst() { + # 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() { + # Switch to the nvidia implementation + "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia + "${ROOT}"/usr/bin/eselect opencl set --use-old nvidia + + elog "To use the NVIDIA GLX, run \"eselect opengl set nvidia\"" + elog + elog "To use the NVIDIA CUDA/OpenCL, run \"eselect opencl set nvidia\"" + elog + elog "NVIDIA has requested that any bug reports submitted have the" + elog "output of /opt/bin/nvidia-bug-report.sh included." + elog + elog "To work with compiz, you must enable the AddARGBGLXVisuals option." + elog + elog "If you are having resolution problems, try disabling DynamicTwinView." + elog +} + +pkg_postrm() { + "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11 +} diff --git a/x11-drivers/nvidia-userspace/nvidia-userspace-304.22.ebuild b/x11-drivers/nvidia-userspace/nvidia-userspace-304.22.ebuild new file mode 100644 index 00000000..301d8462 --- /dev/null +++ b/x11-drivers/nvidia-userspace/nvidia-userspace-304.22.ebuild @@ -0,0 +1,453 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI="2" + +inherit eutils unpacker multilib portability versionator flag-o-matic + +X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}" +AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}" +X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}" + +DESCRIPTION="NVIDIA X11 userspace libraries and applications" +HOMEPAGE="http://www.nvidia.com/" +SRC_URI="x86? ( http://us.download.nvidia.com/XFree86/Linux-x86/${PV}/${X86_NV_PACKAGE}.run ) + amd64? ( http://us.download.nvidia.com/XFree86/Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run ) + x86-fbsd? ( http://us.download.nvidia.com/XFree86/FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )" + +LICENSE="NVIDIA" +SLOT="0" +KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd" +IUSE="acpi multilib kernel_linux" +RESTRICT="strip" +EMULTILIB_PKG="true" + +COMMON="<x11-base/xorg-server-1.12.99 + kernel_linux? ( >=sys-libs/glibc-2.6.1 ) + multilib? ( app-emulation/emul-linux-x86-xlibs ) + >=app-admin/eselect-opengl-1.0.9 + app-admin/eselect-opencl + !<media-video/nvidia-settings-256.52" +DEPEND="${COMMON}" +RDEPEND="${COMMON} + x11-libs/libXvMC + !<x11-drivers/nvidia-userspace-${PV} + !>x11-drivers/nvidia-userspace-${PV} + acpi? ( sys-power/acpid )" +PDEPEND=">=x11-libs/libvdpau-0.3-r1" + +QA_TEXTRELS_x86=" + usr/lib/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib/libXvMCNVIDIA.so.${PV} + usr/lib/libcuda.so.${PV} + usr/lib/libnvcuvid.so.${PV} + usr/lib/libnvidia-cfg.so.${PV} + usr/lib/libnvidia-compiler.so.${PV} + usr/lib/libnvidia-glcore.so.${PV} + usr/lib/libnvidia-ml.so.${PV} + usr/lib/libvdpau_nvidia.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib/xorg/modules/drivers/nvidia_drv.so" + +QA_TEXTRELS_x86_fbsd="boot/modules/nvidia.ko + usr/lib/opengl/nvidia/lib/libGL.so.1 + usr/lib/libnvidia-glcore.so.1 + usr/lib/libvdpau_nvidia.so.1 + usr/lib/libnvidia-cfg.so.1 + usr/lib/opengl/nvidia/extensions/libglx.so.1 + usr/lib/xorg/modules/drivers/nvidia_drv.so" + +QA_TEXTRELS_amd64="usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib32/libnvidia-glcore.so.${PV} + usr/lib32/libvdpau_nvidia.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/libcuda.so.${PV} + usr/lib32/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib32/libnvidia-compiler.so.${PV}" + +QA_EXECSTACK_x86="usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/libnvidia-glcore.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV} + usr/lib/libXvMCNVIDIA.a:NVXVMC.o + usr/lib/libvdpau_nvidia.so.${PV} + usr/lib/libnvidia-compiler.so.${PV} + usr/lib/libcuda.so.${PV} + usr/lib/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0" + +QA_EXECSTACK_amd64="usr/lib32/libnvidia-glcore.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib32/libvdpau_nvidia.so.${PV} + usr/lib32/libcuda.so.${PV} + usr/lib32/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib32/libnvidia-compiler.so.${PV} + usr/lib64/libXvMCNVIDIA.a:NVXVMC.o + usr/lib64/libnvidia-cfg.so.${PV} + usr/lib64/libnvidia-ml.so.${PV} + usr/lib64/libvdpau_nvidia.so.${PV} + usr/lib64/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/libnvidia-glcore.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV} + usr/lib64/libcuda.so.${PV} + usr/lib64/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib64/libnvidia-compiler.so.${PV} + usr/lib64/xorg/modules/drivers/nvidia_drv.so + opt/bin/nvidia-smi + opt/bin/nvidia-xconfig + opt/bin/nvidia-debugdump + opt/bin/nvidia-settings" + +QA_WX_LOAD_x86="usr/lib/libnvidia-glcore.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/libXvMCNVIDIA.a + usr/lib64/libXvMCNVIDIA.so.${PV}" + +QA_WX_LOAD_amd64="usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/libnvidia-glcore.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/libnvidia-glcore.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV}" + +QA_SONAME_x86="usr/lib/libnvidia-compiler.so.${PV}" + +QA_SONAME_amd64="usr/lib64/libnvidia-compiler.so.${PV} + usr/lib32/libnvidia-compiler.so.${PV}" + +QA_DT_HASH_amd64="usr/lib32/libcuda.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/libnvidia-glcore.so.${PV} + usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib32/libvdpau_nvidia.so.${PV} + usr/lib32/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib32/libnvidia-compiler.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV} + usr/lib64/libcuda.so.${PV} + usr/lib64/libnvidia-cfg.so.${PV} + usr/lib64/libnvidia-glcore.so.${PV} + usr/lib64/libnvidia-ml.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/xorg/modules/drivers/nvidia_drv.so + usr/lib64/libvdpau_nvidia.so.${PV} + usr/lib64/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib64/libnvidia-compiler.so.${PV} + usr/lib64/libnvcuvid.so.${PV} + opt/bin/nvidia-smi + opt/bin/nvidia-xconfig + opt/bin/nvidia-debugdump + opt/bin/nvidia-settings" + +QA_DT_HASH_x86="usr/lib/libcuda.so.${PV} + usr/lib/libnvidia-cfg.so.${PV} + usr/lib/libnvidia-glcore.so.${PV} + usr/lib/libnvidia-ml.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/xorg/modules/drivers/nvidia_drv.so + usr/lib/libXvMCNVIDIA.so.${PV} + usr/lib/libvdpau_nvidia.so.${PV} + usr/lib/OpenCL/vendors/nvidia/libOpenCL.so.1.0.0 + usr/lib/libnvidia-compiler.so.${PV} + usr/lib/libnvcuvid.so.${PV} + opt/bin/nvidia-smi + opt/bin/nvidia-xconfig + opt/bin/nvidia-debugdump + opt/bin/nvidia-settings" + + +S="${WORKDIR}/" + +pkg_setup() { + # try to turn off distcc and ccache for people that have a problem with it + export DISTCC_DISABLE=1 + export CCACHE_DISABLE=1 + + if use amd64 && has_multilib_profile && [ "${DEFAULT_ABI}" != "amd64" ]; then + eerror "This ebuild doesn't currently support changing your default abi." + die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}" + fi + + # On BSD userland it wants real make command + use userland_BSD && MAKE="$(get_bmake)" + + export _POSIX2_VERSION="199209" + + # set variables to where files are in the package structure + if use kernel_FreeBSD; then + NV_DOC="${S}/doc" + NV_EXEC="${S}/obj" + NV_LIB="${S}/obj" + NV_SRC="${S}/src" + NV_MAN="${S}/x11/man" + NV_X11="${S}/obj" + NV_X11_DRV="${NV_X11}" + NV_X11_EXT="${NV_X11}" + NV_SOVER=1 + elif use kernel_linux; then + NV_DOC="${S}" + NV_EXEC="${S}" + NV_LIB="${S}" + NV_SRC="${S}/kernel" + NV_MAN="${S}" + NV_X11="${S}" + NV_X11_DRV="${NV_X11}" + NV_X11_EXT="${NV_X11}" + NV_SOVER=${PV} + else + die "Could not determine proper NVIDIA package" + fi +} + +src_unpack() { + if ! use x86-fbsd; then + cd "${S}" + unpack_makeself + else + unpack ${A} + fi +} + +src_prepare() { + # Please add a brief description for every added patch + use x86-fbsd && cd doc + cat <<- EOF > "${S}"/nvidia.icd + /usr/$(get_libdir)/libcuda.so + EOF +} + +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 x86-fbsd; then + MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \ + LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die + fi +} + +src_install() { + if use kernel_linux; then + VIDEOGROUP="$(egetent group video | cut -d ':' -f 3)" + if [ -z "$VIDEOGROUP" ]; then + eerror "Failed to determine the video group gid." + die "Failed to determine the video group gid." + fi + + # Add the aliases + [ -f "${FILESDIR}/nvidia-169.07" ] || die "nvidia missing in FILESDIR" + sed -e 's:PACKAGE:'${PF}':g' \ + -e 's:VIDEOGID:'${VIDEOGROUP}':' "${FILESDIR}"/nvidia-169.07 > \ + "${WORKDIR}"/nvidia + insinto /etc/modprobe.d + newins "${WORKDIR}"/nvidia nvidia.conf || die + + # Ensures that our device nodes are created when not using X + exeinto /lib/udev + doexe "${FILESDIR}"/nvidia-udev.sh + + insinto /lib/udev/rules.d + newins "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules + fi + + # NVIDIA kernel <-> userspace driver config lib + dolib.so ${NV_LIB}/libnvidia-cfg.so.${NV_SOVER} || \ + die "failed to install libnvidia-cfg" + dosym libnvidia-cfg.so.${NV_SOVER} \ + /usr/$(get_libdir)/libnvidia-cfg.so.1 || \ + die "failed to create libnvidia-cfg.so symlink" + dosym libnvidia-cfg.so.1 \ + /usr/$(get_libdir)/libnvidia-cfg.so || \ + die "failed to create libnvidia-cfg.so symlink" + + # NVIDIA monitoring library + dolib.so ${NV_LIB}/libnvidia-ml.so.${NV_SOVER} || \ + die "failed to install libnvidia-ml" + dosym libnvidia-ml.so.${NV_SOVER} \ + /usr/$(get_libdir)/libnvidia-ml.so.1 || \ + die "failed to create libnvidia-ml.so symlink" + dosym libnvidia-ml.so.1 \ + /usr/$(get_libdir)/libnvidia-ml.so || \ + die "failed to create libnvidia-ml.so symlink" + + # NVIDIA video decode <-> CUDA + dolib.so ${NV_LIB}/libnvcuvid.so.${NV_SOVER} || \ + die "failed to install libnvcuvid.so" + dosym libnvcuvid.so.${NV_SOVER} \ + /usr/$(get_libdir)/libnvcuvid.so.1 || \ + die "failed to create libnvcuvid.so symlink" + dosym libnvcuvid.so.1 \ + /usr/$(get_libdir)/libnvcuvid.so || \ + die "failed to create libnvcuvid.so symlink" + + # Xorg DDX driver + insinto /usr/$(get_libdir)/xorg/modules/drivers + doins ${NV_X11_DRV}/nvidia_drv.so || die "failed to install nvidia_drv.so" + + # Xorg GLX driver + insinto /usr/$(get_libdir)/opengl/nvidia/extensions + doins ${NV_X11_EXT}/libglx.so.${NV_SOVER} || \ + die "failed to install libglx.so" + dosym libglx.so.${NV_SOVER} \ + /usr/$(get_libdir)/opengl/nvidia/extensions/libglx.so || \ + die "failed to create libglx.so symlink" + + # XvMC driver + dolib.a ${NV_X11}/libXvMCNVIDIA.a || \ + die "failed to install libXvMCNVIDIA.so" + dolib.so ${NV_X11}/libXvMCNVIDIA.so.${NV_SOVER} || \ + die "failed to install libXvMCNVIDIA.so" + dosym libXvMCNVIDIA.so.${NV_SOVER} \ + /usr/$(get_libdir)/libXvMCNVIDIA.so.1 || \ + die "failed to create libXvMCNVIDIA.so symlink" + dosym libXvMCNVIDIA.so.1 /usr/$(get_libdir)/libXvMCNVIDIA.so || \ + die "failed to create libXvMCNVIDIA.so symlink" + dosym libXvMCNVIDIA.so.${NV_SOVER} \ + /usr/$(get_libdir)/libXvMCNVIDIA_dynamic.so.1 || \ + die "failed to create libXvMCNVIDIA_dynamic.so symlink" + + # OpenCL ICD for NVIDIA + if use kernel_linux; then + insinto /etc/OpenCL/vendors + doins nvidia.icd + fi + + # Documentation + dohtml ${NV_DOC}/html/* + if use x86-fbsd; then + dodoc "${NV_DOC}/README" + doman "${NV_MAN}/nvidia-xconfig.1" + else + # Docs + newdoc "${NV_DOC}/README.txt" README + dodoc "${NV_DOC}/NVIDIA_Changelog" + doman "${NV_MAN}/nvidia-smi.1.gz" + doman "${NV_MAN}/nvidia-xconfig.1.gz" + fi + + # Helper Apps + exeinto /opt/bin/ + doexe ${NV_EXEC}/nvidia-xconfig || die + doexe ${NV_EXEC}/nvidia-debugdump || die + doexe ${NV_EXEC}/nvidia-bug-report.sh || die + if use kernel_linux; then + doexe ${NV_EXEC}/nvidia-smi || die + fi + + if has_multilib_profile ; 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" + + # GNOME3 gnome-terminal redraw bug workaround, + # see: https://bugzilla.gnome.org/show_bug.cgi?id=664858 + doenvd "${FILESDIR}/90mutter-disable-culling" +} + +# Install nvidia library: +# the first parameter is the place where to install it +# the second parameter is the base name of the library +# the third parameter is the provided soversion +donvidia() { + dodir $1 + exeinto $1 + + libname=$(basename $2) + + doexe $2.$3 || die "failed to install $2" + dosym ${libname}.$3 $1/${libname} || die "failed to symlink $2" + [[ $3 != "1" ]] && dosym ${libname}.$3 $1/${libname}.1 +} + +src_install-libs() { + local inslibdir=$(get_libdir) + local NV_ROOT="/usr/${inslibdir}/opengl/nvidia" + local CL_ROOT=/usr/${inslibdir}/OpenCL/vendors/nvidia + local libdir= sover= + + if use kernel_linux; then + if has_multilib_profile && [[ ${ABI} == "x86" ]] ; then + libdir=32 + else + libdir=. + fi + sover=${PV} + else + libdir=obj + # on FreeBSD it has just .1 suffix + sover=1 + fi + + # The GLX libraries + donvidia ${NV_ROOT}/lib ${libdir}/libGL.so ${sover} + donvidia /usr/${inslibdir} ${libdir}/libnvidia-glcore.so ${sover} + if use x86-fbsd; then + donvidia ${NV_ROOT}/lib ${libdir}/libnvidia-tls.so ${sover} + else + donvidia ${NV_ROOT}/lib ${libdir}/tls/libnvidia-tls.so ${sover} + fi + + # VDPAU + donvidia /usr/${inslibdir} ${libdir}/libvdpau_nvidia.so ${sover} + + # CUDA & OpenCL + if use kernel_linux; then + donvidia /usr/${inslibdir} ${libdir}/libcuda.so ${sover} + donvidia /usr/${inslibdir} ${libdir}/libnvidia-compiler.so ${sover} + donvidia ${CL_ROOT} ${libdir}/libOpenCL.so 1.0.0 + #dosym libOpenCL.so.1 ${CL_ROOT}/libOpenCL.so + fi +} + +pkg_preinst() { + # 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() { + # Switch to the nvidia implementation + "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia + "${ROOT}"/usr/bin/eselect opencl set --use-old nvidia + + elog "To use the NVIDIA GLX, run \"eselect opengl set nvidia\"" + elog + elog "To use the NVIDIA CUDA/OpenCL, run \"eselect opencl set nvidia\"" + elog + elog "NVIDIA has requested that any bug reports submitted have the" + elog "output of /opt/bin/nvidia-bug-report.sh included." + elog + elog "To work with compiz, you must enable the AddARGBGLXVisuals option." + elog + elog "If you are having resolution problems, try disabling DynamicTwinView." + elog +} + +pkg_postrm() { + "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11 +} diff --git a/x11-drivers/nvidia-userspace/nvidia-userspace-304.37.ebuild b/x11-drivers/nvidia-userspace/nvidia-userspace-304.37.ebuild new file mode 100644 index 00000000..636221f7 --- /dev/null +++ b/x11-drivers/nvidia-userspace/nvidia-userspace-304.37.ebuild @@ -0,0 +1,385 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI=4 + +inherit eutils flag-o-matic linux-info linux-mod multilib nvidia-driver \ + portability toolchain-funcs unpacker user versionator + +X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}" +AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}" +X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}" +AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}" + +DESCRIPTION="NVIDIA X11 userspace libraries and applications" +HOMEPAGE="http://www.nvidia.com/" +SRC_URI="x86? ( http://us.download.nvidia.com/XFree86/Linux-x86/${PV}/${X86_NV_PACKAGE}.run ) + amd64? ( http://us.download.nvidia.com/XFree86/Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run ) + amd64-fbsd? ( http://us.download.nvidia.com/XFree86/FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz ) + x86-fbsd? ( http://us.download.nvidia.com/XFree86/FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )" + +LICENSE="NVIDIA" +SLOT="0" +KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd" +IUSE="acpi multilib x-multilib kernel_FreeBSD kernel_linux tools +X" +RESTRICT="strip" +EMULTILIB_PKG="true" + +COMMON="app-admin/eselect-opencl + kernel_linux? ( >=sys-libs/glibc-2.6.1 ) + x-multilib? ( app-emulation/emul-linux-x86-xlibs ) + multilib? ( app-emulation/emul-linux-x86-baselibs ) + X? ( + <x11-base/xorg-server-1.12.99 + >=app-admin/eselect-opengl-1.0.9 + )" +DEPEND="${COMMON}" +RDEPEND="${COMMON} + X? ( x11-libs/libXvMC ) + !<x11-drivers/nvidia-userspace-${PV} + !>x11-drivers/nvidia-userspace-${PV} + acpi? ( sys-power/acpid ) + tools? ( media-video/nvidia-settings )" +PDEPEND="X? ( >=x11-libs/libvdpau-0.3-r1 )" + +REQUIRED_USE="tools? ( X )" +QA_PREBUILT="" +S="${WORKDIR}/" + +pkg_pretend() { + if use amd64 && has_multilib_profile && \ + [ "${DEFAULT_ABI}" != "amd64" ]; then + eerror "This ebuild doesn't currently support changing your default ABI" + die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}" + fi + + # Kernel features/options to check for + CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP" + use x86 && CONFIG_CHECK+=" ~HIGHMEM" + + # Now do the above checks + use kernel_linux && check_extra_config +} + +pkg_setup() { + # try to turn off distcc and ccache for people that have a problem with it + export DISTCC_DISABLE=1 + export CCACHE_DISABLE=1 + + if use kernel_linux; then + linux-mod_pkg_setup + MODULE_NAMES="nvidia(video:${S}/kernel)" + BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \ + SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC)" + # linux-mod_src_compile calls set_arch_to_kernel, which + # sets the ARCH to x86 but NVIDIA's wrapping Makefile + # expects x86_64 or i386 and then converts it to x86 + # later on in the build process + BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')" + fi + + # Since Nvidia ships 3 different series of drivers, we need to give the user + # some kind of guidance as to what version they should install. This tries + # to point the user in the right direction but can't be perfect. check + # nvidia-driver.eclass + nvidia-driver-check-warning + + # set variables to where files are in the package structure + if use kernel_FreeBSD; then + use x86-fbsd && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}" + use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}" + NV_DOC="${S}/doc" + NV_OBJ="${S}/obj" + NV_SRC="${S}/src" + NV_MAN="${S}/x11/man" + NV_X11="${S}/obj" + NV_SOVER=1 + elif use kernel_linux; then + NV_DOC="${S}" + NV_OBJ="${S}" + NV_SRC="${S}/kernel" + NV_MAN="${S}" + NV_X11="${S}" + NV_SOVER=${PV} + else + die "Could not determine proper NVIDIA package" + fi +} + +src_unpack() { + if ! use kernel_FreeBSD; then + cd "${S}" + unpack_makeself + else + unpack ${A} + fi +} + +src_prepare() { + # Please add a brief description for every added patch + cat <<- EOF > "${S}"/nvidia.icd + /usr/$(get_libdir)/libcuda.so + EOF + + # Allow user patches so they can support RC kernels and whatever else + epatch_user +} + +src_compile() { + # This is already the default on Linux, as there's no toplevel Makefile, but + # on FreeBSD there's one and triggers the kernel module build, as we install + # it by itself, pass this. + + cd "${NV_SRC}" + if use kernel_FreeBSD; then + MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \ + LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die + fi +} + +# Install nvidia library: +# the first parameter is the library to install +# the second parameter is the provided soversion +# the third parameter is the target directory if its not /usr/lib +donvidia() { + # Full path to library minus SOVER + MY_LIB="$1" + + # SOVER to use + MY_SOVER="$2" + + # Where to install + MY_DEST="$3" + + if [[ -z "${MY_DEST}" ]]; then + MY_DEST="/usr/$(get_libdir)" + action="dolib.so" + else + exeinto ${MY_DEST} + action="doexe" + fi + + # Get just the library name + libname=$(basename $1) + + # Add it to QA_PREBUILT + QA_PREBUILT+=" ${MY_DEST}/${libname}.${MY_SOVER}" + + # Install the library with the correct SOVER + ${action} ${MY_LIB}.${MY_SOVER} || \ + die "failed to install ${libname}" + + # If SOVER wasn't 1, then we need to create a .1 symlink + if [[ "${MY_SOVER}" != "1" ]]; then + dosym ${libname}.${MY_SOVER} \ + ${MY_DEST}/${libname}.1 || \ + die "failed to create ${libname} symlink" + fi + + # Always create the symlink from the raw lib to the .1 + dosym ${libname}.1 \ + ${MY_DEST}/${libname} || \ + die "failed to create ${libname} symlink" +} + +src_install() { + if use kernel_linux; then + VIDEOGROUP="$(egetent group video | cut -d ':' -f 3)" + if [ -z "$VIDEOGROUP" ]; then + eerror "Failed to determine the video group gid." + die "Failed to determine the video group gid." + fi + + # Add the aliases + [ -f "${FILESDIR}/nvidia-169.07" ] || die "nvidia missing in FILESDIR" + sed -e 's:PACKAGE:'${PF}':g' \ + -e 's:VIDEOGID:'${VIDEOGROUP}':' "${FILESDIR}"/nvidia-169.07 > \ + "${WORKDIR}"/nvidia + insinto /etc/modprobe.d + newins "${WORKDIR}"/nvidia nvidia.conf || die + + local udevdir=/lib/udev + has_version sys-fs/udev && udevdir="$($(tc-getPKG_CONFIG) --variable=udevdir udev)" + + # Ensures that our device nodes are created when not using X + exeinto "${udevdir}" + doexe "${FILESDIR}"/nvidia-udev.sh + + insinto "${udevdir}"/rules.d + newins "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules + elif use kernel_FreeBSD; then + if use x86-fbsd; then + insinto /boot/modules + doins "${S}/src/nvidia.kld" || die + fi + + exeinto /boot/modules + doexe "${S}/src/nvidia.ko" || die + fi + + # NVIDIA kernel <-> userspace driver config lib + donvidia ${NV_OBJ}/libnvidia-cfg.so ${NV_SOVER} + + if use kernel_linux; then + # NVIDIA video decode <-> CUDA + donvidia ${NV_OBJ}/libnvcuvid.so ${NV_SOVER} + fi + + if use X; then + # Xorg DDX driver + insinto /usr/$(get_libdir)/xorg/modules/drivers + doins ${NV_X11}/nvidia_drv.so || die "failed to install nvidia_drv.so" + + # Xorg GLX driver + donvidia ${NV_X11}/libglx.so ${NV_SOVER} \ + /usr/$(get_libdir)/opengl/nvidia/extensions + + # XvMC driver + dolib.a ${NV_X11}/libXvMCNVIDIA.a || \ + die "failed to install libXvMCNVIDIA.so" + donvidia ${NV_X11}/libXvMCNVIDIA.so ${NV_SOVER} + dosym libXvMCNVIDIA.so.${NV_SOVER} \ + /usr/$(get_libdir)/libXvMCNVIDIA_dynamic.so.1 || \ + die "failed to create libXvMCNVIDIA_dynamic.so symlink" + fi + + # OpenCL ICD for NVIDIA + if use kernel_linux; then + insinto /etc/OpenCL/vendors + doins nvidia.icd + fi + + # Documentation + dohtml ${NV_DOC}/html/* + if use kernel_FreeBSD; then + dodoc "${NV_DOC}/README" + use X && doman "${NV_MAN}/nvidia-xconfig.1" + else + # Docs + newdoc "${NV_DOC}/README.txt" README + dodoc "${NV_DOC}/NVIDIA_Changelog" + doman "${NV_MAN}/nvidia-smi.1.gz" + use X && doman "${NV_MAN}/nvidia-xconfig.1.gz" + doman "${NV_MAN}/nvidia-cuda-proxy-control.1.gz" + fi + + # Helper Apps + exeinto /opt/bin/ + if use X; then + doexe ${NV_OBJ}/nvidia-xconfig || die + fi + + if use kernel_linux ; then + doexe ${NV_OBJ}/nvidia-debugdump || die + doexe ${NV_OBJ}/nvidia-cuda-proxy-control || die + doexe ${NV_OBJ}/nvidia-cuda-proxy-server || die + doexe ${NV_OBJ}/nvidia-smi || die + newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi + fi + + exeinto /usr/bin/ + doexe ${NV_OBJ}/nvidia-bug-report.sh || die + + 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" + + # GNOME3 gnome-terminal redraw bug workaround, + # see: https://bugzilla.gnome.org/show_bug.cgi?id=664858 + doenvd "${FILESDIR}/90mutter-disable-culling" +} + +src_install-libs() { + local inslibdir=$(get_libdir) + local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib" + local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia" + local libdir=${NV_OBJ} + + if use kernel_linux && has_multilib_profile && \ + [[ ${ABI} == "x86" ]] ; then + libdir=${NV_OBJ}/32 + fi + + if use X; then + # The GLX libraries + donvidia ${libdir}/libGL.so ${NV_SOVER} ${GL_ROOT} + donvidia ${libdir}/libnvidia-glcore.so ${NV_SOVER} + if use kernel_FreeBSD; then + donvidia ${libdir}/libnvidia-tls.so ${NV_SOVER} ${GL_ROOT} + else + donvidia ${libdir}/tls/libnvidia-tls.so ${NV_SOVER} ${GL_ROOT} + fi + + # VDPAU + donvidia ${libdir}/libvdpau_nvidia.so ${NV_SOVER} + fi + + # NVIDIA monitoring library + if use kernel_linux ; then + donvidia ${libdir}/libnvidia-ml.so ${NV_SOVER} + fi + + # CUDA & OpenCL + if use kernel_linux; then + donvidia ${libdir}/libcuda.so ${NV_SOVER} + donvidia ${libdir}/libnvidia-compiler.so ${NV_SOVER} + donvidia ${libdir}/libOpenCL.so 1.0.0 ${CL_ROOT} + fi +} + +pkg_preinst() { + # 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() { + # Switch to the nvidia implementation + use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia + "${ROOT}"/usr/bin/eselect opencl set --use-old nvidia + + elog "You must be in the video group to use the NVIDIA device" + elog "For more info, read the docs at" + elog "http://www.gentoo.org/doc/en/nvidia-guide.xml#doc_chap3_sect6" + elog + elog "To use the NVIDIA GLX, run \"eselect opengl set nvidia\"" + elog + elog "To use the NVIDIA CUDA/OpenCL, run \"eselect opencl set nvidia\"" + elog + elog "NVIDIA has requested that any bug reports submitted have the" + elog "output of /opt/bin/nvidia-bug-report.sh included." + elog + if ! use X; then + elog "You have elected to not install the X.org driver. Along with" + elog "this the OpenGL libraries, XvMC, and VDPAU libraries were not" + elog "installed. Additionally, once the driver is loaded your card" + elog "and fan will run at max speed which may not be desirable." + elog "Use the 'nvidia-smi' init script to have your card and fan" + elog "speed scale appropriately." + elog + fi +} + +pkg_prerm() { + use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11 +} + +pkg_postrm() { + use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11 +} diff --git a/x11-drivers/nvidia-userspace/nvidia-userspace-304.88.ebuild b/x11-drivers/nvidia-userspace/nvidia-userspace-304.88.ebuild new file mode 100644 index 00000000..eabac720 --- /dev/null +++ b/x11-drivers/nvidia-userspace/nvidia-userspace-304.88.ebuild @@ -0,0 +1,379 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI=4 + +inherit eutils flag-o-matic linux-info linux-mod multilib nvidia-driver \ + portability toolchain-funcs unpacker user versionator udev + +X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}" +AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}" +X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}" +AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}" + +DESCRIPTION="NVIDIA X11 userspace libraries and applications" +HOMEPAGE="http://www.nvidia.com/" +SRC_URI="x86? ( ftp://download.nvidia.com/XFree86/Linux-x86/${PV}/${X86_NV_PACKAGE}.run ) + amd64? ( ftp://download.nvidia.com/XFree86/Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run ) + amd64-fbsd? ( ftp://download.nvidia.com/XFree86/FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz ) + x86-fbsd? ( ftp://download.nvidia.com/XFree86/FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )" + +LICENSE="NVIDIA" +SLOT="0" +KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd" +IUSE="acpi multilib x-multilib kernel_FreeBSD kernel_linux tools +X" +RESTRICT="strip" +EMULTILIB_PKG="true" + +COMMON="app-admin/eselect-opencl + kernel_linux? ( >=sys-libs/glibc-2.6.1 ) + x-multilib? ( app-emulation/emul-linux-x86-xlibs ) + multilib? ( app-emulation/emul-linux-x86-baselibs ) + X? ( + <x11-base/xorg-server-1.14.99 + >=app-admin/eselect-opengl-1.0.9 + )" +DEPEND="${COMMON}" +RDEPEND="${COMMON} + X? ( x11-libs/libXvMC ) + !<x11-drivers/nvidia-userspace-${PV} + !>x11-drivers/nvidia-userspace-${PV} + acpi? ( sys-power/acpid ) + tools? ( media-video/nvidia-settings )" +PDEPEND="X? ( >=x11-libs/libvdpau-0.3-r1 )" + +REQUIRED_USE="tools? ( X )" +QA_PREBUILT="opt/* usr/lib*" +S="${WORKDIR}/" + +pkg_pretend() { + if use amd64 && has_multilib_profile && \ + [ "${DEFAULT_ABI}" != "amd64" ]; then + eerror "This ebuild doesn't currently support changing your default ABI" + die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}" + fi + + # Kernel features/options to check for + CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP" + use x86 && CONFIG_CHECK+=" ~HIGHMEM" + + # Now do the above checks + use kernel_linux && check_extra_config +} + +pkg_setup() { + # try to turn off distcc and ccache for people that have a problem with it + export DISTCC_DISABLE=1 + export CCACHE_DISABLE=1 + + if use kernel_linux; then + linux-mod_pkg_setup + MODULE_NAMES="nvidia(video:${S}/kernel)" + BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \ + SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC)" + # linux-mod_src_compile calls set_arch_to_kernel, which + # sets the ARCH to x86 but NVIDIA's wrapping Makefile + # expects x86_64 or i386 and then converts it to x86 + # later on in the build process + BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')" + fi + + # Since Nvidia ships 3 different series of drivers, we need to give the user + # some kind of guidance as to what version they should install. This tries + # to point the user in the right direction but can't be perfect. check + # nvidia-driver.eclass + nvidia-driver-check-warning + + # set variables to where files are in the package structure + if use kernel_FreeBSD; then + use x86-fbsd && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}" + use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}" + NV_DOC="${S}/doc" + NV_OBJ="${S}/obj" + NV_SRC="${S}/src" + NV_MAN="${S}/x11/man" + NV_X11="${S}/obj" + NV_SOVER=1 + elif use kernel_linux; then + NV_DOC="${S}" + NV_OBJ="${S}" + NV_SRC="${S}/kernel" + NV_MAN="${S}" + NV_X11="${S}" + NV_SOVER=${PV} + else + die "Could not determine proper NVIDIA package" + fi +} + +src_unpack() { + if ! use kernel_FreeBSD; then + cd "${S}" + unpack_makeself + else + unpack ${A} + fi +} + +src_prepare() { + # Please add a brief description for every added patch + cat <<- EOF > "${S}"/nvidia.icd + /usr/$(get_libdir)/libnvidia-opencl.so + EOF + + # Allow user patches so they can support RC kernels and whatever else + epatch_user +} + +src_compile() { + # This is already the default on Linux, as there's no toplevel Makefile, but + # on FreeBSD there's one and triggers the kernel module build, as we install + # it by itself, pass this. + + cd "${NV_SRC}" + if use kernel_FreeBSD; then + MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \ + LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die + 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 + VIDEOGROUP="$(egetent group video | cut -d ':' -f 3)" + if [ -z "$VIDEOGROUP" ]; then + eerror "Failed to determine the video group gid." + die "Failed to determine the video group gid." + fi + + # Add the aliases + [ -f "${FILESDIR}/nvidia-169.07" ] || die "nvidia missing in FILESDIR" + sed -e 's:PACKAGE:'${PF}':g' \ + -e 's:VIDEOGID:'${VIDEOGROUP}':' "${FILESDIR}"/nvidia-169.07 > \ + "${WORKDIR}"/nvidia + insinto /etc/modprobe.d + newins "${WORKDIR}"/nvidia nvidia.conf || die + + # Ensures that our device nodes are created when not using X + exeinto "$(udev_get_udevdir)" + doexe "${FILESDIR}"/nvidia-udev.sh + udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules + + elif use kernel_FreeBSD; then + if use x86-fbsd; then + insinto /boot/modules + doins "${S}/src/nvidia.kld" || die + fi + + exeinto /boot/modules + doexe "${S}/src/nvidia.ko" || die + fi + + # NVIDIA kernel <-> userspace driver config lib + donvidia ${NV_OBJ}/libnvidia-cfg.so ${NV_SOVER} + + if use kernel_linux; then + # NVIDIA video decode <-> CUDA + donvidia ${NV_OBJ}/libnvcuvid.so ${NV_SOVER} + fi + + if use X; then + # Xorg DDX driver + insinto /usr/$(get_libdir)/xorg/modules/drivers + doins ${NV_X11}/nvidia_drv.so || die "failed to install nvidia_drv.so" + + # Xorg GLX driver + donvidia ${NV_X11}/libglx.so ${NV_SOVER} \ + /usr/$(get_libdir)/opengl/nvidia/extensions + + # XvMC driver + dolib.a ${NV_X11}/libXvMCNVIDIA.a || \ + die "failed to install libXvMCNVIDIA.so" + donvidia ${NV_X11}/libXvMCNVIDIA.so ${NV_SOVER} + dosym libXvMCNVIDIA.so.${NV_SOVER} \ + /usr/$(get_libdir)/libXvMCNVIDIA_dynamic.so.1 || \ + die "failed to create libXvMCNVIDIA_dynamic.so symlink" + fi + + # OpenCL ICD for NVIDIA + if use kernel_linux; then + insinto /etc/OpenCL/vendors + doins nvidia.icd + donvidia ${NV_OBJ}/libnvidia-opencl.so ${NV_SOVER} + fi + + # Documentation + dohtml ${NV_DOC}/html/* + if use kernel_FreeBSD; then + dodoc "${NV_DOC}/README" + use X && doman "${NV_MAN}/nvidia-xconfig.1" + else + # Docs + newdoc "${NV_DOC}/README.txt" README + dodoc "${NV_DOC}/NVIDIA_Changelog" + doman "${NV_MAN}/nvidia-smi.1.gz" + use X && doman "${NV_MAN}/nvidia-xconfig.1.gz" + doman "${NV_MAN}/nvidia-cuda-proxy-control.1.gz" + fi + + # Helper Apps + exeinto /opt/bin/ + if use X; then + doexe ${NV_OBJ}/nvidia-xconfig || die + fi + + if use kernel_linux ; then + doexe ${NV_OBJ}/nvidia-debugdump || die + doexe ${NV_OBJ}/nvidia-cuda-proxy-control || die + doexe ${NV_OBJ}/nvidia-cuda-proxy-server || die + doexe ${NV_OBJ}/nvidia-smi || die + newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi + fi + + exeinto /usr/bin/ + doexe ${NV_OBJ}/nvidia-bug-report.sh || die + + 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" + + # GNOME3 gnome-terminal redraw bug workaround, + # see: https://bugzilla.gnome.org/show_bug.cgi?id=664858 + doenvd "${FILESDIR}/90mutter-disable-culling" +} + +src_install-libs() { + local inslibdir=$(get_libdir) + local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib" + local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia" + local libdir=${NV_OBJ} + + if use kernel_linux && has_multilib_profile && \ + [[ ${ABI} == "x86" ]] ; then + libdir=${NV_OBJ}/32 + fi + + if use X; then + # The GLX libraries + donvidia ${libdir}/libGL.so ${NV_SOVER} ${GL_ROOT} + donvidia ${libdir}/libnvidia-glcore.so ${NV_SOVER} + if use kernel_FreeBSD; then + donvidia ${libdir}/libnvidia-tls.so ${NV_SOVER} ${GL_ROOT} + else + donvidia ${libdir}/tls/libnvidia-tls.so ${NV_SOVER} ${GL_ROOT} + fi + + # VDPAU + donvidia ${libdir}/libvdpau_nvidia.so ${NV_SOVER} + fi + + # NVIDIA monitoring library + if use kernel_linux ; then + donvidia ${libdir}/libnvidia-ml.so ${NV_SOVER} + fi + + # CUDA & OpenCL + if use kernel_linux; then + donvidia ${libdir}/libcuda.so ${NV_SOVER} + donvidia ${libdir}/libnvidia-compiler.so ${NV_SOVER} + donvidia ${libdir}/libOpenCL.so 1.0.0 ${CL_ROOT} + fi +} + +pkg_preinst() { + # 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() { + # Switch to the nvidia implementation + use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia + "${ROOT}"/usr/bin/eselect opencl set --use-old nvidia + + elog "You must be in the video group to use the NVIDIA device" + elog "For more info, read the docs at" + elog "http://www.gentoo.org/doc/en/nvidia-guide.xml#doc_chap3_sect6" + elog + elog "To use the NVIDIA GLX, run \"eselect opengl set nvidia\"" + elog + elog "To use the NVIDIA CUDA/OpenCL, run \"eselect opencl set nvidia\"" + elog + elog "NVIDIA has requested that any bug reports submitted have the" + elog "output of /opt/bin/nvidia-bug-report.sh included." + elog + if ! use X; then + elog "You have elected to not install the X.org driver. Along with" + elog "this the OpenGL libraries, XvMC, and VDPAU libraries were not" + elog "installed. Additionally, once the driver is loaded your card" + elog "and fan will run at max speed which may not be desirable." + elog "Use the 'nvidia-smi' init script to have your card and fan" + elog "speed scale appropriately." + elog + fi +} + +pkg_prerm() { + use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11 +} + +pkg_postrm() { + use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11 +} diff --git a/x11-drivers/nvidia-userspace/nvidia-userspace-310.19.ebuild b/x11-drivers/nvidia-userspace/nvidia-userspace-310.19.ebuild new file mode 100644 index 00000000..636221f7 --- /dev/null +++ b/x11-drivers/nvidia-userspace/nvidia-userspace-310.19.ebuild @@ -0,0 +1,385 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI=4 + +inherit eutils flag-o-matic linux-info linux-mod multilib nvidia-driver \ + portability toolchain-funcs unpacker user versionator + +X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}" +AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}" +X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}" +AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}" + +DESCRIPTION="NVIDIA X11 userspace libraries and applications" +HOMEPAGE="http://www.nvidia.com/" +SRC_URI="x86? ( http://us.download.nvidia.com/XFree86/Linux-x86/${PV}/${X86_NV_PACKAGE}.run ) + amd64? ( http://us.download.nvidia.com/XFree86/Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run ) + amd64-fbsd? ( http://us.download.nvidia.com/XFree86/FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz ) + x86-fbsd? ( http://us.download.nvidia.com/XFree86/FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )" + +LICENSE="NVIDIA" +SLOT="0" +KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd" +IUSE="acpi multilib x-multilib kernel_FreeBSD kernel_linux tools +X" +RESTRICT="strip" +EMULTILIB_PKG="true" + +COMMON="app-admin/eselect-opencl + kernel_linux? ( >=sys-libs/glibc-2.6.1 ) + x-multilib? ( app-emulation/emul-linux-x86-xlibs ) + multilib? ( app-emulation/emul-linux-x86-baselibs ) + X? ( + <x11-base/xorg-server-1.12.99 + >=app-admin/eselect-opengl-1.0.9 + )" +DEPEND="${COMMON}" +RDEPEND="${COMMON} + X? ( x11-libs/libXvMC ) + !<x11-drivers/nvidia-userspace-${PV} + !>x11-drivers/nvidia-userspace-${PV} + acpi? ( sys-power/acpid ) + tools? ( media-video/nvidia-settings )" +PDEPEND="X? ( >=x11-libs/libvdpau-0.3-r1 )" + +REQUIRED_USE="tools? ( X )" +QA_PREBUILT="" +S="${WORKDIR}/" + +pkg_pretend() { + if use amd64 && has_multilib_profile && \ + [ "${DEFAULT_ABI}" != "amd64" ]; then + eerror "This ebuild doesn't currently support changing your default ABI" + die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}" + fi + + # Kernel features/options to check for + CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP" + use x86 && CONFIG_CHECK+=" ~HIGHMEM" + + # Now do the above checks + use kernel_linux && check_extra_config +} + +pkg_setup() { + # try to turn off distcc and ccache for people that have a problem with it + export DISTCC_DISABLE=1 + export CCACHE_DISABLE=1 + + if use kernel_linux; then + linux-mod_pkg_setup + MODULE_NAMES="nvidia(video:${S}/kernel)" + BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \ + SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC)" + # linux-mod_src_compile calls set_arch_to_kernel, which + # sets the ARCH to x86 but NVIDIA's wrapping Makefile + # expects x86_64 or i386 and then converts it to x86 + # later on in the build process + BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')" + fi + + # Since Nvidia ships 3 different series of drivers, we need to give the user + # some kind of guidance as to what version they should install. This tries + # to point the user in the right direction but can't be perfect. check + # nvidia-driver.eclass + nvidia-driver-check-warning + + # set variables to where files are in the package structure + if use kernel_FreeBSD; then + use x86-fbsd && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}" + use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}" + NV_DOC="${S}/doc" + NV_OBJ="${S}/obj" + NV_SRC="${S}/src" + NV_MAN="${S}/x11/man" + NV_X11="${S}/obj" + NV_SOVER=1 + elif use kernel_linux; then + NV_DOC="${S}" + NV_OBJ="${S}" + NV_SRC="${S}/kernel" + NV_MAN="${S}" + NV_X11="${S}" + NV_SOVER=${PV} + else + die "Could not determine proper NVIDIA package" + fi +} + +src_unpack() { + if ! use kernel_FreeBSD; then + cd "${S}" + unpack_makeself + else + unpack ${A} + fi +} + +src_prepare() { + # Please add a brief description for every added patch + cat <<- EOF > "${S}"/nvidia.icd + /usr/$(get_libdir)/libcuda.so + EOF + + # Allow user patches so they can support RC kernels and whatever else + epatch_user +} + +src_compile() { + # This is already the default on Linux, as there's no toplevel Makefile, but + # on FreeBSD there's one and triggers the kernel module build, as we install + # it by itself, pass this. + + cd "${NV_SRC}" + if use kernel_FreeBSD; then + MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \ + LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die + fi +} + +# Install nvidia library: +# the first parameter is the library to install +# the second parameter is the provided soversion +# the third parameter is the target directory if its not /usr/lib +donvidia() { + # Full path to library minus SOVER + MY_LIB="$1" + + # SOVER to use + MY_SOVER="$2" + + # Where to install + MY_DEST="$3" + + if [[ -z "${MY_DEST}" ]]; then + MY_DEST="/usr/$(get_libdir)" + action="dolib.so" + else + exeinto ${MY_DEST} + action="doexe" + fi + + # Get just the library name + libname=$(basename $1) + + # Add it to QA_PREBUILT + QA_PREBUILT+=" ${MY_DEST}/${libname}.${MY_SOVER}" + + # Install the library with the correct SOVER + ${action} ${MY_LIB}.${MY_SOVER} || \ + die "failed to install ${libname}" + + # If SOVER wasn't 1, then we need to create a .1 symlink + if [[ "${MY_SOVER}" != "1" ]]; then + dosym ${libname}.${MY_SOVER} \ + ${MY_DEST}/${libname}.1 || \ + die "failed to create ${libname} symlink" + fi + + # Always create the symlink from the raw lib to the .1 + dosym ${libname}.1 \ + ${MY_DEST}/${libname} || \ + die "failed to create ${libname} symlink" +} + +src_install() { + if use kernel_linux; then + VIDEOGROUP="$(egetent group video | cut -d ':' -f 3)" + if [ -z "$VIDEOGROUP" ]; then + eerror "Failed to determine the video group gid." + die "Failed to determine the video group gid." + fi + + # Add the aliases + [ -f "${FILESDIR}/nvidia-169.07" ] || die "nvidia missing in FILESDIR" + sed -e 's:PACKAGE:'${PF}':g' \ + -e 's:VIDEOGID:'${VIDEOGROUP}':' "${FILESDIR}"/nvidia-169.07 > \ + "${WORKDIR}"/nvidia + insinto /etc/modprobe.d + newins "${WORKDIR}"/nvidia nvidia.conf || die + + local udevdir=/lib/udev + has_version sys-fs/udev && udevdir="$($(tc-getPKG_CONFIG) --variable=udevdir udev)" + + # Ensures that our device nodes are created when not using X + exeinto "${udevdir}" + doexe "${FILESDIR}"/nvidia-udev.sh + + insinto "${udevdir}"/rules.d + newins "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules + elif use kernel_FreeBSD; then + if use x86-fbsd; then + insinto /boot/modules + doins "${S}/src/nvidia.kld" || die + fi + + exeinto /boot/modules + doexe "${S}/src/nvidia.ko" || die + fi + + # NVIDIA kernel <-> userspace driver config lib + donvidia ${NV_OBJ}/libnvidia-cfg.so ${NV_SOVER} + + if use kernel_linux; then + # NVIDIA video decode <-> CUDA + donvidia ${NV_OBJ}/libnvcuvid.so ${NV_SOVER} + fi + + if use X; then + # Xorg DDX driver + insinto /usr/$(get_libdir)/xorg/modules/drivers + doins ${NV_X11}/nvidia_drv.so || die "failed to install nvidia_drv.so" + + # Xorg GLX driver + donvidia ${NV_X11}/libglx.so ${NV_SOVER} \ + /usr/$(get_libdir)/opengl/nvidia/extensions + + # XvMC driver + dolib.a ${NV_X11}/libXvMCNVIDIA.a || \ + die "failed to install libXvMCNVIDIA.so" + donvidia ${NV_X11}/libXvMCNVIDIA.so ${NV_SOVER} + dosym libXvMCNVIDIA.so.${NV_SOVER} \ + /usr/$(get_libdir)/libXvMCNVIDIA_dynamic.so.1 || \ + die "failed to create libXvMCNVIDIA_dynamic.so symlink" + fi + + # OpenCL ICD for NVIDIA + if use kernel_linux; then + insinto /etc/OpenCL/vendors + doins nvidia.icd + fi + + # Documentation + dohtml ${NV_DOC}/html/* + if use kernel_FreeBSD; then + dodoc "${NV_DOC}/README" + use X && doman "${NV_MAN}/nvidia-xconfig.1" + else + # Docs + newdoc "${NV_DOC}/README.txt" README + dodoc "${NV_DOC}/NVIDIA_Changelog" + doman "${NV_MAN}/nvidia-smi.1.gz" + use X && doman "${NV_MAN}/nvidia-xconfig.1.gz" + doman "${NV_MAN}/nvidia-cuda-proxy-control.1.gz" + fi + + # Helper Apps + exeinto /opt/bin/ + if use X; then + doexe ${NV_OBJ}/nvidia-xconfig || die + fi + + if use kernel_linux ; then + doexe ${NV_OBJ}/nvidia-debugdump || die + doexe ${NV_OBJ}/nvidia-cuda-proxy-control || die + doexe ${NV_OBJ}/nvidia-cuda-proxy-server || die + doexe ${NV_OBJ}/nvidia-smi || die + newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi + fi + + exeinto /usr/bin/ + doexe ${NV_OBJ}/nvidia-bug-report.sh || die + + 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" + + # GNOME3 gnome-terminal redraw bug workaround, + # see: https://bugzilla.gnome.org/show_bug.cgi?id=664858 + doenvd "${FILESDIR}/90mutter-disable-culling" +} + +src_install-libs() { + local inslibdir=$(get_libdir) + local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib" + local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia" + local libdir=${NV_OBJ} + + if use kernel_linux && has_multilib_profile && \ + [[ ${ABI} == "x86" ]] ; then + libdir=${NV_OBJ}/32 + fi + + if use X; then + # The GLX libraries + donvidia ${libdir}/libGL.so ${NV_SOVER} ${GL_ROOT} + donvidia ${libdir}/libnvidia-glcore.so ${NV_SOVER} + if use kernel_FreeBSD; then + donvidia ${libdir}/libnvidia-tls.so ${NV_SOVER} ${GL_ROOT} + else + donvidia ${libdir}/tls/libnvidia-tls.so ${NV_SOVER} ${GL_ROOT} + fi + + # VDPAU + donvidia ${libdir}/libvdpau_nvidia.so ${NV_SOVER} + fi + + # NVIDIA monitoring library + if use kernel_linux ; then + donvidia ${libdir}/libnvidia-ml.so ${NV_SOVER} + fi + + # CUDA & OpenCL + if use kernel_linux; then + donvidia ${libdir}/libcuda.so ${NV_SOVER} + donvidia ${libdir}/libnvidia-compiler.so ${NV_SOVER} + donvidia ${libdir}/libOpenCL.so 1.0.0 ${CL_ROOT} + fi +} + +pkg_preinst() { + # 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() { + # Switch to the nvidia implementation + use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia + "${ROOT}"/usr/bin/eselect opencl set --use-old nvidia + + elog "You must be in the video group to use the NVIDIA device" + elog "For more info, read the docs at" + elog "http://www.gentoo.org/doc/en/nvidia-guide.xml#doc_chap3_sect6" + elog + elog "To use the NVIDIA GLX, run \"eselect opengl set nvidia\"" + elog + elog "To use the NVIDIA CUDA/OpenCL, run \"eselect opencl set nvidia\"" + elog + elog "NVIDIA has requested that any bug reports submitted have the" + elog "output of /opt/bin/nvidia-bug-report.sh included." + elog + if ! use X; then + elog "You have elected to not install the X.org driver. Along with" + elog "this the OpenGL libraries, XvMC, and VDPAU libraries were not" + elog "installed. Additionally, once the driver is loaded your card" + elog "and fan will run at max speed which may not be desirable." + elog "Use the 'nvidia-smi' init script to have your card and fan" + elog "speed scale appropriately." + elog + fi +} + +pkg_prerm() { + use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11 +} + +pkg_postrm() { + use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11 +} diff --git a/x11-drivers/nvidia-userspace/nvidia-userspace-313.30.ebuild b/x11-drivers/nvidia-userspace/nvidia-userspace-313.30.ebuild new file mode 100644 index 00000000..97a23ea4 --- /dev/null +++ b/x11-drivers/nvidia-userspace/nvidia-userspace-313.30.ebuild @@ -0,0 +1,368 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI=5 + +inherit eutils flag-o-matic linux-info linux-mod multilib nvidia-driver \ + portability toolchain-funcs unpacker user udev + +X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}" +AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}" +X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}" +AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}" + +DESCRIPTION="NVIDIA X11 userspace libraries and applications" +HOMEPAGE="http://www.nvidia.com/" +SRC_URI="x86? ( ftp://download.nvidia.com/XFree86/Linux-x86/${PV}/${X86_NV_PACKAGE}.run ) + amd64? ( ftp://download.nvidia.com/XFree86/Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run ) + amd64-fbsd? ( ftp://download.nvidia.com/XFree86/FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz ) + x86-fbsd? ( ftp://download.nvidia.com/XFree86/FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )" + +LICENSE="NVIDIA" +SLOT="0" +KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd" +IUSE="acpi multilib x-multilib kernel_FreeBSD kernel_linux tools +X" +RESTRICT="strip" +EMULTILIB_PKG="true" + +COMMON="app-admin/eselect-opencl + kernel_linux? ( >=sys-libs/glibc-2.6.1 ) + x-multilib? ( app-emulation/emul-linux-x86-xlibs ) + multilib? ( app-emulation/emul-linux-x86-baselibs ) + X? ( + <x11-base/xorg-server-1.14.99 + >=app-admin/eselect-opengl-1.0.9 + )" +DEPEND="${COMMON}" +RDEPEND="${COMMON} + X? ( x11-libs/libXvMC ) + !<x11-drivers/nvidia-userspace-${PV} + !>x11-drivers/nvidia-userspace-${PV} + acpi? ( sys-power/acpid ) + tools? ( media-video/nvidia-settings )" +PDEPEND="X? ( >=x11-libs/libvdpau-0.3-r1 )" + +REQUIRED_USE="tools? ( X )" +QA_PREBUILT="opt/* usr/lib*" +S="${WORKDIR}/" + +pkg_pretend() { + if use amd64 && has_multilib_profile && \ + [ "${DEFAULT_ABI}" != "amd64" ]; then + eerror "This ebuild doesn't currently support changing your default ABI" + die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}" + fi + + # Kernel features/options to check for + CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP" + use x86 && CONFIG_CHECK+=" ~HIGHMEM" + + # Now do the above checks + use kernel_linux && check_extra_config +} + +pkg_setup() { + # try to turn off distcc and ccache for people that have a problem with it + export DISTCC_DISABLE=1 + export CCACHE_DISABLE=1 + + if use kernel_linux; then + linux-mod_pkg_setup + MODULE_NAMES="nvidia(video:${S}/kernel)" + BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \ + SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC)" + # linux-mod_src_compile calls set_arch_to_kernel, which + # sets the ARCH to x86 but NVIDIA's wrapping Makefile + # expects x86_64 or i386 and then converts it to x86 + # later on in the build process + BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')" + fi + + # Since Nvidia ships 3 different series of drivers, we need to give the user + # some kind of guidance as to what version they should install. This tries + # to point the user in the right direction but can't be perfect. check + # nvidia-driver.eclass + nvidia-driver-check-warning + + # set variables to where files are in the package structure + if use kernel_FreeBSD; then + use x86-fbsd && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}" + use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}" + NV_DOC="${S}/doc" + NV_OBJ="${S}/obj" + NV_SRC="${S}/src" + NV_MAN="${S}/x11/man" + NV_X11="${S}/obj" + NV_SOVER=1 + elif use kernel_linux; then + NV_DOC="${S}" + NV_OBJ="${S}" + NV_SRC="${S}/kernel" + NV_MAN="${S}" + NV_X11="${S}" + NV_SOVER=${PV} + else + die "Could not determine proper NVIDIA package" + fi +} + +src_unpack() { + if ! use kernel_FreeBSD; then + cd "${S}" + unpack_makeself + else + unpack ${A} + fi +} + +src_prepare() { + # Please add a brief description for every added patch + + # Allow user patches so they can support RC kernels and whatever else + epatch_user +} + +src_compile() { + # This is already the default on Linux, as there's no toplevel Makefile, but + # on FreeBSD there's one and triggers the kernel module build, as we install + # it by itself, pass this. + + cd "${NV_SRC}" + if use kernel_FreeBSD; then + MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \ + LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die + 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 + VIDEOGROUP="$(egetent group video | cut -d ':' -f 3)" + if [ -z "$VIDEOGROUP" ]; then + eerror "Failed to determine the video group gid." + die "Failed to determine the video group gid." + fi + + # Add the aliases + [ -f "${FILESDIR}/nvidia-169.07" ] || die "nvidia missing in FILESDIR" + sed -e 's:PACKAGE:'${PF}':g' \ + -e 's:VIDEOGID:'${VIDEOGROUP}':' "${FILESDIR}"/nvidia-169.07 > \ + "${WORKDIR}"/nvidia + insinto /etc/modprobe.d + newins "${WORKDIR}"/nvidia nvidia.conf || die + + # Ensures that our device nodes are created when not using X + exeinto "$(udev_get_udevdir)" + doexe "${FILESDIR}"/nvidia-udev.sh + udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules + elif use kernel_FreeBSD; then + if use x86-fbsd; then + insinto /boot/modules + doins "${S}/src/nvidia.kld" || die + fi + + exeinto /boot/modules + doexe "${S}/src/nvidia.ko" || die + fi + + # NVIDIA kernel <-> userspace driver config lib + donvidia ${NV_OBJ}/libnvidia-cfg.so ${NV_SOVER} + + # 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 || die "failed to install nvidia_drv.so" + + # Xorg GLX driver + donvidia ${NV_X11}/libglx.so ${NV_SOVER} \ + /usr/$(get_libdir)/opengl/nvidia/extensions + fi + + # OpenCL ICD for NVIDIA + if use kernel_linux; then + insinto /etc/OpenCL/vendors + doins ${NV_OBJ}/nvidia.icd + fi + + # Documentation + dohtml ${NV_DOC}/html/* + if use kernel_FreeBSD; then + dodoc "${NV_DOC}/README" + use X && doman "${NV_MAN}/nvidia-xconfig.1" + else + # Docs + newdoc "${NV_DOC}/README.txt" README + dodoc "${NV_DOC}/NVIDIA_Changelog" + doman "${NV_MAN}/nvidia-smi.1.gz" + use X && doman "${NV_MAN}/nvidia-xconfig.1.gz" + doman "${NV_MAN}/nvidia-cuda-proxy-control.1.gz" + fi + + # Helper Apps + exeinto /opt/bin/ + if use X; then + doexe ${NV_OBJ}/nvidia-xconfig || die + fi + + if use kernel_linux ; then + doexe ${NV_OBJ}/nvidia-debugdump || die + doexe ${NV_OBJ}/nvidia-cuda-proxy-control || die + doexe ${NV_OBJ}/nvidia-cuda-proxy-server || die + doexe ${NV_OBJ}/nvidia-smi || die + newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi + fi + + exeinto /usr/bin/ + doexe ${NV_OBJ}/nvidia-bug-report.sh || die + + 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" + + # GNOME3 gnome-terminal redraw bug workaround, + # see: https://bugzilla.gnome.org/show_bug.cgi?id=664858 + doenvd "${FILESDIR}/90mutter-disable-culling" +} + +src_install-libs() { + local inslibdir=$(get_libdir) + local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib" + local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia" + local libdir=${NV_OBJ} + + if use kernel_linux && has_multilib_profile && \ + [[ ${ABI} == "x86" ]] ; then + libdir=${NV_OBJ}/32 + fi + + if use X; then + # The GLX libraries + donvidia ${libdir}/libGL.so ${NV_SOVER} ${GL_ROOT} + donvidia ${libdir}/libnvidia-glcore.so ${NV_SOVER} + if use kernel_FreeBSD; then + donvidia ${libdir}/libnvidia-tls.so ${NV_SOVER} + else + donvidia ${libdir}/tls/libnvidia-tls.so ${NV_SOVER} + fi + + # VDPAU + donvidia ${libdir}/libvdpau_nvidia.so ${NV_SOVER} + fi + + # NVIDIA monitoring library + if use kernel_linux ; then + donvidia ${libdir}/libnvidia-ml.so ${NV_SOVER} + fi + + # CUDA & OpenCL + if use kernel_linux; then + donvidia ${libdir}/libcuda.so ${NV_SOVER} + donvidia ${libdir}/libnvidia-compiler.so ${NV_SOVER} + donvidia ${libdir}/libOpenCL.so 1.0.0 ${CL_ROOT} + donvidia ${libdir}/libnvidia-opencl.so ${NV_SOVER} + fi +} + +pkg_preinst() { + # 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() { + # Switch to the nvidia implementation + use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia + "${ROOT}"/usr/bin/eselect opencl set --use-old nvidia + + elog "You must be in the video group to use the NVIDIA device" + elog "For more info, read the docs at" + elog "http://www.gentoo.org/doc/en/nvidia-guide.xml#doc_chap3_sect6" + elog + elog "To use the NVIDIA GLX, run \"eselect opengl set nvidia\"" + elog + elog "To use the NVIDIA CUDA/OpenCL, run \"eselect opencl set nvidia\"" + elog + elog "NVIDIA has requested that any bug reports submitted have the" + elog "output of /opt/bin/nvidia-bug-report.sh included." + elog + if ! use X; then + elog "You have elected to not install the X.org driver. Along with" + elog "this the OpenGL libraries 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 +} + +pkg_prerm() { + use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11 +} + +pkg_postrm() { + use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11 +} diff --git a/x11-drivers/nvidia-userspace/nvidia-userspace-325.15.ebuild b/x11-drivers/nvidia-userspace/nvidia-userspace-325.15.ebuild new file mode 100644 index 00000000..05413f29 --- /dev/null +++ b/x11-drivers/nvidia-userspace/nvidia-userspace-325.15.ebuild @@ -0,0 +1,372 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI=5 + +inherit eutils flag-o-matic linux-info linux-mod multilib nvidia-driver \ + portability toolchain-funcs unpacker user udev + +NV_URI="http://us.download.nvidia.com/XFree86/" +X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}" +AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}" +X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}" +AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}" + +DESCRIPTION="NVIDIA X11 userspace libraries and applications" +HOMEPAGE="http://www.nvidia.com/" +SRC_URI=" + amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz ) + amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run ) + x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz ) + x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run ) +" + +LICENSE="GPL-2 NVIDIA-r1" +SLOT="0" +KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd" +IUSE="acpi multilib x-multilib kernel_FreeBSD kernel_linux tools +X" +RESTRICT="bindist mirror strip" +EMULTILIB_PKG="true" + +COMMON="app-admin/eselect-opencl + kernel_linux? ( >=sys-libs/glibc-2.6.1 ) + x-multilib? ( app-emulation/emul-linux-x86-xlibs ) + multilib? ( app-emulation/emul-linux-x86-baselibs ) + X? ( + >=app-admin/eselect-opengl-1.0.9 + )" +DEPEND="${COMMON}" +RDEPEND="${COMMON} + X? ( x11-libs/libXvMC ) + !<x11-drivers/nvidia-userspace-${PV} + !>x11-drivers/nvidia-userspace-${PV} + acpi? ( sys-power/acpid ) + tools? ( media-video/nvidia-settings )" +PDEPEND="X? ( + <x11-base/xorg-server-1.14.99 + >=x11-libs/libvdpau-0.3-r1 + )" + +REQUIRED_USE="tools? ( X )" +QA_PREBUILT="opt/* usr/lib*" +S="${WORKDIR}/" + +pkg_pretend() { + if use amd64 && has_multilib_profile && \ + [ "${DEFAULT_ABI}" != "amd64" ]; then + eerror "This ebuild doesn't currently support changing your default ABI" + die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}" + fi + + # Kernel features/options to check for + CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP" + use x86 && CONFIG_CHECK+=" ~HIGHMEM" + + # Now do the above checks + use kernel_linux && check_extra_config +} + +pkg_setup() { + # try to turn off distcc and ccache for people that have a problem with it + export DISTCC_DISABLE=1 + export CCACHE_DISABLE=1 + + if use kernel_linux; then + linux-mod_pkg_setup + MODULE_NAMES="nvidia(video:${S}/kernel)" + BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \ + SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC)" + # linux-mod_src_compile calls set_arch_to_kernel, which + # sets the ARCH to x86 but NVIDIA's wrapping Makefile + # expects x86_64 or i386 and then converts it to x86 + # later on in the build process + BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')" + fi + + # set variables to where files are in the package structure + if use kernel_FreeBSD; then + use x86-fbsd && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}" + use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}" + NV_DOC="${S}/doc" + NV_OBJ="${S}/obj" + NV_SRC="${S}/src" + NV_MAN="${S}/x11/man" + NV_X11="${S}/obj" + NV_SOVER=1 + elif use kernel_linux; then + NV_DOC="${S}" + NV_OBJ="${S}" + NV_SRC="${S}/kernel" + NV_MAN="${S}" + NV_X11="${S}" + NV_SOVER=${PV} + else + die "Could not determine proper NVIDIA package" + fi +} + +src_unpack() { + if ! use kernel_FreeBSD; then + cd "${S}" + unpack_makeself + else + unpack ${A} + fi +} + +src_prepare() { + # Please add a brief description for every added patch + + # Allow user patches so they can support RC kernels and whatever else + epatch_user +} + +src_compile() { + # This is already the default on Linux, as there's no toplevel Makefile, but + # on FreeBSD there's one and triggers the kernel module build, as we install + # it by itself, pass this. + + cd "${NV_SRC}" + if use kernel_FreeBSD; then + MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \ + LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die + 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 + VIDEOGROUP="$(egetent group video | cut -d ':' -f 3)" + if [ -z "$VIDEOGROUP" ]; then + eerror "Failed to determine the video group gid." + die "Failed to determine the video group gid." + fi + + # Add the aliases + [ -f "${FILESDIR}/nvidia-169.07" ] || die "nvidia missing in FILESDIR" + sed -e 's:PACKAGE:'${PF}':g' \ + -e 's:VIDEOGID:'${VIDEOGROUP}':' "${FILESDIR}"/nvidia-169.07 > \ + "${WORKDIR}"/nvidia + insinto /etc/modprobe.d + newins "${WORKDIR}"/nvidia nvidia.conf + + # Ensures that our device nodes are created when not using X + exeinto "$(udev_get_udevdir)" + doexe "${FILESDIR}"/nvidia-udev.sh + udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules + elif use kernel_FreeBSD; then + if use x86-fbsd; then + insinto /boot/modules + doins "${S}/src/nvidia.kld" + fi + + exeinto /boot/modules + doexe "${S}/src/nvidia.ko" + fi + + # NVIDIA kernel <-> userspace driver config lib + donvidia ${NV_OBJ}/libnvidia-cfg.so ${NV_SOVER} + + # NVIDIA video encode/decode <-> CUDA + if use kernel_linux; then + donvidia ${NV_OBJ}/libnvcuvid.so ${NV_SOVER} + donvidia ${NV_OBJ}/libnvidia-encode.so ${NV_SOVER} + fi + + if use X; then + # Xorg DDX driver + insinto /usr/$(get_libdir)/xorg/modules/drivers + doins ${NV_X11}/nvidia_drv.so + + # Xorg GLX driver + donvidia ${NV_X11}/libglx.so ${NV_SOVER} \ + /usr/$(get_libdir)/opengl/nvidia/extensions + fi + + # OpenCL ICD for NVIDIA + if use kernel_linux; then + insinto /etc/OpenCL/vendors + doins ${NV_OBJ}/nvidia.icd + fi + + # Documentation + dohtml ${NV_DOC}/html/* + if use kernel_FreeBSD; then + dodoc "${NV_DOC}/README" + use X && doman "${NV_MAN}/nvidia-xconfig.1" + else + # Docs + newdoc "${NV_DOC}/README.txt" README + dodoc "${NV_DOC}/NVIDIA_Changelog" + doman "${NV_MAN}/nvidia-smi.1.gz" + doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz" + use X && doman "${NV_MAN}/nvidia-xconfig.1.gz" + fi + + # Helper Apps + exeinto /opt/bin/ + if use X; then + doexe ${NV_OBJ}/nvidia-xconfig + fi + + if use kernel_linux ; then + doexe ${NV_OBJ}/nvidia-cuda-mps-control + doexe ${NV_OBJ}/nvidia-cuda-mps-server + doexe ${NV_OBJ}/nvidia-debugdump + doexe ${NV_OBJ}/nvidia-modprobe + doexe ${NV_OBJ}/nvidia-persistenced + doexe ${NV_OBJ}/nvidia-smi + doman nvidia-cuda-mps-control.1.gz + doman nvidia-modprobe.1.gz + doman nvidia-persistenced.1.gz + newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi + fi + + exeinto /usr/bin/ + doexe ${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" + + # GNOME3 gnome-terminal redraw bug workaround, + # see: https://bugzilla.gnome.org/show_bug.cgi?id=664858 + doenvd "${FILESDIR}/90mutter-disable-culling" +} + +src_install-libs() { + local inslibdir=$(get_libdir) + local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib" + local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia" + local libdir=${NV_OBJ} + + if use kernel_linux && has_multilib_profile && \ + [[ ${ABI} == "x86" ]] ; then + libdir=${NV_OBJ}/32 + fi + + if use X; then + # The GLX libraries + donvidia ${libdir}/libGL.so ${NV_SOVER} ${GL_ROOT} + donvidia ${libdir}/libnvidia-glcore.so ${NV_SOVER} + if use kernel_FreeBSD; then + donvidia ${libdir}/libnvidia-tls.so ${NV_SOVER} + else + donvidia ${libdir}/tls/libnvidia-tls.so ${NV_SOVER} + fi + + # VDPAU + donvidia ${libdir}/libvdpau_nvidia.so ${NV_SOVER} + fi + + # NVIDIA monitoring library + if use kernel_linux ; then + donvidia ${libdir}/libnvidia-ml.so ${NV_SOVER} + fi + + # CUDA & OpenCL + if use kernel_linux; then + donvidia ${libdir}/libcuda.so ${NV_SOVER} + donvidia ${libdir}/libnvidia-compiler.so ${NV_SOVER} + donvidia ${libdir}/libOpenCL.so 1.0.0 ${CL_ROOT} + donvidia ${libdir}/libnvidia-opencl.so ${NV_SOVER} + fi +} + +pkg_preinst() { + # 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() { + # Switch to the nvidia implementation + use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia + "${ROOT}"/usr/bin/eselect opencl set --use-old nvidia + + elog "You must be in the video group to use the NVIDIA device" + elog "For more info, read the docs at" + elog "http://www.gentoo.org/doc/en/nvidia-guide.xml#doc_chap3_sect6" + elog + elog "To use the NVIDIA GLX, run \"eselect opengl set nvidia\"" + elog + elog "To use the NVIDIA CUDA/OpenCL, run \"eselect opencl set nvidia\"" + elog + elog "NVIDIA has requested that any bug reports submitted have the" + elog "output of /opt/bin/nvidia-bug-report.sh included." + elog + if ! use X; then + elog "You have elected to not install the X.org driver. Along with" + elog "this the OpenGL libraries 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 +} + +pkg_prerm() { + use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11 +} + +pkg_postrm() { + use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11 +} diff --git a/x11-drivers/nvidia-userspace/nvidia-userspace-96.43.20.ebuild b/x11-drivers/nvidia-userspace/nvidia-userspace-96.43.20.ebuild new file mode 100644 index 00000000..ba2362b6 --- /dev/null +++ b/x11-drivers/nvidia-userspace/nvidia-userspace-96.43.20.ebuild @@ -0,0 +1,395 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI="2" + +inherit eutils unpacker multilib portability versionator flag-o-matic + +X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}" +AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}" +X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}" + +DESCRIPTION="NVIDIA X11 userspace libraries and applications" +HOMEPAGE="http://www.nvidia.com/" +SRC_URI="x86? ( ftp://download.nvidia.com/XFree86/Linux-x86/${PV}/${X86_NV_PACKAGE}-pkg0.run ) + amd64? ( ftp://download.nvidia.com/XFree86/Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}-pkg2.run ) + x86-fbsd? ( ftp://download.nvidia.com/freebsd/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )" + +LICENSE="NVIDIA" +SLOT="0" +KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd" +IUSE="multilib kernel_linux" +RESTRICT="strip" +EMULTILIB_PKG="true" + +COMMON="x11-base/xorg-server + kernel_linux? ( >=sys-libs/glibc-2.6.1 ) + multilib? ( app-emulation/emul-linux-x86-opengl ) + >=app-admin/eselect-opengl-1.0.9" +DEPEND="${COMMON} + kernel_linux? ( virtual/linux-sources )" +RDEPEND="${COMMON} + !<x11-drivers/nvidia-userspace-${PV} + !>x11-drivers/nvidia-userspace-${PV}" +PDEPEND="~x11-drivers/nvidia-drivers-${PV}" + +QA_TEXTRELS_x86="usr/lib/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/xorg/modules/drivers/nvidia_drv.so + usr/lib/libcuda.so.${PV} + usr/lib/libnvidia-cfg.so.${PV} + usr/lib/libvdpau_nvidia.so.${PV} + usr/lib/libXvMCNVIDIA.so.${PV}" + +QA_TEXTRELS_x86_fbsd="boot/modules/nvidia.ko + usr/lib/opengl/nvidia/lib/libGL.so.1 + usr/lib/opengl/nvidia/lib/libGLcore.so.1 + usr/lib/libnvidia-cfg.so.1 + usr/lib/opengl/nvidia/extensions/libglx.so.1 + usr/lib/xorg/modules/drivers/nvidia_drv.so" + +QA_TEXTRELS_amd64="usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib32/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/libcuda.so.${PV} + usr/lib32/libvdpau_nvidia.so.${PV}" + +QA_EXECSTACK_x86="usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/xorg/modules/drivers/nvidia_drv.so + usr/lib/libXvMCNVIDIA.a:NVXVMC.o" + +QA_EXECSTACK_amd64="usr/lib32/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/libnvcompiler.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV} + usr/lib64/libXvMCNVIDIA.a:NVXVMC.o + usr/lib64/libnvidia-cfg.so.${PV} + usr/lib64/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/xorg/modules/drivers/nvidia_drv.so + usr/bin/nvidia-smi + usr/bin/nvidia-xconfig" + +QA_WX_LOAD_x86="usr/lib/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/libXvMCNVIDIA.a" + +QA_WX_LOAD_amd64="usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so.${PV}" + +QA_SONAME_amd64="usr/lib64/libnvcompiler.so.${PV}" + +QA_DT_HASH_amd64="usr/lib32/libcuda.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib32/libvdpau_nvidia.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV} + usr/lib64/libcuda.so.${PV} + usr/lib64/libnvidia-cfg.so.${PV} + usr/lib64/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/xorg/modules/drivers/nvidia_drv.so + usr/lib64/libvdpau_nvidia.so.${PV} + usr/bin/nvidia-smi + usr/bin/nvidia-xconfig" + +QA_DT_HASH_x86="usr/lib/libcuda.so.${PV} + usr/lib/libnvidia-cfg.so.${PV} + usr/lib/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/xorg/modules/drivers/nvidia_drv.so + usr/lib/libXvMCNVIDIA.so.${PV} + usr/lib/libvdpau_nvidia.so.${PV} + usr/bin/nvidia-smi + usr/bin/nvidia-xconfig" + +if use x86; then + PKG_V="-pkg0" + NV_PACKAGE="${X86_NV_PACKAGE}" +elif use amd64; then + PKG_V="-pkg2" + NV_PACKAGE="${AMD64_NV_PACKAGE}" +elif use x86-fbsd; then + PKG_V="" + NV_PACKAGE="${X86_FBSD_NV_PACKAGE}" +fi + +S="${WORKDIR}/${NV_PACKAGE}${PKG_V}" + +pkg_setup() { + # try to turn off distcc and ccache for people that have a problem with it + export DISTCC_DISABLE=1 + export CCACHE_DISABLE=1 + + if use amd64 && has_multilib_profile && [ "${DEFAULT_ABI}" != "amd64" ]; then + eerror "This ebuild doesn't currently support changing your default abi." + die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}" + fi + + # On BSD userland it wants real make command + use userland_BSD && MAKE="$(get_bmake)" + + export _POSIX2_VERSION="199209" + + # set variables to where files are in the package structure + if use kernel_FreeBSD; then + NV_DOC="${S}/doc" + NV_EXEC="${S}/obj" + NV_LIB="${S}/obj" + NV_SRC="${S}/src" + NV_MAN="${S}/x11/man" + NV_X11="${S}/obj" + NV_X11_DRV="${NV_X11}" + NV_X11_EXT="${NV_X11}" + NV_SOVER=1 + elif use kernel_linux; then + NV_DOC="${S}/usr/share/doc" + NV_EXEC="${S}/usr/bin" + NV_LIB="${S}/usr/lib" + NV_SRC="${S}/usr/src/nv" + NV_MAN="${S}/usr/share/man/man1" + NV_X11="${S}/usr/X11R6/lib" + NV_X11_DRV="${NV_X11}/modules/drivers" + NV_X11_EXT="${NV_X11}/modules/extensions" + NV_SOVER=${PV} + else + die "Could not determine proper NVIDIA package" + fi +} + +src_unpack() { + if ! use x86-fbsd; then + mkdir "${S}" + cd "${S}" + unpack_makeself + else + unpack ${A} + fi +} + +src_prepare() { + # Please add a brief description for every added patch + use x86-fbsd && cd doc + + # Use the correct defines to make gtkglext build work + epatch "${FILESDIR}"/NVIDIA_glx-defines.patch + # Use some more sensible gl headers and make way for new glext.h + epatch "${FILESDIR}"/NVIDIA_glx-glheader.patch +} + +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 x86-fbsd; then + MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \ + LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die + fi +} + +src_install() { + if use kernel_linux; then + VIDEOGROUP="$(egetent group video | cut -d ':' -f 3)" + if [ -z "$VIDEOGROUP" ]; then + eerror "Failed to determine the video group gid." + die "Failed to determine the video group gid." + fi + + # Add the aliases + [ -f "${FILESDIR}/nvidia-169.07" ] || die "nvidia missing in FILESDIR" + sed -e 's:PACKAGE:'${PF}':g' \ + -e 's:VIDEOGID:'${VIDEOGROUP}':' "${FILESDIR}"/nvidia-169.07 > \ + "${WORKDIR}"/nvidia + insinto /etc/modprobe.d + newins "${WORKDIR}"/nvidia nvidia.conf || die + fi + + # NVIDIA kernel <-> userspace driver config lib + dolib.so ${NV_LIB}/libnvidia-cfg.so.${NV_SOVER} || \ + die "failed to install libnvidia-cfg" + + # Xorg DDX driver + insinto /usr/$(get_libdir)/xorg/modules/drivers + doins ${NV_X11_DRV}/nvidia_drv.so || die "failed to install nvidia_drv.so" + + # Xorg GLX driver + insinto /usr/$(get_libdir)/opengl/nvidia/extensions + doins ${NV_X11_EXT}/libglx.so.${NV_SOVER} || \ + die "failed to install libglx.so" + dosym /usr/$(get_libdir)/opengl/nvidia/extensions/libglx.so.${NV_SOVER} \ + /usr/$(get_libdir)/opengl/nvidia/extensions/libglx.so || \ + die "failed to create libglx.so symlink" + + # XvMC driver + dolib.a ${NV_X11}/libXvMCNVIDIA.a || \ + die "failed to install libXvMCNVIDIA.so" + dolib.so ${NV_X11}/libXvMCNVIDIA.so.${NV_SOVER} || \ + die "failed to install libXvMCNVIDIA.so" + dosym libXvMCNVIDIA.so.${NV_SOVER} /usr/$(get_libdir)/libXvMCNVIDIA.so || \ + die "failed to create libXvMCNVIDIA.so symlink" + + # CUDA headers (driver to come) + if use kernel_linux && [[ -d ${S}/usr/include/cuda ]]; then + dodir /usr/include/cuda + insinto /usr/include/cuda + doins usr/include/cuda/*.h || die "failed to install cuda headers" + fi + + # OpenCL headers (driver to come) + if [[ -d ${S}/usr/include/CL ]]; then + dodir /usr/include/CL + insinto /usr/include/CL + doins usr/include/CL/*.h || die "failed to install OpenCL headers" + fi + + # Documentation + dodoc ${NV_DOC}/XF86Config.sample + dohtml ${NV_DOC}/html/* + if use x86-fbsd; then + dodoc "${NV_DOC}/README" + doman "${NV_MAN}/nvidia-xconfig.1" + else + # Docs + newdoc "${NV_DOC}/README.txt" README + dodoc "${NV_DOC}/NVIDIA_Changelog" +# doman "${NV_MAN}/nvidia-smi.1.gz" + doman "${NV_MAN}/nvidia-xconfig.1.gz" + fi + + # Helper Apps + dobin ${NV_EXEC}/nvidia-xconfig || die + dobin ${NV_EXEC}/nvidia-bug-report.sh || die +# if use kernel_linux; then +# dobin ${NV_EXEC}/nvidia-smi || die +# fi + + if has_multilib_profile ; then + local OABI=${ABI} + for ABI in $(get_install_abis) ; do + src_install-libs + done + ABI=${OABI} + unset OABI + else + src_install-libs + fi + + is_final_abi || die "failed to iterate through all ABIs" +} + +# Install nvidia library: +# the first parameter is the place where to install it +# the second parameter is the base name of the library +# the third parameter is the provided soversion +donvidia() { + dodir $1 + exeinto $1 + + libname=$(basename $2) + + doexe $2.$3 || die "failed to install $2" + dosym ${libname}.$3 $1/${libname} || die "failed to symlink $2" + [[ $3 != "1" ]] && dosym ${libname}.$3 $1/${libname}.1 +} + +src_install-libs() { + local inslibdir=$(get_libdir) + local NV_ROOT="/usr/${inslibdir}/opengl/nvidia" + local libdir= sover= + + if use kernel_linux; then + if has_multilib_profile && [[ ${ABI} == "x86" ]] ; then + libdir=usr/lib32 + else + libdir=usr/lib + fi + sover=${PV} + else + libdir=obj + # on FreeBSD it has just .1 suffix + sover=1 + fi + + # The GLX libraries + donvidia ${NV_ROOT}/lib ${libdir}/libGL.so ${sover} + donvidia ${NV_ROOT}/lib ${libdir}/libGLcore.so ${sover} + if use x86-fbsd; then + donvidia ${NV_ROOT}/lib ${libdir}/libnvidia-tls.so ${sover} + else + donvidia ${NV_ROOT}/lib ${libdir}/tls/libnvidia-tls.so ${sover} + fi + + #cuda + if [[ -f ${libdir}/libcuda.so.${sover} ]]; then + dolib.so ${libdir}/libcuda.so.${sover} + [[ "${sover}" != "1" ]] && dosym libcuda.so.${sover} /usr/${inslibdir}/libcuda.so.1 + dosym libcuda.so.1 /usr/${inslibdir}/libcuda.so + fi + + #vdpau + if [[ -f ${libdir}/libvdpau_nvidia.so.${sover} ]]; then + dolib.so ${libdir}/libvdpau_nvidia.so.${sover} + dosym libvdpau_nvidia.so.${sover} /usr/${inslibdir}/libvdpau_nvidia.so + fi + + # OpenCL + # NOTE: This isn't currently available in the publicly released drivers. + if [[ -f ${libdir}/libOpenCL.so.1.0.0 ]]; then + + dolib.so ${libdir}/libnvcompiler.so.${sover} + [[ "${sover}" != "1" ]] && dosym libnvcompiler.so.${sover} /usr/${inslibdir}/libnvcompiler.so.1 + dosym libnvcompiler.so.1 /usr/${inslibdir}/libnvcompiler.so + + dolib.so ${libdir}/libOpenCL.so.1.0.0 + dosym libOpenCL.so.1.0.0 /usr/${inslibdir}/libOpenCL.so.1 + dosym libOpenCL.so.1 /usr/${inslibdir}/libOpenCL.so + fi +} + +pkg_preinst() { + # Clean the dynamic libGL stuff's home to ensure + # we dont have stale libs floating around + if [ -d "${ROOT}"/usr/lib/opengl/nvidia ] ; then + rm -rf "${ROOT}"/usr/lib/opengl/nvidia/* + fi + # Make sure we nuke the old nvidia-glx's env.d file + if [ -e "${ROOT}"/etc/env.d/09nvidia ] ; then + rm -f "${ROOT}"/etc/env.d/09nvidia + fi +} + +pkg_postinst() { + # Switch to the nvidia implementation + eselect opengl set --use-old nvidia + + elog "To use the NVIDIA GLX, run \"eselect opengl set nvidia\"" + elog + elog "NVIDIA has requested that any bug reports submitted have the" + elog "output of /usr/bin/nvidia-bug-report.sh included." + elog + elog "To work with compiz, you must enable the AddARGBGLXVisuals option." + elog + elog "If you are having resolution problems, try disabling DynamicTwinView." +} + +pkg_postrm() { + eselect opengl set --use-old xorg-x11 +} |