summaryrefslogtreecommitdiff
path: root/x11-drivers
diff options
context:
space:
mode:
authorroot <root@alpha.trunkmasters.com>2026-06-12 19:09:37 -0500
committerroot <root@alpha.trunkmasters.com>2026-06-12 19:09:37 -0500
commitb590c8d7572b727d565cc0b8ff660d43569845de (patch)
tree06f7a4102ea4e845df8b66660f252920d52952f9 /x11-drivers
parent24f9cbfc4c34fdb6a6e03311674414e881ceab47 (diff)
downloadbaldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.tar.gz
baldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.tar.xz
baldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.zip
Adding metadata
Diffstat (limited to 'x11-drivers')
-rw-r--r--x11-drivers/nvidia-drivers/Manifest63
-rw-r--r--x11-drivers/nvidia-drivers/files/95-nvidia-settings-r12
-rw-r--r--x11-drivers/nvidia-drivers/files/nvidia-390.conf22
-rw-r--r--x11-drivers/nvidia-drivers/files/nvidia-470.conf34
-rw-r--r--x11-drivers/nvidia-drivers/files/nvidia-580.conf47
-rw-r--r--x11-drivers/nvidia-drivers/files/nvidia-595.conf36
-rw-r--r--x11-drivers/nvidia-drivers/files/nvidia-610.conf44
-rw-r--r--x11-drivers/nvidia-drivers/files/nvidia-drivers-390.154-clang15-x86.patch29
-rw-r--r--x11-drivers/nvidia-drivers/files/nvidia-drivers-390.154-clang15.patch84
-rw-r--r--x11-drivers/nvidia-drivers/files/nvidia-drivers-470.141.03-clang15.patch110
-rw-r--r--x11-drivers/nvidia-drivers/files/nvidia-drivers-580.159.03-null-deref.patch57
-rw-r--r--x11-drivers/nvidia-drivers/files/nvidia-drm-outputclass-390.conf7
-rw-r--r--x11-drivers/nvidia-drivers/files/nvidia-kernel-module-source-515.86.01-raw-ldflags.patch13
-rw-r--r--x11-drivers/nvidia-drivers/files/nvidia-modprobe-390.141-uvm-perms.patch12
-rw-r--r--x11-drivers/nvidia-drivers/files/nvidia-persistenced.confd7
-rw-r--r--x11-drivers/nvidia-drivers/files/nvidia-persistenced.initd11
-rw-r--r--x11-drivers/nvidia-drivers/files/nvidia-powerd.initd11
-rw-r--r--x11-drivers/nvidia-drivers/files/nvidia-settings-390.141-fno-common.patch16
-rw-r--r--x11-drivers/nvidia-drivers/files/nvidia-settings-390.144-desktop.patch12
-rw-r--r--x11-drivers/nvidia-drivers/files/nvidia-settings-390.144-no-gtk2.patch11
-rw-r--r--x11-drivers/nvidia-drivers/files/nvidia-settings-390.144-raw-ldflags.patch9
-rw-r--r--x11-drivers/nvidia-drivers/files/nvidia-settings-530.30.02-desktop.patch11
-rw-r--r--x11-drivers/nvidia-drivers/files/system-sleep.elogind7
-rw-r--r--x11-drivers/nvidia-drivers/metadata.xml37
-rw-r--r--x11-drivers/nvidia-drivers/nvidia-drivers-390.157.ebuild452
-rw-r--r--x11-drivers/nvidia-drivers/nvidia-drivers-470.256.02-r2.ebuild486
-rw-r--r--x11-drivers/nvidia-drivers/nvidia-drivers-535.309.01.ebuild574
-rw-r--r--x11-drivers/nvidia-drivers/nvidia-drivers-580.159.03-r1.ebuild602
-rw-r--r--x11-drivers/nvidia-drivers/nvidia-drivers-580.159.04.ebuild602
-rw-r--r--x11-drivers/nvidia-drivers/nvidia-drivers-595.44.09.ebuild557
-rw-r--r--x11-drivers/nvidia-drivers/nvidia-drivers-595.71.05.ebuild556
-rw-r--r--x11-drivers/nvidia-drivers/nvidia-drivers-595.80.ebuild556
-rw-r--r--x11-drivers/nvidia-drivers/nvidia-drivers-610.43.02-r1.ebuild557
-rw-r--r--x11-drivers/xf86-input-elographics/Manifest1
-rw-r--r--x11-drivers/xf86-input-elographics/metadata.xml9
-rw-r--r--x11-drivers/xf86-input-elographics/xf86-input-elographics-1.4.4.ebuild9
-rw-r--r--x11-drivers/xf86-input-evdev/Manifest1
-rw-r--r--x11-drivers/xf86-input-evdev/metadata.xml9
-rw-r--r--x11-drivers/xf86-input-evdev/xf86-input-evdev-2.11.0.ebuild26
-rw-r--r--x11-drivers/xf86-input-joystick/Manifest1
-rw-r--r--x11-drivers/xf86-input-joystick/metadata.xml9
-rw-r--r--x11-drivers/xf86-input-joystick/xf86-input-joystick-1.6.4.ebuild16
-rw-r--r--x11-drivers/xf86-input-libinput/Manifest1
-rw-r--r--x11-drivers/xf86-input-libinput/metadata.xml9
-rw-r--r--x11-drivers/xf86-input-libinput/xf86-input-libinput-1.5.0.ebuild21
-rw-r--r--x11-drivers/xf86-input-mtrack/Manifest1
-rw-r--r--x11-drivers/xf86-input-mtrack/metadata.xml9
-rw-r--r--x11-drivers/xf86-input-mtrack/xf86-input-mtrack-0.5.0-r1.ebuild43
-rw-r--r--x11-drivers/xf86-input-synaptics/Manifest1
-rw-r--r--x11-drivers/xf86-input-synaptics/metadata.xml9
-rw-r--r--x11-drivers/xf86-input-synaptics/xf86-input-synaptics-1.10.0.ebuild44
-rw-r--r--x11-drivers/xf86-input-vmmouse/Manifest1
-rw-r--r--x11-drivers/xf86-input-vmmouse/metadata.xml9
-rw-r--r--x11-drivers/xf86-input-vmmouse/xf86-input-vmmouse-13.2.0.ebuild34
-rw-r--r--x11-drivers/xf86-input-vmmouse/xf86-input-vmmouse-9999.ebuild32
-rw-r--r--x11-drivers/xf86-input-void/Manifest1
-rw-r--r--x11-drivers/xf86-input-void/metadata.xml9
-rw-r--r--x11-drivers/xf86-input-void/xf86-input-void-1.4.2.ebuild10
-rw-r--r--x11-drivers/xf86-input-wacom/Manifest1
-rw-r--r--x11-drivers/xf86-input-wacom/metadata.xml9
-rw-r--r--x11-drivers/xf86-input-wacom/xf86-input-wacom-1.2.4.ebuild63
-rw-r--r--x11-drivers/xf86-video-amdgpu/Manifest1
-rw-r--r--x11-drivers/xf86-video-amdgpu/metadata.xml9
-rw-r--r--x11-drivers/xf86-video-amdgpu/xf86-video-amdgpu-25.0.0-r1.ebuild26
-rw-r--r--x11-drivers/xf86-video-amdgpu/xf86-video-amdgpu-9999.ebuild26
-rw-r--r--x11-drivers/xf86-video-ast/Manifest1
-rw-r--r--x11-drivers/xf86-video-ast/metadata.xml9
-rw-r--r--x11-drivers/xf86-video-ast/xf86-video-ast-1.2.1.ebuild9
-rw-r--r--x11-drivers/xf86-video-ati/Manifest1
-rw-r--r--x11-drivers/xf86-video-ati/metadata.xml9
-rw-r--r--x11-drivers/xf86-video-ati/xf86-video-ati-22.0.0.ebuild49
-rw-r--r--x11-drivers/xf86-video-ati/xf86-video-ati-9999.ebuild49
-rw-r--r--x11-drivers/xf86-video-dummy/Manifest1
-rw-r--r--x11-drivers/xf86-video-dummy/metadata.xml9
-rw-r--r--x11-drivers/xf86-video-dummy/xf86-video-dummy-0.4.1.ebuild9
-rw-r--r--x11-drivers/xf86-video-fbdev/Manifest1
-rw-r--r--x11-drivers/xf86-video-fbdev/metadata.xml9
-rw-r--r--x11-drivers/xf86-video-fbdev/xf86-video-fbdev-0.5.1.ebuild8
-rw-r--r--x11-drivers/xf86-video-geode/Manifest1
-rw-r--r--x11-drivers/xf86-video-geode/metadata.xml15
-rw-r--r--x11-drivers/xf86-video-geode/xf86-video-geode-2.18.2.ebuild23
-rw-r--r--x11-drivers/xf86-video-intel/Manifest1
-rw-r--r--x11-drivers/xf86-video-intel/metadata.xml18
-rw-r--r--x11-drivers/xf86-video-intel/xf86-video-intel-2.99.917_p20230201.ebuild98
-rw-r--r--x11-drivers/xf86-video-intel/xf86-video-intel-9999.ebuild98
-rw-r--r--x11-drivers/xf86-video-mga/Manifest1
-rw-r--r--x11-drivers/xf86-video-mga/metadata.xml9
-rw-r--r--x11-drivers/xf86-video-mga/xf86-video-mga-2.1.0.ebuild17
-rw-r--r--x11-drivers/xf86-video-nouveau/Manifest1
-rw-r--r--x11-drivers/xf86-video-nouveau/metadata.xml9
-rw-r--r--x11-drivers/xf86-video-nouveau/xf86-video-nouveau-1.0.18.ebuild19
-rw-r--r--x11-drivers/xf86-video-qxl/Manifest1
-rw-r--r--x11-drivers/xf86-video-qxl/metadata.xml12
-rw-r--r--x11-drivers/xf86-video-qxl/xf86-video-qxl-0.1.6.ebuild44
-rw-r--r--x11-drivers/xf86-video-r128/Manifest1
-rw-r--r--x11-drivers/xf86-video-r128/metadata.xml9
-rw-r--r--x11-drivers/xf86-video-r128/xf86-video-r128-6.13.0.ebuild20
-rw-r--r--x11-drivers/xf86-video-siliconmotion/Manifest1
-rw-r--r--x11-drivers/xf86-video-siliconmotion/metadata.xml9
-rw-r--r--x11-drivers/xf86-video-siliconmotion/xf86-video-siliconmotion-1.7.10.ebuild10
-rw-r--r--x11-drivers/xf86-video-vesa/Manifest1
-rw-r--r--x11-drivers/xf86-video-vesa/metadata.xml9
-rw-r--r--x11-drivers/xf86-video-vesa/xf86-video-vesa-2.6.0.ebuild22
-rw-r--r--x11-drivers/xf86-video-vmware/Manifest1
-rw-r--r--x11-drivers/xf86-video-vmware/metadata.xml9
-rw-r--r--x11-drivers/xf86-video-vmware/xf86-video-vmware-13.4.0-r1.ebuild17
106 files changed, 6724 insertions, 0 deletions
diff --git a/x11-drivers/nvidia-drivers/Manifest b/x11-drivers/nvidia-drivers/Manifest
new file mode 100644
index 000000000000..50997c19ace2
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/Manifest
@@ -0,0 +1,63 @@
+DIST NVIDIA-Linux-aarch64-535.309.01.run 270033799 BLAKE2B 3f5ce5f024d0bb35707034f41211d0c60a3711643dbae8d8f29830c9029c9c66a1e232651c9a5b9c1fb699078ab6aef0c3f2df476a14eee7cd1258e0c8141971 SHA512 ee2f59716d06652dc9083376d758a1f1ba60a11139534d67c39d8b6a4abd2290017d97cc2c8b1ed8bf5ef659e075ccd1a546125a3ce57b6ddd61ada5ba7e6cf2
+DIST NVIDIA-Linux-aarch64-580.159.03.run 314175977 BLAKE2B 20b0446d8870c2a667f25d9d68c906bbe159bd5f2095c975fba468e1407448052467c32a9b6eb96e9073d3f2121420be4e3ff1173d26816d862dd026249baf2e SHA512 0213dff7afc53733ef0ec9d8d24b20f8f577aa3225470fa2b86bf74939075683eefa9cd12aef94b8239ba8366aacdec605ee13b8259da9a1393761d853c3e453
+DIST NVIDIA-Linux-aarch64-580.159.04.run 313659746 BLAKE2B be22824e065d565301435cdb8d22139ae1a52654830c1350cf9bb43d1bb14294cf3e37e05fb4cc2c8e121cfd860b0221943b85ae4a96cff293803c0ec4c6b214 SHA512 2c23269305b59563924dfae85d4eb49a88bf391b77d5edf05026d33f4ff1b504b51847cae0404c6885dc543303889ae665e1c08258fc52737b7b610ec5135521
+DIST NVIDIA-Linux-aarch64-595.71.05.run 316744636 BLAKE2B 8a3c0179701342ef649cc9d247688cd6ae3a6be88920830ca8f81dd7b2e1862e497164698acf484bb145b04002e3903b1aa8116abd4530c7200f0d9ae525159c SHA512 a2d4ee2c260e34c16b7e04e9dbbe3a8ca486279e7743fb2b95ffa02cedb5e42ad7c5dc4c26fead86cd3a7d7ccf7467439d93691e0e0ce66e8425e622a07bf050
+DIST NVIDIA-Linux-aarch64-595.80.run 317098210 BLAKE2B b7857052b4d03b7e041f2dc364c3a257bef711f2e6c094be441236449f1b0f9a099002024437521ecf0b4299997ed816b096f22ee78ec25f8a60222a2255ba08 SHA512 2d5a7b21199223f7b5f41a64c05155586cda9e54e9444c2602c742442bfb278653db8f282e705dddd5f5774e25b5e4e3ff4b24acd5137d9e28ce4f569a1d63dc
+DIST NVIDIA-Linux-aarch64-610.43.02.run 354603118 BLAKE2B 2db0cb1fb486d3919edccf0047d1db4f0feb8258103016995aac8314dcb1408807cd029bcdb33570ac729c9c23a984f94ad17fa894ef48554a7e6f273011de02 SHA512 fe44af192ec259793b2f05e53da25481fae5a9fe01131b3b4f7893858c9f788b5d031cd83b7439bf3f1ee1be48c629548d61d8f611153324ba5b46583846a1a4
+DIST NVIDIA-Linux-x86-390.157.run 49417041 BLAKE2B 435b5e0e60468cc74b41cc5d9b5bb0105d29c11a2d408457835212a96519c9334ecf19278b36749d3ff7f498f5b0ae45a2efae2d428703dac21245c62f1efebe SHA512 dae9ac2c12f9ad90f7441e00e01a984147c577892421911d7f67f6a31e616ac1cb7d434bc9c7f58fbd9b8ae909521b5bece607a63c79588c0bb9d99c6bad5fb0
+DIST NVIDIA-Linux-x86_64-390.157.run 85835541 BLAKE2B 44b855cd11f3b2f231f9fb90492ae2e67a67ea3ea83c413e7c90956d38c9730a8bd0321281ae03c6afce633d102f5b499aed25622b9bfd31bdd2c98f0717e95b SHA512 4780503a4cff0180b1b1f37d20a6ba3438dd78b51fa7f69b98d35521835e5d61099129746929d51d63afa2d47b672b3e145e1e1897584dc3799e7f822c5b3a0a
+DIST NVIDIA-Linux-x86_64-470.256.02.run 272850014 BLAKE2B 0fdc867f92b82b2a60810c3b43751cad7ac2c39928c92c6c343c0c6044f4d7d923d93b8599db3f7c999c0ee7d16940e65d991a61cbb30e1d9e49c5639ac6bdc8 SHA512 a837946dd24d7945c1962a695f1f31965f3ceb6927f52cd08fd51b8db138b7a888bbeab69243f5c8468a7bd7ccd47f5dbdb48a1ca81264866c1ebb7d88628f88
+DIST NVIDIA-Linux-x86_64-535.309.01.run 341945818 BLAKE2B dc7bca19eee348648ed6ded096ed9eedc953d7e5be84bb812baf98230096c9f3a92421abb9adfcd0c257dc63a31d9f4fe4a02c7bdc4be65975229941fc39fa5a SHA512 16a505fb053d514b98bed816559279cbe2962eef8a3d64cce7aaf859b2d27602ac9018bb099a56ab4223532f70e00984e5468a4ba9c2914dc68dcbe0d8b2d64d
+DIST NVIDIA-Linux-x86_64-580.159.03.run 398016015 BLAKE2B 6ac3bb48c17bdd9a143fd3483913784d14cc7fb7120b20c0d74de7aebb9569c945d693af4e7c2e2f50fca97e67c26ac91e4943d21ff636a30e372888cff02d94 SHA512 658c7bee6289f9e3d4d04fabc9fee5692ec2a61242d05dddbad61d5d667fbc47ea2cb57802079b6f139c240d9119da4b462548a79a03483dfac53de797ffb5cf
+DIST NVIDIA-Linux-x86_64-580.159.04.run 397162548 BLAKE2B ee0dd051341955d8eab23a12b4a1b81a4977346b2324db175522c07e252ac6c9cea179810ba1535095796ad89ccd92826506dc73954496130249b1c355cb4288 SHA512 50cc5f58ef733f8f196c71dd7b7756fc1e2f163533d9333af4341aa1379b4b68fe5a4afc5698494b2e0928fc970e902d32e6e3f8f6795d03657842c1c6434fe4
+DIST NVIDIA-Linux-x86_64-595.44.09.run 423549686 BLAKE2B eb3f959b4103895db808743f6986036a275689fabadeb16be5f9e496ccc7a963447568c8d8b248ca9bd2e8843e32c676a4e63d360dcfbde5df7a32405284b59b SHA512 835f22e562d0ac362473cd6425a9065a05a360d6c9d85e4973d34e2005468b75e177283cac8140c725f5146db3e748065eb9b93787936692fd54a8ab80939f9b
+DIST NVIDIA-Linux-x86_64-595.71.05.run 423133031 BLAKE2B 770af0e6228c300de069b2e87467d030d199dcd9f9c6e32c583291eaac7196974f72f1e25902b8e38056897cff99f845adf73e3eab6dedfce8339b21b76b1042 SHA512 75d22994ba963223300d3c57fdc05803ddf7d8630fb5aee3ba92017d6f614e4a7019dc09f0f02b02ec28d6d5607e284d4e6de2cd506eeda604f75a2d4177028a
+DIST NVIDIA-Linux-x86_64-595.80.run 423049323 BLAKE2B 8713689690a3e8144f82e83bfb1df0db7b4a4276b5580ddf47c970590b2a211dfd7171f3fdb3eaa66e16b56e87667ceb48a8549d832518874a99d9ab45425879 SHA512 2294c8e1f2d6a3bbc116bf6b2a4c84b26c23c4c1f413ff86259c2aff1ac2f0f66a44350b0c796dd66438b0013b3e8f3a8f15d3513f4876c104a6d570b68b649a
+DIST NVIDIA-Linux-x86_64-610.43.02.run 461616501 BLAKE2B 9b55b3e7fd756c1979ce86901654bab5cb05680b7ea525c7fc3c22f2d200cd3fdbec1eaac435cfb9cbe036e6659a97e4edcac79275de8b3803dcd673f20f0110 SHA512 aa626828964bd9b68dffd07865d2fb05de09b0fe944d6ff8af20412601fc72459186eee580e290c379e1a2b74f8e88c6ee406016814850952cf9330e64ab3032
+DIST NVIDIA-kernel-module-source-535.309.01.tar.xz 12537052 BLAKE2B 2bff6a129c7c407de95d140fefefd50c266c7c8dcf938a71690545cff65b3502872645e79d47f9091deac54b7e140bd93a321b18af0b9cb24ca958f033461c53 SHA512 5bd08038823f3f9c39307b441cadc6231d71195adf1835f33e5af794df24be8abed83d3b246edbf5cbaae2379b52ecdd5c975c722001e19fc96054528bada773
+DIST NVIDIA-kernel-module-source-580.159.03.tar.xz 22253960 BLAKE2B 31245291564c734c5facc49e866b345f92d4fc08baabda4a9d49ea2073e62fbcbae9f4a39dfb430533ed0bef2acbf36d4546d9cce3a3da582b2cfbaed0ddfbce SHA512 8deb20e9d5b65cc9d701cacf1470187dd72765a291ff6c7ed3b6c6dda32287271befbb88d0bb6cab736958eca96b4e093182848274ca2cfd901ae65bcac06abf
+DIST NVIDIA-kernel-module-source-580.159.04.tar.xz 22255440 BLAKE2B b293f941ead331674b235a6d75961b13eb488c306e22a2afb50cfaa965e65fc0768cb9642fc82a16ce1b6383ccf7c252b729ec305a39db3dec38284e4fb7191b SHA512 f0ef07705510aad25344b51129c2a62d6a36a0eac02e5a60b36dc47c88cfb91d875e0298369c3bca97208deccd3f2f0d1a595abf9e01b6433bf194c778f134e9
+DIST NVIDIA-kernel-module-source-595.71.05.tar.xz 23778996 BLAKE2B 45361ac9830c16c748688545501124647859c247c5cf7dc6ab4508fe614425715c7299cf88728a3da4111c7fbf6f9eab8a1c77b039ebd868dc7a6367b5e97ff8 SHA512 dc417fd79ac6fa388e8c66ecb55e8207ddf19f4f98b5a04a574aad9a100753e9930e29cae08c4d36721cf56863b107ace4695207c6c91f4a831ebc3f0108e1cf
+DIST NVIDIA-kernel-module-source-595.80.tar.xz 23777372 BLAKE2B 1bfd80d07a12f5224b232e2cfcbc4b5ae04cbf1cbd6411d1e5c67ea71dca2c90b615355c9fd664ba94c11fd120b84340baf7ea68357c3faaec40f73e0d3f6668 SHA512 2ca3461e120af359abc1943ab5c64a71333586d45702db195697329834c6da9e11dd908a180f6bab4905b5492acdea42fb77cdd4126d25e67e0947c8e154fd60
+DIST NVIDIA-kernel-module-source-610.43.02.tar.xz 26167288 BLAKE2B e87b46ff8f33cbe1262cd230012d0f2694194a7c16824a671817d212e1b93c8b3a31d35db75f9b0399693c1f2b6030b99f2f0af70d9c83c3ab9cd1c24e7d90f8 SHA512 a7bead484b396ffb34468d3d94dd87c9d9133a084b0219a275516d9c726a47550b66eb5f80ab71b04db27614c411f102402f66714d8a933fe234c2b3a2776b5e
+DIST nvidia-installer-390.157.tar.bz2 150323 BLAKE2B 8058ca87a6dea956d564af9f7eab9b1fc82b1f2382bd5cb2f6d97cbe2e19292533522d5f8f2eacbeb16520372715fcb72f8f9b0998962af5d4e75522c8d74524 SHA512 93a7ece648602157496c8e27a88864ede341a100f5328a4c1a25faf8f0b94d252060e5e2f71d0c302fd0566c10773c30b76b3b5f431d8039b71c90a7969f7d7e
+DIST nvidia-installer-470.256.02.tar.bz2 146269 BLAKE2B 4402e725c8fd0157eb84d4ec140a33f97e873014577487ef1e32fb8921cabe79c60ff46532e5bfaabb2b6ac894f7c80086dbab19e61906e2e27346fb85f98829 SHA512 c962dc17d9696256d1ebedcaeb3010994f2ce3895aedc47987599ebfec132a9b9a249d2ece6502b15bd4a93f9b0106aa13487a7da5f64199c274ce11eba27cfd
+DIST nvidia-installer-535.309.01.tar.bz2 149086 BLAKE2B 14ed4eed4d3f998bf3c93d7cdcca8748bad9fa4751b81d193ce00dbd9694b9ae38fa865a2e82c5ec78ba58f10a73c0d5120b5aa2069cd418b9d423c3da592aab SHA512 e4a362fc0980e34c984be811570fac7b2b0ace3a7105643f8b3d15122cbc6fb9988d017e22a72659dba40588638b60eaf243bd228a386e8d2d12db0f50f42f0a
+DIST nvidia-installer-580.159.03.tar.bz2 169966 BLAKE2B 9f723b18796de0c34eef130e5bd854f55d310351fc13891041d01a55a0b79d2a69e4b36be9dc9d8216442819399b93ab7f4f2581a66ded2de2994b1a4e132018 SHA512 3da64f9039466b95910bc165473d5f6e39bd48ac5c8aef6ab3b196f6054cc177e2182aebc532a285f076b2d277982346cedcd952c3a5487a617bc85db2b351f5
+DIST nvidia-installer-580.159.04.tar.bz2 169644 BLAKE2B f01f9da4e7e3ed6524f586706a7167746c88e7033d61d7ee459408748c0eaf75b236667e7177baae282c1e4ac0896abe9ab2e6796ba2638b2db6ad074646eff0 SHA512 00d11f80b8f410d8110a8450ea56a653a5a223bb1e728382e63312121d3926985c815019dc9cd0659ed97ce824f0c29d67d1188b41f1a3120e25881f1403ddce
+DIST nvidia-installer-595.71.05.tar.bz2 172399 BLAKE2B fda7ec136805aa7e481162af171206c3e6dd8c641fc60910f1336895b87ec1e4ab7469456d3fe96ec18f763df3ab158e7c707edb89833a628fe24e69ad97080a SHA512 08ebd56a639cad608db8a82cccfc386cad4f2dadb7a01a7318f5cd70b0428e0d62fc51cf6c8fef16d567c226f5cc83c8905fb3bc36404abbc5a6bf36c0b26403
+DIST nvidia-installer-595.80.tar.bz2 172439 BLAKE2B 10b59538c6645a7a6c2ced03bf38f2fabec1cbbf8c6e915240551fcf3217333da0260fc4d50b9ba817a721c49dcf5902a3e32a1de261c1a9d20d2a2afe443bd1 SHA512 17ea2123805458470e463ceef2bc37cab5e22e55e43040ca6d6862acd036ae23c647c2c05fa9eab4eac5a8462fe38a9502648d6720bc3065f75a826fd5208ea5
+DIST nvidia-installer-610.43.02.tar.bz2 171883 BLAKE2B 7de020021d83b8283c1603bd7351113ff11444db7922593d956589473bef46a0b408208b3aabdb08314880310637c3b0149d30b7547c9973d2fd806fa3d7b946 SHA512 26e43710517192883f41586fbd3806e71e5648bd3f9a531d27d3a4ffb114ee803940d6e1e05d86eb853f69217c4a158d00dc4b7b410828e25856c4ade5ef5bad
+DIST nvidia-modprobe-390.157.tar.bz2 35306 BLAKE2B 80d202b39c2f95ec0f909712c2e101483af50124092c32efb33bd98ff58ddfb97b737ff07f1ddc941f688c1b4c26a15f392566d522e18506771f10422fcd571c SHA512 109bbe24a3758b568ea65fe1e9d78f69fae6108ec0497b796c885a3912825fe04ffd7389a3e22987f1a10a2926bf6eaa384faabc59478aa3ee244dd3ac91c6d3
+DIST nvidia-modprobe-470.256.02.tar.bz2 38769 BLAKE2B 0db444b09b0b6d24c04877fae95249e781d82b3141f90eb05d869b64d2b6e65ad00bf44c4e427c64dbd4765fa99a8699f80a1d95b00c66137a54dc878d7ea298 SHA512 c1cbfa6c8e188e5a5eb5d390b9a903406cbff103d212fc30e611e4023be3fde896ad84e8bb45b030beb5d1bcd8155c9e55a8f9636c45ce1e2a5c03f672989a31
+DIST nvidia-modprobe-535.309.01.tar.bz2 40756 BLAKE2B 4c8d41c3f8d811155aad952e7120bed92e44d50e6af3551396f4be73f733f64b72d76d670676adc957efcf4c0e05df6473ca50a7cd378e56a0da52f8dfb2246e SHA512 b39f282034320836cc4424901d0230b5bdeb72050f18e0d024715a89b0085fe5a420ca82425ded4218a25ee3f7e8f6fa1abb37ac37843eb1b9e35aa8a2657a66
+DIST nvidia-modprobe-580.159.03.tar.bz2 41685 BLAKE2B b8df703c509987538e979ed1d65131004dfd2eea3b4d4a9a98c2784a13523f8ea55fda24fb9d3f04a1bcad04d8726ffceb4f5abe9eb19f50fee5c91f8f1db99c SHA512 09d4d1b0474bb35a0e64f6a6b550096b7e5c18bc1746300211d829bc6ef503b301b2ca8909057cbfcd8585a9969ea807ab746bc253ccf2f5f2cc5ec263a989d6
+DIST nvidia-modprobe-580.159.04.tar.bz2 41688 BLAKE2B 4600a5ec3428d0340e4268c7b191c5cc872680e3b7cfb2d3886c05b3d9706295b276cea6a957bc5263a21d7e9a60a18f8986efa1f88a9b13d9f22c3b2534bcff SHA512 9577d291a23e8044a1d8caedd5c9a7d900698b7d53f9a2373c9e38a313be0846d7e4965fdecb081d18144f01216159c4bcae7c0741d3210c7e9d8b0f42d91099
+DIST nvidia-modprobe-595.71.05.tar.bz2 41724 BLAKE2B 23a0fd55e50106341a4196af7bca568c96555c6b0583ae41b860ac73ed4cd6d5222709a88768662fd18a2e4f7686ff092e5603497af71ea7dcbebaf50235c54e SHA512 97fa81a96884f4c2fa6ecdb86d513121b00e8bc955b9bea0947c8ab34271a016458e405df451fb6340e4b8243572980b5e7a4f24af2775310d3cae35a1bcee0b
+DIST nvidia-modprobe-595.80.tar.bz2 41701 BLAKE2B 68c12da5284a27a0c5bcdf96e7b791a16fd80e0c425ac51bb42c9b2172f215adc311844f7eec534af928bb25265a480c591d077aa8c2a5352739c8f27335814b SHA512 779c1dc3b4505c197cd6e667225c60445938c9fe6fc1f4914e50755c58c6e9ac7fef51be8b59c7b66d17fdf463b7d87379b48b40a5002604cab6a88e963369c7
+DIST nvidia-modprobe-610.43.02.tar.bz2 41751 BLAKE2B 2fc6e0077633acba025ad9728f002f283dcaa4b3ff2802e63e53073f3fd54f4e955d62bea5e0677e9f8a4eef771f0bb35bc4d728e96eb0356eb335ecb9e0c9e5 SHA512 c94f4c820744c183b8584e1b74e2e6f50c752fde52ab133055999c1eedc5096e0d2788ee1bd7476b959c243df1ff6ebb5fae5c56e92f87b99573f2e52ec75ed5
+DIST nvidia-persistenced-390.157.tar.bz2 48654 BLAKE2B 2cf6c92da90acff55e8c180a06b0c6a29d48be9fd8ca3c541202fd14f0697220fba6b66452942aa7ae7cc8821f5c5eb9fa8f7a31d2248624e5f9141d83a176b8 SHA512 70f0707ed6f2b877e69ef90cf782f66cbc9d2071db53ca09ceb7b89427b0fe176708517340621fa251539b7d481b238adeeb60261674eed74de1f62db6dbb72e
+DIST nvidia-persistenced-470.256.02.tar.bz2 46567 BLAKE2B 8f837322a3b88412fd2f6acf38721b49a6cb444fbd842d652519e5596f2e545d8f06bbdf017f46a22301ce87455f96147fab2829ca5fbf26131ec3e4a772e282 SHA512 4fd19258649b7d39945fb5c8578bf11ab118617dd14f3d11cdf15cb3fe77daf7b4719e4ae57af59031b1b809d02f4e8e8afed0ec60b9d0aed4d2488bd3013cd9
+DIST nvidia-persistenced-535.309.01.tar.bz2 48569 BLAKE2B 5756b1335d6a1932529babcc401de4f544ea18dd6da271fde258ba046c98584fc736f211e4c5ac485eab70a6d1717b5aac3cb15f818cbf9eda29a64151fbcdf1 SHA512 e49631fbbc1466820c87fe9a7538b7dfaed512690d1b14e4482bfb471c4e144c62d0f2df5bc8dd3aae443475278b0aa1ab9cbe27059a38fce9b82212477b87b1
+DIST nvidia-persistenced-580.159.03.tar.bz2 62211 BLAKE2B be8d6afa3cc3439ce1ff84b4f9100c81247e75572e15f12882f65763497628427b0ccc7b460b95b5c287d9b5170f1917989450277b5d33b1f221745806d4d3e4 SHA512 e81b6eeea182fea9b041d6e7e205332801926c810efd0c32cacbdb23a1d949ac127cb6646e9ac6119fde0a270a882ad3937b79fe0cf5e1cecb342d02e3ffd016
+DIST nvidia-persistenced-580.159.04.tar.bz2 62225 BLAKE2B 2d3b4585c9fa0a9b367c73c204f5350088971690fe98019840405645fc90020c6c1a6e985049b191df796f07784604e97337ef9c39311554cfb05353c1429204 SHA512 057537c1641ef3a4d9f594371ee01c4a0fe821561969cd5c1557bdd8c6b4319aaee02cf6bc583f20e47102ecb8fed99666269c5398e31d17024aa0a299505830
+DIST nvidia-persistenced-595.71.05.tar.bz2 62538 BLAKE2B ebf86357c81689d553d0f1f8a602932ec466781f81402a9bcfd1d4155de6ceaa795dec0ae0b9937b3e02ba2605cc11849bad36847df30aae673fbccb52bc2e3a SHA512 a3fa79468d7b3e8eccfab4f52a6e9240e3d65dec9454a10d350f45e5c27781922bc7ceffcbe6d40d9cf63694d84b4a7678c1f1268b72b821f08d22bbd05f7a78
+DIST nvidia-persistenced-595.80.tar.bz2 62512 BLAKE2B 854263b23e7445993eacfaffee7ffd40ab8681dabfb32706a8adb70d6fd66a2b2cdb8ce4947693617397b1e5347017d27bfb4c6ea059ad4ac3abd08d185407ce SHA512 aaad09d17534017a521120673f556a32b492884c8ba49cd5d6229be5e043e8a412699125692ba9d99a2e7a8fad44af4053a2b3bceca3af04c098bb7fec1a08f3
+DIST nvidia-persistenced-610.43.02.tar.bz2 63333 BLAKE2B 5b844724f4eb06b23b4844915541f1ee9564d7a377801fdfcbec56b5fb2411b93a526f89a62057fb645d9cb9a45d0ad62fe72353dea818fc2259fec6fbcfed92 SHA512 63075e7ad5f7bd99ccbdc5f83044e977a5856a2a0e27c8342f15a2163c47d70378ddcca7a97641ac6cc43a13595a6a7c0cbb8bc610b4ca99e1c4592520482d19
+DIST nvidia-settings-390.157.tar.bz2 1108938 BLAKE2B d9ec1ab5d7f157d74627272adf752a671dd17e2ede02069437b6180b927fe315b15cc6416d584ab2f038b76fe01e5b64514a834f24d88ac16676e55205fdecdd SHA512 b16699009bf56a1ff3b623a528c58061c4f5a2c5c4a373756a07bcd667743a1df7c733a572d2d0baa835a904ac2fda8a5c85890dcc00c3a0f223e0467aea902d
+DIST nvidia-settings-470.256.02.tar.bz2 1062273 BLAKE2B 8e66201e7861469b12932595ef8f9fd29d4cfd570c2576ae7fbb7383f61c55ac71fe721cc431e79d6d69f86d998b5b4c3cafe531b573f439e6b499b0fc047a19 SHA512 626e66118ae2e62eacfdf44e37529c409b945a6f33637b9690d74abd87a2afb581aaca5f90328d280da99ceb659959d0e5dc5c22ef8013b2205b2b1c72e08007
+DIST nvidia-settings-535.309.01.tar.bz2 1094768 BLAKE2B 6a951e7e8e1ccd968a0727d2c8aa5008044d789dac5002f148930ba7ceb07cd3caa59f265c818392a7fd996bf0418729be349bbc1ea0b8870b1a38f5fa9470f1 SHA512 d0d62c3abffe52ad65585f6e88b894efa07cfb9918d2cb628b771d4d8a40149d9097ad7cb66b01a9bc0b4067e63540f2bd67412fe52105348bcca60955f228c8
+DIST nvidia-settings-580.159.03.tar.bz2 1133196 BLAKE2B c36b3e8333eb325b74152a6fbb3f5e5d001b306ea1c6cf9ed9b8c61479f4d0d72b8fca4b7372cef1b66f06b94e7d20e5b69da61a2e0b16f918df504607a3e7dd SHA512 e50ff8850e4405ea7ad8f5725b4787b3c6166b90585b098270e277c45625f4540ae7ef00a460f1eb6da694fbfdd29fb9ec9ad82c797931106db5dfee40a3edd0
+DIST nvidia-settings-580.159.04.tar.bz2 1133196 BLAKE2B ebe947f523301a612f3bc87c9d38659052158d6e421339e12a879b6e854f0778a6166b91e71d0e4638961d63eb983e0bd899b9cecc45433b51bd04d010c38319 SHA512 edb4def04272bc663a47ad117e67a91f0b6719bb3a8b6d0c85758275767b945bf430ea025828c9fd121550546f65d253b5c54792c2151090b6ad0e7ae9d02c75
+DIST nvidia-settings-595.71.05.tar.bz2 1136100 BLAKE2B 8b0af1e7a81b63042c762794c2f8f3094b40c4a9fc845dae9c39b63c02c613ce6893cb2451806ba775df8128b498259435ad49dd4ea27dafccf0c6c7bfcfda6c SHA512 8f7286863e1306cb50860f83aca046bf4743d3c8c72ddb9e6461e240bb741aa7c03e795081d821808832923ba0e736a4676cf137c84adc8ea770c6d0a28d8dc5
+DIST nvidia-settings-595.80.tar.bz2 1136230 BLAKE2B de34d8594c1f5e888e7c941aab1a3222233b56f565559c7a3e96fd8c605390ffd4bba05f319ae9d584b216d7f032d63c86fffa320ebfe52756a986fe5a69ab28 SHA512 46529e60f24ee97f20eba30d242070bbb57599daa7b440c41d7477c8ec2047702367d1e771a722cb69d240185837e9f6b93171ad7013c6c55b691d9c411b8dbb
+DIST nvidia-settings-610.43.02.tar.bz2 1138293 BLAKE2B 4d0931334d14b60ed8cf113d1a74d321c12edd1fb2f62c23683f392931f7b65779c9539148e20a9e259d4e2f9d6a6fd2249265e93edf81e49bec25291e174d4b SHA512 e4a5a5ba6f5858f786c98d6bca4f416f0fb160beb0a5329b80d5d03378d68d623e69ed0fea29de81a16b7d819c9e57007d2e690b7dc890cccc04b6298c86f9b7
+DIST nvidia-xconfig-390.157.tar.bz2 107399 BLAKE2B 0cbb3b1ba508ddc3ba4a161c290b31bf7a67f67880bdbd01171a962c5fa97ca945b1ef17932403f8589309380743f1da632c728d8accb6d4e56dbd895e7486bb SHA512 50b390811c9bf091b14add41f886925b17496b41006b7d3981d2398caa65cf5db8a579c8cebed78278384bf3acc629befb07b54339c61abcc75852c0dcb8b8ca
+DIST nvidia-xconfig-470.256.02.tar.bz2 108698 BLAKE2B e468574e4bc57e7279d4120e2b08a201671b50d408be0c530eabe5da7d45daaf21cbf5c7fa31410d0d732fe8ea1551cbfb21d1ae193c1b3f5b5c50c764c9e236 SHA512 9dcec1e0c2b56b4d38a5f2c76086302f8bc0860cc15012cce29c3a5062f801a48b6a2bb78344361b07a2717b58502783441a2daf402d9973a17526175b1f15ca
+DIST nvidia-xconfig-535.309.01.tar.bz2 111085 BLAKE2B 7a2f55989f93bbfecef0ae0c76113b42cc79c3fefce12f3becb2c3722978115b2408efefa63845ef2f9ef7563f9ce79c5a9cafcc3de4f70605f34aae44d485f5 SHA512 710f279b6e4ac143c39344c44cda5950777c613f193170a76fa948def5a13b5b9177b44651e3b46a2630e7f420a9189671042f76b88c14a31ba6f6dcd78fdb7d
+DIST nvidia-xconfig-580.159.03.tar.bz2 111535 BLAKE2B 5ae167c6aae8596e89f1b254ed8cc4c21d20ca4d1ac4d238c79d64458324d5910e9d66b29d8079d9eaa771b2cdc15af3685ac224cf9d1f69dd471838edff783c SHA512 2d34928a5b5f419090742a6592e8c07bbcfc05b037af125c0f20d1267b8685e5a0d4bd8a039192c158579c39c08ac2c49e362d170009db02ba11835f1d8268d1
+DIST nvidia-xconfig-580.159.04.tar.bz2 111540 BLAKE2B 95cfd0c4af5e2d171e39c1e53e225ec92cf5ac9ce3c9953c9e558f08a67e314030f5a2b4618706ffd6e598f314eab45b4d3087a8896222dcbf6c1a4b73a2debb SHA512 878a37240de42baf2f9a453cb3f5aaf0a6029cb1f00b3b1567c9e25175a2e1118b5266965163296eba0b39a9e01137b9d815ed29d4dd67f1ee43d5905b373d98
+DIST nvidia-xconfig-595.71.05.tar.bz2 111096 BLAKE2B 8b6f7e043319577f0b21780cc88ce189b99123ee079a4e5188e7c12d7d2859776f5d47efc1625ba70542df300ba88bf555e8d4638816322966d04c9a316b5a56 SHA512 bf705b1916633d8dfd4742d94358607901bc843f1280954391d9ee7be98da36f0f895811057b8666f59ab3b850bc6e5bb2bf80a88923827497cf0b5a852db6fa
+DIST nvidia-xconfig-595.80.tar.bz2 110917 BLAKE2B 93b78ac4de45b63ccc7fe16008631abbdaea30cc3e7b5958a2ae54e0a95ab1f492edd00c53af3d543895b3fb9a5f329013b6cb1abb091d778346ad0c1dd4bc0c SHA512 eb2a9221face01763807ee4ee6198f549e89b3f1c8faf37711c7c424503d0e4c8ff70bbf7d487264b9d745d75ed3e55af5d41001b783dedb3cafd8328b76d851
+DIST nvidia-xconfig-610.43.02.tar.bz2 111123 BLAKE2B 5ade2f6525b4fc847a28c6d853dd5d829c434ed892cda9060ddb6f66566e440bc11d0f01a2930016000b8f1861bcd5be5c9ca168d4d7ecb91fdfb46e61b2c98f SHA512 c8975ea34bcff52fd19973c28b3c215e847567e0d153ca2dc3b867b55c3bb9325a52a7802e77986f65a0472cd0ac501b872bf2ed05ca9543413ef8dc26af2b2c
+DIST open-gpu-kernel-modules-595.44.09.tar.gz 24805417 BLAKE2B 0281e825fb55982971499bc4a5284115fd0fdd24eb033bbff17010d1e7ace7c041dac56f98123cfbd5009f1f75b25332e3dfa68acc684c3f59ff740769cd291c SHA512 57a43e94740d31b84671cddb061825d954d1039fbdf82572875f8ca3f94309d7480ac19718e96cf062c9a78e8b2ef3598766928f03e9420fed90ab6f3ab65b7a
diff --git a/x11-drivers/nvidia-drivers/files/95-nvidia-settings-r1 b/x11-drivers/nvidia-drivers/files/95-nvidia-settings-r1
new file mode 100644
index 000000000000..48c41d8aad0d
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/95-nvidia-settings-r1
@@ -0,0 +1,2 @@
+#!/bin/sh
+/usr/bin/nvidia-settings --load-config-only
diff --git a/x11-drivers/nvidia-drivers/files/nvidia-390.conf b/x11-drivers/nvidia-drivers/files/nvidia-390.conf
new file mode 100644
index 000000000000..bf2eb3fb52e4
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-390.conf
@@ -0,0 +1,22 @@
+# NVIDIA drivers options
+# See /usr/share/doc/nvidia-drivers-*/README.txt* for more information.
+
+# nvidia-drivers and nouveau / nova cannot be used at same time.
+# Comment out the following lines if you wish to allow either.
+blacklist nouveau
+blacklist nova_core
+
+# !!! Security Warning !!!
+# Do not change the DeviceFile 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_DeviceFileGID=@VIDEOGID@ \
+ NVreg_DeviceFileMode=432 \
+ NVreg_DeviceFileUID=0 \
+ NVreg_ModifyDeviceFiles=1
+
+# Should be no need to touch anything below.
+alias char-major-195 nvidia
+alias /dev/nvidiactl char-major-195
+remove nvidia modprobe -r --ignore-remove nvidia-drm nvidia-modeset nvidia-uvm nvidia
diff --git a/x11-drivers/nvidia-drivers/files/nvidia-470.conf b/x11-drivers/nvidia-drivers/files/nvidia-470.conf
new file mode 100644
index 000000000000..77b9d385fe71
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-470.conf
@@ -0,0 +1,34 @@
+# NVIDIA drivers options
+# See /usr/share/doc/nvidia-drivers-*/README.txt* for more information.
+
+# nvidia-drivers and nouveau / nova cannot be used at same time.
+# Comment out the following lines if you wish to allow either.
+blacklist nouveau
+blacklist nova_core
+
+# Kernel Mode Setting (needed for wayland but is hardly usable with legacy 470)
+# Enabling may possibly cause issues with SLI and Reverse PRIME.
+#options nvidia-drm modeset=1
+
+# Suspend options. Note that Allocations=1 requires suspend hooks currently
+# only used when either systemd or elogind is used to suspend. If using
+# neither or have issues, try Allocations=0 (revert if it does not help
+# as =0 is not recommended).
+options nvidia \
+ NVreg_PreserveVideoMemoryAllocations=1 \
+ NVreg_TemporaryFilePath=/var/tmp
+
+# !!! Security Warning !!!
+# Do not change the DeviceFile 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_DeviceFileGID=@VIDEOGID@ \
+ NVreg_DeviceFileMode=432 \
+ NVreg_DeviceFileUID=0 \
+ NVreg_ModifyDeviceFiles=1
+
+# Should be no need to touch anything below.
+alias char-major-195 nvidia
+alias /dev/nvidiactl char-major-195
+remove nvidia modprobe -r --ignore-remove nvidia-drm nvidia-modeset nvidia-uvm nvidia
diff --git a/x11-drivers/nvidia-drivers/files/nvidia-580.conf b/x11-drivers/nvidia-drivers/files/nvidia-580.conf
new file mode 100644
index 000000000000..36d71d1664cb
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-580.conf
@@ -0,0 +1,47 @@
+# NVIDIA drivers options
+# See /usr/share/doc/nvidia-drivers-*/README.txt* for more information.
+
+# nvidia-drivers and nouveau / nova cannot be used at same time.
+# Comment out the following lines if you wish to allow either.
+blacklist nouveau
+blacklist nova_core
+
+# Kernel Mode Setting (notably needed for fbdev and wayland).
+# If in doubt, even X11 users should not touch this.
+options nvidia-drm modeset=1
+
+# If modeset=1 ^, NVIDIA will handle the console/tty display and allow
+# overriding DRM devices such as simpledrm by default. May or may not
+# cause issues like being unable to display/switch tty properly or
+# resume from sleep with *some* setups. Try disabling by uncommenting
+# if need to troubleshoot issues, and re-enable if unrelated.
+#options nvidia-drm fbdev=0
+
+# Disable use of the GSP firmware, only an option when USE=kernel-open
+# is disabled (which in turn disables usage of Blackwell 50xx or newer
+# GPUs). This should not be touched unless it is causing known issues.
+# Notably may be needed to get Runtime D3 to work with Turing GPUs.
+#options nvidia NVreg_EnableGpuFirmware=0
+
+# Suspend options. Note that Allocations=1 requires suspend hooks currently
+# only used when either systemd or elogind is used to suspend. If using
+# neither or have issues, try Allocations=0 (revert if it does not help
+# as =0 is not recommended).
+options nvidia \
+ NVreg_PreserveVideoMemoryAllocations=1 \
+ NVreg_TemporaryFilePath=/var/tmp
+
+# !!! Security Warning !!!
+# Do not change the DeviceFile 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_DeviceFileGID=@VIDEOGID@ \
+ NVreg_DeviceFileMode=432 \
+ NVreg_DeviceFileUID=0 \
+ NVreg_ModifyDeviceFiles=1
+
+# Should be no need to touch anything below.
+alias char-major-195 nvidia
+alias /dev/nvidiactl char-major-195
+remove nvidia modprobe -r --ignore-remove nvidia-drm nvidia-modeset nvidia-uvm nvidia
diff --git a/x11-drivers/nvidia-drivers/files/nvidia-595.conf b/x11-drivers/nvidia-drivers/files/nvidia-595.conf
new file mode 100644
index 000000000000..e166611781d9
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-595.conf
@@ -0,0 +1,36 @@
+# NVIDIA drivers options
+# See /usr/share/doc/nvidia-drivers-*/README.txt* for more information.
+
+# nvidia-drivers and nouveau / nova cannot be used at same time.
+# Comment out the following lines if you wish to allow either.
+blacklist nouveau
+blacklist nova_core
+
+# By default, NVIDIA will handle the console/tty display and allow
+# overriding DRM devices such as simpledrm. May or may not cause
+# issues like being unable to display/switch tty properly or resume
+# from sleep with *some* setups. Try disabling by uncommenting if
+# need to troubleshoot issues, and re-enable if unrelated.
+#options nvidia-drm fbdev=0
+
+# Suspend options. Notifiers=1 implies NVreg_PreserveVideoMemoryAllocations=1
+# which is needed to avoid issues when resuming from suspend esp. on wayland
+# (former systemd suspend services are not needed with kernel notifiers).
+options nvidia \
+ NVreg_UseKernelSuspendNotifiers=1 \
+ NVreg_TemporaryFilePath=/var/tmp
+
+# !!! Security Warning !!!
+# Do not change the DeviceFile 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_DeviceFileGID=@VIDEOGID@ \
+ NVreg_DeviceFileMode=432 \
+ NVreg_DeviceFileUID=0 \
+ NVreg_ModifyDeviceFiles=1
+
+# Should be no need to touch anything below.
+alias char-major-195 nvidia
+alias /dev/nvidiactl char-major-195
+remove nvidia modprobe -r --ignore-remove nvidia-drm nvidia-modeset nvidia-uvm nvidia
diff --git a/x11-drivers/nvidia-drivers/files/nvidia-610.conf b/x11-drivers/nvidia-drivers/files/nvidia-610.conf
new file mode 100644
index 000000000000..b69054f442bd
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-610.conf
@@ -0,0 +1,44 @@
+# NVIDIA drivers options
+# See /usr/share/doc/nvidia-drivers-*/README.txt* for more information.
+
+# nvidia-drivers and nouveau / nova cannot be used at same time.
+# Comment out the following lines if you wish to allow either.
+blacklist nouveau
+blacklist nova_core
+
+# This is a new feature targeting wayland+HDR that not all wayland
+# compositors can handle properly yet, this disables it by default
+# for now. Feel free to re-enable if it works fine for you as it may
+# provide a performance gain when using HDR.
+# https://forums.developer.nvidia.com/t/365381
+# https://forums.developer.nvidia.com/t/371356
+options nvidia-drm color_pipeline=0
+
+# By default, NVIDIA will handle the console/tty display and allow
+# overriding DRM devices such as simpledrm. May or may not cause
+# issues like being unable to display/switch tty properly or resume
+# from sleep with *some* setups. Try disabling by uncommenting if
+# need to troubleshoot issues, and re-enable if unrelated.
+#options nvidia-drm fbdev=0
+
+# Suspend options. Notifiers=1 implies NVreg_PreserveVideoMemoryAllocations=1
+# which is needed to avoid issues when resuming from suspend esp. on wayland
+# (former systemd suspend services are not needed with kernel notifiers).
+options nvidia \
+ NVreg_UseKernelSuspendNotifiers=1 \
+ NVreg_TemporaryFilePath=/var/tmp
+
+# !!! Security Warning !!!
+# Do not change the DeviceFile 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_DeviceFileGID=@VIDEOGID@ \
+ NVreg_DeviceFileMode=432 \
+ NVreg_DeviceFileUID=0 \
+ NVreg_ModifyDeviceFiles=1
+
+# Should be no need to touch anything below.
+alias char-major-195 nvidia
+alias /dev/nvidiactl char-major-195
+remove nvidia modprobe -r --ignore-remove nvidia-drm nvidia-modeset nvidia-uvm nvidia
diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-390.154-clang15-x86.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-390.154-clang15-x86.patch
new file mode 100644
index 000000000000..98eaee949074
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-drivers-390.154-clang15-x86.patch
@@ -0,0 +1,29 @@
+Kernel's makefiles pass -Werror=strict-prototypes which
+can trigger errors depending on compiler defaults.
+https://bugs.gentoo.org/870238
+https://github.com/NVIDIA/open-gpu-kernel-modules/issues/377
+--- a/kernel/nvidia/nvlink_linux.c
++++ b/kernel/nvidia/nvlink_linux.c
+@@ -639 +639 @@
+-void * NVLINK_API_CALL nvlink_allocLock()
++void * NVLINK_API_CALL nvlink_allocLock(void)
+--- a/kernel/nvidia/os-interface.c
++++ b/kernel/nvidia/os-interface.c
+@@ -879 +879 @@
+-NV_STATUS NV_API_CALL os_flush_cpu_cache()
++NV_STATUS NV_API_CALL os_flush_cpu_cache(void)
+@@ -886 +886 @@
+-NV_STATUS NV_API_CALL os_flush_cpu_cache_all()
++NV_STATUS NV_API_CALL os_flush_cpu_cache_all(void)
+@@ -944 +944 @@
+-void NV_API_CALL os_flush_cpu_write_combine_buffer()
++void NV_API_CALL os_flush_cpu_write_combine_buffer(void)
+@@ -1073 +1073 @@
+-NvU32 NV_API_CALL os_get_cpu_number()
++NvU32 NV_API_CALL os_get_cpu_number(void)
+@@ -1080 +1080 @@
+-NvU32 NV_API_CALL os_get_cpu_count()
++NvU32 NV_API_CALL os_get_cpu_count(void)
+@@ -1155 +1155 @@
+-void NV_API_CALL os_dump_stack()
++void NV_API_CALL os_dump_stack(void)
diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-390.154-clang15.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-390.154-clang15.patch
new file mode 100644
index 000000000000..b08f35894fd4
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-drivers-390.154-clang15.patch
@@ -0,0 +1,84 @@
+Kernel's makefiles pass -Werror=strict-prototypes which
+can trigger errors depending on compiler defaults.
+https://bugs.gentoo.org/870238
+https://github.com/NVIDIA/open-gpu-kernel-modules/issues/377
+--- a/kernel/nvidia/nvlink_linux.c
++++ b/kernel/nvidia/nvlink_linux.c
+@@ -639 +639 @@
+-void * NVLINK_API_CALL nvlink_allocLock()
++void * NVLINK_API_CALL nvlink_allocLock(void)
+--- a/kernel/nvidia/os-interface.c
++++ b/kernel/nvidia/os-interface.c
+@@ -879 +879 @@
+-NV_STATUS NV_API_CALL os_flush_cpu_cache()
++NV_STATUS NV_API_CALL os_flush_cpu_cache(void)
+@@ -886 +886 @@
+-NV_STATUS NV_API_CALL os_flush_cpu_cache_all()
++NV_STATUS NV_API_CALL os_flush_cpu_cache_all(void)
+@@ -944 +944 @@
+-void NV_API_CALL os_flush_cpu_write_combine_buffer()
++void NV_API_CALL os_flush_cpu_write_combine_buffer(void)
+@@ -1073 +1073 @@
+-NvU32 NV_API_CALL os_get_cpu_number()
++NvU32 NV_API_CALL os_get_cpu_number(void)
+@@ -1080 +1080 @@
+-NvU32 NV_API_CALL os_get_cpu_count()
++NvU32 NV_API_CALL os_get_cpu_count(void)
+@@ -1155 +1155 @@
+-void NV_API_CALL os_dump_stack()
++void NV_API_CALL os_dump_stack(void)
+--- a/kernel/nvidia-uvm/uvm8_lock.c
++++ b/kernel/nvidia-uvm/uvm8_lock.c
+@@ -312 +312 @@
+-bool __uvm_thread_check_all_unlocked()
++bool __uvm_thread_check_all_unlocked(void)
+--- a/kernel/nvidia-uvm/uvm8_perf_heuristics.c
++++ b/kernel/nvidia-uvm/uvm8_perf_heuristics.c
+@@ -29 +29 @@
+-NV_STATUS uvm_perf_heuristics_init()
++NV_STATUS uvm_perf_heuristics_init(void)
+@@ -44 +44 @@
+-void uvm_perf_heuristics_exit()
++void uvm_perf_heuristics_exit(void)
+--- a/kernel/nvidia-uvm/uvm8_perf_prefetch.c
++++ b/kernel/nvidia-uvm/uvm8_perf_prefetch.c
+@@ -462 +462 @@
+-NV_STATUS uvm_perf_prefetch_init()
++NV_STATUS uvm_perf_prefetch_init(void)
+@@ -500 +500 @@
+-void uvm_perf_prefetch_exit()
++void uvm_perf_prefetch_exit(void)
+--- a/kernel/nvidia-uvm/uvm8_perf_thrashing.c
++++ b/kernel/nvidia-uvm/uvm8_perf_thrashing.c
+@@ -1324 +1324 @@
+-NV_STATUS uvm_perf_thrashing_init()
++NV_STATUS uvm_perf_thrashing_init(void)
+@@ -1401 +1401 @@
+-void uvm_perf_thrashing_exit()
++void uvm_perf_thrashing_exit(void)
+--- a/kernel/nvidia-uvm/uvm8_procfs.c
++++ b/kernel/nvidia-uvm/uvm8_procfs.c
+@@ -61 +61 @@
+-NV_STATUS uvm_procfs_init()
++NV_STATUS uvm_procfs_init(void)
+@@ -77 +77 @@
+-void uvm_procfs_exit()
++void uvm_procfs_exit(void)
+@@ -106 +106 @@
+-struct proc_dir_entry *uvm_procfs_get_gpu_base_dir()
++struct proc_dir_entry *uvm_procfs_get_gpu_base_dir(void)
+--- a/kernel/nvidia-uvm/uvm8_push.c
++++ b/kernel/nvidia-uvm/uvm8_push.c
+@@ -103 +103 @@
+-bool uvm_push_info_is_tracking_descriptions()
++bool uvm_push_info_is_tracking_descriptions(void)
+--- a/kernel/nvidia-uvm/uvm8_tools.c
++++ b/kernel/nvidia-uvm/uvm8_tools.c
+@@ -2041 +2041 @@
+-void uvm_tools_flush_events()
++void uvm_tools_flush_events(void)
+--- a/kernel/nvidia-uvm/uvm_common.c
++++ b/kernel/nvidia-uvm/uvm_common.c
+@@ -63 +63 @@
+-bool uvm_debug_prints_enabled()
++bool uvm_debug_prints_enabled(void)
diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-470.141.03-clang15.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-470.141.03-clang15.patch
new file mode 100644
index 000000000000..334f0d1c9b13
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-drivers-470.141.03-clang15.patch
@@ -0,0 +1,110 @@
+Kernel's makefiles pass -Werror=strict-prototypes which
+can trigger errors depending on compiler defaults.
+https://bugs.gentoo.org/870238
+https://github.com/NVIDIA/open-gpu-kernel-modules/issues/377
+--- a/kernel/nvidia/nvlink_linux.c
++++ b/kernel/nvidia/nvlink_linux.c
+@@ -571 +571 @@
+-void * nvlink_allocLock()
++void * nvlink_allocLock(void)
+--- a/kernel/nvidia/os-interface.c
++++ b/kernel/nvidia/os-interface.c
+@@ -1076 +1076 @@
+-NvU32 NV_API_CALL os_get_cpu_number()
++NvU32 NV_API_CALL os_get_cpu_number(void)
+@@ -1083 +1083 @@
+-NvU32 NV_API_CALL os_get_cpu_count()
++NvU32 NV_API_CALL os_get_cpu_count(void)
+@@ -1136 +1136 @@
+-void NV_API_CALL os_dump_stack()
++void NV_API_CALL os_dump_stack(void)
+--- a/kernel/nvidia-uvm/uvm_common.c
++++ b/kernel/nvidia-uvm/uvm_common.c
+@@ -37 +37 @@
+-bool uvm_debug_prints_enabled()
++bool uvm_debug_prints_enabled(void)
+--- a/kernel/nvidia-uvm/uvm_gpu_access_counters.c
++++ b/kernel/nvidia-uvm/uvm_gpu_access_counters.c
+@@ -1527 +1527 @@
+-NV_STATUS uvm_perf_access_counters_init()
++NV_STATUS uvm_perf_access_counters_init(void)
+@@ -1538 +1538 @@
+-void uvm_perf_access_counters_exit()
++void uvm_perf_access_counters_exit(void)
+--- a/kernel/nvidia-uvm/uvm_lock.c
++++ b/kernel/nvidia-uvm/uvm_lock.c
+@@ -337 +337 @@
+-bool __uvm_thread_check_all_unlocked()
++bool __uvm_thread_check_all_unlocked(void)
+--- a/kernel/nvidia-uvm/uvm_migrate.c
++++ b/kernel/nvidia-uvm/uvm_migrate.c
+@@ -795 +795 @@
+-NV_STATUS uvm_migrate_init()
++NV_STATUS uvm_migrate_init(void)
+@@ -821 +821 @@
+-void uvm_migrate_exit()
++void uvm_migrate_exit(void)
+--- a/kernel/nvidia-uvm/uvm_migrate_pageable.c
++++ b/kernel/nvidia-uvm/uvm_migrate_pageable.c
+@@ -979 +979 @@
+-NV_STATUS uvm_migrate_pageable_init()
++NV_STATUS uvm_migrate_pageable_init(void)
+@@ -988 +988 @@
+-void uvm_migrate_pageable_exit()
++void uvm_migrate_pageable_exit(void)
+--- a/kernel/nvidia-uvm/uvm_perf_heuristics.c
++++ b/kernel/nvidia-uvm/uvm_perf_heuristics.c
+@@ -31 +31 @@
+-NV_STATUS uvm_perf_heuristics_init()
++NV_STATUS uvm_perf_heuristics_init(void)
+@@ -50 +50 @@
+-void uvm_perf_heuristics_exit()
++void uvm_perf_heuristics_exit(void)
+--- a/kernel/nvidia-uvm/uvm_perf_prefetch.c
++++ b/kernel/nvidia-uvm/uvm_perf_prefetch.c
+@@ -463 +463 @@
+-NV_STATUS uvm_perf_prefetch_init()
++NV_STATUS uvm_perf_prefetch_init(void)
+@@ -501 +501 @@
+-void uvm_perf_prefetch_exit()
++void uvm_perf_prefetch_exit(void)
+--- a/kernel/nvidia-uvm/uvm_perf_thrashing.c
++++ b/kernel/nvidia-uvm/uvm_perf_thrashing.c
+@@ -1955 +1955 @@
+-NV_STATUS uvm_perf_thrashing_init()
++NV_STATUS uvm_perf_thrashing_init(void)
+@@ -2014 +2014 @@
+-void uvm_perf_thrashing_exit()
++void uvm_perf_thrashing_exit(void)
+--- a/kernel/nvidia-uvm/uvm_procfs.c
++++ b/kernel/nvidia-uvm/uvm_procfs.c
+@@ -49 +49 @@
+-NV_STATUS uvm_procfs_init()
++NV_STATUS uvm_procfs_init(void)
+@@ -69 +69 @@
+-void uvm_procfs_exit()
++void uvm_procfs_exit(void)
+@@ -98 +98 @@
+-struct proc_dir_entry *uvm_procfs_get_gpu_base_dir()
++struct proc_dir_entry *uvm_procfs_get_gpu_base_dir(void)
+@@ -103 +103 @@
+-struct proc_dir_entry *uvm_procfs_get_cpu_base_dir()
++struct proc_dir_entry *uvm_procfs_get_cpu_base_dir(void)
+--- a/kernel/nvidia-uvm/uvm_push.c
++++ b/kernel/nvidia-uvm/uvm_push.c
+@@ -245 +245 @@
+-bool uvm_push_info_is_tracking_descriptions()
++bool uvm_push_info_is_tracking_descriptions(void)
+@@ -250 +250 @@
+-bool uvm_push_info_is_tracking_acquires()
++bool uvm_push_info_is_tracking_acquires(void)
+--- a/kernel/nvidia-uvm/uvm_thread_context.c
++++ b/kernel/nvidia-uvm/uvm_thread_context.c
+@@ -104 +104 @@
+-bool uvm_thread_context_wrapper_is_used()
++bool uvm_thread_context_wrapper_is_used(void)
+--- a/kernel/nvidia-uvm/uvm_tools.c
++++ b/kernel/nvidia-uvm/uvm_tools.c
+@@ -2144 +2144 @@
+-void uvm_tools_flush_events()
++void uvm_tools_flush_events(void)
diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-580.159.03-null-deref.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-580.159.03-null-deref.patch
new file mode 100644
index 000000000000..1e1edfe33569
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-drivers-580.159.03-null-deref.patch
@@ -0,0 +1,57 @@
+This reverts the contents of nvidia-drm-fb.c back to the one used
+by nvidia-drivers-580.126.18 as a temporary fix to avoid a NULL
+dereference sometimes seen when using kwin.
+
+NVIDIA is aware of the issue but no fix have been deployed as of
+the writing of this. Unclear if reverting can cause different
+issues but it is believed to be better than doing nothing.
+
+USE=kernel-open is not known to be affected at the moment, so not
+changing anything for the open variant.
+
+https://bugs.gentoo.org/971109
+https://forums.developer.nvidia.com/t/363409
+--- a/kernel/nvidia-drm/nvidia-drm-fb.c
++++ b/kernel/nvidia-drm/nvidia-drm-fb.c
+@@ -64,7 +64,5 @@
+ /* Free NvKmsKapiSurface associated with this framebuffer object */
+
+- if (nv_fb->pSurface != NULL) {
+- nvKms->destroySurface(nv_dev->pDevice, nv_fb->pSurface);
+- }
++ nvKms->destroySurface(nv_dev->pDevice, nv_fb->pSurface);
+
+ __nv_drm_framebuffer_free(nv_fb);
+@@ -142,5 +140,4 @@
+ struct nv_drm_gem_object *nv_gem;
+ struct drm_framebuffer *fb = &nv_fb->base;
+- bool non_scanout_mem_backed = false;
+ uint32_t i;
+ int ret;
+@@ -164,8 +161,4 @@
+ params.planes[i].offset = fb->offsets[i];
+ params.planes[i].pitch = fb->pitches[i];
+-
+- if (!nvKms->isVidmem(nv_gem->pMemory) && nv_dev->hasVideoMemory) {
+- non_scanout_mem_backed = true;
+- }
+ }
+ }
+@@ -234,13 +227,8 @@
+ /* Create NvKmsKapiSurface */
+
+- if (non_scanout_mem_backed) {
+- /* Do not register drm_framebuffer against nvkms */
+- nv_fb->pSurface = NULL;
+- } else {
+- nv_fb->pSurface = nvKms->createSurface(nv_dev->pDevice, &params);
+- if (nv_fb->pSurface == NULL) {
+- NV_DRM_DEV_DEBUG_DRIVER(nv_dev, "Failed to create NvKmsKapiSurface");
+- goto fail;
+- }
++ nv_fb->pSurface = nvKms->createSurface(nv_dev->pDevice, &params);
++ if (nv_fb->pSurface == NULL) {
++ NV_DRM_DEV_DEBUG_DRIVER(nv_dev, "Failed to create NvKmsKapiSurface");
++ goto fail;
+ }
+
diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drm-outputclass-390.conf b/x11-drivers/nvidia-drivers/files/nvidia-drm-outputclass-390.conf
new file mode 100644
index 000000000000..f459c69dad8d
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-drm-outputclass-390.conf
@@ -0,0 +1,7 @@
+Section "OutputClass"
+ Identifier "nvidia"
+ MatchDriver "nvidia-drm"
+ Driver "nvidia"
+ Option "AllowEmptyInitialConfiguration"
+ ModulePath "@LIBDIR@/extensions/nvidia"
+EndSection
diff --git a/x11-drivers/nvidia-drivers/files/nvidia-kernel-module-source-515.86.01-raw-ldflags.patch b/x11-drivers/nvidia-drivers/files/nvidia-kernel-module-source-515.86.01-raw-ldflags.patch
new file mode 100644
index 000000000000..9185ec0f33ce
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-kernel-module-source-515.86.01-raw-ldflags.patch
@@ -0,0 +1,13 @@
+Need to pass ABI flags if LD is ld.lld for USE=kernel-open
+ld.lld: error: target emulation unknown: -m or at least one .o file required
+
+https://bugs.gentoo.org/885483
+https://github.com/NVIDIA/open-gpu-kernel-modules/issues/405
+https://github.com/NVIDIA/open-gpu-kernel-modules/issues/214
+--- a/kernel-module-source/utils.mk
++++ b/kernel-module-source/utils.mk
+@@ -556,3 +556,3 @@
+ $(at_if_quiet)cd $$(dir $(1)); \
+- $$(call quiet_cmd_no_at,LD) -r -z noexecstack --format=binary \
++ $$(call quiet_cmd_no_at,LD) $$(RAW_LDFLAGS) -r -z noexecstack --format=binary \
+ $$(notdir $(1)) -o $$(OUTPUTDIR_ABSOLUTE)/$$(notdir $$@)
diff --git a/x11-drivers/nvidia-drivers/files/nvidia-modprobe-390.141-uvm-perms.patch b/x11-drivers/nvidia-drivers/files/nvidia-modprobe-390.141-uvm-perms.patch
new file mode 100644
index 000000000000..6ffd42ff77ea
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-modprobe-390.141-uvm-perms.patch
@@ -0,0 +1,12 @@
+Create /dev/nvidia-uvm* by respecting nvidia.conf's permissions.
+--- a/nvidia-modprobe/modprobe-utils/nvidia-modprobe-utils.c
++++ b/nvidia-modprobe/modprobe-utils/nvidia-modprobe-utils.c
+@@ -742,6 +742,6 @@
+ }
+
+- return mknod_helper(major, base_minor, NV_UVM_DEVICE_NAME, NULL) &&
+- mknod_helper(major, base_minor + 1, NV_UVM_TOOLS_DEVICE_NAME, NULL);
++ return mknod_helper(major, base_minor, NV_UVM_DEVICE_NAME, NV_PROC_REGISTRY_PATH) &&
++ mknod_helper(major, base_minor + 1, NV_UVM_TOOLS_DEVICE_NAME, NV_PROC_REGISTRY_PATH);
+ }
+
diff --git a/x11-drivers/nvidia-drivers/files/nvidia-persistenced.confd b/x11-drivers/nvidia-drivers/files/nvidia-persistenced.confd
new file mode 100644
index 000000000000..e06d53c0c98d
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-persistenced.confd
@@ -0,0 +1,7 @@
+# configuration file for /etc/init.d/nvidia-persistenced
+
+# NVPD_USER: user to run as, needs access to /dev/nvidia* (video group)
+NVPD_USER="nvpd"
+
+# ARGS: additional arguments, see nvidia-persistenced(1)
+ARGS=""
diff --git a/x11-drivers/nvidia-drivers/files/nvidia-persistenced.initd b/x11-drivers/nvidia-drivers/files/nvidia-persistenced.initd
new file mode 100644
index 000000000000..27d8bb37d98a
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-persistenced.initd
@@ -0,0 +1,11 @@
+#!/sbin/openrc-run
+# SPDX-License-Identifier: MIT
+
+description="Maintain persistent software state in the NVIDIA driver"
+command="nvidia-persistenced"
+command_args="${NVPD_USER:+--user ${NVPD_USER}} ${ARGS}"
+pidfile="/var/run/nvidia-persistenced/nvidia-persistenced.pid"
+
+stop_post() {
+ rmdir "${pidfile%/*}" 2>/dev/null || true
+}
diff --git a/x11-drivers/nvidia-drivers/files/nvidia-powerd.initd b/x11-drivers/nvidia-drivers/files/nvidia-powerd.initd
new file mode 100644
index 000000000000..5132a20c6539
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-powerd.initd
@@ -0,0 +1,11 @@
+#!/sbin/openrc-run
+# SPDX-License-Identifier: MIT
+
+description="Support for NVIDIA Dynamic Boost (only for use with specific laptops)"
+command="nvidia-powerd"
+command_background=true
+pidfile="/var/run/nvidia-powerd.pid"
+
+depend() {
+ need dbus
+}
diff --git a/x11-drivers/nvidia-drivers/files/nvidia-settings-390.141-fno-common.patch b/x11-drivers/nvidia-drivers/files/nvidia-settings-390.141-fno-common.patch
new file mode 100644
index 000000000000..499e969bf23a
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-settings-390.141-fno-common.patch
@@ -0,0 +1,16 @@
+Fix compilation with -fno-common or gcc10
+https://bugs.gentoo.org/706742
+--- a/nvidia-settings/src/gtk+-2.x/ctkvdpau.c
++++ b/nvidia-settings/src/gtk+-2.x/ctkvdpau.c
+@@ -105,2 +105,4 @@
+
++struct VDPAUDeviceImpl VDPAUDeviceFunctions;
++
+ static int queryOutputSurface(CtkVDPAU *ctk_vdpau, VdpDevice device,
+--- a/nvidia-settings/src/gtk+-2.x/ctkvdpau.h
++++ b/nvidia-settings/src/gtk+-2.x/ctkvdpau.h
+@@ -48,3 +48,3 @@
+
+-struct VDPAUDeviceImpl {
++extern struct VDPAUDeviceImpl {
+
diff --git a/x11-drivers/nvidia-drivers/files/nvidia-settings-390.144-desktop.patch b/x11-drivers/nvidia-drivers/files/nvidia-settings-390.144-desktop.patch
new file mode 100644
index 000000000000..a00545ad6044
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-settings-390.144-desktop.patch
@@ -0,0 +1,12 @@
+For icon: https://github.com/NVIDIA/nvidia-settings/pull/56
+--- a/nvidia-settings/doc/nvidia-settings.desktop
++++ b/nvidia-settings/doc/nvidia-settings.desktop
+@@ -5,5 +5,5 @@
+ Comment=Configure NVIDIA X Server Settings
+-Exec=__UTILS_PATH__/nvidia-settings
+-Icon=__PIXMAP_PATH__/nvidia-settings.png
+-Categories=__NVIDIA_SETTINGS_DESKTOP_CATEGORIES__
++Exec=nvidia-settings
++Icon=nvidia-settings
++Categories=System;HardwareSettings;
+
diff --git a/x11-drivers/nvidia-drivers/files/nvidia-settings-390.144-no-gtk2.patch b/x11-drivers/nvidia-drivers/files/nvidia-settings-390.144-no-gtk2.patch
new file mode 100644
index 000000000000..d1689ee27280
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-settings-390.144-no-gtk2.patch
@@ -0,0 +1,11 @@
+--- a/nvidia-settings/src/Makefile
++++ b/nvidia-settings/src/Makefile
+@@ -132,3 +132,2 @@
+ GTK2LIB_DIR = $(OUTPUTDIR)/gtk2
+-GTK2LIB = $(OUTPUTDIR)/$(GTK2LIB_NAME)
+ GTK2LIB_SONAME = $(GTK2LIB_NAME).$(NVIDIA_SETTINGS_VERSION)
+@@ -276,4 +275,2 @@
+ $(MKDIR) $(LIBDIR)
+- $(INSTALL) $(INSTALL_LIB_ARGS) $(GTK2LIB) \
+- $(LIBDIR)/$(GTK2LIB_SONAME)
+ ifdef BUILD_GTK3LIB
diff --git a/x11-drivers/nvidia-drivers/files/nvidia-settings-390.144-raw-ldflags.patch b/x11-drivers/nvidia-drivers/files/nvidia-settings-390.144-raw-ldflags.patch
new file mode 100644
index 000000000000..f815dadce704
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-settings-390.144-raw-ldflags.patch
@@ -0,0 +1,9 @@
+Currently need to pass ABI flags if LD is ld.lld for USE=tools
+ld.lld: error: target emulation unknown: -m or at least one .o file required
+--- a/nvidia-settings/utils.mk
++++ b/nvidia-settings/utils.mk
+@@ -477,3 +477,3 @@
+ $(at_if_quiet)cd $$(dir $(1)); \
+- $$(call quiet_cmd_no_at,LD) -r -z noexecstack --format=binary \
++ $$(call quiet_cmd_no_at,LD) $$(RAW_LDFLAGS) -r -z noexecstack --format=binary \
+ $$(notdir $(1)) -o $$(OUTPUTDIR_ABSOLUTE)/$$(notdir $$@)
diff --git a/x11-drivers/nvidia-drivers/files/nvidia-settings-530.30.02-desktop.patch b/x11-drivers/nvidia-drivers/files/nvidia-settings-530.30.02-desktop.patch
new file mode 100644
index 000000000000..d1cdbcec448a
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-settings-530.30.02-desktop.patch
@@ -0,0 +1,11 @@
+These __PLACEHOLDER__ are replaced by nvidia-installer which we don't use.
+--- a/nvidia-settings/doc/nvidia-settings.desktop
++++ b/nvidia-settings/doc/nvidia-settings.desktop
+@@ -5,5 +5,5 @@
+ Comment=Configure NVIDIA X Server Settings
+-Exec=__UTILS_PATH__/nvidia-settings
++Exec=nvidia-settings
+ Icon=nvidia-settings
+-Categories=__NVIDIA_SETTINGS_DESKTOP_CATEGORIES__
++Categories=System;HardwareSettings;
+
diff --git a/x11-drivers/nvidia-drivers/files/system-sleep.elogind b/x11-drivers/nvidia-drivers/files/system-sleep.elogind
new file mode 100644
index 000000000000..d36e2697b86c
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/system-sleep.elogind
@@ -0,0 +1,7 @@
+#!/bin/sh
+case ${1-} in
+ pre) nvidia-sleep.sh suspend;;
+ # run in background given resume is flaky if elogind did not finish
+ post) nvidia-sleep.sh resume &;;
+ *) exit 1;;
+esac
diff --git a/x11-drivers/nvidia-drivers/metadata.xml b/x11-drivers/nvidia-drivers/metadata.xml
new file mode 100644
index 000000000000..75a44bfaa124
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/metadata.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>ionen@gentoo.org</email>
+ <name>Ionen Wolkens</name>
+ </maintainer>
+ <maintainer type="person">
+ <email>soap@gentoo.org</email>
+ <name>David Seifert</name>
+ </maintainer>
+ <use>
+ <flag name="kernel-open">
+ Use the open source variant of the drivers (only
+ works for Turing/Ampere or newer GPUs, aka GTX 1650+
+ -- recommended with &gt;=560.xx drivers if usable and
+ is *required* for 50xx Blackwell or newer GPUs --
+ always-enabled regardless of USE in &gt;=595.xx)
+ </flag>
+ <flag name="persistenced">Install the persistence daemon for keeping devices state when unused (e.g. for headless)</flag>
+ <flag name="powerd">Install the NVIDIA dynamic boost support daemon (only useful with specific laptops, ignore if unsure)</flag>
+ <flag name="static-libs">Install the XNVCtrl static library for accessing sensors and other features</flag>
+ <flag name="tools">Install additional tools such as nvidia-settings</flag>
+ </use>
+ <upstream>
+ <remote-id type="cpe">cpe:/a:nvidia:gpu_driver</remote-id>
+ </upstream>
+ <slots>
+ <subslots>
+ Subslot is primarily used to identify branches, at most
+ rebuilding reverse dependencies on bumps would only be
+ for the static library (not essential to) given other
+ headers are provided by nvidia-cuda-toolkit instead.
+ </subslots>
+ </slots>
+ <origin>baldeagleos-repo</origin>
+</pkgmetadata>
diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-390.157.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-390.157.ebuild
new file mode 100644
index 000000000000..3c7dd26989b7
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-390.157.ebuild
@@ -0,0 +1,452 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+MODULES_OPTIONAL_IUSE=+modules
+inherit desktop dot-a eapi9-pipestatus flag-o-matic linux-mod-r1 multilib
+inherit readme.gentoo-r1 systemd toolchain-funcs unpacker user-info
+
+MODULES_KERNEL_MAX=6.1
+NV_URI="https://download.nvidia.com/XFree86/"
+
+DESCRIPTION="NVIDIA Accelerated Graphics Driver"
+HOMEPAGE="https://www.nvidia.com/"
+SRC_URI="
+ amd64? ( ${NV_URI}Linux-x86_64/${PV}/NVIDIA-Linux-x86_64-${PV}.run )
+ x86? ( ${NV_URI}Linux-x86/${PV}/NVIDIA-Linux-x86-${PV}.run )
+ $(printf "${NV_URI}%s/%s-${PV}.tar.bz2 " \
+ nvidia-{installer,modprobe,persistenced,settings,xconfig}{,})
+"
+# nvidia-installer is unused but here for GPL-2's "distribute sources"
+S=${WORKDIR}
+
+LICENSE="NVIDIA-r2 BSD BSD-2 GPL-2 MIT"
+SLOT="0/${PV%%.*}"
+KEYWORDS="-* amd64 x86"
+IUSE="+X abi_x86_32 abi_x86_64 persistenced +static-libs +tools"
+
+COMMON_DEPEND="
+ acct-group/video
+ persistenced? (
+ acct-user/nvpd
+ net-libs/libtirpc:=
+ )
+ tools? (
+ >=app-accessibility/at-spi2-core-2.46:2
+ dev-libs/glib:2
+ dev-libs/jansson:=
+ media-libs/harfbuzz:=
+ x11-libs/cairo
+ x11-libs/gdk-pixbuf:2
+ x11-libs/gtk+:3[X]
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/libXxf86vm
+ x11-libs/pango
+ )
+"
+RDEPEND="
+ ${COMMON_DEPEND}
+ sys-libs/glibc
+ X? (
+ media-libs/libglvnd[X,abi_x86_32(-)?]
+ x11-libs/libX11[abi_x86_32(-)?]
+ x11-libs/libXext[abi_x86_32(-)?]
+ )
+"
+DEPEND="
+ ${COMMON_DEPEND}
+ static-libs? (
+ x11-base/xorg-proto
+ x11-libs/libX11
+ x11-libs/libXext
+ )
+ tools? (
+ media-libs/libglvnd
+ sys-apps/dbus
+ x11-base/xorg-proto
+ x11-libs/libXrandr
+ x11-libs/libXv
+ x11-libs/libvdpau
+ )
+"
+BDEPEND="
+ sys-devel/m4
+ virtual/pkgconfig
+"
+
+# there is some non-prebuilt exceptions but rather not maintain a list
+QA_PREBUILT="usr/bin/* usr/lib*"
+
+PATCHES=(
+ # note: no plans to add patches for newer kernels here, when the last
+ # working 6.1.x LTS is EOL then 390 will simply be removed from the tree
+ "${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch
+ "${FILESDIR}"/nvidia-settings-390.141-fno-common.patch
+ "${FILESDIR}"/nvidia-settings-390.144-desktop.patch
+ "${FILESDIR}"/nvidia-settings-390.144-no-gtk2.patch
+ "${FILESDIR}"/nvidia-settings-390.144-raw-ldflags.patch
+)
+
+pkg_setup() {
+ use modules && [[ ${MERGE_TYPE} != binary ]] || return
+
+ local CONFIG_CHECK="
+ PROC_FS
+ ~DRM_KMS_HELPER
+ ~SYSVIPC
+ ~!AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT
+ ~!LOCKDEP
+ ~!X86_KERNEL_IBT
+ !DEBUG_MUTEXES
+ "
+
+ local ERROR_DRM_KMS_HELPER="CONFIG_DRM_KMS_HELPER: is not set but needed for Xorg auto-detection
+ of drivers (no custom config), and optional nvidia-drm.modeset=1.
+ With 390.xx drivers, also used by a GLX workaround needed for OpenGL.
+ Cannot be directly selected in the kernel's menuconfig, and may need
+ selection of a DRM device even if unused, e.g. CONFIG_DRM_AMDGPU=m or
+ DRM_I915=y, DRM_NOUVEAU=m also acceptable if a module and not built-in."
+
+ local ERROR_X86_KERNEL_IBT="CONFIG_X86_KERNEL_IBT: is set and, if the CPU supports the feature,
+ this will likely lead to modules load failure with ENDBR errors.
+ Please ignore if not having issues, but otherwise try to unset or
+ pass ibt=off to the kernel's command line." #911142
+
+ kernel_is -ge 5 8 && CONFIG_CHECK+=" X86_PAT" #817764
+
+ linux-mod-r1_pkg_setup
+}
+
+src_prepare() {
+ # make patches usable across versions
+ rm nvidia-modprobe && mv nvidia-modprobe{-${PV},} || die
+ rm nvidia-persistenced && mv nvidia-persistenced{-${PV},} || die
+ rm nvidia-settings && mv nvidia-settings{-${PV},} || die
+ rm nvidia-xconfig && mv nvidia-xconfig{-${PV},} || die
+
+ eapply "${FILESDIR}"/nvidia-drivers-390.154-clang15$(usev {,-}x86).patch
+
+ default
+
+ # prevent detection of incomplete kernel DRM support (bug #603818)
+ sed 's/defined(CONFIG_DRM/defined(CONFIG_DRM_KMS_HELPER/g' \
+ -i kernel/conftest.sh || die
+
+ sed 's/__USER__/nvpd/' \
+ nvidia-persistenced/init/systemd/nvidia-persistenced.service.template \
+ > "${T}"/nvidia-persistenced.service || die
+
+ # use alternative vulkan icd option if USE=-X (bug #909181)
+ sed "s/__NV_VK_ICD__/lib$(usex X GLX EGL)_nvidia.so.0/" \
+ nvidia_icd.json.template > nvidia_icd.json || die
+
+ # 390 has legacy glx needing a modified .conf (bug #713546)
+ # directory is not quite right, but kept for any existing custom xorg.conf
+ sed "s|@LIBDIR@|${EPREFIX}/usr/$(get_libdir)|" \
+ "${FILESDIR}"/nvidia-drm-outputclass-390.conf > nvidia-drm-outputclass.conf || die
+}
+
+src_compile() {
+ tc-export AR CC CXX LD OBJCOPY OBJDUMP PKG_CONFIG
+ local -x RAW_LDFLAGS="$(get_abi_LDFLAGS) $(raw-ldflags)" # raw-ldflags.patch
+
+ use static-libs && lto-guarantee-fat
+
+ # dead branch that will never be fixed and due for eventual removal,
+ # so keeping lazy "fixes" (bug #921370)
+ local kcflags=(
+ -std=gnu17
+ -Wno-error=implicit-function-declaration
+ -Wno-error=incompatible-pointer-types
+ )
+ # not *FLAGS to ensure it's used everywhere including conftest.sh
+ CC+=" $(test-flags-CC "${kcflags[@]}")"
+ use modules && KERNEL_CC+=" $(CC=${KERNEL_CC} test-flags-CC "${kcflags[@]}")"
+
+ NV_ARGS=(
+ PREFIX="${EPREFIX}"/usr
+ HOST_CC="$(tc-getBUILD_CC)"
+ HOST_LD="$(tc-getBUILD_LD)"
+ NV_USE_BUNDLED_LIBJANSSON=0
+ NV_VERBOSE=1 DO_STRIP= MANPAGE_GZIP= OUTPUTDIR=out
+ )
+
+ local modlist=( nvidia{,-drm,-modeset}=video:kernel )
+ use x86 || modlist+=( nvidia-uvm=video:kernel )
+ local modargs=(
+ CC="${KERNEL_CC}" # for the above kcflags workarounds
+ IGNORE_CC_MISMATCH=yes NV_VERBOSE=1
+ SYSOUT="${KV_OUT_DIR}" SYSSRC="${KV_DIR}"
+ )
+
+ # temporary workaround for bug #914468
+ use modules && addpredict "${KV_OUT_DIR}"
+
+ linux-mod-r1_src_compile
+
+ if use persistenced; then
+ # 390.xx persistenced does not auto-detect libtirpc
+ LIBS=$(${PKG_CONFIG} --libs libtirpc || die) \
+ common_cflags=$(${PKG_CONFIG} --cflags libtirpc || die) \
+ emake "${NV_ARGS[@]}" -C nvidia-persistenced
+ fi
+
+ emake "${NV_ARGS[@]}" -C nvidia-modprobe
+ use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig
+
+ if use tools; then
+ # avoid noisy *very* noisy logs with deprecation warnings
+ CFLAGS="-Wno-deprecated-declarations ${CFLAGS}" \
+ emake "${NV_ARGS[@]}" -C nvidia-settings
+ elif use static-libs; then
+ emake "${NV_ARGS[@]}" -C nvidia-settings/src build-xnvctrl
+ fi
+}
+
+src_install() {
+ local libdir=$(get_libdir) libdir32=$(ABI=x86 get_libdir)
+
+ NV_ARGS+=( DESTDIR="${D}" LIBDIR="${ED}"/usr/${libdir} )
+
+ local -A paths=(
+ [APPLICATION_PROFILE]=/usr/share/nvidia
+ [CUDA_ICD]=/etc/OpenCL/vendors
+ [EGL_EXTERNAL_PLATFORM_JSON]=/usr/share/egl/egl_external_platform.d
+ [GLVND_EGL_ICD_JSON]=/usr/share/glvnd/egl_vendor.d
+ [VULKAN_ICD_JSON]=/usr/share/vulkan/icd.d
+ [XORG_OUTPUTCLASS_CONFIG]=/usr/share/X11/xorg.conf.d
+
+ [GLX_MODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules/extensions
+ [GLX_MODULE_SYMLINK]=/usr/${libdir}/extensions/nvidia
+ [XMODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules
+ [XMODULE_SYMLINK]=/usr/${libdir}/xorg/modules
+ )
+
+ local skip_files=(
+ $(usev !X "libGLX_nvidia libglx libnvidia-ifr")
+ libGLX_indirect # non-glvnd unused fallback
+ libnvidia-gtk nvidia-{settings,xconfig} # built from source
+ libnvidia-egl-wayland 10_nvidia_wayland # gui-libs/egl-wayland
+ )
+ local skip_modules=(
+ $(usev !X "nvfbc vdpau xdriver")
+ installer nvpd # handled separately / built from source
+ )
+ local skip_types=(
+ GLVND_LIB GLVND_SYMLINK EGL_CLIENT.\* GLX_CLIENT.\* # media-libs/libglvnd
+ OPENCL_WRAPPER.\* # virtual/opencl
+ DOCUMENTATION DOT_DESKTOP # handled separately
+ XMODULE_NEWSYM # use xorg's libwfb.so, nvidia also keeps it if it exists
+ .\*_SRC DKMS_CONF LIBGL_LA OPENGL_HEADER # unused
+ )
+
+ local DOCS=(
+ README.txt NVIDIA_Changelog
+ nvidia-settings/doc/{FRAMELOCK,NV-CONTROL-API}.txt
+ )
+ local HTML_DOCS=( html/. )
+ einstalldocs
+
+ local DISABLE_AUTOFORMATTING=yes
+ local DOC_CONTENTS="\
+Trusted users should be in the 'video' group to use NVIDIA devices.
+You can add yourself by using: gpasswd -a my-user video\
+$(usev modules "
+
+Like all out-of-tree kernel modules, it is necessary to rebuild
+${PN} after upgrading or rebuilding the Linux kernel
+by for example running \`emerge @module-rebuild\`. Alternatively,
+if using a distribution kernel (sys-kernel/gentoo-kernel{,-bin}),
+this can be automated by setting USE=dist-kernel globally.
+
+Loaded kernel modules also must not mismatch with the installed
+${PN} version (excluding -r revision), meaning should
+ensure \`eselect kernel list\` points to the kernel that will be
+booted before building and preferably reboot after upgrading
+${PN} (the ebuild will emit a warning if mismatching).
+
+See '${EPREFIX}/etc/modprobe.d/nvidia.conf' for modules options.")\
+$(use amd64 && usev !abi_x86_32 "
+
+Note that without USE=abi_x86_32 on ${PN}, 32bit applications
+(typically using wine / steam) will not be able to use GPU acceleration.")\
+$(usev X "
+
+390.xx libglvnd support is partial and requires different Xorg modules
+for working OpenGL/GLX. If using the default Xorg configuration these
+should be used automatically, otherwise manually add the ModulePath
+from: '${EPREFIX}/${paths[XORG_OUTPUTCLASS_CONFIG]#/}/nvidia-drm-outputclass.conf'")\
+$(usev x86 "
+
+Note that NVIDIA is no longer offering support for the unified memory
+module (nvidia-uvm) on x86 (32bit), as such the module is missing.
+This means OpenCL/CUDA (and related, like nvenc) cannot be used.
+Other functions, like OpenGL, will continue to work.")
+
+Support from NVIDIA for 390.xx will end in December 2022, how long
+Gentoo will be able to reasonably support it beyond that is unknown.
+If wish to continue using this hardware, should consider switching
+to the Nouveau open source driver.
+https://nvidia.custhelp.com/app/answers/detail/a_id/3142/
+
+For additional information or for troubleshooting issues, please see
+https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers and NVIDIA's own
+documentation that is installed alongside this README."
+ readme.gentoo_create_doc
+
+ if use modules; then
+ linux-mod-r1_src_install
+
+ insinto /etc/modprobe.d
+ newins "${FILESDIR}"/nvidia-390.conf nvidia.conf
+ fi
+
+ emake "${NV_ARGS[@]}" -C nvidia-modprobe install
+ fowners :video /usr/bin/nvidia-modprobe #505092
+ fperms 4710 /usr/bin/nvidia-modprobe
+
+ if use persistenced; then
+ emake "${NV_ARGS[@]}" -C nvidia-persistenced install
+ newconfd "${FILESDIR}"/nvidia-persistenced.confd nvidia-persistenced
+ newinitd "${FILESDIR}"/nvidia-persistenced.initd nvidia-persistenced
+ systemd_dounit "${T}"/nvidia-persistenced.service
+ fi
+
+ if use tools; then
+ emake "${NV_ARGS[@]}" -C nvidia-settings install
+
+ doicon nvidia-settings/doc/nvidia-settings.png
+ domenu nvidia-settings/doc/nvidia-settings.desktop
+
+ exeinto /etc/X11/xinit/xinitrc.d
+ newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
+ fi
+
+ if use static-libs; then
+ dolib.a nvidia-settings/src/libXNVCtrl/libXNVCtrl.a
+ strip-lto-bytecode
+
+ insinto /usr/include/NVCtrl
+ doins nvidia-settings/src/libXNVCtrl/NVCtrl{Lib,}.h
+ fi
+
+ use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig install
+
+ # mimic nvidia-installer by reading .manifest to install files
+ # 0:file 1:perms 2:type 3+:subtype/arguments -:module
+ local m into
+ while IFS=' ' read -ra m; do
+ ! [[ ${#m[@]} -ge 2 && ${m[-1]} =~ MODULE: ]] ||
+ [[ " ${m[0]##*/}" =~ ^(\ ${skip_files[*]/%/.*|\\} )$ ]] ||
+ [[ " ${m[2]}" =~ ^(\ ${skip_types[*]/%/|\\} )$ ]] ||
+ has ${m[-1]#MODULE:} "${skip_modules[@]}" && continue
+
+ case ${m[2]} in
+ MANPAGE)
+ gzip -dc ${m[0]} | newman - ${m[0]%.gz}
+ pipestatus || die
+ continue
+ ;;
+ GLX_MODULE_SYMLINK|XMODULE_NEWSYM)
+ # messy symlinks for non-glvnd xorg modules overrides put
+ # in a different directory to avoid collisions (390-only)
+ m[4]=../../xorg/modules/${m[3]#/}${m[4]}
+ m[3]=/
+ ;;
+ TLS_LIB) [[ ${m[4]} == CLASSIC ]] && continue;; # segfaults (bug #785289)
+ VDPAU_SYMLINK) m[4]=vdpau/; m[5]=${m[5]#vdpau/};; # .so to vdpau/
+ VULKAN_ICD_JSON) m[0]=${m[0]%.template};;
+ esac
+
+ if [[ -v 'paths[${m[2]}]' ]]; then
+ into=${paths[${m[2]}]}
+ elif [[ ${m[2]} == *_BINARY ]]; then
+ into=/usr/bin
+ elif [[ ${m[3]} == COMPAT32 ]]; then
+ use abi_x86_32 || continue
+ into=/usr/${libdir32}
+ elif [[ ${m[2]} == *_@(LIB|SYMLINK) ]]; then
+ into=/usr/${libdir}
+ else
+ die "No known installation path for ${m[0]}"
+ fi
+ [[ ${m[3]: -2} == ?/ ]] && into+=/${m[3]%/}
+ [[ ${m[4]: -2} == ?/ ]] && into+=/${m[4]%/}
+
+ if [[ ${m[2]} =~ _SYMLINK$|_NEWSYM$ ]]; then
+ [[ ${m[4]: -1} == / ]] && m[4]=${m[5]}
+ dosym ${m[4]} ${into}/${m[0]}
+ continue
+ fi
+
+ printf -v m[1] %o $((m[1] | 0200)) # 444->644
+ insopts -m${m[1]}
+ insinto ${into}
+ doins ${m[0]}
+ done < .manifest || die
+ insopts -m0644 # reset
+
+ # MODULE:installer non-skipped extras
+ dolib.so libnvidia-cfg.so.${PV}
+ dosym libnvidia-cfg.so.${PV} /usr/${libdir}/libnvidia-cfg.so.1
+ dosym libnvidia-cfg.so.${PV} /usr/${libdir}/libnvidia-cfg.so
+
+ dobin nvidia-bug-report.sh
+
+ # symlink non-versioned so nvidia-settings can use it even if misdetected
+ dosym nvidia-application-profiles-${PV}-key-documentation \
+ ${paths[APPLICATION_PROFILE]}/nvidia-application-profiles-key-documentation
+
+ # sandbox issues with /dev/nvidiactl are widespread and sometime
+ # affect revdeps of packages built with USE=opencl/cuda making it
+ # hard to manage in ebuilds (minimal set, ebuilds should handle
+ # manually if need others or addwrite)
+ insinto /etc/sandbox.d
+ newins - 20nvidia <<<'SANDBOX_PREDICT="/dev/nvidiactl"'
+
+ # dracut does not use /etc/modprobe.d if hostonly=no, but want to make sure
+ # our settings are used for bug 932781#c8 and nouveau blacklist if either
+ # modules are included (however, just best-effort without initramfs regen)
+ if use modules; then
+ echo "install_items+=\" ${EPREFIX}/etc/modprobe.d/nvidia.conf \"" >> \
+ "${ED}"/usr/lib/dracut/dracut.conf.d/10-${PN}.conf || die
+ fi
+}
+
+pkg_preinst() {
+ use modules || return
+
+ # set video group id based on live system (bug #491414)
+ local g=$(egetent group video | cut -d: -f3)
+ [[ ${g} =~ ^[0-9]+$ ]] || die "Failed to determine video group id (got '${g}')"
+ sed -i "s/@VIDEOGID@/${g}/" "${ED}"/etc/modprobe.d/nvidia.conf || die
+}
+
+pkg_postinst() {
+ linux-mod-r1_pkg_postinst
+
+ readme.gentoo_print_elog
+
+ if [[ -r /proc/driver/nvidia/version &&
+ $(</proc/driver/nvidia/version) != *" ${PV} "* ]]; then
+ ewarn "\nCurrently loaded NVIDIA modules do not match the newly installed"
+ ewarn "libraries and may prevent launching GPU-accelerated applications."
+ if use modules; then
+ ewarn "Easiest way to fix this is normally to reboot. If still run into issues"
+ ewarn "(e.g. API mismatch messages in the \`dmesg\` output), please verify"
+ ewarn "that the running kernel is ${KV_FULL} and that (if used) the"
+ ewarn "initramfs does not include NVIDIA modules (or at least, not old ones)."
+ fi
+ fi
+
+ ewarn "\nBe warned/reminded that the 390.xx branch reached end-of-life and"
+ ewarn "NVIDIA is no longer fixing issues (including security). Free to keep"
+ ewarn "using (for now) but it is recommended to either switch to nouveau or"
+ ewarn "replace hardware. Will be kept in-tree while possible, but expect it"
+ ewarn "to be removed likely in late 2027 or earlier if major issues arise."
+ ewarn "\nNote that there is no plans to patch in support for kernels branches"
+ ewarn "newer than 6.1.x which will be supported upstream until December 2027"
+ ewarn "albeit its support *could* end earlier in Gentoo."
+}
diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-470.256.02-r2.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-470.256.02-r2.ebuild
new file mode 100644
index 000000000000..3c7de626aa88
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-470.256.02-r2.ebuild
@@ -0,0 +1,486 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+MODULES_OPTIONAL_IUSE=+modules
+inherit desktop dot-a eapi9-pipestatus flag-o-matic linux-mod-r1 multilib
+inherit readme.gentoo-r1 systemd toolchain-funcs unpacker user-info
+
+MODULES_KERNEL_MAX=6.6
+NV_URI="https://download.nvidia.com/XFree86/"
+
+DESCRIPTION="NVIDIA Accelerated Graphics Driver"
+HOMEPAGE="https://www.nvidia.com/"
+SRC_URI="
+ ${NV_URI}Linux-x86_64/${PV}/NVIDIA-Linux-x86_64-${PV}.run
+ $(printf "${NV_URI}%s/%s-${PV}.tar.bz2 " \
+ nvidia-{installer,modprobe,persistenced,settings,xconfig}{,})
+"
+# nvidia-installer is unused but here for GPL-2's "distribute sources"
+S=${WORKDIR}
+
+LICENSE="NVIDIA-r2 BSD BSD-2 GPL-2 MIT ZLIB curl openssl"
+SLOT="0/${PV%%.*}"
+KEYWORDS="-* amd64"
+IUSE="+X abi_x86_32 abi_x86_64 persistenced +static-libs +tools"
+
+COMMON_DEPEND="
+ acct-group/video
+ persistenced? (
+ acct-user/nvpd
+ net-libs/libtirpc:=
+ )
+ tools? (
+ >=app-accessibility/at-spi2-core-2.46:2
+ dev-libs/glib:2
+ dev-libs/jansson:=
+ media-libs/harfbuzz:=
+ x11-libs/cairo
+ x11-libs/gdk-pixbuf:2
+ x11-libs/gtk+:3[X]
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/libXxf86vm
+ x11-libs/pango
+ )
+"
+RDEPEND="
+ ${COMMON_DEPEND}
+ sys-libs/glibc
+ X? (
+ media-libs/libglvnd[X,abi_x86_32(-)?]
+ x11-libs/libX11[abi_x86_32(-)?]
+ x11-libs/libXext[abi_x86_32(-)?]
+ )
+"
+DEPEND="
+ ${COMMON_DEPEND}
+ static-libs? (
+ x11-base/xorg-proto
+ x11-libs/libX11
+ x11-libs/libXext
+ )
+ tools? (
+ media-libs/libglvnd
+ sys-apps/dbus
+ x11-base/xorg-proto
+ x11-libs/libXrandr
+ x11-libs/libXv
+ x11-libs/libvdpau
+ )
+"
+BDEPEND="
+ sys-devel/m4
+ virtual/pkgconfig
+"
+
+# there is some non-prebuilt exceptions but rather not maintain a list
+QA_PREBUILT="lib/firmware/* usr/bin/* usr/lib*"
+
+PATCHES=(
+ "${FILESDIR}"/nvidia-drivers-470.141.03-clang15.patch
+ "${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch
+ "${FILESDIR}"/nvidia-settings-390.144-desktop.patch
+ "${FILESDIR}"/nvidia-settings-390.144-no-gtk2.patch
+ "${FILESDIR}"/nvidia-settings-390.144-raw-ldflags.patch
+)
+
+pkg_setup() {
+ use modules && [[ ${MERGE_TYPE} != binary ]] || return
+
+ local CONFIG_CHECK="
+ PROC_FS
+ ~DRM_KMS_HELPER
+ ~SYSVIPC
+ ~!AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT
+ ~!LOCKDEP
+ ~!SLUB_DEBUG_ON
+ ~!X86_KERNEL_IBT
+ !DEBUG_MUTEXES
+ "
+
+ local ERROR_DRM_KMS_HELPER="CONFIG_DRM_KMS_HELPER: is not set but needed for Xorg auto-detection
+ of drivers (no custom config), and for nvidia-drm.modeset=1 if used.
+ Cannot be directly selected in the kernel's menuconfig, and may need
+ selection of a DRM device even if unused, e.g. CONFIG_DRM_AMDGPU=m or
+ DRM_I915=y, DRM_NOUVEAU=m also acceptable if a module and not built-in."
+
+ local ERROR_X86_KERNEL_IBT="CONFIG_X86_KERNEL_IBT: is set and, if the CPU supports the feature,
+ this *could* lead to modules load failure with ENDBR errors, or to
+ broken CUDA/NVENC. Please ignore if not having issues, but otherwise
+ try to unset or pass ibt=off to the kernel's command line." #911142
+
+ use amd64 && kernel_is -ge 5 8 && CONFIG_CHECK+=" X86_PAT" #817764
+
+ linux-mod-r1_pkg_setup
+}
+
+src_prepare() {
+ # make patches usable across versions
+ rm nvidia-modprobe && mv nvidia-modprobe{-${PV},} || die
+ rm nvidia-persistenced && mv nvidia-persistenced{-${PV},} || die
+ rm nvidia-settings && mv nvidia-settings{-${PV},} || die
+ rm nvidia-xconfig && mv nvidia-xconfig{-${PV},} || die
+
+ default
+
+ # prevent detection of incomplete kernel DRM support (bug #603818)
+ sed 's/defined(CONFIG_DRM/defined(CONFIG_DRM_KMS_HELPER/g' \
+ -i kernel/conftest.sh || die
+
+ sed 's/__USER__/nvpd/' \
+ nvidia-persistenced/init/systemd/nvidia-persistenced.service.template \
+ > "${T}"/nvidia-persistenced.service || die
+}
+
+src_compile() {
+ tc-export AR CC CXX LD OBJCOPY OBJDUMP PKG_CONFIG
+ local -x RAW_LDFLAGS="$(get_abi_LDFLAGS) $(raw-ldflags)" # raw-ldflags.patch
+
+ # dead branch that will never be fixed and due for eventual removal,
+ # so keeping lazy "fixes" (bug #921370)
+ local kcflags=(
+ -std=gnu17
+ -Wno-error=implicit-function-declaration
+ -Wno-error=incompatible-pointer-types
+ )
+ # not *FLAGS to ensure it's used everywhere including conftest.sh
+ CC+=" $(test-flags-CC "${kcflags[@]}")"
+ use modules && KERNEL_CC+=" $(CC=${KERNEL_CC} test-flags-CC "${kcflags[@]}")"
+
+ # extra flags for the libXNVCtrl.a static library
+ local xnvflags=-fPIC #840389
+ tc-is-lto && xnvflags+=" $(test-flags-CC -ffat-lto-objects)"
+
+ NV_ARGS=(
+ PREFIX="${EPREFIX}"/usr
+ HOST_CC="$(tc-getBUILD_CC)"
+ HOST_LD="$(tc-getBUILD_LD)"
+ NV_USE_BUNDLED_LIBJANSSON=0
+ NV_VERBOSE=1 DO_STRIP= MANPAGE_GZIP= OUTPUTDIR=out
+ XNVCTRL_CFLAGS="${xnvflags}"
+ )
+
+ local modlist=( nvidia{,-drm,-modeset,-peermem,-uvm}=video:kernel )
+ local modargs=(
+ CC="${KERNEL_CC}" # for the above kcflags workarounds
+ IGNORE_CC_MISMATCH=yes NV_VERBOSE=1
+ SYSOUT="${KV_OUT_DIR}" SYSSRC="${KV_DIR}"
+ )
+
+ # temporary workaround for bug #914468
+ use modules && addpredict "${KV_OUT_DIR}"
+
+ linux-mod-r1_src_compile
+ emake "${NV_ARGS[@]}" -C nvidia-modprobe
+ use persistenced && emake "${NV_ARGS[@]}" -C nvidia-persistenced
+ use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig
+
+ if use tools; then
+ # avoid noisy *very* noisy logs with deprecation warnings
+ CFLAGS="-Wno-deprecated-declarations ${CFLAGS}" \
+ emake "${NV_ARGS[@]}" -C nvidia-settings
+ elif use static-libs; then
+ emake "${NV_ARGS[@]}" -C nvidia-settings/src out/libXNVCtrl.a
+ fi
+}
+
+src_install() {
+ local libdir=$(get_libdir) libdir32=$(ABI=x86 get_libdir)
+
+ NV_ARGS+=( DESTDIR="${D}" LIBDIR="${ED}"/usr/${libdir} )
+
+ local -A paths=(
+ [APPLICATION_PROFILE]=/usr/share/nvidia
+ [CUDA_ICD]=/etc/OpenCL/vendors
+ [EGL_EXTERNAL_PLATFORM_JSON]=/usr/share/egl/egl_external_platform.d
+ [FIRMWARE]=/lib/firmware/nvidia/${PV}
+ [GLVND_EGL_ICD_JSON]=/usr/share/glvnd/egl_vendor.d
+ [VULKAN_ICD_JSON]=/usr/share/vulkan
+ [WINE_LIB]=/usr/${libdir}/nvidia/wine
+ [XORG_OUTPUTCLASS_CONFIG]=/usr/share/X11/xorg.conf.d
+
+ [GLX_MODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules/extensions
+ [GLX_MODULE_SYMLINK]=/usr/${libdir}/xorg/modules
+ [XMODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules
+ )
+
+ local skip_files=(
+ $(usev !X "libGLX_nvidia libglxserver_nvidia libnvidia-ifr")
+ libGLX_indirect # non-glvnd unused fallback
+ libnvidia-gtk nvidia-{settings,xconfig} # built from source
+ # skip wayland-related files, largely broken with 470 at this point
+ libnvidia-egl-wayland 10_nvidia_wayland libnvidia-vulkan-producer
+ )
+ local skip_modules=(
+ $(usev !X "nvfbc vdpau xdriver")
+ $(usev !modules gsp)
+ installer nvpd # handled separately / built from source
+ )
+ local skip_types=(
+ GLVND_LIB GLVND_SYMLINK EGL_CLIENT.\* GLX_CLIENT.\* # media-libs/libglvnd
+ OPENCL_WRAPPER.\* # virtual/opencl
+ DOCUMENTATION DOT_DESKTOP .\*_SRC DKMS_CONF # handled separately / unused
+ )
+
+ local DOCS=(
+ README.txt NVIDIA_Changelog supported-gpus/supported-gpus.json
+ nvidia-settings/doc/{FRAMELOCK,NV-CONTROL-API}.txt
+ )
+ local HTML_DOCS=( html/. )
+ einstalldocs
+
+ local DISABLE_AUTOFORMATTING=yes
+ local DOC_CONTENTS="\
+Trusted users should be in the 'video' group to use NVIDIA devices.
+You can add yourself by using: gpasswd -a my-user video\
+$(usev modules "
+
+Like all out-of-tree kernel modules, it is necessary to rebuild
+${PN} after upgrading or rebuilding the Linux kernel
+by for example running \`emerge @module-rebuild\`. Alternatively,
+if using a distribution kernel (sys-kernel/gentoo-kernel{,-bin}),
+this can be automated by setting USE=dist-kernel globally.
+
+Loaded kernel modules also must not mismatch with the installed
+${PN} version (excluding -r revision), meaning should
+ensure \`eselect kernel list\` points to the kernel that will be
+booted before building and preferably reboot after upgrading
+${PN} (the ebuild will emit a warning if mismatching).
+
+See '${EPREFIX}/etc/modprobe.d/nvidia.conf' for modules options.")\
+$(use amd64 && usev !abi_x86_32 "
+
+Note that without USE=abi_x86_32 on ${PN}, 32bit applications
+(typically using wine / steam) will not be able to use GPU acceleration.")
+
+For additional information or for troubleshooting issues, please see
+https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers and NVIDIA's own
+documentation that is installed alongside this README."
+ readme.gentoo_create_doc
+
+ if use modules; then
+ linux-mod-r1_src_install
+
+ insinto /etc/modprobe.d
+ newins "${FILESDIR}"/nvidia-470.conf nvidia.conf
+
+ # used for gpu verification with binpkgs (not kept, see pkg_preinst)
+ insinto /usr/share/nvidia
+ doins supported-gpus/supported-gpus.json
+ fi
+
+ emake "${NV_ARGS[@]}" -C nvidia-modprobe install
+ fowners :video /usr/bin/nvidia-modprobe #505092
+ fperms 4710 /usr/bin/nvidia-modprobe
+
+ if use persistenced; then
+ emake "${NV_ARGS[@]}" -C nvidia-persistenced install
+ newconfd "${FILESDIR}"/nvidia-persistenced.confd nvidia-persistenced
+ newinitd "${FILESDIR}"/nvidia-persistenced.initd nvidia-persistenced
+ systemd_dounit "${T}"/nvidia-persistenced.service
+ fi
+
+ if use tools; then
+ emake "${NV_ARGS[@]}" -C nvidia-settings install
+
+ doicon nvidia-settings/doc/nvidia-settings.png
+ domenu nvidia-settings/doc/nvidia-settings.desktop
+
+ exeinto /etc/X11/xinit/xinitrc.d
+ newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
+ fi
+
+ if use static-libs; then
+ dolib.a nvidia-settings/src/out/libXNVCtrl.a
+ strip-lto-bytecode
+
+ insinto /usr/include/NVCtrl
+ doins nvidia-settings/src/libXNVCtrl/NVCtrl{Lib,}.h
+ fi
+
+ use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig install
+
+ # mimic nvidia-installer by reading .manifest to install files
+ # 0:file 1:perms 2:type 3+:subtype/arguments -:module
+ local m into
+ while IFS=' ' read -ra m; do
+ ! [[ ${#m[@]} -ge 2 && ${m[-1]} =~ MODULE: ]] ||
+ [[ " ${m[0]##*/}" =~ ^(\ ${skip_files[*]/%/.*|\\} )$ ]] ||
+ [[ " ${m[2]}" =~ ^(\ ${skip_types[*]/%/|\\} )$ ]] ||
+ has ${m[-1]#MODULE:} "${skip_modules[@]}" && continue
+
+ case ${m[2]} in
+ MANPAGE)
+ gzip -dc ${m[0]} | newman - ${m[0]%.gz}
+ pipestatus || die
+ continue
+ ;;
+ VDPAU_SYMLINK) m[4]=vdpau/; m[5]=${m[5]#vdpau/};; # .so to vdpau/
+ esac
+
+ if [[ -v 'paths[${m[2]}]' ]]; then
+ into=${paths[${m[2]}]}
+ elif [[ ${m[2]} == *_BINARY ]]; then
+ into=/usr/bin
+ elif [[ ${m[3]} == COMPAT32 ]]; then
+ use abi_x86_32 || continue
+ into=/usr/${libdir32}
+ elif [[ ${m[2]} == *_@(LIB|SYMLINK) ]]; then
+ into=/usr/${libdir}
+ else
+ die "No known installation path for ${m[0]}"
+ fi
+ [[ ${m[3]: -2} == ?/ ]] && into+=/${m[3]%/}
+ [[ ${m[4]: -2} == ?/ ]] && into+=/${m[4]%/}
+
+ if [[ ${m[2]} =~ _SYMLINK$ ]]; then
+ [[ ${m[4]: -1} == / ]] && m[4]=${m[5]}
+ dosym ${m[4]} ${into}/${m[0]}
+ continue
+ fi
+ [[ ${m[0]} =~ ^libnvidia-ngx.so ]] &&
+ dosym ${m[0]} ${into}/${m[0]%.so*}.so.1 # soname not in .manifest
+
+ printf -v m[1] %o $((m[1] | 0200)) # 444->644
+ insopts -m${m[1]}
+ insinto ${into}
+ doins ${m[0]}
+ done < .manifest || die
+ insopts -m0644 # reset
+
+ # MODULE:installer non-skipped extras
+ : "$(systemd_get_sleepdir)"
+ exeinto "${_#"${EPREFIX}"}"
+ doexe systemd/system-sleep/nvidia
+ dobin systemd/nvidia-sleep.sh
+ systemd_dounit systemd/system/nvidia-{hibernate,resume,suspend}.service
+
+ dobin nvidia-bug-report.sh
+
+ # enabling is needed for sleep to work properly and little reason not to do
+ # it unconditionally for a better user experience
+ : "$(systemd_get_systemunitdir)"
+ local unitdir=${_#"${EPREFIX}"}
+ # not using relative symlinks to match systemd's own links
+ dosym {"${unitdir}",/etc/systemd/system/systemd-hibernate.service.wants}/nvidia-hibernate.service
+ dosym {"${unitdir}",/etc/systemd/system/systemd-hibernate.service.wants}/nvidia-resume.service
+ dosym {"${unitdir}",/etc/systemd/system/systemd-suspend.service.wants}/nvidia-suspend.service
+ dosym {"${unitdir}",/etc/systemd/system/systemd-suspend.service.wants}/nvidia-resume.service
+ # also add a custom elogind hook to do the equivalent of the above
+ exeinto /usr/lib/elogind/system-sleep
+ newexe "${FILESDIR}"/system-sleep.elogind nvidia
+ # <elogind-255.5 used a different path (bug #939216), keep a compat symlink
+ # TODO: cleanup after 255.5 been stable for a few months
+ dosym {/usr/lib,/"${libdir}"}/elogind/system-sleep/nvidia
+
+ # needed with >=systemd-256 or may fail to resume with some setups
+ # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1072722
+ insinto "${unitdir}"/systemd-homed.service.d
+ newins - 10-nvidia.conf <<-EOF
+ [Service]
+ Environment=SYSTEMD_HOME_LOCK_FREEZE_SESSION=false
+ EOF
+ insinto "${unitdir}"/systemd-suspend.service.d
+ newins - 10-nvidia.conf <<-EOF
+ [Service]
+ Environment=SYSTEMD_SLEEP_FREEZE_USER_SESSIONS=false
+ EOF
+ dosym -r "${unitdir}"/systemd-{suspend,hibernate}.service.d/10-nvidia.conf
+ dosym -r "${unitdir}"/systemd-{suspend,hybrid-sleep}.service.d/10-nvidia.conf
+ dosym -r "${unitdir}"/systemd-{suspend,suspend-then-hibernate}.service.d/10-nvidia.conf
+
+ # symlink non-versioned so nvidia-settings can use it even if misdetected
+ dosym nvidia-application-profiles-${PV}-key-documentation \
+ ${paths[APPLICATION_PROFILE]}/nvidia-application-profiles-key-documentation
+
+ # don't attempt to strip firmware files (silences errors)
+ dostrip -x ${paths[FIRMWARE]}
+
+ # sandbox issues with /dev/nvidiactl (and /dev/char wrt bug #904292)
+ # are widespread and sometime affect revdeps of packages built with
+ # USE=opencl/cuda making it hard to manage in ebuilds (minimal set,
+ # ebuilds should handle manually if need others or addwrite)
+ insinto /etc/sandbox.d
+ newins - 20nvidia <<<'SANDBOX_PREDICT="/dev/nvidiactl:/dev/char"'
+
+ # dracut does not use /etc/modprobe.d if hostonly=no, but want to make sure
+ # our settings are used for bug 932781#c8 and nouveau blacklist if either
+ # modules are included (however, just best-effort without initramfs regen)
+ if use modules; then
+ echo "install_items+=\" ${EPREFIX}/etc/modprobe.d/nvidia.conf \"" >> \
+ "${ED}"/usr/lib/dracut/dracut.conf.d/10-${PN}.conf || die
+ fi
+}
+
+pkg_preinst() {
+ use modules || return
+
+ # set video group id based on live system (bug #491414)
+ local g=$(egetent group video | cut -d: -f3)
+ [[ ${g} =~ ^[0-9]+$ ]] || die "Failed to determine video group id (got '${g}')"
+ sed -i "s/@VIDEOGID@/${g}/" "${ED}"/etc/modprobe.d/nvidia.conf || die
+
+ # try to find driver mismatches using temporary supported-gpus.json
+ for g in $(grep -l 0x10de /sys/bus/pci/devices/*/vendor 2>/dev/null); do
+ g=$(grep -io "\"devid\":\"$(<${g%vendor}device)\"[^}]*branch\":\"[0-9]*" \
+ "${ED}"/usr/share/nvidia/supported-gpus.json 2>/dev/null)
+ if [[ ${g} ]]; then
+ g=$((${g##*\"}+1))
+ if ver_test -ge ${g}; then
+ NV_LEGACY_MASK=">=${CATEGORY}/${PN}-${g}"
+ break
+ fi
+ fi
+ done
+ rm "${ED}"/usr/share/nvidia/supported-gpus.json || die
+}
+
+pkg_postinst() {
+ linux-mod-r1_pkg_postinst
+
+ readme.gentoo_print_elog
+
+ if [[ -r /proc/driver/nvidia/version &&
+ $(</proc/driver/nvidia/version) != *" ${PV} "* ]]; then
+ ewarn "\nCurrently loaded NVIDIA modules do not match the newly installed"
+ ewarn "libraries and may prevent launching GPU-accelerated applications."
+ if use modules; then
+ ewarn "Easiest way to fix this is normally to reboot. If still run into issues"
+ ewarn "(e.g. API mismatch messages in the \`dmesg\` output), please verify"
+ ewarn "that the running kernel is ${KV_FULL} and that (if used) the"
+ ewarn "initramfs does not include NVIDIA modules (or at least, not old ones)."
+ fi
+ fi
+
+ if [[ $(</proc/cmdline) == *slub_debug=[!-]* ]]; then
+ ewarn "\nDetected that the current kernel command line is using 'slub_debug=',"
+ ewarn "this may lead to system instability/freezes with this version of"
+ ewarn "${PN}. Bug: https://bugs.gentoo.org/796329"
+ fi
+
+ if [[ -v NV_LEGACY_MASK ]]; then
+ ewarn "\n***WARNING***"
+ ewarn "\nYou are installing a version of ${PN} known not to work"
+ ewarn "with a GPU of the current system. If unwanted, add the mask:"
+ if [[ -d ${EROOT}/etc/portage/package.mask ]]; then
+ ewarn "\n echo '${NV_LEGACY_MASK}' > ${EROOT}/etc/portage/package.mask/${PN}"
+ else
+ ewarn "\n echo '${NV_LEGACY_MASK}' >> ${EROOT}/etc/portage/package.mask"
+ fi
+ ewarn "\n...then downgrade to a legacy[1] branch if possible (not all old versions"
+ ewarn "are available or fully functional, may need to consider nouveau[2])."
+ ewarn "\n[1] https://www.nvidia.com/object/IO_32667.html"
+ ewarn "[2] https://wiki.gentoo.org/wiki/Nouveau"
+ fi
+
+ ewarn "\nBe warned/reminded that the 470.xx branch reached end-of-life and"
+ ewarn "NVIDIA is no longer fixing issues (including security). Free to keep"
+ ewarn "using (for now) but it is recommended to either switch to nouveau or"
+ ewarn "replace hardware. Will be kept in-tree while possible, but expect it"
+ ewarn "to be removed likely in late 2027 or earlier if major issues arise."
+ ewarn "\nNote that there is no plans to patch in support for kernels branches"
+ ewarn "newer than 6.6.x which will be supported upstream until December 2027"
+ ewarn "albeit its support *could* end earlier in Gentoo."
+}
diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-535.309.01.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-535.309.01.ebuild
new file mode 100644
index 000000000000..35686cfe16c2
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-535.309.01.ebuild
@@ -0,0 +1,574 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+MODULES_OPTIONAL_IUSE=+modules
+inherit desktop dot-a eapi9-pipestatus flag-o-matic linux-mod-r1 multilib
+inherit readme.gentoo-r1 systemd toolchain-funcs unpacker user-info
+
+MODULES_KERNEL_MAX=6.18
+NV_URI="https://download.nvidia.com/XFree86/"
+
+DESCRIPTION="NVIDIA Accelerated Graphics Driver"
+HOMEPAGE="https://www.nvidia.com/"
+SRC_URI="
+ amd64? ( ${NV_URI}Linux-x86_64/${PV}/NVIDIA-Linux-x86_64-${PV}.run )
+ arm64? ( ${NV_URI}Linux-aarch64/${PV}/NVIDIA-Linux-aarch64-${PV}.run )
+ $(printf "${NV_URI}%s/%s-${PV}.tar.bz2 " \
+ nvidia-{installer,modprobe,persistenced,settings,xconfig}{,})
+ ${NV_URI}NVIDIA-kernel-module-source/NVIDIA-kernel-module-source-${PV}.tar.xz
+"
+# nvidia-installer is unused but here for GPL-2's "distribute sources"
+S=${WORKDIR}
+
+LICENSE="NVIDIA-2023 Apache-2.0 BSD BSD-2 GPL-2 MIT ZLIB curl openssl"
+SLOT="0/${PV%%.*}"
+KEYWORDS="-* amd64 ~arm64"
+IUSE="+X abi_x86_32 abi_x86_64 kernel-open persistenced powerd +static-libs +tools wayland"
+
+COMMON_DEPEND="
+ acct-group/video
+ X? ( x11-libs/libpciaccess )
+ persistenced? (
+ acct-user/nvpd
+ net-libs/libtirpc:=
+ )
+ tools? (
+ >=app-accessibility/at-spi2-core-2.46:2
+ dev-libs/glib:2
+ dev-libs/jansson:=
+ media-libs/harfbuzz:=
+ x11-libs/cairo
+ x11-libs/gdk-pixbuf:2
+ x11-libs/gtk+:3[X]
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/libXxf86vm
+ x11-libs/pango
+ )
+"
+RDEPEND="
+ ${COMMON_DEPEND}
+ || (
+ dev-libs/openssl-compat:3
+ dev-libs/openssl:0/3
+ )
+ sys-libs/glibc
+ X? (
+ media-libs/libglvnd[X,abi_x86_32(-)?]
+ x11-libs/libX11[abi_x86_32(-)?]
+ x11-libs/libXext[abi_x86_32(-)?]
+ )
+ powerd? ( sys-apps/dbus[abi_x86_32(-)?] )
+ wayland? (
+ gui-libs/egl-gbm
+ >=gui-libs/egl-wayland-1.1.10
+ media-libs/libglvnd
+ )
+"
+DEPEND="
+ ${COMMON_DEPEND}
+ static-libs? (
+ x11-base/xorg-proto
+ x11-libs/libX11
+ x11-libs/libXext
+ )
+ tools? (
+ media-libs/libglvnd
+ sys-apps/dbus
+ x11-base/xorg-proto
+ x11-libs/libXrandr
+ x11-libs/libXv
+ x11-libs/libvdpau
+ )
+"
+BDEPEND="
+ sys-devel/m4
+ virtual/pkgconfig
+"
+
+# there is some non-prebuilt exceptions but rather not maintain a list
+QA_PREBUILT="lib/firmware/* usr/bin/* usr/lib*"
+
+PATCHES=(
+ "${FILESDIR}"/nvidia-kernel-module-source-515.86.01-raw-ldflags.patch
+ "${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch
+ "${FILESDIR}"/nvidia-settings-390.144-raw-ldflags.patch
+ "${FILESDIR}"/nvidia-settings-530.30.02-desktop.patch
+)
+
+pkg_setup() {
+ use modules && [[ ${MERGE_TYPE} != binary ]] || return
+
+ local CONFIG_CHECK="
+ PROC_FS
+ ~DRM_KMS_HELPER
+ ~SYSVIPC
+ ~!LOCKDEP
+ ~!PREEMPT_RT
+ ~!SLUB_DEBUG_ON
+ !DEBUG_MUTEXES
+ $(usev amd64 'X86_PAT')
+ $(usev powerd '~CPU_FREQ')
+ "
+
+ local ERROR_DRM_KMS_HELPER="CONFIG_DRM_KMS_HELPER: is not set but needed for Xorg auto-detection
+ of drivers (no custom config), and for wayland / nvidia-drm.modeset=1.
+ Cannot be directly selected in the kernel's menuconfig, and may need
+ selection of a DRM device even if unused, e.g. CONFIG_DRM_AMDGPU=m or
+ DRM_I915=y, DRM_NOUVEAU=m also acceptable if a module and not built-in."
+
+ use kernel-open && CONFIG_CHECK+=" MMU_NOTIFIER" #843827
+ local ERROR_MMU_NOTIFIER="CONFIG_MMU_NOTIFIER: is not set but needed to build with USE=kernel-open.
+ Cannot be directly selected in the kernel's menuconfig, and may need
+ selection of another option that requires it such as CONFIG_AMD_IOMMU=y,
+ or DRM_I915=m (among others, consult the kernel config's help)."
+
+ local ERROR_PREEMPT_RT="CONFIG_PREEMPT_RT: is set but is unsupported by NVIDIA upstream and
+ will fail to build unless the env var IGNORE_PREEMPT_RT_PRESENCE=1 is
+ set. Please do not report issues if run into e.g. kernel panics while
+ ignoring this."
+
+ linux-mod-r1_pkg_setup
+}
+
+src_prepare() {
+ # make patches usable across versions
+ rm nvidia-modprobe && mv nvidia-modprobe{-${PV},} || die
+ rm nvidia-persistenced && mv nvidia-persistenced{-${PV},} || die
+ rm nvidia-settings && mv nvidia-settings{-${PV},} || die
+ rm nvidia-xconfig && mv nvidia-xconfig{-${PV},} || die
+ mv NVIDIA-kernel-module-source-${PV} kernel-module-source || die
+
+ default
+
+ # prevent detection of incomplete kernel DRM support (bug #603818)
+ sed 's/defined(CONFIG_DRM/defined(CONFIG_DRM_KMS_HELPER/g' \
+ -i kernel{,-module-source/kernel-open}/conftest.sh || die
+
+ sed 's/__USER__/nvpd/' \
+ nvidia-persistenced/init/systemd/nvidia-persistenced.service.template \
+ > "${T}"/nvidia-persistenced.service || die
+
+ # use alternative vulkan icd option if USE=-X (bug #909181)
+ use X || sed -i 's/"libGLX/"libEGL/' nvidia_{layers,icd}.json || die
+
+ # enable nvidia-drm.modeset=1 by default with USE=wayland
+ cp "${FILESDIR}"/nvidia-470.conf "${T}"/nvidia.conf || die
+ use !wayland || sed -i '/^#.*modeset=1$/s/^#//' "${T}"/nvidia.conf || die
+
+ # makefile attempts to install wayland library even if not built
+ use wayland || sed -i 's/ WAYLAND_LIB_install$//' \
+ nvidia-settings/src/Makefile || die
+
+ # temporary option, nvidia will remove in the future
+ use !kernel-open ||
+ sed -i '/blacklist/a\
+\
+# Enable using kernel-open with workstation GPUs (experimental)\
+options nvidia NVreg_OpenRmEnableUnsupportedGpus=1' "${T}"/nvidia.conf || die
+}
+
+src_compile() {
+ tc-export AR CC CXX LD OBJCOPY OBJDUMP PKG_CONFIG
+ local -x RAW_LDFLAGS="$(get_abi_LDFLAGS) $(raw-ldflags)" # raw-ldflags.patch
+
+ # extra flags for the libXNVCtrl.a static library
+ local xnvflags=-fPIC #840389
+ tc-is-lto && xnvflags+=" $(test-flags-CC -ffat-lto-objects)"
+
+ # same as uname -m
+ local target_arch
+ case ${ARCH} in
+ amd64) target_arch=x86_64;;
+ arm64) target_arch=aarch64;;
+ *) die "Unrecognised architecture: ${ARCH}";;
+ esac
+
+ NV_ARGS=(
+ PREFIX="${EPREFIX}"/usr
+ HOST_CC="$(tc-getBUILD_CC)"
+ HOST_LD="$(tc-getBUILD_LD)"
+ BUILD_GTK2LIB=
+ NV_USE_BUNDLED_LIBJANSSON=0
+ NV_VERBOSE=1 DO_STRIP= MANPAGE_GZIP= OUTPUTDIR=out
+ TARGET_ARCH="${target_arch}"
+ WAYLAND_AVAILABLE=$(usex wayland 1 0)
+ XNVCTRL_CFLAGS="${xnvflags}"
+ )
+
+ if use modules; then
+ local o_cflags=${CFLAGS} o_cxxflags=${CXXFLAGS} o_ldflags=${LDFLAGS}
+
+ local modlistargs=video:kernel
+ if use kernel-open; then
+ modlistargs+=-module-source:kernel-module-source/kernel-open
+
+ # environment flags are normally unused for modules, but nvidia
+ # uses it for building the "blob" and it is a bit fragile
+ filter-flags -fno-plt #912949
+ filter-lto
+ CC=${KERNEL_CC} CXX=${KERNEL_CXX} strip-unsupported-flags
+
+ # the "blob" uses C++ which is an issue if there is debug symbols
+ # when running pahole
+ linux_chkconfig_present DEBUG_INFO_BTF_MODULES && append-flags -g0
+ fi
+
+ local modlist=( nvidia{,-drm,-modeset,-peermem,-uvm}=${modlistargs} )
+ local modargs=(
+ IGNORE_CC_MISMATCH=yes NV_VERBOSE=1
+ SYSOUT="${KV_OUT_DIR}" SYSSRC="${KV_DIR}"
+ TARGET_ARCH="${target_arch}"
+
+ # kernel takes "x86" and "x86_64" as meaning the same, but nvidia
+ # makes the distinction (since 550.135) and is not happy with "x86"
+ # TODO?: it should be ok/better for tc-arch-kernel to do x86_64
+ $(usev amd64 ARCH=x86_64)
+ )
+
+ # temporary workaround for bug #914468
+ addpredict "${KV_OUT_DIR}"
+
+ linux-mod-r1_src_compile
+ CFLAGS=${o_cflags} CXXFLAGS=${o_cxxflags} LDFLAGS=${o_ldflags}
+ fi
+
+ emake "${NV_ARGS[@]}" -C nvidia-modprobe
+ use persistenced && emake "${NV_ARGS[@]}" -C nvidia-persistenced
+ use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig
+
+ if use tools; then
+ # avoid noisy *very* noisy logs with deprecation warnings
+ CFLAGS="-Wno-deprecated-declarations ${CFLAGS}" \
+ emake "${NV_ARGS[@]}" -C nvidia-settings
+ elif use static-libs; then
+ # pretend GTK+3 is available, not actually used (bug #880879)
+ emake "${NV_ARGS[@]}" BUILD_GTK3LIB=1 \
+ -C nvidia-settings/src out/libXNVCtrl.a
+ fi
+}
+
+src_install() {
+ local libdir=$(get_libdir) libdir32=$(ABI=x86 get_libdir)
+
+ NV_ARGS+=( DESTDIR="${D}" LIBDIR="${ED}"/usr/${libdir} )
+
+ local -A paths=(
+ [APPLICATION_PROFILE]=/usr/share/nvidia
+ [CUDA_ICD]=/etc/OpenCL/vendors
+ [EGL_EXTERNAL_PLATFORM_JSON]=/usr/share/egl/egl_external_platform.d
+ [FIRMWARE]=/lib/firmware/nvidia/${PV}
+ [GBM_BACKEND_LIB_SYMLINK]=/usr/${libdir}/gbm
+ [GLVND_EGL_ICD_JSON]=/usr/share/glvnd/egl_vendor.d
+ [OPENGL_DATA]=/usr/share/nvidia
+ [VULKAN_ICD_JSON]=/usr/share/vulkan
+ [WINE_LIB]=/usr/${libdir}/nvidia/wine
+ [XORG_OUTPUTCLASS_CONFIG]=/usr/share/X11/xorg.conf.d
+
+ [GLX_MODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules/extensions
+ [GLX_MODULE_SYMLINK]=/usr/${libdir}/xorg/modules
+ [XMODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules
+ )
+
+ local skip_files=(
+ $(usev !X "libGLX_nvidia libglxserver_nvidia")
+ $(usev !wayland libnvidia-vulkan-producer)
+ libGLX_indirect # non-glvnd unused fallback
+ libnvidia-{gtk,wayland-client} nvidia-{settings,xconfig} # from source
+ libnvidia-egl-gbm 15_nvidia_gbm # gui-libs/egl-gbm
+ libnvidia-egl-wayland 10_nvidia_wayland # gui-libs/egl-wayland
+ libnvidia-pkcs11.so # using the openssl3 version instead
+ )
+ local skip_modules=(
+ $(usev !X "nvfbc vdpau xdriver")
+ $(usev !modules gsp)
+ $(usev !powerd powerd)
+ installer nvpd # handled separately / built from source
+ )
+ local skip_types=(
+ GLVND_LIB GLVND_SYMLINK EGL_CLIENT.\* GLX_CLIENT.\* # media-libs/libglvnd
+ OPENCL_WRAPPER.\* # virtual/opencl
+ DOCUMENTATION DOT_DESKTOP .\*_SRC DKMS_CONF SYSTEMD_UNIT # handled separately / unused
+ )
+
+ local DOCS=(
+ README.txt NVIDIA_Changelog supported-gpus/supported-gpus.json
+ nvidia-settings/doc/{FRAMELOCK,NV-CONTROL-API}.txt
+ )
+ local HTML_DOCS=( html/. )
+ einstalldocs
+
+ local DISABLE_AUTOFORMATTING=yes
+ local DOC_CONTENTS="\
+Trusted users should be in the 'video' group to use NVIDIA devices.
+You can add yourself by using: gpasswd -a my-user video\
+$(usev modules "
+
+Like all out-of-tree kernel modules, it is necessary to rebuild
+${PN} after upgrading or rebuilding the Linux kernel
+by for example running \`emerge @module-rebuild\`. Alternatively,
+if using a distribution kernel (sys-kernel/gentoo-kernel{,-bin}),
+this can be automated by setting USE=dist-kernel globally.
+
+Loaded kernel modules also must not mismatch with the installed
+${PN} version (excluding -r revision), meaning should
+ensure \`eselect kernel list\` points to the kernel that will be
+booted before building and preferably reboot after upgrading
+${PN} (the ebuild will emit a warning if mismatching).
+
+See '${EPREFIX}/etc/modprobe.d/nvidia.conf' for modules options.")\
+$(use amd64 && usev !abi_x86_32 "
+
+Note that without USE=abi_x86_32 on ${PN}, 32bit applications
+(typically using wine / steam) will not be able to use GPU acceleration.")
+
+For additional information or for troubleshooting issues, please see
+https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers and NVIDIA's own
+documentation that is installed alongside this README."
+ readme.gentoo_create_doc
+
+ if use modules; then
+ linux-mod-r1_src_install
+
+ insinto /etc/modprobe.d
+ doins "${T}"/nvidia.conf
+
+ # used for gpu verification with binpkgs (not kept, see pkg_preinst)
+ insinto /usr/share/nvidia
+ doins supported-gpus/supported-gpus.json
+ fi
+
+ emake "${NV_ARGS[@]}" -C nvidia-modprobe install
+ fowners :video /usr/bin/nvidia-modprobe #505092
+ fperms 4710 /usr/bin/nvidia-modprobe
+
+ if use persistenced; then
+ emake "${NV_ARGS[@]}" -C nvidia-persistenced install
+ newconfd "${FILESDIR}"/nvidia-persistenced.confd nvidia-persistenced
+ newinitd "${FILESDIR}"/nvidia-persistenced.initd nvidia-persistenced
+ systemd_dounit "${T}"/nvidia-persistenced.service
+ fi
+
+ if use tools; then
+ emake "${NV_ARGS[@]}" -C nvidia-settings install
+
+ doicon nvidia-settings/doc/nvidia-settings.png
+ domenu nvidia-settings/doc/nvidia-settings.desktop
+
+ exeinto /etc/X11/xinit/xinitrc.d
+ newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
+ fi
+
+ if use static-libs; then
+ dolib.a nvidia-settings/src/out/libXNVCtrl.a
+ strip-lto-bytecode
+
+ insinto /usr/include/NVCtrl
+ doins nvidia-settings/src/libXNVCtrl/NVCtrl{Lib,}.h
+ fi
+
+ use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig install
+
+ # mimic nvidia-installer by reading .manifest to install files
+ # 0:file 1:perms 2:type 3+:subtype/arguments -:module
+ local m into
+ while IFS=' ' read -ra m; do
+ ! [[ ${#m[@]} -ge 2 && ${m[-1]} =~ MODULE: ]] ||
+ [[ " ${m[0]##*/}" =~ ^(\ ${skip_files[*]/%/.*|\\} )$ ]] ||
+ [[ " ${m[2]}" =~ ^(\ ${skip_types[*]/%/|\\} )$ ]] ||
+ has ${m[-1]#MODULE:} "${skip_modules[@]}" && continue
+
+ case ${m[2]} in
+ MANPAGE)
+ gzip -dc ${m[0]} | newman - ${m[0]%.gz}
+ pipestatus || die
+ continue
+ ;;
+ GBM_BACKEND_LIB_SYMLINK) m[4]=../${m[4]};; # missing ../
+ VDPAU_SYMLINK) m[4]=vdpau/; m[5]=${m[5]#vdpau/};; # .so to vdpau/
+ esac
+
+ if [[ -v 'paths[${m[2]}]' ]]; then
+ into=${paths[${m[2]}]}
+ elif [[ ${m[2]} == EXPLICIT_PATH ]]; then
+ into=${m[3]}
+ elif [[ ${m[2]} == *_BINARY ]]; then
+ into=/usr/bin
+ elif [[ ${m[3]} == COMPAT32 ]]; then
+ use abi_x86_32 || continue
+ into=/usr/${libdir32}
+ elif [[ ${m[2]} == *_@(LIB|SYMLINK) ]]; then
+ into=/usr/${libdir}
+ else
+ die "No known installation path for ${m[0]}"
+ fi
+ [[ ${m[3]: -2} == ?/ ]] && into+=/${m[3]%/}
+ [[ ${m[4]: -2} == ?/ ]] && into+=/${m[4]%/}
+
+ if [[ ${m[2]} =~ _SYMLINK$ ]]; then
+ [[ ${m[4]: -1} == / ]] && m[4]=${m[5]}
+ dosym ${m[4]} ${into}/${m[0]}
+ continue
+ fi
+ [[ ${m[0]} =~ ^libnvidia-ngx.so|^libnvidia-egl-gbm.so ]] &&
+ dosym ${m[0]} ${into}/${m[0]%.so*}.so.1 # soname not in .manifest
+
+ printf -v m[1] %o $((m[1] | 0200)) # 444->644
+ insopts -m${m[1]}
+ insinto ${into}
+ doins ${m[0]}
+ done < .manifest || die
+ insopts -m0644 # reset
+
+ # MODULE:installer non-skipped extras
+ : "$(systemd_get_sleepdir)"
+ exeinto "${_#"${EPREFIX}"}"
+ doexe systemd/system-sleep/nvidia
+ dobin systemd/nvidia-sleep.sh
+ systemd_dounit systemd/system/nvidia-{hibernate,resume,suspend}.service
+
+ dobin nvidia-bug-report.sh
+
+ # MODULE:powerd extras
+ if use powerd; then
+ newinitd "${FILESDIR}"/nvidia-powerd.initd nvidia-powerd #923117
+ systemd_dounit systemd/system/nvidia-powerd.service
+
+ insinto /usr/share/dbus-1/system.d
+ doins nvidia-dbus.conf
+ fi
+
+ # enabling is needed for sleep to work properly and little reason not to do
+ # it unconditionally for a better user experience
+ : "$(systemd_get_systemunitdir)"
+ local unitdir=${_#"${EPREFIX}"}
+ # not using relative symlinks to match systemd's own links
+ dosym {"${unitdir}",/etc/systemd/system/systemd-hibernate.service.wants}/nvidia-hibernate.service
+ dosym {"${unitdir}",/etc/systemd/system/systemd-hibernate.service.wants}/nvidia-resume.service
+ dosym {"${unitdir}",/etc/systemd/system/systemd-suspend.service.wants}/nvidia-suspend.service
+ dosym {"${unitdir}",/etc/systemd/system/systemd-suspend.service.wants}/nvidia-resume.service
+ # also add a custom elogind hook to do the equivalent of the above
+ exeinto /usr/lib/elogind/system-sleep
+ newexe "${FILESDIR}"/system-sleep.elogind nvidia
+ # <elogind-255.5 used a different path (bug #939216), keep a compat symlink
+ # TODO: cleanup after 255.5 been stable for a few months
+ dosym {/usr/lib,/"${libdir}"}/elogind/system-sleep/nvidia
+
+ # needed with >=systemd-256 or may fail to resume with some setups
+ # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1072722
+ insinto "${unitdir}"/systemd-homed.service.d
+ newins - 10-nvidia.conf <<-EOF
+ [Service]
+ Environment=SYSTEMD_HOME_LOCK_FREEZE_SESSION=false
+ EOF
+ insinto "${unitdir}"/systemd-suspend.service.d
+ newins - 10-nvidia.conf <<-EOF
+ [Service]
+ Environment=SYSTEMD_SLEEP_FREEZE_USER_SESSIONS=false
+ EOF
+ dosym -r "${unitdir}"/systemd-{suspend,hibernate}.service.d/10-nvidia.conf
+ dosym -r "${unitdir}"/systemd-{suspend,hybrid-sleep}.service.d/10-nvidia.conf
+ dosym -r "${unitdir}"/systemd-{suspend,suspend-then-hibernate}.service.d/10-nvidia.conf
+
+ # symlink non-versioned so nvidia-settings can use it even if misdetected
+ dosym nvidia-application-profiles-${PV}-key-documentation \
+ ${paths[APPLICATION_PROFILE]}/nvidia-application-profiles-key-documentation
+
+ # don't attempt to strip firmware files (silences errors)
+ dostrip -x ${paths[FIRMWARE]}
+
+ # sandbox issues with /dev/nvidiactl (and /dev/char wrt bug #904292)
+ # are widespread and sometime affect revdeps of packages built with
+ # USE=opencl/cuda making it hard to manage in ebuilds (minimal set,
+ # ebuilds should handle manually if need others or addwrite)
+ insinto /etc/sandbox.d
+ newins - 20nvidia <<<'SANDBOX_PREDICT="/dev/nvidiactl:/dev/char"'
+
+ # dracut does not use /etc/modprobe.d if hostonly=no, but want to make sure
+ # our settings are used for bug 932781#c8 and nouveau blacklist if either
+ # modules are included (however, just best-effort without initramfs regen)
+ if use modules; then
+ echo "install_items+=\" ${EPREFIX}/etc/modprobe.d/nvidia.conf \"" >> \
+ "${ED}"/usr/lib/dracut/dracut.conf.d/10-${PN}.conf || die
+ fi
+}
+
+pkg_preinst() {
+ has_version "${CATEGORY}/${PN}[wayland]" && NV_HAD_WAYLAND=
+
+ use modules || return
+
+ # set video group id based on live system (bug #491414)
+ local g=$(egetent group video | cut -d: -f3)
+ [[ ${g} =~ ^[0-9]+$ ]] || die "Failed to determine video group id (got '${g}')"
+ sed -i "s/@VIDEOGID@/${g}/" "${ED}"/etc/modprobe.d/nvidia.conf || die
+
+ # try to find driver mismatches using temporary supported-gpus.json
+ for g in $(grep -l 0x10de /sys/bus/pci/devices/*/vendor 2>/dev/null); do
+ g=$(grep -io "\"devid\":\"$(<${g%vendor}device)\"[^}]*branch\":\"[0-9]*" \
+ "${ED}"/usr/share/nvidia/supported-gpus.json 2>/dev/null)
+ if [[ ${g} ]]; then
+ g=$((${g##*\"}+1))
+ if ver_test -ge ${g}; then
+ NV_LEGACY_MASK=">=${CATEGORY}/${PN}-${g}"
+ break
+ fi
+ fi
+ done
+ rm "${ED}"/usr/share/nvidia/supported-gpus.json || die
+}
+
+pkg_postinst() {
+ linux-mod-r1_pkg_postinst
+
+ readme.gentoo_print_elog
+
+ if [[ -r /proc/driver/nvidia/version &&
+ $(</proc/driver/nvidia/version) != *" ${PV} "* ]]; then
+ ewarn "\nCurrently loaded NVIDIA modules do not match the newly installed"
+ ewarn "libraries and may prevent launching GPU-accelerated applications."
+ if use modules; then
+ ewarn "Easiest way to fix this is normally to reboot. If still run into issues"
+ ewarn "(e.g. API mismatch messages in the \`dmesg\` output), please verify"
+ ewarn "that the running kernel is ${KV_FULL} and that (if used) the"
+ ewarn "initramfs does not include NVIDIA modules (or at least, not old ones)."
+ fi
+ fi
+
+ if [[ $(</proc/cmdline) == *slub_debug=[!-]* ]]; then
+ ewarn "\nDetected that the current kernel command line is using 'slub_debug=',"
+ ewarn "this may lead to system instability/freezes with this version of"
+ ewarn "${PN}. Bug: https://bugs.gentoo.org/796329"
+ fi
+
+ if [[ -v NV_LEGACY_MASK ]]; then
+ ewarn "\n***WARNING***"
+ ewarn "\nYou are installing a version of ${PN} known not to work"
+ ewarn "with a GPU of the current system. If unwanted, add the mask:"
+ if [[ -d ${EROOT}/etc/portage/package.mask ]]; then
+ ewarn "\n echo '${NV_LEGACY_MASK}' > ${EROOT}/etc/portage/package.mask/${PN}"
+ else
+ ewarn "\n echo '${NV_LEGACY_MASK}' >> ${EROOT}/etc/portage/package.mask"
+ fi
+ ewarn "\n...then downgrade to a legacy[1] branch if possible (not all old versions"
+ ewarn "are available or fully functional, may need to consider nouveau[2])."
+ ewarn "\n[1] https://www.nvidia.com/object/IO_32667.html"
+ ewarn "[2] https://wiki.gentoo.org/wiki/Nouveau"
+ fi
+
+ if use kernel-open && use modules; then
+ ewarn "\nOpen source variant of ${PN} was selected, be warned it is experimental"
+ ewarn "and only for modern GPUs (e.g. GTX 1650+). Try to disable if run into issues."
+ ewarn "Please also see: ${EROOT}/usr/share/doc/${PF}/html/kernel_open.html"
+ fi
+
+ if use wayland && use modules && [[ ! -v NV_HAD_WAYLAND ]]; then
+ elog "\nWith USE=wayland, this version of ${PN} sets nvidia-drm.modeset=1"
+ elog "in '${EROOT}/etc/modprobe.d/nvidia.conf'. This feature is considered"
+ elog "experimental but is required for wayland."
+ elog "\nIf you experience issues, either disable wayland or edit nvidia.conf."
+ elog "Of note, may possibly cause issues with SLI and Reverse PRIME."
+ fi
+}
diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-580.159.03-r1.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-580.159.03-r1.ebuild
new file mode 100644
index 000000000000..805a533c3ae8
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-580.159.03-r1.ebuild
@@ -0,0 +1,602 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+MODULES_OPTIONAL_IUSE=+modules
+inherit desktop dot-a eapi9-pipestatus eapi9-ver flag-o-matic linux-mod-r1
+inherit readme.gentoo-r1 systemd toolchain-funcs unpacker user-info
+
+MODULES_KERNEL_MAX=7.0
+NV_URI="https://download.nvidia.com/XFree86/"
+
+DESCRIPTION="NVIDIA Accelerated Graphics Driver"
+HOMEPAGE="https://www.nvidia.com/"
+SRC_URI="
+ amd64? ( ${NV_URI}Linux-x86_64/${PV}/NVIDIA-Linux-x86_64-${PV}.run )
+ arm64? ( ${NV_URI}Linux-aarch64/${PV}/NVIDIA-Linux-aarch64-${PV}.run )
+ $(printf "${NV_URI}%s/%s-${PV}.tar.bz2 " \
+ nvidia-{installer,modprobe,persistenced,settings,xconfig}{,})
+ ${NV_URI}NVIDIA-kernel-module-source/NVIDIA-kernel-module-source-${PV}.tar.xz
+"
+# nvidia-installer is unused but here for GPL-2's "distribute sources"
+S=${WORKDIR}
+
+LICENSE="
+ NVIDIA-2025 Apache-2.0 Boost-1.0 BSD BSD-2 GPL-2 MIT ZLIB
+ curl openssl public-domain
+"
+SLOT="0/${PV%%.*}"
+KEYWORDS="-* amd64 ~arm64"
+IUSE="
+ +X abi_x86_32 abi_x86_64 kernel-open persistenced powerd
+ +static-libs +tools wayland
+"
+
+COMMON_DEPEND="
+ acct-group/video
+ X? ( x11-libs/libpciaccess )
+ persistenced? (
+ acct-user/nvpd
+ net-libs/libtirpc:=
+ )
+ tools? (
+ >=app-accessibility/at-spi2-core-2.46:2
+ dev-libs/glib:2
+ dev-libs/jansson:=
+ media-libs/harfbuzz:=
+ x11-libs/cairo
+ x11-libs/gdk-pixbuf:2
+ x11-libs/gtk+:3[X]
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/libXxf86vm
+ x11-libs/pango
+ )
+"
+RDEPEND="
+ ${COMMON_DEPEND}
+ || (
+ dev-libs/openssl-compat:3
+ dev-libs/openssl:0/3
+ )
+ sys-libs/glibc
+ X? (
+ media-libs/libglvnd[X,abi_x86_32(-)?]
+ x11-libs/libX11[abi_x86_32(-)?]
+ x11-libs/libXext[abi_x86_32(-)?]
+ )
+ powerd? ( sys-apps/dbus[abi_x86_32(-)?] )
+ wayland? (
+ >=gui-libs/egl-gbm-1.1.1-r2[abi_x86_32(-)?]
+ >=gui-libs/egl-wayland-1.1.13.1[abi_x86_32(-)?]
+ X? ( gui-libs/egl-x11[abi_x86_32(-)?] )
+ )
+"
+DEPEND="
+ ${COMMON_DEPEND}
+ static-libs? (
+ x11-base/xorg-proto
+ x11-libs/libX11
+ x11-libs/libXext
+ )
+ tools? (
+ dev-util/vulkan-headers
+ media-libs/libglvnd
+ sys-apps/dbus
+ x11-base/xorg-proto
+ x11-libs/libXrandr
+ x11-libs/libXv
+ x11-libs/libvdpau
+ )
+"
+BDEPEND="
+ sys-devel/m4
+ virtual/pkgconfig
+"
+
+# there is some non-prebuilt exceptions but rather not maintain a list
+QA_PREBUILT="lib/firmware/* usr/bin/* usr/lib*"
+
+PATCHES=(
+ "${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch
+ "${FILESDIR}"/nvidia-settings-530.30.02-desktop.patch
+ "${FILESDIR}"/nvidia-drivers-580.159.03-null-deref.patch
+)
+
+pkg_setup() {
+ use modules && [[ ${MERGE_TYPE} != binary ]] || return
+
+ # do early before linux-mod-r1 so can use chkconfig to setup CONFIG_CHECK
+ get_version
+ require_configured_kernel
+
+ local CONFIG_CHECK="
+ PROC_FS
+ ~DRM_KMS_HELPER
+ ~DRM_FBDEV_EMULATION
+ ~SYSVIPC
+ ~!LOCKDEP
+ ~!PREEMPT_RT
+ ~!SLUB_DEBUG_ON
+ !DEBUG_MUTEXES
+ $(usev amd64 'X86_PAT')
+ $(usev powerd '~CPU_FREQ')
+ "
+
+ kernel_is -ge 6 11 && linux_chkconfig_present DRM_FBDEV_EMULATION &&
+ CONFIG_CHECK+=" DRM_TTM_HELPER"
+
+ use kernel-open && CONFIG_CHECK+=" MMU_NOTIFIER" #843827
+
+ local drm_helper_msg="Cannot be directly selected in the kernel's config menus, and may need
+ selection of a DRM device even if unused, e.g. CONFIG_DRM_QXL=m or
+ DRM_AMDGPU=m (among others, consult the kernel config's help), can
+ also use DRM_NOUVEAU=m as long as built as module *not* built-in."
+ local ERROR_DRM_KMS_HELPER="CONFIG_DRM_KMS_HELPER: is not set but is needed for nvidia-drm.modeset=1
+ support (see ${EPREFIX}/etc/modprobe.d/nvidia.conf) which is needed for wayland
+ and for config-less Xorg auto-detection.
+ ${drm_helper_msg}"
+ local ERROR_DRM_TTM_HELPER="CONFIG_DRM_TTM_HELPER: is not set but is needed to compile when using
+ kernel version 6.11.x or newer while DRM_FBDEV_EMULATION is set.
+ ${drm_helper_msg}"
+ local ERROR_DRM_FBDEV_EMULATION="CONFIG_DRM_FBDEV_EMULATION: is not set but is needed for
+ nvidia-drm.fbdev=1 support (see ${EPREFIX}/etc/modprobe.d/nvidia.conf), may
+ result in a blank console/tty."
+ local ERROR_MMU_NOTIFIER="CONFIG_MMU_NOTIFIER: is not set but needed to build with USE=kernel-open.
+ Cannot be directly selected in the kernel's menuconfig, and may need
+ selection of another option that requires it such as CONFIG_AMD_IOMMU=y,
+ or DRM_I915=m (among others, consult the kernel config's help)."
+ local ERROR_PREEMPT_RT="CONFIG_PREEMPT_RT: is set but is unsupported by NVIDIA upstream and
+ will fail to build unless the env var IGNORE_PREEMPT_RT_PRESENCE=1 is
+ set. Please do not report issues if run into e.g. kernel panics while
+ ignoring this."
+
+ linux-mod-r1_pkg_setup
+}
+
+src_prepare() {
+ # make patches usable across versions
+ rm nvidia-modprobe && mv nvidia-modprobe{-${PV},} || die
+ rm nvidia-persistenced && mv nvidia-persistenced{-${PV},} || die
+ rm nvidia-settings && mv nvidia-settings{-${PV},} || die
+ rm nvidia-xconfig && mv nvidia-xconfig{-${PV},} || die
+ mv NVIDIA-kernel-module-source-${PV} kernel-module-source || die
+
+ default
+
+ # prevent detection of incomplete kernel DRM support (bug #603818)
+ sed 's/defined(CONFIG_DRM/defined(CONFIG_DRM_KMS_HELPER/g' \
+ -i kernel{,-module-source/kernel-open}/conftest.sh || die
+
+ sed 's/__USER__/nvpd/' \
+ nvidia-persistenced/init/systemd/nvidia-persistenced.service.template \
+ > "${T}"/nvidia-persistenced.service || die
+
+ # use alternative vulkan icd option if USE=-X (bug #909181)
+ use X || sed -i 's/"libGLX/"libEGL/' nvidia_{layers,icd}.json || die
+
+ # makefile attempts to install wayland library even if not built
+ use wayland || sed -i 's/ WAYLAND_LIB_install$//' \
+ nvidia-settings/src/Makefile || die
+}
+
+src_compile() {
+ tc-export AR CC CXX LD OBJCOPY OBJDUMP PKG_CONFIG
+
+ # extra flags for the libXNVCtrl.a static library
+ local xnvflags=-fPIC #840389
+ tc-is-lto && xnvflags+=" $(test-flags-CC -ffat-lto-objects)"
+
+ # same as uname -m
+ local target_arch
+ case ${ARCH} in
+ amd64) target_arch=x86_64;;
+ arm64) target_arch=aarch64;;
+ *) die "Unrecognised architecture: ${ARCH}";;
+ esac
+
+ NV_ARGS=(
+ PREFIX="${EPREFIX}"/usr
+ HOST_CC="$(tc-getBUILD_CC)"
+ HOST_LD="$(tc-getBUILD_LD)"
+ BUILD_GTK2LIB=
+ NV_USE_BUNDLED_LIBJANSSON=0
+ NV_VERBOSE=1 DO_STRIP= MANPAGE_GZIP= OUTPUTDIR=out
+ TARGET_ARCH="${target_arch}"
+ WAYLAND_AVAILABLE=$(usex wayland 1 0)
+ XNVCTRL_CFLAGS="${xnvflags}"
+ )
+
+ if use modules; then
+ local o_cflags=${CFLAGS} o_cxxflags=${CXXFLAGS} o_ldflags=${LDFLAGS}
+
+ local modlistargs=video:kernel
+ if use kernel-open; then
+ modlistargs+=-module-source:kernel-module-source/kernel-open
+
+ # environment flags are normally unused for modules, but nvidia
+ # uses it for building the "blob" and it is a bit fragile
+ filter-flags -fno-plt #912949
+ filter-lto
+ CC=${KERNEL_CC} CXX=${KERNEL_CXX} strip-unsupported-flags
+
+ LDFLAGS=$(raw-ldflags)
+
+ # the "blob" uses C++ which is an issue if there is debug symbols
+ # when running pahole, there is a pahole.sh wrapper that tries to
+ # exclude C++ but it did not seem to be enough last time tried
+ linux_chkconfig_present DEBUG_INFO_BTF_MODULES && append-flags -g0
+ fi
+
+ local modlist=( nvidia{,-drm,-modeset,-peermem,-uvm}=${modlistargs} )
+ local modargs=(
+ IGNORE_CC_MISMATCH=yes NV_VERBOSE=1
+ SYSOUT="${KV_OUT_DIR}" SYSSRC="${KV_DIR}"
+ TARGET_ARCH="${target_arch}"
+
+ # kernel takes "x86" and "x86_64" as meaning the same, but nvidia
+ # makes the distinction (since 550.135) and is not happy with "x86"
+ # TODO?: it should be ok/better for tc-arch-kernel to do x86_64
+ $(usev amd64 ARCH=x86_64)
+ )
+
+ # temporary workaround for bug #914468
+ addpredict "${KV_OUT_DIR}"
+
+ linux-mod-r1_src_compile
+ CFLAGS=${o_cflags} CXXFLAGS=${o_cxxflags} LDFLAGS=${o_ldflags}
+ fi
+
+ emake "${NV_ARGS[@]}" -C nvidia-modprobe
+ use persistenced && emake "${NV_ARGS[@]}" -C nvidia-persistenced
+ use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig
+
+ if use tools; then
+ # avoid noisy *very* noisy logs with deprecation warnings
+ CFLAGS="-Wno-deprecated-declarations ${CFLAGS}" \
+ emake "${NV_ARGS[@]}" -C nvidia-settings
+ elif use static-libs; then
+ # pretend GTK+3 is available, not actually used (bug #880879)
+ emake "${NV_ARGS[@]}" BUILD_GTK3LIB=1 \
+ -C nvidia-settings/src out/libXNVCtrl.a
+ fi
+}
+
+src_install() {
+ local libdir=$(get_libdir) libdir32=$(ABI=x86 get_libdir)
+
+ NV_ARGS+=( DESTDIR="${D}" LIBDIR="${ED}"/usr/${libdir} )
+
+ local -A paths=(
+ [APPLICATION_PROFILE]=/usr/share/nvidia
+ [CUDA_ICD]=/etc/OpenCL/vendors
+ [EGL_EXTERNAL_PLATFORM_JSON]=/usr/share/egl/egl_external_platform.d
+ [FIRMWARE]=/lib/firmware/nvidia/${PV}
+ [GBM_BACKEND_LIB_SYMLINK]=/usr/${libdir}/gbm
+ [GLVND_EGL_ICD_JSON]=/usr/share/glvnd/egl_vendor.d
+ [OPENGL_DATA]=/usr/share/nvidia
+ [VULKANSC_ICD_JSON]=/usr/share/vulkansc
+ [VULKAN_ICD_JSON]=/usr/share/vulkan
+ [WINE_LIB]=/usr/${libdir}/nvidia/wine
+ [XORG_OUTPUTCLASS_CONFIG]=/usr/share/X11/xorg.conf.d
+
+ [GLX_MODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules/extensions
+ [GLX_MODULE_SYMLINK]=/usr/${libdir}/xorg/modules
+ [XMODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules
+ )
+
+ local skip_files=(
+ $(usev !X "libGLX_nvidia libglxserver_nvidia")
+ libGLX_indirect # non-glvnd unused fallback
+ libnvidia-{gtk,wayland-client} nvidia-{settings,xconfig} # from source
+ libnvidia-egl-gbm 15_nvidia_gbm # gui-libs/egl-gbm
+ libnvidia-egl-wayland 10_nvidia_wayland # gui-libs/egl-wayland
+ libnvidia-egl-xcb 20_nvidia_xcb.json # gui-libs/egl-x11
+ libnvidia-egl-xlib 20_nvidia_xlib.json # gui-libs/egl-x11
+ libnvidia-pkcs11.so # using the openssl3 version instead
+ )
+ local skip_modules=(
+ $(usev !X "nvfbc vdpau xdriver")
+ $(usev !modules gsp)
+ $(usev !powerd nvtopps)
+ installer nvpd # handled separately / built from source
+ )
+ local skip_types=(
+ GLVND_LIB GLVND_SYMLINK EGL_CLIENT.\* GLX_CLIENT.\* # media-libs/libglvnd
+ OPENCL_WRAPPER.\* # virtual/opencl
+ DOCUMENTATION DOT_DESKTOP .\*_SRC DKMS_CONF SYSTEMD_UNIT # handled separately / unused
+ )
+
+ local DOCS=(
+ README.txt NVIDIA_Changelog supported-gpus/supported-gpus.json
+ nvidia-settings/doc/{FRAMELOCK,NV-CONTROL-API}.txt
+ )
+ local HTML_DOCS=( html/. )
+ einstalldocs
+
+ local DISABLE_AUTOFORMATTING=yes
+ local DOC_CONTENTS="\
+Trusted users should be in the 'video' group to use NVIDIA devices.
+You can add yourself by using: gpasswd -a my-user video\
+$(usev modules "
+
+Like all out-of-tree kernel modules, it is necessary to rebuild
+${PN} after upgrading or rebuilding the Linux kernel
+by for example running \`emerge @module-rebuild\`. Alternatively,
+if using a distribution kernel (sys-kernel/gentoo-kernel{,-bin}),
+this can be automated by setting USE=dist-kernel globally.
+
+Loaded kernel modules also must not mismatch with the installed
+${PN} version (excluding -r revision), meaning should
+ensure \`eselect kernel list\` points to the kernel that will be
+booted before building and preferably reboot after upgrading
+${PN} (the ebuild will emit a warning if mismatching).
+
+See '${EPREFIX}/etc/modprobe.d/nvidia.conf' for modules options.")\
+$(use amd64 && usev !abi_x86_32 "
+
+Note that without USE=abi_x86_32 on ${PN}, 32bit applications
+(typically using wine / steam) will not be able to use GPU acceleration.")
+
+Be warned that USE=kernel-open may need to be either enabled or
+disabled for certain cards to function:
+- GTX 50xx (blackwell) and higher require it to be enabled
+- GTX 1650 and higher (pre-blackwell) should work either way
+- Older cards require it to be disabled
+
+For additional information or for troubleshooting issues, please see
+https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers and NVIDIA's own
+documentation that is installed alongside this README."
+ readme.gentoo_create_doc
+
+ if use modules; then
+ linux-mod-r1_src_install
+
+ insinto /etc/modprobe.d
+ newins "${FILESDIR}"/nvidia-580.conf nvidia.conf
+
+ # used for gpu verification with binpkgs (not kept, see pkg_preinst)
+ insinto /usr/share/nvidia
+ doins supported-gpus/supported-gpus.json
+ fi
+
+ emake "${NV_ARGS[@]}" -C nvidia-modprobe install
+ fowners :video /usr/bin/nvidia-modprobe #505092
+ fperms 4710 /usr/bin/nvidia-modprobe
+
+ if use persistenced; then
+ emake "${NV_ARGS[@]}" -C nvidia-persistenced install
+ newconfd "${FILESDIR}"/nvidia-persistenced.confd nvidia-persistenced
+ newinitd "${FILESDIR}"/nvidia-persistenced.initd nvidia-persistenced
+ systemd_dounit "${T}"/nvidia-persistenced.service
+ fi
+
+ if use tools; then
+ emake "${NV_ARGS[@]}" -C nvidia-settings install
+
+ doicon nvidia-settings/doc/nvidia-settings.png
+ domenu nvidia-settings/doc/nvidia-settings.desktop
+
+ exeinto /etc/X11/xinit/xinitrc.d
+ newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
+ fi
+
+ if use static-libs; then
+ dolib.a nvidia-settings/src/out/libXNVCtrl.a
+ strip-lto-bytecode
+
+ insinto /usr/include/NVCtrl
+ doins nvidia-settings/src/libXNVCtrl/NVCtrl{Lib,}.h
+ fi
+
+ use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig install
+
+ # mimic nvidia-installer by reading .manifest to install files
+ # 0:file 1:perms 2:type 3+:subtype/arguments -:module
+ local m into
+ while IFS=' ' read -ra m; do
+ ! [[ ${#m[@]} -ge 2 && ${m[-1]} =~ MODULE: ]] ||
+ [[ " ${m[0]##*/}" =~ ^(\ ${skip_files[*]/%/.*|\\} )$ ]] ||
+ [[ " ${m[2]}" =~ ^(\ ${skip_types[*]/%/|\\} )$ ]] ||
+ has ${m[-1]#MODULE:} "${skip_modules[@]}" && continue
+
+ case ${m[2]} in
+ MANPAGE)
+ gzip -dc ${m[0]} | newman - ${m[0]%.gz}
+ pipestatus || die
+ continue
+ ;;
+ GBM_BACKEND_LIB_SYMLINK) m[4]=../${m[4]};; # missing ../
+ VDPAU_SYMLINK) m[4]=vdpau/; m[5]=${m[5]#vdpau/};; # .so to vdpau/
+ esac
+
+ if [[ -v 'paths[${m[2]}]' ]]; then
+ into=${paths[${m[2]}]}
+ elif [[ ${m[2]} == EXPLICIT_PATH ]]; then
+ into=${m[3]}
+ elif [[ ${m[2]} == *_BINARY ]]; then
+ into=/usr/bin
+ elif [[ ${m[3]} == COMPAT32 ]]; then
+ use abi_x86_32 || continue
+ into=/usr/${libdir32}
+ elif [[ ${m[2]} == *_@(LIB|SYMLINK) ]]; then
+ into=/usr/${libdir}
+ else
+ die "No known installation path for ${m[0]}"
+ fi
+ [[ ${m[3]: -2} == ?/ ]] && into+=/${m[3]%/}
+ [[ ${m[4]: -2} == ?/ ]] && into+=/${m[4]%/}
+
+ if [[ ${m[2]} =~ _SYMLINK$ ]]; then
+ [[ ${m[4]: -1} == / ]] && m[4]=${m[5]}
+ dosym ${m[4]} ${into}/${m[0]}
+ continue
+ fi
+ # avoid portage warning due to missing soname links in manifest
+ [[ ${m[0]} =~ ^libnvidia-ngx.so ]] &&
+ dosym ${m[0]} ${into}/${m[0]%.so*}.so.1
+
+ printf -v m[1] %o $((m[1] | 0200)) # 444->644
+ insopts -m${m[1]}
+ insinto ${into}
+ doins ${m[0]}
+ done < .manifest || die
+ insopts -m0644 # reset
+
+ # MODULE:installer non-skipped extras
+ : "$(systemd_get_sleepdir)"
+ exeinto "${_#"${EPREFIX}"}"
+ doexe systemd/system-sleep/nvidia
+ dobin systemd/nvidia-sleep.sh
+ systemd_dounit systemd/system/nvidia-{hibernate,resume,suspend,suspend-then-hibernate}.service
+
+ dobin nvidia-bug-report.sh
+
+ insinto /usr/share/nvidia/files.d
+ doins sandboxutils-filelist.json
+
+ # MODULE:powerd extras
+ if use powerd; then
+ newinitd "${FILESDIR}"/nvidia-powerd.initd nvidia-powerd #923117
+ systemd_dounit systemd/system/nvidia-powerd.service
+
+ insinto /usr/share/dbus-1/system.d
+ doins nvidia-dbus.conf
+ fi
+
+ # enabling is needed for sleep to work properly and little reason not to do
+ # it unconditionally for a better user experience
+ : "$(systemd_get_systemunitdir)"
+ local unitdir=${_#"${EPREFIX}"}
+ # not using relative symlinks to match systemd's own links
+ dosym {"${unitdir}",/etc/systemd/system/systemd-hibernate.service.wants}/nvidia-hibernate.service
+ dosym {"${unitdir}",/etc/systemd/system/systemd-hibernate.service.wants}/nvidia-resume.service
+ dosym {"${unitdir}",/etc/systemd/system/systemd-suspend.service.wants}/nvidia-suspend.service
+ dosym {"${unitdir}",/etc/systemd/system/systemd-suspend.service.wants}/nvidia-resume.service
+ dosym {"${unitdir}",/etc/systemd/system/systemd-suspend-then-hibernate.service.wants}/nvidia-suspend-then-hibernate.service
+ dosym {"${unitdir}",/etc/systemd/system/systemd-suspend-then-hibernate.service.wants}/nvidia-resume.service
+ # also add a custom elogind hook to do the equivalent of the above
+ exeinto /usr/lib/elogind/system-sleep
+ newexe "${FILESDIR}"/system-sleep.elogind nvidia
+ # <elogind-255.5 used a different path (bug #939216), keep a compat symlink
+ # TODO: cleanup after 255.5 been stable for a few months
+ dosym {/usr/lib,/"${libdir}"}/elogind/system-sleep/nvidia
+
+ # needed with >=systemd-256 or may fail to resume with some setups
+ # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1072722
+ insinto "${unitdir}"/systemd-homed.service.d
+ newins - 10-nvidia.conf <<-EOF
+ [Service]
+ Environment=SYSTEMD_HOME_LOCK_FREEZE_SESSION=false
+ EOF
+ insinto "${unitdir}"/systemd-suspend.service.d
+ newins - 10-nvidia.conf <<-EOF
+ [Service]
+ Environment=SYSTEMD_SLEEP_FREEZE_USER_SESSIONS=false
+ EOF
+ dosym -r "${unitdir}"/systemd-{suspend,hibernate}.service.d/10-nvidia.conf
+ dosym -r "${unitdir}"/systemd-{suspend,hybrid-sleep}.service.d/10-nvidia.conf
+ dosym -r "${unitdir}"/systemd-{suspend,suspend-then-hibernate}.service.d/10-nvidia.conf
+
+ # symlink non-versioned so nvidia-settings can use it even if misdetected
+ dosym nvidia-application-profiles-${PV}-key-documentation \
+ ${paths[APPLICATION_PROFILE]}/nvidia-application-profiles-key-documentation
+
+ # don't attempt to strip firmware files (silences errors)
+ dostrip -x ${paths[FIRMWARE]}
+
+ # sandbox issues with /dev/nvidiactl and others (bug #904292,#921578)
+ # are widespread and sometime affect revdeps of packages built with
+ # USE=opencl/cuda making it hard to manage in ebuilds (minimal set,
+ # ebuilds should handle manually if need others or addwrite)
+ insinto /etc/sandbox.d
+ newins - 20nvidia <<<'SANDBOX_PREDICT="/dev/nvidiactl:/dev/nvidia-caps:/dev/char"'
+
+ # dracut does not use /etc/modprobe.d if hostonly=no, but want to make sure
+ # our settings are used for bug 932781#c8 and nouveau blacklist if either
+ # modules are included (however, just best-effort without initramfs regen)
+ if use modules; then
+ echo "install_items+=\" ${EPREFIX}/etc/modprobe.d/nvidia.conf \"" >> \
+ "${ED}"/usr/lib/dracut/dracut.conf.d/10-${PN}.conf || die
+ fi
+}
+
+pkg_preinst() {
+ has_version "${CATEGORY}/${PN}[kernel-open]" && NV_HAD_KERNEL_OPEN=
+
+ use modules || return
+
+ # set video group id based on live system (bug #491414)
+ local g=$(egetent group video | cut -d: -f3)
+ [[ ${g} =~ ^[0-9]+$ ]] || die "Failed to determine video group id (got '${g}')"
+ sed -i "s/@VIDEOGID@/${g}/" "${ED}"/etc/modprobe.d/nvidia.conf || die
+
+ # try to find driver mismatches using temporary supported-gpus.json
+ for g in $(grep -l 0x10de /sys/bus/pci/devices/*/vendor 2>/dev/null); do
+ g=$(grep -io "\"devid\":\"$(<${g%vendor}device)\"[^}]*branch\":\"[0-9]*" \
+ "${ED}"/usr/share/nvidia/supported-gpus.json 2>/dev/null)
+ if [[ ${g} ]]; then
+ g=$((${g##*\"}+1))
+ if ver_test -ge ${g}; then
+ NV_LEGACY_MASK=">=${CATEGORY}/${PN}-${g}"
+ break
+ fi
+ fi
+ done
+ rm "${ED}"/usr/share/nvidia/supported-gpus.json || die
+}
+
+pkg_postinst() {
+ linux-mod-r1_pkg_postinst
+
+ readme.gentoo_print_elog
+
+ if [[ -r /proc/driver/nvidia/version &&
+ $(</proc/driver/nvidia/version) != *" ${PV} "* ]]; then
+ ewarn "\nCurrently loaded NVIDIA modules do not match the newly installed"
+ ewarn "libraries and may prevent launching GPU-accelerated applications."
+ if use modules; then
+ ewarn "Easiest way to fix this is normally to reboot. If still run into issues"
+ ewarn "(e.g. API mismatch messages in the \`dmesg\` output), please verify"
+ ewarn "that the running kernel is ${KV_FULL} and that (if used) the"
+ ewarn "initramfs does not include NVIDIA modules (or at least, not old ones)."
+ fi
+ fi
+
+ if [[ $(</proc/cmdline) == *slub_debug=[!-]* ]]; then
+ ewarn "\nDetected that the current kernel command line is using 'slub_debug=',"
+ ewarn "this may lead to system instability/freezes with this version of"
+ ewarn "${PN}. Bug: https://bugs.gentoo.org/796329"
+ fi
+
+ if [[ -v NV_LEGACY_MASK ]]; then
+ ewarn "\n***WARNING***"
+ ewarn "\nYou are installing a version of ${PN} known not to work"
+ ewarn "with a GPU of the current system. If unwanted, add the mask:"
+ if [[ -d ${EROOT}/etc/portage/package.mask ]]; then
+ ewarn "\n echo '${NV_LEGACY_MASK}' > ${EROOT}/etc/portage/package.mask/${PN}"
+ else
+ ewarn "\n echo '${NV_LEGACY_MASK}' >> ${EROOT}/etc/portage/package.mask"
+ fi
+ ewarn "\n...then downgrade to a legacy[1] branch if possible (not all old versions"
+ ewarn "are available or fully functional, may need to consider nouveau[2])."
+ ewarn "\n[1] https://www.nvidia.com/object/IO_32667.html"
+ ewarn "[2] https://wiki.gentoo.org/wiki/Nouveau"
+ fi
+
+ if use kernel-open && use modules && [[ ! -v NV_HAD_KERNEL_OPEN ]]; then
+ ewarn "\nOpen source variant of ${PN} was selected, note that it requires"
+ ewarn "Turing/Ampere+ GPUs (aka GTX 1650+). Try disabling if run into issues."
+ ewarn "Also see: ${EROOT}/usr/share/doc/${PF}/html/kernel_open.html"
+ fi
+
+ if ver_replacing -lt 580.126.09-r1; then
+ elog "\n>=nvidia-drivers-580.126.09-r1 changes some defaults that may or may"
+ elog "not need attention:"
+ elog "1. nvidia-drm.modeset=1 is now default regardless of USE=wayland"
+ elog "2. nvidia-drm.fbdev=1 is now also tentatively default to match upstream"
+ elog "See ${EROOT}/etc/modprobe.d/nvidia.conf to modify settings if needed,"
+ elog "fbdev=1 *could* cause issues for the console display with some setups."
+ fi
+}
diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-580.159.04.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-580.159.04.ebuild
new file mode 100644
index 000000000000..805a533c3ae8
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-580.159.04.ebuild
@@ -0,0 +1,602 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+MODULES_OPTIONAL_IUSE=+modules
+inherit desktop dot-a eapi9-pipestatus eapi9-ver flag-o-matic linux-mod-r1
+inherit readme.gentoo-r1 systemd toolchain-funcs unpacker user-info
+
+MODULES_KERNEL_MAX=7.0
+NV_URI="https://download.nvidia.com/XFree86/"
+
+DESCRIPTION="NVIDIA Accelerated Graphics Driver"
+HOMEPAGE="https://www.nvidia.com/"
+SRC_URI="
+ amd64? ( ${NV_URI}Linux-x86_64/${PV}/NVIDIA-Linux-x86_64-${PV}.run )
+ arm64? ( ${NV_URI}Linux-aarch64/${PV}/NVIDIA-Linux-aarch64-${PV}.run )
+ $(printf "${NV_URI}%s/%s-${PV}.tar.bz2 " \
+ nvidia-{installer,modprobe,persistenced,settings,xconfig}{,})
+ ${NV_URI}NVIDIA-kernel-module-source/NVIDIA-kernel-module-source-${PV}.tar.xz
+"
+# nvidia-installer is unused but here for GPL-2's "distribute sources"
+S=${WORKDIR}
+
+LICENSE="
+ NVIDIA-2025 Apache-2.0 Boost-1.0 BSD BSD-2 GPL-2 MIT ZLIB
+ curl openssl public-domain
+"
+SLOT="0/${PV%%.*}"
+KEYWORDS="-* amd64 ~arm64"
+IUSE="
+ +X abi_x86_32 abi_x86_64 kernel-open persistenced powerd
+ +static-libs +tools wayland
+"
+
+COMMON_DEPEND="
+ acct-group/video
+ X? ( x11-libs/libpciaccess )
+ persistenced? (
+ acct-user/nvpd
+ net-libs/libtirpc:=
+ )
+ tools? (
+ >=app-accessibility/at-spi2-core-2.46:2
+ dev-libs/glib:2
+ dev-libs/jansson:=
+ media-libs/harfbuzz:=
+ x11-libs/cairo
+ x11-libs/gdk-pixbuf:2
+ x11-libs/gtk+:3[X]
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/libXxf86vm
+ x11-libs/pango
+ )
+"
+RDEPEND="
+ ${COMMON_DEPEND}
+ || (
+ dev-libs/openssl-compat:3
+ dev-libs/openssl:0/3
+ )
+ sys-libs/glibc
+ X? (
+ media-libs/libglvnd[X,abi_x86_32(-)?]
+ x11-libs/libX11[abi_x86_32(-)?]
+ x11-libs/libXext[abi_x86_32(-)?]
+ )
+ powerd? ( sys-apps/dbus[abi_x86_32(-)?] )
+ wayland? (
+ >=gui-libs/egl-gbm-1.1.1-r2[abi_x86_32(-)?]
+ >=gui-libs/egl-wayland-1.1.13.1[abi_x86_32(-)?]
+ X? ( gui-libs/egl-x11[abi_x86_32(-)?] )
+ )
+"
+DEPEND="
+ ${COMMON_DEPEND}
+ static-libs? (
+ x11-base/xorg-proto
+ x11-libs/libX11
+ x11-libs/libXext
+ )
+ tools? (
+ dev-util/vulkan-headers
+ media-libs/libglvnd
+ sys-apps/dbus
+ x11-base/xorg-proto
+ x11-libs/libXrandr
+ x11-libs/libXv
+ x11-libs/libvdpau
+ )
+"
+BDEPEND="
+ sys-devel/m4
+ virtual/pkgconfig
+"
+
+# there is some non-prebuilt exceptions but rather not maintain a list
+QA_PREBUILT="lib/firmware/* usr/bin/* usr/lib*"
+
+PATCHES=(
+ "${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch
+ "${FILESDIR}"/nvidia-settings-530.30.02-desktop.patch
+ "${FILESDIR}"/nvidia-drivers-580.159.03-null-deref.patch
+)
+
+pkg_setup() {
+ use modules && [[ ${MERGE_TYPE} != binary ]] || return
+
+ # do early before linux-mod-r1 so can use chkconfig to setup CONFIG_CHECK
+ get_version
+ require_configured_kernel
+
+ local CONFIG_CHECK="
+ PROC_FS
+ ~DRM_KMS_HELPER
+ ~DRM_FBDEV_EMULATION
+ ~SYSVIPC
+ ~!LOCKDEP
+ ~!PREEMPT_RT
+ ~!SLUB_DEBUG_ON
+ !DEBUG_MUTEXES
+ $(usev amd64 'X86_PAT')
+ $(usev powerd '~CPU_FREQ')
+ "
+
+ kernel_is -ge 6 11 && linux_chkconfig_present DRM_FBDEV_EMULATION &&
+ CONFIG_CHECK+=" DRM_TTM_HELPER"
+
+ use kernel-open && CONFIG_CHECK+=" MMU_NOTIFIER" #843827
+
+ local drm_helper_msg="Cannot be directly selected in the kernel's config menus, and may need
+ selection of a DRM device even if unused, e.g. CONFIG_DRM_QXL=m or
+ DRM_AMDGPU=m (among others, consult the kernel config's help), can
+ also use DRM_NOUVEAU=m as long as built as module *not* built-in."
+ local ERROR_DRM_KMS_HELPER="CONFIG_DRM_KMS_HELPER: is not set but is needed for nvidia-drm.modeset=1
+ support (see ${EPREFIX}/etc/modprobe.d/nvidia.conf) which is needed for wayland
+ and for config-less Xorg auto-detection.
+ ${drm_helper_msg}"
+ local ERROR_DRM_TTM_HELPER="CONFIG_DRM_TTM_HELPER: is not set but is needed to compile when using
+ kernel version 6.11.x or newer while DRM_FBDEV_EMULATION is set.
+ ${drm_helper_msg}"
+ local ERROR_DRM_FBDEV_EMULATION="CONFIG_DRM_FBDEV_EMULATION: is not set but is needed for
+ nvidia-drm.fbdev=1 support (see ${EPREFIX}/etc/modprobe.d/nvidia.conf), may
+ result in a blank console/tty."
+ local ERROR_MMU_NOTIFIER="CONFIG_MMU_NOTIFIER: is not set but needed to build with USE=kernel-open.
+ Cannot be directly selected in the kernel's menuconfig, and may need
+ selection of another option that requires it such as CONFIG_AMD_IOMMU=y,
+ or DRM_I915=m (among others, consult the kernel config's help)."
+ local ERROR_PREEMPT_RT="CONFIG_PREEMPT_RT: is set but is unsupported by NVIDIA upstream and
+ will fail to build unless the env var IGNORE_PREEMPT_RT_PRESENCE=1 is
+ set. Please do not report issues if run into e.g. kernel panics while
+ ignoring this."
+
+ linux-mod-r1_pkg_setup
+}
+
+src_prepare() {
+ # make patches usable across versions
+ rm nvidia-modprobe && mv nvidia-modprobe{-${PV},} || die
+ rm nvidia-persistenced && mv nvidia-persistenced{-${PV},} || die
+ rm nvidia-settings && mv nvidia-settings{-${PV},} || die
+ rm nvidia-xconfig && mv nvidia-xconfig{-${PV},} || die
+ mv NVIDIA-kernel-module-source-${PV} kernel-module-source || die
+
+ default
+
+ # prevent detection of incomplete kernel DRM support (bug #603818)
+ sed 's/defined(CONFIG_DRM/defined(CONFIG_DRM_KMS_HELPER/g' \
+ -i kernel{,-module-source/kernel-open}/conftest.sh || die
+
+ sed 's/__USER__/nvpd/' \
+ nvidia-persistenced/init/systemd/nvidia-persistenced.service.template \
+ > "${T}"/nvidia-persistenced.service || die
+
+ # use alternative vulkan icd option if USE=-X (bug #909181)
+ use X || sed -i 's/"libGLX/"libEGL/' nvidia_{layers,icd}.json || die
+
+ # makefile attempts to install wayland library even if not built
+ use wayland || sed -i 's/ WAYLAND_LIB_install$//' \
+ nvidia-settings/src/Makefile || die
+}
+
+src_compile() {
+ tc-export AR CC CXX LD OBJCOPY OBJDUMP PKG_CONFIG
+
+ # extra flags for the libXNVCtrl.a static library
+ local xnvflags=-fPIC #840389
+ tc-is-lto && xnvflags+=" $(test-flags-CC -ffat-lto-objects)"
+
+ # same as uname -m
+ local target_arch
+ case ${ARCH} in
+ amd64) target_arch=x86_64;;
+ arm64) target_arch=aarch64;;
+ *) die "Unrecognised architecture: ${ARCH}";;
+ esac
+
+ NV_ARGS=(
+ PREFIX="${EPREFIX}"/usr
+ HOST_CC="$(tc-getBUILD_CC)"
+ HOST_LD="$(tc-getBUILD_LD)"
+ BUILD_GTK2LIB=
+ NV_USE_BUNDLED_LIBJANSSON=0
+ NV_VERBOSE=1 DO_STRIP= MANPAGE_GZIP= OUTPUTDIR=out
+ TARGET_ARCH="${target_arch}"
+ WAYLAND_AVAILABLE=$(usex wayland 1 0)
+ XNVCTRL_CFLAGS="${xnvflags}"
+ )
+
+ if use modules; then
+ local o_cflags=${CFLAGS} o_cxxflags=${CXXFLAGS} o_ldflags=${LDFLAGS}
+
+ local modlistargs=video:kernel
+ if use kernel-open; then
+ modlistargs+=-module-source:kernel-module-source/kernel-open
+
+ # environment flags are normally unused for modules, but nvidia
+ # uses it for building the "blob" and it is a bit fragile
+ filter-flags -fno-plt #912949
+ filter-lto
+ CC=${KERNEL_CC} CXX=${KERNEL_CXX} strip-unsupported-flags
+
+ LDFLAGS=$(raw-ldflags)
+
+ # the "blob" uses C++ which is an issue if there is debug symbols
+ # when running pahole, there is a pahole.sh wrapper that tries to
+ # exclude C++ but it did not seem to be enough last time tried
+ linux_chkconfig_present DEBUG_INFO_BTF_MODULES && append-flags -g0
+ fi
+
+ local modlist=( nvidia{,-drm,-modeset,-peermem,-uvm}=${modlistargs} )
+ local modargs=(
+ IGNORE_CC_MISMATCH=yes NV_VERBOSE=1
+ SYSOUT="${KV_OUT_DIR}" SYSSRC="${KV_DIR}"
+ TARGET_ARCH="${target_arch}"
+
+ # kernel takes "x86" and "x86_64" as meaning the same, but nvidia
+ # makes the distinction (since 550.135) and is not happy with "x86"
+ # TODO?: it should be ok/better for tc-arch-kernel to do x86_64
+ $(usev amd64 ARCH=x86_64)
+ )
+
+ # temporary workaround for bug #914468
+ addpredict "${KV_OUT_DIR}"
+
+ linux-mod-r1_src_compile
+ CFLAGS=${o_cflags} CXXFLAGS=${o_cxxflags} LDFLAGS=${o_ldflags}
+ fi
+
+ emake "${NV_ARGS[@]}" -C nvidia-modprobe
+ use persistenced && emake "${NV_ARGS[@]}" -C nvidia-persistenced
+ use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig
+
+ if use tools; then
+ # avoid noisy *very* noisy logs with deprecation warnings
+ CFLAGS="-Wno-deprecated-declarations ${CFLAGS}" \
+ emake "${NV_ARGS[@]}" -C nvidia-settings
+ elif use static-libs; then
+ # pretend GTK+3 is available, not actually used (bug #880879)
+ emake "${NV_ARGS[@]}" BUILD_GTK3LIB=1 \
+ -C nvidia-settings/src out/libXNVCtrl.a
+ fi
+}
+
+src_install() {
+ local libdir=$(get_libdir) libdir32=$(ABI=x86 get_libdir)
+
+ NV_ARGS+=( DESTDIR="${D}" LIBDIR="${ED}"/usr/${libdir} )
+
+ local -A paths=(
+ [APPLICATION_PROFILE]=/usr/share/nvidia
+ [CUDA_ICD]=/etc/OpenCL/vendors
+ [EGL_EXTERNAL_PLATFORM_JSON]=/usr/share/egl/egl_external_platform.d
+ [FIRMWARE]=/lib/firmware/nvidia/${PV}
+ [GBM_BACKEND_LIB_SYMLINK]=/usr/${libdir}/gbm
+ [GLVND_EGL_ICD_JSON]=/usr/share/glvnd/egl_vendor.d
+ [OPENGL_DATA]=/usr/share/nvidia
+ [VULKANSC_ICD_JSON]=/usr/share/vulkansc
+ [VULKAN_ICD_JSON]=/usr/share/vulkan
+ [WINE_LIB]=/usr/${libdir}/nvidia/wine
+ [XORG_OUTPUTCLASS_CONFIG]=/usr/share/X11/xorg.conf.d
+
+ [GLX_MODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules/extensions
+ [GLX_MODULE_SYMLINK]=/usr/${libdir}/xorg/modules
+ [XMODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules
+ )
+
+ local skip_files=(
+ $(usev !X "libGLX_nvidia libglxserver_nvidia")
+ libGLX_indirect # non-glvnd unused fallback
+ libnvidia-{gtk,wayland-client} nvidia-{settings,xconfig} # from source
+ libnvidia-egl-gbm 15_nvidia_gbm # gui-libs/egl-gbm
+ libnvidia-egl-wayland 10_nvidia_wayland # gui-libs/egl-wayland
+ libnvidia-egl-xcb 20_nvidia_xcb.json # gui-libs/egl-x11
+ libnvidia-egl-xlib 20_nvidia_xlib.json # gui-libs/egl-x11
+ libnvidia-pkcs11.so # using the openssl3 version instead
+ )
+ local skip_modules=(
+ $(usev !X "nvfbc vdpau xdriver")
+ $(usev !modules gsp)
+ $(usev !powerd nvtopps)
+ installer nvpd # handled separately / built from source
+ )
+ local skip_types=(
+ GLVND_LIB GLVND_SYMLINK EGL_CLIENT.\* GLX_CLIENT.\* # media-libs/libglvnd
+ OPENCL_WRAPPER.\* # virtual/opencl
+ DOCUMENTATION DOT_DESKTOP .\*_SRC DKMS_CONF SYSTEMD_UNIT # handled separately / unused
+ )
+
+ local DOCS=(
+ README.txt NVIDIA_Changelog supported-gpus/supported-gpus.json
+ nvidia-settings/doc/{FRAMELOCK,NV-CONTROL-API}.txt
+ )
+ local HTML_DOCS=( html/. )
+ einstalldocs
+
+ local DISABLE_AUTOFORMATTING=yes
+ local DOC_CONTENTS="\
+Trusted users should be in the 'video' group to use NVIDIA devices.
+You can add yourself by using: gpasswd -a my-user video\
+$(usev modules "
+
+Like all out-of-tree kernel modules, it is necessary to rebuild
+${PN} after upgrading or rebuilding the Linux kernel
+by for example running \`emerge @module-rebuild\`. Alternatively,
+if using a distribution kernel (sys-kernel/gentoo-kernel{,-bin}),
+this can be automated by setting USE=dist-kernel globally.
+
+Loaded kernel modules also must not mismatch with the installed
+${PN} version (excluding -r revision), meaning should
+ensure \`eselect kernel list\` points to the kernel that will be
+booted before building and preferably reboot after upgrading
+${PN} (the ebuild will emit a warning if mismatching).
+
+See '${EPREFIX}/etc/modprobe.d/nvidia.conf' for modules options.")\
+$(use amd64 && usev !abi_x86_32 "
+
+Note that without USE=abi_x86_32 on ${PN}, 32bit applications
+(typically using wine / steam) will not be able to use GPU acceleration.")
+
+Be warned that USE=kernel-open may need to be either enabled or
+disabled for certain cards to function:
+- GTX 50xx (blackwell) and higher require it to be enabled
+- GTX 1650 and higher (pre-blackwell) should work either way
+- Older cards require it to be disabled
+
+For additional information or for troubleshooting issues, please see
+https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers and NVIDIA's own
+documentation that is installed alongside this README."
+ readme.gentoo_create_doc
+
+ if use modules; then
+ linux-mod-r1_src_install
+
+ insinto /etc/modprobe.d
+ newins "${FILESDIR}"/nvidia-580.conf nvidia.conf
+
+ # used for gpu verification with binpkgs (not kept, see pkg_preinst)
+ insinto /usr/share/nvidia
+ doins supported-gpus/supported-gpus.json
+ fi
+
+ emake "${NV_ARGS[@]}" -C nvidia-modprobe install
+ fowners :video /usr/bin/nvidia-modprobe #505092
+ fperms 4710 /usr/bin/nvidia-modprobe
+
+ if use persistenced; then
+ emake "${NV_ARGS[@]}" -C nvidia-persistenced install
+ newconfd "${FILESDIR}"/nvidia-persistenced.confd nvidia-persistenced
+ newinitd "${FILESDIR}"/nvidia-persistenced.initd nvidia-persistenced
+ systemd_dounit "${T}"/nvidia-persistenced.service
+ fi
+
+ if use tools; then
+ emake "${NV_ARGS[@]}" -C nvidia-settings install
+
+ doicon nvidia-settings/doc/nvidia-settings.png
+ domenu nvidia-settings/doc/nvidia-settings.desktop
+
+ exeinto /etc/X11/xinit/xinitrc.d
+ newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
+ fi
+
+ if use static-libs; then
+ dolib.a nvidia-settings/src/out/libXNVCtrl.a
+ strip-lto-bytecode
+
+ insinto /usr/include/NVCtrl
+ doins nvidia-settings/src/libXNVCtrl/NVCtrl{Lib,}.h
+ fi
+
+ use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig install
+
+ # mimic nvidia-installer by reading .manifest to install files
+ # 0:file 1:perms 2:type 3+:subtype/arguments -:module
+ local m into
+ while IFS=' ' read -ra m; do
+ ! [[ ${#m[@]} -ge 2 && ${m[-1]} =~ MODULE: ]] ||
+ [[ " ${m[0]##*/}" =~ ^(\ ${skip_files[*]/%/.*|\\} )$ ]] ||
+ [[ " ${m[2]}" =~ ^(\ ${skip_types[*]/%/|\\} )$ ]] ||
+ has ${m[-1]#MODULE:} "${skip_modules[@]}" && continue
+
+ case ${m[2]} in
+ MANPAGE)
+ gzip -dc ${m[0]} | newman - ${m[0]%.gz}
+ pipestatus || die
+ continue
+ ;;
+ GBM_BACKEND_LIB_SYMLINK) m[4]=../${m[4]};; # missing ../
+ VDPAU_SYMLINK) m[4]=vdpau/; m[5]=${m[5]#vdpau/};; # .so to vdpau/
+ esac
+
+ if [[ -v 'paths[${m[2]}]' ]]; then
+ into=${paths[${m[2]}]}
+ elif [[ ${m[2]} == EXPLICIT_PATH ]]; then
+ into=${m[3]}
+ elif [[ ${m[2]} == *_BINARY ]]; then
+ into=/usr/bin
+ elif [[ ${m[3]} == COMPAT32 ]]; then
+ use abi_x86_32 || continue
+ into=/usr/${libdir32}
+ elif [[ ${m[2]} == *_@(LIB|SYMLINK) ]]; then
+ into=/usr/${libdir}
+ else
+ die "No known installation path for ${m[0]}"
+ fi
+ [[ ${m[3]: -2} == ?/ ]] && into+=/${m[3]%/}
+ [[ ${m[4]: -2} == ?/ ]] && into+=/${m[4]%/}
+
+ if [[ ${m[2]} =~ _SYMLINK$ ]]; then
+ [[ ${m[4]: -1} == / ]] && m[4]=${m[5]}
+ dosym ${m[4]} ${into}/${m[0]}
+ continue
+ fi
+ # avoid portage warning due to missing soname links in manifest
+ [[ ${m[0]} =~ ^libnvidia-ngx.so ]] &&
+ dosym ${m[0]} ${into}/${m[0]%.so*}.so.1
+
+ printf -v m[1] %o $((m[1] | 0200)) # 444->644
+ insopts -m${m[1]}
+ insinto ${into}
+ doins ${m[0]}
+ done < .manifest || die
+ insopts -m0644 # reset
+
+ # MODULE:installer non-skipped extras
+ : "$(systemd_get_sleepdir)"
+ exeinto "${_#"${EPREFIX}"}"
+ doexe systemd/system-sleep/nvidia
+ dobin systemd/nvidia-sleep.sh
+ systemd_dounit systemd/system/nvidia-{hibernate,resume,suspend,suspend-then-hibernate}.service
+
+ dobin nvidia-bug-report.sh
+
+ insinto /usr/share/nvidia/files.d
+ doins sandboxutils-filelist.json
+
+ # MODULE:powerd extras
+ if use powerd; then
+ newinitd "${FILESDIR}"/nvidia-powerd.initd nvidia-powerd #923117
+ systemd_dounit systemd/system/nvidia-powerd.service
+
+ insinto /usr/share/dbus-1/system.d
+ doins nvidia-dbus.conf
+ fi
+
+ # enabling is needed for sleep to work properly and little reason not to do
+ # it unconditionally for a better user experience
+ : "$(systemd_get_systemunitdir)"
+ local unitdir=${_#"${EPREFIX}"}
+ # not using relative symlinks to match systemd's own links
+ dosym {"${unitdir}",/etc/systemd/system/systemd-hibernate.service.wants}/nvidia-hibernate.service
+ dosym {"${unitdir}",/etc/systemd/system/systemd-hibernate.service.wants}/nvidia-resume.service
+ dosym {"${unitdir}",/etc/systemd/system/systemd-suspend.service.wants}/nvidia-suspend.service
+ dosym {"${unitdir}",/etc/systemd/system/systemd-suspend.service.wants}/nvidia-resume.service
+ dosym {"${unitdir}",/etc/systemd/system/systemd-suspend-then-hibernate.service.wants}/nvidia-suspend-then-hibernate.service
+ dosym {"${unitdir}",/etc/systemd/system/systemd-suspend-then-hibernate.service.wants}/nvidia-resume.service
+ # also add a custom elogind hook to do the equivalent of the above
+ exeinto /usr/lib/elogind/system-sleep
+ newexe "${FILESDIR}"/system-sleep.elogind nvidia
+ # <elogind-255.5 used a different path (bug #939216), keep a compat symlink
+ # TODO: cleanup after 255.5 been stable for a few months
+ dosym {/usr/lib,/"${libdir}"}/elogind/system-sleep/nvidia
+
+ # needed with >=systemd-256 or may fail to resume with some setups
+ # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1072722
+ insinto "${unitdir}"/systemd-homed.service.d
+ newins - 10-nvidia.conf <<-EOF
+ [Service]
+ Environment=SYSTEMD_HOME_LOCK_FREEZE_SESSION=false
+ EOF
+ insinto "${unitdir}"/systemd-suspend.service.d
+ newins - 10-nvidia.conf <<-EOF
+ [Service]
+ Environment=SYSTEMD_SLEEP_FREEZE_USER_SESSIONS=false
+ EOF
+ dosym -r "${unitdir}"/systemd-{suspend,hibernate}.service.d/10-nvidia.conf
+ dosym -r "${unitdir}"/systemd-{suspend,hybrid-sleep}.service.d/10-nvidia.conf
+ dosym -r "${unitdir}"/systemd-{suspend,suspend-then-hibernate}.service.d/10-nvidia.conf
+
+ # symlink non-versioned so nvidia-settings can use it even if misdetected
+ dosym nvidia-application-profiles-${PV}-key-documentation \
+ ${paths[APPLICATION_PROFILE]}/nvidia-application-profiles-key-documentation
+
+ # don't attempt to strip firmware files (silences errors)
+ dostrip -x ${paths[FIRMWARE]}
+
+ # sandbox issues with /dev/nvidiactl and others (bug #904292,#921578)
+ # are widespread and sometime affect revdeps of packages built with
+ # USE=opencl/cuda making it hard to manage in ebuilds (minimal set,
+ # ebuilds should handle manually if need others or addwrite)
+ insinto /etc/sandbox.d
+ newins - 20nvidia <<<'SANDBOX_PREDICT="/dev/nvidiactl:/dev/nvidia-caps:/dev/char"'
+
+ # dracut does not use /etc/modprobe.d if hostonly=no, but want to make sure
+ # our settings are used for bug 932781#c8 and nouveau blacklist if either
+ # modules are included (however, just best-effort without initramfs regen)
+ if use modules; then
+ echo "install_items+=\" ${EPREFIX}/etc/modprobe.d/nvidia.conf \"" >> \
+ "${ED}"/usr/lib/dracut/dracut.conf.d/10-${PN}.conf || die
+ fi
+}
+
+pkg_preinst() {
+ has_version "${CATEGORY}/${PN}[kernel-open]" && NV_HAD_KERNEL_OPEN=
+
+ use modules || return
+
+ # set video group id based on live system (bug #491414)
+ local g=$(egetent group video | cut -d: -f3)
+ [[ ${g} =~ ^[0-9]+$ ]] || die "Failed to determine video group id (got '${g}')"
+ sed -i "s/@VIDEOGID@/${g}/" "${ED}"/etc/modprobe.d/nvidia.conf || die
+
+ # try to find driver mismatches using temporary supported-gpus.json
+ for g in $(grep -l 0x10de /sys/bus/pci/devices/*/vendor 2>/dev/null); do
+ g=$(grep -io "\"devid\":\"$(<${g%vendor}device)\"[^}]*branch\":\"[0-9]*" \
+ "${ED}"/usr/share/nvidia/supported-gpus.json 2>/dev/null)
+ if [[ ${g} ]]; then
+ g=$((${g##*\"}+1))
+ if ver_test -ge ${g}; then
+ NV_LEGACY_MASK=">=${CATEGORY}/${PN}-${g}"
+ break
+ fi
+ fi
+ done
+ rm "${ED}"/usr/share/nvidia/supported-gpus.json || die
+}
+
+pkg_postinst() {
+ linux-mod-r1_pkg_postinst
+
+ readme.gentoo_print_elog
+
+ if [[ -r /proc/driver/nvidia/version &&
+ $(</proc/driver/nvidia/version) != *" ${PV} "* ]]; then
+ ewarn "\nCurrently loaded NVIDIA modules do not match the newly installed"
+ ewarn "libraries and may prevent launching GPU-accelerated applications."
+ if use modules; then
+ ewarn "Easiest way to fix this is normally to reboot. If still run into issues"
+ ewarn "(e.g. API mismatch messages in the \`dmesg\` output), please verify"
+ ewarn "that the running kernel is ${KV_FULL} and that (if used) the"
+ ewarn "initramfs does not include NVIDIA modules (or at least, not old ones)."
+ fi
+ fi
+
+ if [[ $(</proc/cmdline) == *slub_debug=[!-]* ]]; then
+ ewarn "\nDetected that the current kernel command line is using 'slub_debug=',"
+ ewarn "this may lead to system instability/freezes with this version of"
+ ewarn "${PN}. Bug: https://bugs.gentoo.org/796329"
+ fi
+
+ if [[ -v NV_LEGACY_MASK ]]; then
+ ewarn "\n***WARNING***"
+ ewarn "\nYou are installing a version of ${PN} known not to work"
+ ewarn "with a GPU of the current system. If unwanted, add the mask:"
+ if [[ -d ${EROOT}/etc/portage/package.mask ]]; then
+ ewarn "\n echo '${NV_LEGACY_MASK}' > ${EROOT}/etc/portage/package.mask/${PN}"
+ else
+ ewarn "\n echo '${NV_LEGACY_MASK}' >> ${EROOT}/etc/portage/package.mask"
+ fi
+ ewarn "\n...then downgrade to a legacy[1] branch if possible (not all old versions"
+ ewarn "are available or fully functional, may need to consider nouveau[2])."
+ ewarn "\n[1] https://www.nvidia.com/object/IO_32667.html"
+ ewarn "[2] https://wiki.gentoo.org/wiki/Nouveau"
+ fi
+
+ if use kernel-open && use modules && [[ ! -v NV_HAD_KERNEL_OPEN ]]; then
+ ewarn "\nOpen source variant of ${PN} was selected, note that it requires"
+ ewarn "Turing/Ampere+ GPUs (aka GTX 1650+). Try disabling if run into issues."
+ ewarn "Also see: ${EROOT}/usr/share/doc/${PF}/html/kernel_open.html"
+ fi
+
+ if ver_replacing -lt 580.126.09-r1; then
+ elog "\n>=nvidia-drivers-580.126.09-r1 changes some defaults that may or may"
+ elog "not need attention:"
+ elog "1. nvidia-drm.modeset=1 is now default regardless of USE=wayland"
+ elog "2. nvidia-drm.fbdev=1 is now also tentatively default to match upstream"
+ elog "See ${EROOT}/etc/modprobe.d/nvidia.conf to modify settings if needed,"
+ elog "fbdev=1 *could* cause issues for the console display with some setups."
+ fi
+}
diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-595.44.09.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-595.44.09.ebuild
new file mode 100644
index 000000000000..21061e333524
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-595.44.09.ebuild
@@ -0,0 +1,557 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+MODULES_OPTIONAL_IUSE=+modules
+inherit desktop dot-a eapi9-pipestatus eapi9-ver flag-o-matic linux-mod-r1
+inherit readme.gentoo-r1 systemd toolchain-funcs unpacker user-info
+
+MODULES_KERNEL_MAX=7.0
+NV_PIN=595.71.05
+
+DESCRIPTION="NVIDIA Accelerated Graphics Driver"
+HOMEPAGE="https://developer.nvidia.com/vulkan-driver/"
+SRC_URI="
+ https://developer.nvidia.com/downloads/vulkan-beta-${PV//.}-linux
+ -> NVIDIA-Linux-x86_64-${PV}.run
+ $(printf "https://download.nvidia.com/XFree86/%s/%s-${NV_PIN}.tar.bz2 " \
+ nvidia-{installer,modprobe,persistenced,settings,xconfig}{,})
+ https://github.com/NVIDIA/open-gpu-kernel-modules/archive/refs/tags/${PV}.tar.gz
+ -> open-gpu-kernel-modules-${PV}.tar.gz
+"
+# nvidia-installer is unused but here for GPL-2's "distribute sources"
+S=${WORKDIR}
+
+LICENSE="
+ NVIDIA-2025 Apache-2.0 Boost-1.0 BSD BSD-2 GPL-2 MIT ZLIB
+ curl openssl public-domain
+"
+SLOT="0/vulkan"
+KEYWORDS="-* ~amd64"
+IUSE="+X abi_x86_32 abi_x86_64 persistenced powerd +static-libs +tools wayland"
+
+COMMON_DEPEND="
+ acct-group/video
+ X? ( x11-libs/libpciaccess )
+ persistenced? (
+ acct-user/nvpd
+ net-libs/libtirpc:=
+ )
+ tools? (
+ >=app-accessibility/at-spi2-core-2.46:2
+ dev-libs/glib:2
+ dev-libs/jansson:=
+ media-libs/harfbuzz:=
+ x11-libs/cairo
+ x11-libs/gdk-pixbuf:2
+ x11-libs/gtk+:3[X]
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/libXxf86vm
+ x11-libs/pango
+ )
+"
+# egl-wayland2: nvidia currently ships both versions so, to ensure
+# everything works properly, depend on both at same time for now
+# (may use one or the other depending on setup)
+RDEPEND="
+ ${COMMON_DEPEND}
+ || (
+ dev-libs/openssl-compat:3
+ dev-libs/openssl:0/3
+ )
+ sys-libs/glibc
+ X? (
+ media-libs/libglvnd[X,abi_x86_32(-)?]
+ x11-libs/libX11[abi_x86_32(-)?]
+ x11-libs/libXext[abi_x86_32(-)?]
+ )
+ powerd? ( sys-apps/dbus[abi_x86_32(-)?] )
+ wayland? (
+ >=gui-libs/egl-gbm-1.1.1-r2[abi_x86_32(-)?]
+ >=gui-libs/egl-wayland-1.1.13.1[abi_x86_32(-)?]
+ gui-libs/egl-wayland2[abi_x86_32(-)?]
+ X? ( gui-libs/egl-x11[abi_x86_32(-)?] )
+ )
+"
+DEPEND="
+ ${COMMON_DEPEND}
+ static-libs? (
+ x11-base/xorg-proto
+ x11-libs/libX11
+ x11-libs/libXext
+ )
+ tools? (
+ dev-util/vulkan-headers
+ media-libs/libglvnd
+ sys-apps/dbus
+ x11-base/xorg-proto
+ x11-libs/libXrandr
+ x11-libs/libXv
+ x11-libs/libvdpau
+ )
+"
+BDEPEND="
+ sys-devel/m4
+ virtual/pkgconfig
+"
+
+# there is some non-prebuilt exceptions but rather not maintain a list
+QA_PREBUILT="lib/firmware/* usr/bin/* usr/lib*"
+
+PATCHES=(
+ "${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch
+ "${FILESDIR}"/nvidia-settings-530.30.02-desktop.patch
+)
+
+pkg_setup() {
+ use modules && [[ ${MERGE_TYPE} != binary ]] || return
+
+ # do early before linux-mod-r1 so can use chkconfig to setup CONFIG_CHECK
+ get_version
+ require_configured_kernel
+
+ local CONFIG_CHECK="
+ PROC_FS
+ ~DRM_KMS_HELPER
+ ~DRM_FBDEV_EMULATION
+ ~SYSVIPC
+ ~!LOCKDEP
+ ~!PREEMPT_RT
+ ~!SLUB_DEBUG_ON
+ !DEBUG_MUTEXES
+ $(usev amd64 'X86_PAT')
+ $(usev powerd '~CPU_FREQ')
+ "
+
+ kernel_is -ge 6 11 && linux_chkconfig_present DRM_FBDEV_EMULATION &&
+ CONFIG_CHECK+=" DRM_TTM_HELPER"
+
+ local drm_helper_msg="Cannot be directly selected in the kernel's config menus, and may need
+ selection of a DRM device even if unused, e.g. CONFIG_DRM_QXL=m or
+ DRM_AMDGPU=m (among others, consult the kernel config's help), can
+ also use DRM_NOUVEAU=m as long as built as module *not* built-in."
+ local ERROR_DRM_KMS_HELPER="CONFIG_DRM_KMS_HELPER: is not set but is needed for wayland support,
+ tty takeover (e.g. for simpledrm), and config-less Xorg auto-detection.
+ ${drm_helper_msg}"
+ local ERROR_DRM_TTM_HELPER="CONFIG_DRM_TTM_HELPER: is not set but is needed to compile when using
+ kernel version 6.11.x or newer while DRM_FBDEV_EMULATION is set.
+ ${drm_helper_msg}"
+ local ERROR_DRM_FBDEV_EMULATION="CONFIG_DRM_FBDEV_EMULATION: is not set but is needed for
+ nvidia-drm.fbdev=1 support (see ${EPREFIX}/etc/modprobe.d/nvidia.conf), may
+ result in a blank console/tty."
+ local ERROR_PREEMPT_RT="CONFIG_PREEMPT_RT: is set but is unsupported by NVIDIA upstream and
+ will fail to build unless the env var IGNORE_PREEMPT_RT_PRESENCE=1 is
+ set. Please do not report issues if run into e.g. kernel panics while
+ ignoring this."
+
+ linux-mod-r1_pkg_setup
+}
+
+src_prepare() {
+ # make patches usable across versions
+ rm nvidia-modprobe && mv nvidia-modprobe{-${NV_PIN},} || die
+ rm nvidia-persistenced && mv nvidia-persistenced{-${NV_PIN},} || die
+ rm nvidia-settings && mv nvidia-settings{-${NV_PIN},} || die
+ rm nvidia-xconfig && mv nvidia-xconfig{-${NV_PIN},} || die
+ mv open-gpu-kernel-modules-${PV} kernel-module-source || die
+
+ default
+
+ sed 's/__USER__/nvpd/' \
+ nvidia-persistenced/init/systemd/nvidia-persistenced.service.template \
+ > "${T}"/nvidia-persistenced.service || die
+
+ # use alternative vulkan icd option if USE=-X (bug #909181)
+ use X || sed -i 's/"libGLX/"libEGL/' nvidia_{layers,icd}.json || die
+
+ # makefile attempts to install wayland library even if not built
+ use wayland || sed -i 's/ WAYLAND_LIB_install$//' \
+ nvidia-settings/src/Makefile || die
+}
+
+src_compile() {
+ tc-export AR CC CXX LD OBJCOPY OBJDUMP PKG_CONFIG
+
+ # extra flags for the libXNVCtrl.a static library
+ local xnvflags=-fPIC #840389
+ tc-is-lto && xnvflags+=" $(test-flags-CC -ffat-lto-objects)"
+
+ # same as uname -m
+ local target_arch
+ case ${ARCH} in
+ amd64) target_arch=x86_64;;
+ arm64) target_arch=aarch64;;
+ *) die "Unrecognised architecture: ${ARCH}";;
+ esac
+
+ NV_ARGS=(
+ PREFIX="${EPREFIX}"/usr
+ HOST_CC="$(tc-getBUILD_CC)"
+ HOST_LD="$(tc-getBUILD_LD)"
+ BUILD_GTK2LIB=
+ NV_USE_BUNDLED_LIBJANSSON=0
+ NV_VERBOSE=1 DO_STRIP= MANPAGE_GZIP= OUTPUTDIR=out
+ TARGET_ARCH="${target_arch}"
+ WAYLAND_AVAILABLE=$(usex wayland 1 0)
+ XNVCTRL_CFLAGS="${xnvflags}"
+ )
+
+ if use modules; then
+ local o_cflags=${CFLAGS} o_cxxflags=${CXXFLAGS} o_ldflags=${LDFLAGS}
+
+ # environment flags are normally unused for modules, but nvidia uses
+ # them for building the formerly closed "blob" and it is a bit fragile
+ filter-flags -fno-plt #912949
+ filter-lto
+ CC=${KERNEL_CC} CXX=${KERNEL_CXX} strip-unsupported-flags
+ LDFLAGS=$(raw-ldflags)
+
+ # the "blob" uses C++ which is an issue if there is debug symbols
+ # when running pahole, there is a pahole.sh wrapper that tries to
+ # exclude C++ but it did not seem to be enough last time tried
+ linux_chkconfig_present DEBUG_INFO_BTF_MODULES && append-flags -g0
+
+ : video:kernel-module-source:kernel-module-source/kernel-open
+ local modlist=( nvidia{,-drm,-modeset,-peermem,-uvm}=${_} )
+ local modargs=(
+ IGNORE_CC_MISMATCH=yes NV_VERBOSE=1
+ SYSOUT="${KV_OUT_DIR}" SYSSRC="${KV_DIR}"
+ TARGET_ARCH="${target_arch}"
+
+ # kernel takes "x86" and "x86_64" as meaning the same, but nvidia
+ # makes the distinction (since 550.135) and is not happy with "x86"
+ # TODO?: it should be ok/better for tc-arch-kernel to do x86_64
+ $(usev amd64 ARCH=x86_64)
+ )
+
+ # temporary workaround for bug #914468
+ addpredict "${KV_OUT_DIR}"
+
+ linux-mod-r1_src_compile
+ CFLAGS=${o_cflags} CXXFLAGS=${o_cxxflags} LDFLAGS=${o_ldflags}
+ fi
+
+ emake "${NV_ARGS[@]}" -C nvidia-modprobe
+ use persistenced && emake "${NV_ARGS[@]}" -C nvidia-persistenced
+ use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig
+
+ if use tools; then
+ # avoid noisy *very* noisy logs with deprecation warnings
+ CFLAGS="-Wno-deprecated-declarations ${CFLAGS}" \
+ emake "${NV_ARGS[@]}" -C nvidia-settings
+ elif use static-libs; then
+ # pretend GTK+3 is available, not actually used (bug #880879)
+ emake "${NV_ARGS[@]}" BUILD_GTK3LIB=1 \
+ -C nvidia-settings/src out/libXNVCtrl.a
+ fi
+}
+
+src_install() {
+ local libdir=$(get_libdir) libdir32=$(ABI=x86 get_libdir)
+
+ NV_ARGS+=( DESTDIR="${D}" LIBDIR="${ED}"/usr/${libdir} )
+
+ local -A paths=(
+ [APPLICATION_PROFILE]=/usr/share/nvidia
+ [CUDA_ICD]=/etc/OpenCL/vendors
+ [EGL_EXTERNAL_PLATFORM_JSON]=/usr/share/egl/egl_external_platform.d
+ [FIRMWARE]=/lib/firmware/nvidia/${PV}
+ [GBM_BACKEND_LIB_SYMLINK]=/usr/${libdir}/gbm
+ [GLVND_EGL_ICD_JSON]=/usr/share/glvnd/egl_vendor.d
+ [OPENGL_DATA]=/usr/share/nvidia
+ [VULKANSC_ICD_JSON]=/usr/share/vulkansc
+ [VULKAN_ICD_JSON]=/usr/share/vulkan
+ [WINE_LIB]=/usr/${libdir}/nvidia/wine
+ [XORG_OUTPUTCLASS_CONFIG]=/usr/share/X11/xorg.conf.d
+
+ [GLX_MODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules/extensions
+ [GLX_MODULE_SYMLINK]=/usr/${libdir}/xorg/modules
+ [XMODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules
+ )
+
+ local skip_files=(
+ $(usev !X "libGLX_nvidia libglxserver_nvidia")
+ libGLX_indirect # non-glvnd unused fallback
+ libnvidia-{gtk,wayland-client} nvidia-{settings,xconfig} # from source
+ libnvidia-egl-gbm 15_nvidia_gbm # gui-libs/egl-gbm
+ libnvidia-egl-wayland 10_nvidia_wayland # gui-libs/egl-wayland
+ libnvidia-egl-wayland2 09_nvidia_wayland2 # gui-libs/egl-wayland2
+ libnvidia-egl-xcb 20_nvidia_xcb.json # gui-libs/egl-x11
+ libnvidia-egl-xlib 20_nvidia_xlib.json # gui-libs/egl-x11
+ libnvidia-pkcs11.so # using the openssl3 version instead
+ )
+ local skip_modules=(
+ $(usev !X "nvfbc vdpau xdriver")
+ $(usev !modules gsp)
+ $(usev !powerd nvtopps)
+ installer nvpd # handled separately / built from source
+ )
+ local skip_types=(
+ GLVND_LIB GLVND_SYMLINK EGL_CLIENT.\* GLX_CLIENT.\* # media-libs/libglvnd
+ OPENCL_WRAPPER.\* # virtual/opencl
+ DOCUMENTATION DOT_DESKTOP .\*_SRC DKMS_CONF SYSTEMD_UNIT # handled separately / unused
+ )
+
+ local DOCS=(
+ README.txt NVIDIA_Changelog supported-gpus/supported-gpus.json
+ nvidia-settings/doc/{FRAMELOCK,NV-CONTROL-API}.txt
+ )
+ local HTML_DOCS=( html/. )
+ einstalldocs
+
+ local DISABLE_AUTOFORMATTING=yes
+ local DOC_CONTENTS="\
+Trusted users should be in the 'video' group to use NVIDIA devices.
+You can add yourself by using: gpasswd -a my-user video\
+$(usev modules "
+
+Like all out-of-tree kernel modules, it is necessary to rebuild
+${PN} after upgrading or rebuilding the Linux kernel
+by for example running \`emerge @module-rebuild\`. Alternatively,
+if using a distribution kernel (sys-kernel/gentoo-kernel{,-bin}),
+this can be automated by setting USE=dist-kernel globally.
+
+Loaded kernel modules also must not mismatch with the installed
+${PN} version (excluding -r revision), meaning should
+ensure \`eselect kernel list\` points to the kernel that will be
+booted before building and preferably reboot after upgrading
+${PN} (the ebuild will emit a warning if mismatching).
+
+See '${EPREFIX}/etc/modprobe.d/nvidia.conf' for modules options.")\
+$(use amd64 && usev !abi_x86_32 "
+
+Note that without USE=abi_x86_32 on ${PN}, 32bit applications
+(typically using wine / steam) will not be able to use GPU acceleration.")
+
+For additional information or for troubleshooting issues, please see
+https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers and NVIDIA's own
+documentation that is installed alongside this README."
+ readme.gentoo_create_doc
+
+ if use modules; then
+ linux-mod-r1_src_install
+
+ insinto /etc/modprobe.d
+ newins "${FILESDIR}"/nvidia-595.conf nvidia.conf
+
+ # used for gpu verification with binpkgs (not kept, see pkg_preinst)
+ insinto /usr/share/nvidia
+ doins supported-gpus/supported-gpus.json
+ fi
+
+ emake "${NV_ARGS[@]}" -C nvidia-modprobe install
+ fowners :video /usr/bin/nvidia-modprobe #505092
+ fperms 4710 /usr/bin/nvidia-modprobe
+
+ if use persistenced; then
+ emake "${NV_ARGS[@]}" -C nvidia-persistenced install
+ newconfd "${FILESDIR}"/nvidia-persistenced.confd nvidia-persistenced
+ newinitd "${FILESDIR}"/nvidia-persistenced.initd nvidia-persistenced
+ systemd_dounit "${T}"/nvidia-persistenced.service
+ fi
+
+ if use tools; then
+ emake "${NV_ARGS[@]}" -C nvidia-settings install
+
+ doicon nvidia-settings/doc/nvidia-settings.png
+ domenu nvidia-settings/doc/nvidia-settings.desktop
+
+ exeinto /etc/X11/xinit/xinitrc.d
+ newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
+ fi
+
+ if use static-libs; then
+ dolib.a nvidia-settings/src/out/libXNVCtrl.a
+ strip-lto-bytecode
+
+ insinto /usr/include/NVCtrl
+ doins nvidia-settings/src/libXNVCtrl/NVCtrl{Lib,}.h
+ fi
+
+ use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig install
+
+ # mimic nvidia-installer by reading .manifest to install files
+ # 0:file 1:perms 2:type 3+:subtype/arguments -:module
+ local m into
+ while IFS=' ' read -ra m; do
+ ! [[ ${#m[@]} -ge 2 && ${m[-1]} =~ MODULE: ]] ||
+ [[ " ${m[0]##*/}" =~ ^(\ ${skip_files[*]/%/.*|\\} )$ ]] ||
+ [[ " ${m[2]}" =~ ^(\ ${skip_types[*]/%/|\\} )$ ]] ||
+ has ${m[-1]#MODULE:} "${skip_modules[@]}" && continue
+
+ case ${m[2]} in
+ MANPAGE)
+ gzip -dc ${m[0]} | newman - ${m[0]%.gz}
+ pipestatus || die
+ continue
+ ;;
+ GBM_BACKEND_LIB_SYMLINK) m[4]=../${m[4]};; # missing ../
+ VDPAU_SYMLINK) m[4]=vdpau/; m[5]=${m[5]#vdpau/};; # .so to vdpau/
+ esac
+
+ if [[ -v 'paths[${m[2]}]' ]]; then
+ into=${paths[${m[2]}]}
+ elif [[ ${m[2]} == EXPLICIT_PATH ]]; then
+ into=${m[3]}
+ elif [[ ${m[2]} == *_BINARY ]]; then
+ into=/usr/bin
+ elif [[ ${m[3]} == COMPAT32 ]]; then
+ use abi_x86_32 || continue
+ into=/usr/${libdir32}
+ elif [[ ${m[2]} == *_@(LIB|SYMLINK) ]]; then
+ into=/usr/${libdir}
+ else
+ die "No known installation path for ${m[0]}"
+ fi
+ [[ ${m[3]: -2} == ?/ ]] && into+=/${m[3]%/}
+ [[ ${m[4]: -2} == ?/ ]] && into+=/${m[4]%/}
+
+ if [[ ${m[2]} =~ _SYMLINK$ ]]; then
+ [[ ${m[4]: -1} == / ]] && m[4]=${m[5]}
+ dosym ${m[4]} ${into}/${m[0]}
+ continue
+ fi
+ # avoid portage warning due to missing soname links in manifest
+ [[ ${m[0]} =~ ^libnvidia-ngx.so ]] &&
+ dosym ${m[0]} ${into}/${m[0]%.so*}.so.1
+
+ printf -v m[1] %o $((m[1] | 0200)) # 444->644
+ insopts -m${m[1]}
+ insinto ${into}
+ doins ${m[0]}
+ done < .manifest || die
+ insopts -m0644 # reset
+
+ # MODULE:installer non-skipped extras
+ # (sleep services skipped, obsoleted by NVreg_UseKernelSuspendNotifiers=1)
+ dobin nvidia-bug-report.sh
+
+ insinto /usr/share/nvidia/files.d
+ doins sandboxutils-filelist.json
+
+ # needed with >=systemd-256 or may fail to resume with some setups
+ # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1072722
+ : "$(systemd_get_systemunitdir)"
+ local unitdir=${_#"${EPREFIX}"}
+ insinto "${unitdir}"/systemd-homed.service.d
+ newins - 10-nvidia.conf <<-EOF
+ [Service]
+ Environment=SYSTEMD_HOME_LOCK_FREEZE_SESSION=false
+ EOF
+ insinto "${unitdir}"/systemd-suspend.service.d
+ newins systemd/system/systemd-suspend.service.d/nvidia-suspend-nofreeze.conf 10-nvidia.conf
+ dosym -r "${unitdir}"/systemd-{suspend,hibernate}.service.d/10-nvidia.conf
+ dosym -r "${unitdir}"/systemd-{suspend,hybrid-sleep}.service.d/10-nvidia.conf
+ dosym -r "${unitdir}"/systemd-{suspend,suspend-then-hibernate}.service.d/10-nvidia.conf
+
+ # MODULE:powerd extras
+ if use powerd; then
+ newinitd "${FILESDIR}"/nvidia-powerd.initd nvidia-powerd #923117
+ systemd_dounit systemd/system/nvidia-powerd.service
+
+ insinto /usr/share/dbus-1/system.d
+ doins nvidia-dbus.conf
+ fi
+
+ # symlink non-versioned so nvidia-settings can use it even if misdetected
+ dosym nvidia-application-profiles-${PV}-key-documentation \
+ ${paths[APPLICATION_PROFILE]}/nvidia-application-profiles-key-documentation
+
+ # don't attempt to strip firmware files (silences errors)
+ dostrip -x ${paths[FIRMWARE]}
+
+ # sandbox issues with /dev/nvidiactl and others (bug #904292,#921578)
+ # are widespread and sometime affect revdeps of packages built with
+ # USE=opencl/cuda making it hard to manage in ebuilds (minimal set,
+ # ebuilds should handle manually if need others or addwrite)
+ insinto /etc/sandbox.d
+ newins - 20nvidia <<<'SANDBOX_PREDICT="/dev/nvidiactl:/dev/nvidia-caps:/dev/char"'
+
+ # dracut does not use /etc/modprobe.d if hostonly=no, but want to make sure
+ # our settings are used for bug 932781#c8 and nouveau blacklist if either
+ # modules are included (however, just best-effort without initramfs regen)
+ if use modules; then
+ echo "install_items+=\" ${EPREFIX}/etc/modprobe.d/nvidia.conf \"" >> \
+ "${ED}"/usr/lib/dracut/dracut.conf.d/10-${PN}.conf || die
+ fi
+}
+
+pkg_preinst() {
+ use modules || return
+
+ # set video group id based on live system (bug #491414)
+ local g=$(egetent group video | cut -d: -f3)
+ [[ ${g} =~ ^[0-9]+$ ]] || die "Failed to determine video group id (got '${g}')"
+ sed -i "s/@VIDEOGID@/${g}/" "${ED}"/etc/modprobe.d/nvidia.conf || die
+
+ # try to find driver mismatches using temporary supported-gpus.json
+ for g in $(grep -l 0x10de /sys/bus/pci/devices/*/vendor 2>/dev/null); do
+ g=$(grep -io "\"devid\":\"$(<${g%vendor}device)\"[^}]*branch\":\"[0-9]*" \
+ "${ED}"/usr/share/nvidia/supported-gpus.json 2>/dev/null)
+ if [[ ${g} ]]; then
+ g=$((${g##*\"}+1))
+ if ver_test -ge ${g}; then
+ NV_LEGACY_MASK=">=${CATEGORY}/${PN}-${g}"
+ break
+ fi
+ fi
+ done
+ rm "${ED}"/usr/share/nvidia/supported-gpus.json || die
+}
+
+pkg_postinst() {
+ linux-mod-r1_pkg_postinst
+
+ readme.gentoo_print_elog
+
+ if [[ -r /proc/driver/nvidia/version &&
+ $(</proc/driver/nvidia/version) != *" ${PV} "* ]]; then
+ ewarn "\nCurrently loaded NVIDIA modules do not match the newly installed"
+ ewarn "libraries and may prevent launching GPU-accelerated applications."
+ if use modules; then
+ ewarn "Easiest way to fix this is normally to reboot. If still run into issues"
+ ewarn "(e.g. API mismatch messages in the \`dmesg\` output), please verify"
+ ewarn "that the running kernel is ${KV_FULL} and that (if used) the"
+ ewarn "initramfs does not include NVIDIA modules (or at least, not old ones)."
+ fi
+ fi
+
+ if [[ $(</proc/cmdline) == *slub_debug=[!-]* ]]; then
+ ewarn "\nDetected that the current kernel command line is using 'slub_debug=',"
+ ewarn "this may lead to system instability/freezes with this version of"
+ ewarn "${PN}. Bug: https://bugs.gentoo.org/796329"
+ fi
+
+ if [[ -v NV_LEGACY_MASK ]]; then
+ ewarn "\n***WARNING***"
+ ewarn "\nYou are installing a version of ${PN} known not to work"
+ ewarn "with a GPU of the current system. If unwanted, add the mask:"
+ if [[ -d ${EROOT}/etc/portage/package.mask ]]; then
+ ewarn "\n echo '${NV_LEGACY_MASK}' > ${EROOT}/etc/portage/package.mask/${PN}"
+ else
+ ewarn "\n echo '${NV_LEGACY_MASK}' >> ${EROOT}/etc/portage/package.mask"
+ fi
+ ewarn "\n...then downgrade to a legacy[1] branch if possible (not all old versions"
+ ewarn "are available or fully functional, may need to consider nouveau[2])."
+ ewarn "\n[1] https://www.nvidia.com/object/IO_32667.html"
+ ewarn "[2] https://wiki.gentoo.org/wiki/Nouveau"
+ fi
+
+ if ver_replacing -lt 595; then
+ elog "\n>=${PN}-595 has changes that may or may not need attention:"
+ elog "1. USE=kernel-open was removed and is now always enabled. If for some"
+ elog " reason you really need the closed variant (e.g. Runtime D3 on Turing"
+ elog " GPUs), please use LTS 580.xx instead as Gentoo has no intention to"
+ elog " support both variants anymore going forward"
+ elog "2. systemd/elogind sleep services (nvidia-sleep.sh) were tentatively"
+ elog " removed and replaced by setting NVreg_UseKernelSuspendNotifiers=1 in"
+ elog " ${EROOT}/etc/modprobe.d/nvidia.conf. If using a non-default custom"
+ elog " nvidia.conf, please ensure the option is set. Also, systemd users"
+ elog " may want to ensure that they do not have old sleep/suspend/resume"
+ elog " *nvidia* files in ${EROOT}/etc/systemd to avoid potential issues."
+ elog "3. nvidia-drm.modeset=1 was removed from nvidia.conf because it is now"
+ elog " default enabled regardless (new NVIDIA default)"
+ fi
+}
diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-595.71.05.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-595.71.05.ebuild
new file mode 100644
index 000000000000..117af792bb31
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-595.71.05.ebuild
@@ -0,0 +1,556 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+MODULES_OPTIONAL_IUSE=+modules
+inherit desktop dot-a eapi9-pipestatus eapi9-ver flag-o-matic linux-mod-r1
+inherit readme.gentoo-r1 systemd toolchain-funcs unpacker user-info
+
+MODULES_KERNEL_MAX=7.0
+NV_URI="https://download.nvidia.com/XFree86/"
+
+DESCRIPTION="NVIDIA Accelerated Graphics Driver"
+HOMEPAGE="https://www.nvidia.com/"
+SRC_URI="
+ amd64? ( ${NV_URI}Linux-x86_64/${PV}/NVIDIA-Linux-x86_64-${PV}.run )
+ arm64? ( ${NV_URI}Linux-aarch64/${PV}/NVIDIA-Linux-aarch64-${PV}.run )
+ $(printf "${NV_URI}%s/%s-${PV}.tar.bz2 " \
+ nvidia-{installer,modprobe,persistenced,settings,xconfig}{,})
+ ${NV_URI}NVIDIA-kernel-module-source/NVIDIA-kernel-module-source-${PV}.tar.xz
+"
+# nvidia-installer is unused but here for GPL-2's "distribute sources"
+S=${WORKDIR}
+
+LICENSE="
+ NVIDIA-2025 Apache-2.0 Boost-1.0 BSD BSD-2 GPL-2 MIT ZLIB
+ curl openssl public-domain
+"
+SLOT="0/${PV%%.*}"
+KEYWORDS="-* amd64 ~arm64"
+IUSE="+X abi_x86_32 abi_x86_64 persistenced powerd +static-libs +tools wayland"
+
+COMMON_DEPEND="
+ acct-group/video
+ X? ( x11-libs/libpciaccess )
+ persistenced? (
+ acct-user/nvpd
+ net-libs/libtirpc:=
+ )
+ tools? (
+ >=app-accessibility/at-spi2-core-2.46:2
+ dev-libs/glib:2
+ dev-libs/jansson:=
+ media-libs/harfbuzz:=
+ x11-libs/cairo
+ x11-libs/gdk-pixbuf:2
+ x11-libs/gtk+:3[X]
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/libXxf86vm
+ x11-libs/pango
+ )
+"
+# egl-wayland2: nvidia currently ships both versions so, to ensure
+# everything works properly, depend on both at same time for now
+# (may use one or the other depending on setup)
+RDEPEND="
+ ${COMMON_DEPEND}
+ || (
+ dev-libs/openssl-compat:3
+ dev-libs/openssl:0/3
+ )
+ sys-libs/glibc
+ X? (
+ media-libs/libglvnd[X,abi_x86_32(-)?]
+ x11-libs/libX11[abi_x86_32(-)?]
+ x11-libs/libXext[abi_x86_32(-)?]
+ )
+ powerd? ( sys-apps/dbus[abi_x86_32(-)?] )
+ wayland? (
+ >=gui-libs/egl-gbm-1.1.1-r2[abi_x86_32(-)?]
+ >=gui-libs/egl-wayland-1.1.13.1[abi_x86_32(-)?]
+ gui-libs/egl-wayland2[abi_x86_32(-)?]
+ X? ( gui-libs/egl-x11[abi_x86_32(-)?] )
+ )
+"
+DEPEND="
+ ${COMMON_DEPEND}
+ static-libs? (
+ x11-base/xorg-proto
+ x11-libs/libX11
+ x11-libs/libXext
+ )
+ tools? (
+ dev-util/vulkan-headers
+ media-libs/libglvnd
+ sys-apps/dbus
+ x11-base/xorg-proto
+ x11-libs/libXrandr
+ x11-libs/libXv
+ x11-libs/libvdpau
+ )
+"
+BDEPEND="
+ sys-devel/m4
+ virtual/pkgconfig
+"
+
+# there is some non-prebuilt exceptions but rather not maintain a list
+QA_PREBUILT="lib/firmware/* usr/bin/* usr/lib*"
+
+PATCHES=(
+ "${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch
+ "${FILESDIR}"/nvidia-settings-530.30.02-desktop.patch
+)
+
+pkg_setup() {
+ use modules && [[ ${MERGE_TYPE} != binary ]] || return
+
+ # do early before linux-mod-r1 so can use chkconfig to setup CONFIG_CHECK
+ get_version
+ require_configured_kernel
+
+ local CONFIG_CHECK="
+ PROC_FS
+ ~DRM_KMS_HELPER
+ ~DRM_FBDEV_EMULATION
+ ~SYSVIPC
+ ~!LOCKDEP
+ ~!PREEMPT_RT
+ ~!SLUB_DEBUG_ON
+ !DEBUG_MUTEXES
+ $(usev amd64 'X86_PAT')
+ $(usev powerd '~CPU_FREQ')
+ "
+
+ kernel_is -ge 6 11 && linux_chkconfig_present DRM_FBDEV_EMULATION &&
+ CONFIG_CHECK+=" DRM_TTM_HELPER"
+
+ local drm_helper_msg="Cannot be directly selected in the kernel's config menus, and may need
+ selection of a DRM device even if unused, e.g. CONFIG_DRM_QXL=m or
+ DRM_AMDGPU=m (among others, consult the kernel config's help), can
+ also use DRM_NOUVEAU=m as long as built as module *not* built-in."
+ local ERROR_DRM_KMS_HELPER="CONFIG_DRM_KMS_HELPER: is not set but is needed for wayland support,
+ tty takeover (e.g. for simpledrm), and config-less Xorg auto-detection.
+ ${drm_helper_msg}"
+ local ERROR_DRM_TTM_HELPER="CONFIG_DRM_TTM_HELPER: is not set but is needed to compile when using
+ kernel version 6.11.x or newer while DRM_FBDEV_EMULATION is set.
+ ${drm_helper_msg}"
+ local ERROR_DRM_FBDEV_EMULATION="CONFIG_DRM_FBDEV_EMULATION: is not set but is needed for
+ nvidia-drm.fbdev=1 support (see ${EPREFIX}/etc/modprobe.d/nvidia.conf), may
+ result in a blank console/tty."
+ local ERROR_PREEMPT_RT="CONFIG_PREEMPT_RT: is set but is unsupported by NVIDIA upstream and
+ will fail to build unless the env var IGNORE_PREEMPT_RT_PRESENCE=1 is
+ set. Please do not report issues if run into e.g. kernel panics while
+ ignoring this."
+
+ linux-mod-r1_pkg_setup
+}
+
+src_prepare() {
+ # make patches usable across versions
+ rm nvidia-modprobe && mv nvidia-modprobe{-${PV},} || die
+ rm nvidia-persistenced && mv nvidia-persistenced{-${PV},} || die
+ rm nvidia-settings && mv nvidia-settings{-${PV},} || die
+ rm nvidia-xconfig && mv nvidia-xconfig{-${PV},} || die
+ mv NVIDIA-kernel-module-source-${PV} kernel-module-source || die
+
+ default
+
+ sed 's/__USER__/nvpd/' \
+ nvidia-persistenced/init/systemd/nvidia-persistenced.service.template \
+ > "${T}"/nvidia-persistenced.service || die
+
+ # use alternative vulkan icd option if USE=-X (bug #909181)
+ use X || sed -i 's/"libGLX/"libEGL/' nvidia_{layers,icd}.json || die
+
+ # makefile attempts to install wayland library even if not built
+ use wayland || sed -i 's/ WAYLAND_LIB_install$//' \
+ nvidia-settings/src/Makefile || die
+}
+
+src_compile() {
+ tc-export AR CC CXX LD OBJCOPY OBJDUMP PKG_CONFIG
+
+ # extra flags for the libXNVCtrl.a static library
+ local xnvflags=-fPIC #840389
+ tc-is-lto && xnvflags+=" $(test-flags-CC -ffat-lto-objects)"
+
+ # same as uname -m
+ local target_arch
+ case ${ARCH} in
+ amd64) target_arch=x86_64;;
+ arm64) target_arch=aarch64;;
+ *) die "Unrecognised architecture: ${ARCH}";;
+ esac
+
+ NV_ARGS=(
+ PREFIX="${EPREFIX}"/usr
+ HOST_CC="$(tc-getBUILD_CC)"
+ HOST_LD="$(tc-getBUILD_LD)"
+ BUILD_GTK2LIB=
+ NV_USE_BUNDLED_LIBJANSSON=0
+ NV_VERBOSE=1 DO_STRIP= MANPAGE_GZIP= OUTPUTDIR=out
+ TARGET_ARCH="${target_arch}"
+ WAYLAND_AVAILABLE=$(usex wayland 1 0)
+ XNVCTRL_CFLAGS="${xnvflags}"
+ )
+
+ if use modules; then
+ local o_cflags=${CFLAGS} o_cxxflags=${CXXFLAGS} o_ldflags=${LDFLAGS}
+
+ # environment flags are normally unused for modules, but nvidia uses
+ # them for building the formerly closed "blob" and it is a bit fragile
+ filter-flags -fno-plt #912949
+ filter-lto
+ CC=${KERNEL_CC} CXX=${KERNEL_CXX} strip-unsupported-flags
+ LDFLAGS=$(raw-ldflags)
+
+ # the "blob" uses C++ which is an issue if there is debug symbols
+ # when running pahole, there is a pahole.sh wrapper that tries to
+ # exclude C++ but it did not seem to be enough last time tried
+ linux_chkconfig_present DEBUG_INFO_BTF_MODULES && append-flags -g0
+
+ : video:kernel-module-source:kernel-module-source/kernel-open
+ local modlist=( nvidia{,-drm,-modeset,-peermem,-uvm}=${_} )
+ local modargs=(
+ IGNORE_CC_MISMATCH=yes NV_VERBOSE=1
+ SYSOUT="${KV_OUT_DIR}" SYSSRC="${KV_DIR}"
+ TARGET_ARCH="${target_arch}"
+
+ # kernel takes "x86" and "x86_64" as meaning the same, but nvidia
+ # makes the distinction (since 550.135) and is not happy with "x86"
+ # TODO?: it should be ok/better for tc-arch-kernel to do x86_64
+ $(usev amd64 ARCH=x86_64)
+ )
+
+ # temporary workaround for bug #914468
+ addpredict "${KV_OUT_DIR}"
+
+ linux-mod-r1_src_compile
+ CFLAGS=${o_cflags} CXXFLAGS=${o_cxxflags} LDFLAGS=${o_ldflags}
+ fi
+
+ emake "${NV_ARGS[@]}" -C nvidia-modprobe
+ use persistenced && emake "${NV_ARGS[@]}" -C nvidia-persistenced
+ use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig
+
+ if use tools; then
+ # avoid noisy *very* noisy logs with deprecation warnings
+ CFLAGS="-Wno-deprecated-declarations ${CFLAGS}" \
+ emake "${NV_ARGS[@]}" -C nvidia-settings
+ elif use static-libs; then
+ # pretend GTK+3 is available, not actually used (bug #880879)
+ emake "${NV_ARGS[@]}" BUILD_GTK3LIB=1 \
+ -C nvidia-settings/src out/libXNVCtrl.a
+ fi
+}
+
+src_install() {
+ local libdir=$(get_libdir) libdir32=$(ABI=x86 get_libdir)
+
+ NV_ARGS+=( DESTDIR="${D}" LIBDIR="${ED}"/usr/${libdir} )
+
+ local -A paths=(
+ [APPLICATION_PROFILE]=/usr/share/nvidia
+ [CUDA_ICD]=/etc/OpenCL/vendors
+ [EGL_EXTERNAL_PLATFORM_JSON]=/usr/share/egl/egl_external_platform.d
+ [FIRMWARE]=/lib/firmware/nvidia/${PV}
+ [GBM_BACKEND_LIB_SYMLINK]=/usr/${libdir}/gbm
+ [GLVND_EGL_ICD_JSON]=/usr/share/glvnd/egl_vendor.d
+ [OPENGL_DATA]=/usr/share/nvidia
+ [VULKANSC_ICD_JSON]=/usr/share/vulkansc
+ [VULKAN_ICD_JSON]=/usr/share/vulkan
+ [WINE_LIB]=/usr/${libdir}/nvidia/wine
+ [XORG_OUTPUTCLASS_CONFIG]=/usr/share/X11/xorg.conf.d
+
+ [GLX_MODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules/extensions
+ [GLX_MODULE_SYMLINK]=/usr/${libdir}/xorg/modules
+ [XMODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules
+ )
+
+ local skip_files=(
+ $(usev !X "libGLX_nvidia libglxserver_nvidia")
+ libGLX_indirect # non-glvnd unused fallback
+ libnvidia-{gtk,wayland-client} nvidia-{settings,xconfig} # from source
+ libnvidia-egl-gbm 15_nvidia_gbm # gui-libs/egl-gbm
+ libnvidia-egl-wayland 10_nvidia_wayland # gui-libs/egl-wayland
+ libnvidia-egl-wayland2 09_nvidia_wayland2 # gui-libs/egl-wayland2
+ libnvidia-egl-xcb 20_nvidia_xcb.json # gui-libs/egl-x11
+ libnvidia-egl-xlib 20_nvidia_xlib.json # gui-libs/egl-x11
+ libnvidia-pkcs11.so # using the openssl3 version instead
+ )
+ local skip_modules=(
+ $(usev !X "nvfbc vdpau xdriver")
+ $(usev !modules gsp)
+ $(usev !powerd nvtopps)
+ installer nvpd # handled separately / built from source
+ )
+ local skip_types=(
+ GLVND_LIB GLVND_SYMLINK EGL_CLIENT.\* GLX_CLIENT.\* # media-libs/libglvnd
+ OPENCL_WRAPPER.\* # virtual/opencl
+ DOCUMENTATION DOT_DESKTOP .\*_SRC DKMS_CONF SYSTEMD_UNIT # handled separately / unused
+ )
+
+ local DOCS=(
+ README.txt NVIDIA_Changelog supported-gpus/supported-gpus.json
+ nvidia-settings/doc/{FRAMELOCK,NV-CONTROL-API}.txt
+ )
+ local HTML_DOCS=( html/. )
+ einstalldocs
+
+ local DISABLE_AUTOFORMATTING=yes
+ local DOC_CONTENTS="\
+Trusted users should be in the 'video' group to use NVIDIA devices.
+You can add yourself by using: gpasswd -a my-user video\
+$(usev modules "
+
+Like all out-of-tree kernel modules, it is necessary to rebuild
+${PN} after upgrading or rebuilding the Linux kernel
+by for example running \`emerge @module-rebuild\`. Alternatively,
+if using a distribution kernel (sys-kernel/gentoo-kernel{,-bin}),
+this can be automated by setting USE=dist-kernel globally.
+
+Loaded kernel modules also must not mismatch with the installed
+${PN} version (excluding -r revision), meaning should
+ensure \`eselect kernel list\` points to the kernel that will be
+booted before building and preferably reboot after upgrading
+${PN} (the ebuild will emit a warning if mismatching).
+
+See '${EPREFIX}/etc/modprobe.d/nvidia.conf' for modules options.")\
+$(use amd64 && usev !abi_x86_32 "
+
+Note that without USE=abi_x86_32 on ${PN}, 32bit applications
+(typically using wine / steam) will not be able to use GPU acceleration.")
+
+For additional information or for troubleshooting issues, please see
+https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers and NVIDIA's own
+documentation that is installed alongside this README."
+ readme.gentoo_create_doc
+
+ if use modules; then
+ linux-mod-r1_src_install
+
+ insinto /etc/modprobe.d
+ newins "${FILESDIR}"/nvidia-595.conf nvidia.conf
+
+ # used for gpu verification with binpkgs (not kept, see pkg_preinst)
+ insinto /usr/share/nvidia
+ doins supported-gpus/supported-gpus.json
+ fi
+
+ emake "${NV_ARGS[@]}" -C nvidia-modprobe install
+ fowners :video /usr/bin/nvidia-modprobe #505092
+ fperms 4710 /usr/bin/nvidia-modprobe
+
+ if use persistenced; then
+ emake "${NV_ARGS[@]}" -C nvidia-persistenced install
+ newconfd "${FILESDIR}"/nvidia-persistenced.confd nvidia-persistenced
+ newinitd "${FILESDIR}"/nvidia-persistenced.initd nvidia-persistenced
+ systemd_dounit "${T}"/nvidia-persistenced.service
+ fi
+
+ if use tools; then
+ emake "${NV_ARGS[@]}" -C nvidia-settings install
+
+ doicon nvidia-settings/doc/nvidia-settings.png
+ domenu nvidia-settings/doc/nvidia-settings.desktop
+
+ exeinto /etc/X11/xinit/xinitrc.d
+ newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
+ fi
+
+ if use static-libs; then
+ dolib.a nvidia-settings/src/out/libXNVCtrl.a
+ strip-lto-bytecode
+
+ insinto /usr/include/NVCtrl
+ doins nvidia-settings/src/libXNVCtrl/NVCtrl{Lib,}.h
+ fi
+
+ use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig install
+
+ # mimic nvidia-installer by reading .manifest to install files
+ # 0:file 1:perms 2:type 3+:subtype/arguments -:module
+ local m into
+ while IFS=' ' read -ra m; do
+ ! [[ ${#m[@]} -ge 2 && ${m[-1]} =~ MODULE: ]] ||
+ [[ " ${m[0]##*/}" =~ ^(\ ${skip_files[*]/%/.*|\\} )$ ]] ||
+ [[ " ${m[2]}" =~ ^(\ ${skip_types[*]/%/|\\} )$ ]] ||
+ has ${m[-1]#MODULE:} "${skip_modules[@]}" && continue
+
+ case ${m[2]} in
+ MANPAGE)
+ gzip -dc ${m[0]} | newman - ${m[0]%.gz}
+ pipestatus || die
+ continue
+ ;;
+ GBM_BACKEND_LIB_SYMLINK) m[4]=../${m[4]};; # missing ../
+ VDPAU_SYMLINK) m[4]=vdpau/; m[5]=${m[5]#vdpau/};; # .so to vdpau/
+ esac
+
+ if [[ -v 'paths[${m[2]}]' ]]; then
+ into=${paths[${m[2]}]}
+ elif [[ ${m[2]} == EXPLICIT_PATH ]]; then
+ into=${m[3]}
+ elif [[ ${m[2]} == *_BINARY ]]; then
+ into=/usr/bin
+ elif [[ ${m[3]} == COMPAT32 ]]; then
+ use abi_x86_32 || continue
+ into=/usr/${libdir32}
+ elif [[ ${m[2]} == *_@(LIB|SYMLINK) ]]; then
+ into=/usr/${libdir}
+ else
+ die "No known installation path for ${m[0]}"
+ fi
+ [[ ${m[3]: -2} == ?/ ]] && into+=/${m[3]%/}
+ [[ ${m[4]: -2} == ?/ ]] && into+=/${m[4]%/}
+
+ if [[ ${m[2]} =~ _SYMLINK$ ]]; then
+ [[ ${m[4]: -1} == / ]] && m[4]=${m[5]}
+ dosym ${m[4]} ${into}/${m[0]}
+ continue
+ fi
+ # avoid portage warning due to missing soname links in manifest
+ [[ ${m[0]} =~ ^libnvidia-ngx.so ]] &&
+ dosym ${m[0]} ${into}/${m[0]%.so*}.so.1
+
+ printf -v m[1] %o $((m[1] | 0200)) # 444->644
+ insopts -m${m[1]}
+ insinto ${into}
+ doins ${m[0]}
+ done < .manifest || die
+ insopts -m0644 # reset
+
+ # MODULE:installer non-skipped extras
+ # (sleep services skipped, obsoleted by NVreg_UseKernelSuspendNotifiers=1)
+ dobin nvidia-bug-report.sh
+
+ insinto /usr/share/nvidia/files.d
+ doins sandboxutils-filelist.json
+
+ # needed with >=systemd-256 or may fail to resume with some setups
+ # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1072722
+ : "$(systemd_get_systemunitdir)"
+ local unitdir=${_#"${EPREFIX}"}
+ insinto "${unitdir}"/systemd-homed.service.d
+ newins - 10-nvidia.conf <<-EOF
+ [Service]
+ Environment=SYSTEMD_HOME_LOCK_FREEZE_SESSION=false
+ EOF
+ insinto "${unitdir}"/systemd-suspend.service.d
+ newins systemd/system/systemd-suspend.service.d/nvidia-suspend-nofreeze.conf 10-nvidia.conf
+ dosym -r "${unitdir}"/systemd-{suspend,hibernate}.service.d/10-nvidia.conf
+ dosym -r "${unitdir}"/systemd-{suspend,hybrid-sleep}.service.d/10-nvidia.conf
+ dosym -r "${unitdir}"/systemd-{suspend,suspend-then-hibernate}.service.d/10-nvidia.conf
+
+ # MODULE:powerd extras
+ if use powerd; then
+ newinitd "${FILESDIR}"/nvidia-powerd.initd nvidia-powerd #923117
+ systemd_dounit systemd/system/nvidia-powerd.service
+
+ insinto /usr/share/dbus-1/system.d
+ doins nvidia-dbus.conf
+ fi
+
+ # symlink non-versioned so nvidia-settings can use it even if misdetected
+ dosym nvidia-application-profiles-${PV}-key-documentation \
+ ${paths[APPLICATION_PROFILE]}/nvidia-application-profiles-key-documentation
+
+ # don't attempt to strip firmware files (silences errors)
+ dostrip -x ${paths[FIRMWARE]}
+
+ # sandbox issues with /dev/nvidiactl and others (bug #904292,#921578)
+ # are widespread and sometime affect revdeps of packages built with
+ # USE=opencl/cuda making it hard to manage in ebuilds (minimal set,
+ # ebuilds should handle manually if need others or addwrite)
+ insinto /etc/sandbox.d
+ newins - 20nvidia <<<'SANDBOX_PREDICT="/dev/nvidiactl:/dev/nvidia-caps:/dev/char"'
+
+ # dracut does not use /etc/modprobe.d if hostonly=no, but want to make sure
+ # our settings are used for bug 932781#c8 and nouveau blacklist if either
+ # modules are included (however, just best-effort without initramfs regen)
+ if use modules; then
+ echo "install_items+=\" ${EPREFIX}/etc/modprobe.d/nvidia.conf \"" >> \
+ "${ED}"/usr/lib/dracut/dracut.conf.d/10-${PN}.conf || die
+ fi
+}
+
+pkg_preinst() {
+ use modules || return
+
+ # set video group id based on live system (bug #491414)
+ local g=$(egetent group video | cut -d: -f3)
+ [[ ${g} =~ ^[0-9]+$ ]] || die "Failed to determine video group id (got '${g}')"
+ sed -i "s/@VIDEOGID@/${g}/" "${ED}"/etc/modprobe.d/nvidia.conf || die
+
+ # try to find driver mismatches using temporary supported-gpus.json
+ for g in $(grep -l 0x10de /sys/bus/pci/devices/*/vendor 2>/dev/null); do
+ g=$(grep -io "\"devid\":\"$(<${g%vendor}device)\"[^}]*branch\":\"[0-9]*" \
+ "${ED}"/usr/share/nvidia/supported-gpus.json 2>/dev/null)
+ if [[ ${g} ]]; then
+ g=$((${g##*\"}+1))
+ if ver_test -ge ${g}; then
+ NV_LEGACY_MASK=">=${CATEGORY}/${PN}-${g}"
+ break
+ fi
+ fi
+ done
+ rm "${ED}"/usr/share/nvidia/supported-gpus.json || die
+}
+
+pkg_postinst() {
+ linux-mod-r1_pkg_postinst
+
+ readme.gentoo_print_elog
+
+ if [[ -r /proc/driver/nvidia/version &&
+ $(</proc/driver/nvidia/version) != *" ${PV} "* ]]; then
+ ewarn "\nCurrently loaded NVIDIA modules do not match the newly installed"
+ ewarn "libraries and may prevent launching GPU-accelerated applications."
+ if use modules; then
+ ewarn "Easiest way to fix this is normally to reboot. If still run into issues"
+ ewarn "(e.g. API mismatch messages in the \`dmesg\` output), please verify"
+ ewarn "that the running kernel is ${KV_FULL} and that (if used) the"
+ ewarn "initramfs does not include NVIDIA modules (or at least, not old ones)."
+ fi
+ fi
+
+ if [[ $(</proc/cmdline) == *slub_debug=[!-]* ]]; then
+ ewarn "\nDetected that the current kernel command line is using 'slub_debug=',"
+ ewarn "this may lead to system instability/freezes with this version of"
+ ewarn "${PN}. Bug: https://bugs.gentoo.org/796329"
+ fi
+
+ if [[ -v NV_LEGACY_MASK ]]; then
+ ewarn "\n***WARNING***"
+ ewarn "\nYou are installing a version of ${PN} known not to work"
+ ewarn "with a GPU of the current system. If unwanted, add the mask:"
+ if [[ -d ${EROOT}/etc/portage/package.mask ]]; then
+ ewarn "\n echo '${NV_LEGACY_MASK}' > ${EROOT}/etc/portage/package.mask/${PN}"
+ else
+ ewarn "\n echo '${NV_LEGACY_MASK}' >> ${EROOT}/etc/portage/package.mask"
+ fi
+ ewarn "\n...then downgrade to a legacy[1] branch if possible (not all old versions"
+ ewarn "are available or fully functional, may need to consider nouveau[2])."
+ ewarn "\n[1] https://www.nvidia.com/object/IO_32667.html"
+ ewarn "[2] https://wiki.gentoo.org/wiki/Nouveau"
+ fi
+
+ if ver_replacing -lt 595; then
+ elog "\n>=${PN}-595 has changes that may or may not need attention:"
+ elog "1. USE=kernel-open was removed and is now always enabled. If for some"
+ elog " reason you really need the closed variant (e.g. Runtime D3 on Turing"
+ elog " GPUs), please use LTS 580.xx instead as Gentoo has no intention to"
+ elog " support both variants anymore going forward"
+ elog "2. systemd/elogind sleep services (nvidia-sleep.sh) were tentatively"
+ elog " removed and replaced by setting NVreg_UseKernelSuspendNotifiers=1 in"
+ elog " ${EROOT}/etc/modprobe.d/nvidia.conf. If using a non-default custom"
+ elog " nvidia.conf, please ensure the option is set. Also, systemd users"
+ elog " may want to ensure that they do not have old sleep/suspend/resume"
+ elog " *nvidia* files in ${EROOT}/etc/systemd to avoid potential issues."
+ elog "3. nvidia-drm.modeset=1 was removed from nvidia.conf because it is now"
+ elog " default enabled regardless (new NVIDIA default)"
+ fi
+}
diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-595.80.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-595.80.ebuild
new file mode 100644
index 000000000000..065d2e2af767
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-595.80.ebuild
@@ -0,0 +1,556 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+MODULES_OPTIONAL_IUSE=+modules
+inherit desktop dot-a eapi9-pipestatus eapi9-ver flag-o-matic linux-mod-r1
+inherit readme.gentoo-r1 systemd toolchain-funcs unpacker user-info
+
+MODULES_KERNEL_MAX=7.0
+NV_URI="https://download.nvidia.com/XFree86/"
+
+DESCRIPTION="NVIDIA Accelerated Graphics Driver"
+HOMEPAGE="https://www.nvidia.com/"
+SRC_URI="
+ amd64? ( ${NV_URI}Linux-x86_64/${PV}/NVIDIA-Linux-x86_64-${PV}.run )
+ arm64? ( ${NV_URI}Linux-aarch64/${PV}/NVIDIA-Linux-aarch64-${PV}.run )
+ $(printf "${NV_URI}%s/%s-${PV}.tar.bz2 " \
+ nvidia-{installer,modprobe,persistenced,settings,xconfig}{,})
+ ${NV_URI}NVIDIA-kernel-module-source/NVIDIA-kernel-module-source-${PV}.tar.xz
+"
+# nvidia-installer is unused but here for GPL-2's "distribute sources"
+S=${WORKDIR}
+
+LICENSE="
+ NVIDIA-2025 Apache-2.0 Boost-1.0 BSD BSD-2 GPL-2 MIT ZLIB
+ curl openssl public-domain
+"
+SLOT="0/${PV%%.*}"
+KEYWORDS="-* ~amd64 ~arm64"
+IUSE="+X abi_x86_32 abi_x86_64 persistenced powerd +static-libs +tools wayland"
+
+COMMON_DEPEND="
+ acct-group/video
+ X? ( x11-libs/libpciaccess )
+ persistenced? (
+ acct-user/nvpd
+ net-libs/libtirpc:=
+ )
+ tools? (
+ >=app-accessibility/at-spi2-core-2.46:2
+ dev-libs/glib:2
+ dev-libs/jansson:=
+ media-libs/harfbuzz:=
+ x11-libs/cairo
+ x11-libs/gdk-pixbuf:2
+ x11-libs/gtk+:3[X]
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/libXxf86vm
+ x11-libs/pango
+ )
+"
+# egl-wayland2: nvidia currently ships both versions so, to ensure
+# everything works properly, depend on both at same time for now
+# (may use one or the other depending on setup)
+RDEPEND="
+ ${COMMON_DEPEND}
+ || (
+ dev-libs/openssl-compat:3
+ dev-libs/openssl:0/3
+ )
+ sys-libs/glibc
+ X? (
+ media-libs/libglvnd[X,abi_x86_32(-)?]
+ x11-libs/libX11[abi_x86_32(-)?]
+ x11-libs/libXext[abi_x86_32(-)?]
+ )
+ powerd? ( sys-apps/dbus[abi_x86_32(-)?] )
+ wayland? (
+ >=gui-libs/egl-gbm-1.1.1-r2[abi_x86_32(-)?]
+ >=gui-libs/egl-wayland-1.1.13.1[abi_x86_32(-)?]
+ gui-libs/egl-wayland2[abi_x86_32(-)?]
+ X? ( gui-libs/egl-x11[abi_x86_32(-)?] )
+ )
+"
+DEPEND="
+ ${COMMON_DEPEND}
+ static-libs? (
+ x11-base/xorg-proto
+ x11-libs/libX11
+ x11-libs/libXext
+ )
+ tools? (
+ dev-util/vulkan-headers
+ media-libs/libglvnd
+ sys-apps/dbus
+ x11-base/xorg-proto
+ x11-libs/libXrandr
+ x11-libs/libXv
+ x11-libs/libvdpau
+ )
+"
+BDEPEND="
+ sys-devel/m4
+ virtual/pkgconfig
+"
+
+# there is some non-prebuilt exceptions but rather not maintain a list
+QA_PREBUILT="lib/firmware/* usr/bin/* usr/lib*"
+
+PATCHES=(
+ "${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch
+ "${FILESDIR}"/nvidia-settings-530.30.02-desktop.patch
+)
+
+pkg_setup() {
+ use modules && [[ ${MERGE_TYPE} != binary ]] || return
+
+ # do early before linux-mod-r1 so can use chkconfig to setup CONFIG_CHECK
+ get_version
+ require_configured_kernel
+
+ local CONFIG_CHECK="
+ PROC_FS
+ ~DRM_KMS_HELPER
+ ~DRM_FBDEV_EMULATION
+ ~SYSVIPC
+ ~!LOCKDEP
+ ~!PREEMPT_RT
+ ~!SLUB_DEBUG_ON
+ !DEBUG_MUTEXES
+ $(usev amd64 'X86_PAT')
+ $(usev powerd '~CPU_FREQ')
+ "
+
+ kernel_is -ge 6 11 && linux_chkconfig_present DRM_FBDEV_EMULATION &&
+ CONFIG_CHECK+=" DRM_TTM_HELPER"
+
+ local drm_helper_msg="Cannot be directly selected in the kernel's config menus, and may need
+ selection of a DRM device even if unused, e.g. CONFIG_DRM_QXL=m or
+ DRM_AMDGPU=m (among others, consult the kernel config's help), can
+ also use DRM_NOUVEAU=m as long as built as module *not* built-in."
+ local ERROR_DRM_KMS_HELPER="CONFIG_DRM_KMS_HELPER: is not set but is needed for wayland support,
+ tty takeover (e.g. for simpledrm), and config-less Xorg auto-detection.
+ ${drm_helper_msg}"
+ local ERROR_DRM_TTM_HELPER="CONFIG_DRM_TTM_HELPER: is not set but is needed to compile when using
+ kernel version 6.11.x or newer while DRM_FBDEV_EMULATION is set.
+ ${drm_helper_msg}"
+ local ERROR_DRM_FBDEV_EMULATION="CONFIG_DRM_FBDEV_EMULATION: is not set but is needed for
+ nvidia-drm.fbdev=1 support (see ${EPREFIX}/etc/modprobe.d/nvidia.conf), may
+ result in a blank console/tty."
+ local ERROR_PREEMPT_RT="CONFIG_PREEMPT_RT: is set but is unsupported by NVIDIA upstream and
+ will fail to build unless the env var IGNORE_PREEMPT_RT_PRESENCE=1 is
+ set. Please do not report issues if run into e.g. kernel panics while
+ ignoring this."
+
+ linux-mod-r1_pkg_setup
+}
+
+src_prepare() {
+ # make patches usable across versions
+ rm nvidia-modprobe && mv nvidia-modprobe{-${PV},} || die
+ rm nvidia-persistenced && mv nvidia-persistenced{-${PV},} || die
+ rm nvidia-settings && mv nvidia-settings{-${PV},} || die
+ rm nvidia-xconfig && mv nvidia-xconfig{-${PV},} || die
+ mv NVIDIA-kernel-module-source-${PV} kernel-module-source || die
+
+ default
+
+ sed 's/__USER__/nvpd/' \
+ nvidia-persistenced/init/systemd/nvidia-persistenced.service.template \
+ > "${T}"/nvidia-persistenced.service || die
+
+ # use alternative vulkan icd option if USE=-X (bug #909181)
+ use X || sed -i 's/"libGLX/"libEGL/' nvidia_{layers,icd}.json || die
+
+ # makefile attempts to install wayland library even if not built
+ use wayland || sed -i 's/ WAYLAND_LIB_install$//' \
+ nvidia-settings/src/Makefile || die
+}
+
+src_compile() {
+ tc-export AR CC CXX LD OBJCOPY OBJDUMP PKG_CONFIG
+
+ # extra flags for the libXNVCtrl.a static library
+ local xnvflags=-fPIC #840389
+ tc-is-lto && xnvflags+=" $(test-flags-CC -ffat-lto-objects)"
+
+ # same as uname -m
+ local target_arch
+ case ${ARCH} in
+ amd64) target_arch=x86_64;;
+ arm64) target_arch=aarch64;;
+ *) die "Unrecognised architecture: ${ARCH}";;
+ esac
+
+ NV_ARGS=(
+ PREFIX="${EPREFIX}"/usr
+ HOST_CC="$(tc-getBUILD_CC)"
+ HOST_LD="$(tc-getBUILD_LD)"
+ BUILD_GTK2LIB=
+ NV_USE_BUNDLED_LIBJANSSON=0
+ NV_VERBOSE=1 DO_STRIP= MANPAGE_GZIP= OUTPUTDIR=out
+ TARGET_ARCH="${target_arch}"
+ WAYLAND_AVAILABLE=$(usex wayland 1 0)
+ XNVCTRL_CFLAGS="${xnvflags}"
+ )
+
+ if use modules; then
+ local o_cflags=${CFLAGS} o_cxxflags=${CXXFLAGS} o_ldflags=${LDFLAGS}
+
+ # environment flags are normally unused for modules, but nvidia uses
+ # them for building the formerly closed "blob" and it is a bit fragile
+ filter-flags -fno-plt #912949
+ filter-lto
+ CC=${KERNEL_CC} CXX=${KERNEL_CXX} strip-unsupported-flags
+ LDFLAGS=$(raw-ldflags)
+
+ # the "blob" uses C++ which is an issue if there is debug symbols
+ # when running pahole, there is a pahole.sh wrapper that tries to
+ # exclude C++ but it did not seem to be enough last time tried
+ linux_chkconfig_present DEBUG_INFO_BTF_MODULES && append-flags -g0
+
+ : video:kernel-module-source:kernel-module-source/kernel-open
+ local modlist=( nvidia{,-drm,-modeset,-peermem,-uvm}=${_} )
+ local modargs=(
+ IGNORE_CC_MISMATCH=yes NV_VERBOSE=1
+ SYSOUT="${KV_OUT_DIR}" SYSSRC="${KV_DIR}"
+ TARGET_ARCH="${target_arch}"
+
+ # kernel takes "x86" and "x86_64" as meaning the same, but nvidia
+ # makes the distinction (since 550.135) and is not happy with "x86"
+ # TODO?: it should be ok/better for tc-arch-kernel to do x86_64
+ $(usev amd64 ARCH=x86_64)
+ )
+
+ # temporary workaround for bug #914468
+ addpredict "${KV_OUT_DIR}"
+
+ linux-mod-r1_src_compile
+ CFLAGS=${o_cflags} CXXFLAGS=${o_cxxflags} LDFLAGS=${o_ldflags}
+ fi
+
+ emake "${NV_ARGS[@]}" -C nvidia-modprobe
+ use persistenced && emake "${NV_ARGS[@]}" -C nvidia-persistenced
+ use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig
+
+ if use tools; then
+ # avoid noisy *very* noisy logs with deprecation warnings
+ CFLAGS="-Wno-deprecated-declarations ${CFLAGS}" \
+ emake "${NV_ARGS[@]}" -C nvidia-settings
+ elif use static-libs; then
+ # pretend GTK+3 is available, not actually used (bug #880879)
+ emake "${NV_ARGS[@]}" BUILD_GTK3LIB=1 \
+ -C nvidia-settings/src out/libXNVCtrl.a
+ fi
+}
+
+src_install() {
+ local libdir=$(get_libdir) libdir32=$(ABI=x86 get_libdir)
+
+ NV_ARGS+=( DESTDIR="${D}" LIBDIR="${ED}"/usr/${libdir} )
+
+ local -A paths=(
+ [APPLICATION_PROFILE]=/usr/share/nvidia
+ [CUDA_ICD]=/etc/OpenCL/vendors
+ [EGL_EXTERNAL_PLATFORM_JSON]=/usr/share/egl/egl_external_platform.d
+ [FIRMWARE]=/lib/firmware/nvidia/${PV}
+ [GBM_BACKEND_LIB_SYMLINK]=/usr/${libdir}/gbm
+ [GLVND_EGL_ICD_JSON]=/usr/share/glvnd/egl_vendor.d
+ [OPENGL_DATA]=/usr/share/nvidia
+ [VULKANSC_ICD_JSON]=/usr/share/vulkansc
+ [VULKAN_ICD_JSON]=/usr/share/vulkan
+ [WINE_LIB]=/usr/${libdir}/nvidia/wine
+ [XORG_OUTPUTCLASS_CONFIG]=/usr/share/X11/xorg.conf.d
+
+ [GLX_MODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules/extensions
+ [GLX_MODULE_SYMLINK]=/usr/${libdir}/xorg/modules
+ [XMODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules
+ )
+
+ local skip_files=(
+ $(usev !X "libGLX_nvidia libglxserver_nvidia")
+ libGLX_indirect # non-glvnd unused fallback
+ libnvidia-{gtk,wayland-client} nvidia-{settings,xconfig} # from source
+ libnvidia-egl-gbm 15_nvidia_gbm # gui-libs/egl-gbm
+ libnvidia-egl-wayland 10_nvidia_wayland # gui-libs/egl-wayland
+ libnvidia-egl-wayland2 09_nvidia_wayland2 # gui-libs/egl-wayland2
+ libnvidia-egl-xcb 20_nvidia_xcb.json # gui-libs/egl-x11
+ libnvidia-egl-xlib 20_nvidia_xlib.json # gui-libs/egl-x11
+ libnvidia-pkcs11.so # using the openssl3 version instead
+ )
+ local skip_modules=(
+ $(usev !X "nvfbc vdpau xdriver")
+ $(usev !modules gsp)
+ $(usev !powerd nvtopps)
+ installer nvpd # handled separately / built from source
+ )
+ local skip_types=(
+ GLVND_LIB GLVND_SYMLINK EGL_CLIENT.\* GLX_CLIENT.\* # media-libs/libglvnd
+ OPENCL_WRAPPER.\* # virtual/opencl
+ DOCUMENTATION DOT_DESKTOP .\*_SRC DKMS_CONF SYSTEMD_UNIT # handled separately / unused
+ )
+
+ local DOCS=(
+ README.txt NVIDIA_Changelog supported-gpus/supported-gpus.json
+ nvidia-settings/doc/{FRAMELOCK,NV-CONTROL-API}.txt
+ )
+ local HTML_DOCS=( html/. )
+ einstalldocs
+
+ local DISABLE_AUTOFORMATTING=yes
+ local DOC_CONTENTS="\
+Trusted users should be in the 'video' group to use NVIDIA devices.
+You can add yourself by using: gpasswd -a my-user video\
+$(usev modules "
+
+Like all out-of-tree kernel modules, it is necessary to rebuild
+${PN} after upgrading or rebuilding the Linux kernel
+by for example running \`emerge @module-rebuild\`. Alternatively,
+if using a distribution kernel (sys-kernel/gentoo-kernel{,-bin}),
+this can be automated by setting USE=dist-kernel globally.
+
+Loaded kernel modules also must not mismatch with the installed
+${PN} version (excluding -r revision), meaning should
+ensure \`eselect kernel list\` points to the kernel that will be
+booted before building and preferably reboot after upgrading
+${PN} (the ebuild will emit a warning if mismatching).
+
+See '${EPREFIX}/etc/modprobe.d/nvidia.conf' for modules options.")\
+$(use amd64 && usev !abi_x86_32 "
+
+Note that without USE=abi_x86_32 on ${PN}, 32bit applications
+(typically using wine / steam) will not be able to use GPU acceleration.")
+
+For additional information or for troubleshooting issues, please see
+https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers and NVIDIA's own
+documentation that is installed alongside this README."
+ readme.gentoo_create_doc
+
+ if use modules; then
+ linux-mod-r1_src_install
+
+ insinto /etc/modprobe.d
+ newins "${FILESDIR}"/nvidia-595.conf nvidia.conf
+
+ # used for gpu verification with binpkgs (not kept, see pkg_preinst)
+ insinto /usr/share/nvidia
+ doins supported-gpus/supported-gpus.json
+ fi
+
+ emake "${NV_ARGS[@]}" -C nvidia-modprobe install
+ fowners :video /usr/bin/nvidia-modprobe #505092
+ fperms 4710 /usr/bin/nvidia-modprobe
+
+ if use persistenced; then
+ emake "${NV_ARGS[@]}" -C nvidia-persistenced install
+ newconfd "${FILESDIR}"/nvidia-persistenced.confd nvidia-persistenced
+ newinitd "${FILESDIR}"/nvidia-persistenced.initd nvidia-persistenced
+ systemd_dounit "${T}"/nvidia-persistenced.service
+ fi
+
+ if use tools; then
+ emake "${NV_ARGS[@]}" -C nvidia-settings install
+
+ doicon nvidia-settings/doc/nvidia-settings.png
+ domenu nvidia-settings/doc/nvidia-settings.desktop
+
+ exeinto /etc/X11/xinit/xinitrc.d
+ newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
+ fi
+
+ if use static-libs; then
+ dolib.a nvidia-settings/src/out/libXNVCtrl.a
+ strip-lto-bytecode
+
+ insinto /usr/include/NVCtrl
+ doins nvidia-settings/src/libXNVCtrl/NVCtrl{Lib,}.h
+ fi
+
+ use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig install
+
+ # mimic nvidia-installer by reading .manifest to install files
+ # 0:file 1:perms 2:type 3+:subtype/arguments -:module
+ local m into
+ while IFS=' ' read -ra m; do
+ ! [[ ${#m[@]} -ge 2 && ${m[-1]} =~ MODULE: ]] ||
+ [[ " ${m[0]##*/}" =~ ^(\ ${skip_files[*]/%/.*|\\} )$ ]] ||
+ [[ " ${m[2]}" =~ ^(\ ${skip_types[*]/%/|\\} )$ ]] ||
+ has ${m[-1]#MODULE:} "${skip_modules[@]}" && continue
+
+ case ${m[2]} in
+ MANPAGE)
+ gzip -dc ${m[0]} | newman - ${m[0]%.gz}
+ pipestatus || die
+ continue
+ ;;
+ GBM_BACKEND_LIB_SYMLINK) m[4]=../${m[4]};; # missing ../
+ VDPAU_SYMLINK) m[4]=vdpau/; m[5]=${m[5]#vdpau/};; # .so to vdpau/
+ esac
+
+ if [[ -v 'paths[${m[2]}]' ]]; then
+ into=${paths[${m[2]}]}
+ elif [[ ${m[2]} == EXPLICIT_PATH ]]; then
+ into=${m[3]}
+ elif [[ ${m[2]} == *_BINARY ]]; then
+ into=/usr/bin
+ elif [[ ${m[3]} == COMPAT32 ]]; then
+ use abi_x86_32 || continue
+ into=/usr/${libdir32}
+ elif [[ ${m[2]} == *_@(LIB|SYMLINK) ]]; then
+ into=/usr/${libdir}
+ else
+ die "No known installation path for ${m[0]}"
+ fi
+ [[ ${m[3]: -2} == ?/ ]] && into+=/${m[3]%/}
+ [[ ${m[4]: -2} == ?/ ]] && into+=/${m[4]%/}
+
+ if [[ ${m[2]} =~ _SYMLINK$ ]]; then
+ [[ ${m[4]: -1} == / ]] && m[4]=${m[5]}
+ dosym ${m[4]} ${into}/${m[0]}
+ continue
+ fi
+ # avoid portage warning due to missing soname links in manifest
+ [[ ${m[0]} =~ ^libnvidia-ngx.so ]] &&
+ dosym ${m[0]} ${into}/${m[0]%.so*}.so.1
+
+ printf -v m[1] %o $((m[1] | 0200)) # 444->644
+ insopts -m${m[1]}
+ insinto ${into}
+ doins ${m[0]}
+ done < .manifest || die
+ insopts -m0644 # reset
+
+ # MODULE:installer non-skipped extras
+ # (sleep services skipped, obsoleted by NVreg_UseKernelSuspendNotifiers=1)
+ dobin nvidia-bug-report.sh
+
+ insinto /usr/share/nvidia/files.d
+ doins sandboxutils-filelist.json
+
+ # needed with >=systemd-256 or may fail to resume with some setups
+ # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1072722
+ : "$(systemd_get_systemunitdir)"
+ local unitdir=${_#"${EPREFIX}"}
+ insinto "${unitdir}"/systemd-homed.service.d
+ newins - 10-nvidia.conf <<-EOF
+ [Service]
+ Environment=SYSTEMD_HOME_LOCK_FREEZE_SESSION=false
+ EOF
+ insinto "${unitdir}"/systemd-suspend.service.d
+ newins systemd/system/systemd-suspend.service.d/nvidia-suspend-nofreeze.conf 10-nvidia.conf
+ dosym -r "${unitdir}"/systemd-{suspend,hibernate}.service.d/10-nvidia.conf
+ dosym -r "${unitdir}"/systemd-{suspend,hybrid-sleep}.service.d/10-nvidia.conf
+ dosym -r "${unitdir}"/systemd-{suspend,suspend-then-hibernate}.service.d/10-nvidia.conf
+
+ # MODULE:powerd extras
+ if use powerd; then
+ newinitd "${FILESDIR}"/nvidia-powerd.initd nvidia-powerd #923117
+ systemd_dounit systemd/system/nvidia-powerd.service
+
+ insinto /usr/share/dbus-1/system.d
+ doins nvidia-dbus.conf
+ fi
+
+ # symlink non-versioned so nvidia-settings can use it even if misdetected
+ dosym nvidia-application-profiles-${PV}-key-documentation \
+ ${paths[APPLICATION_PROFILE]}/nvidia-application-profiles-key-documentation
+
+ # don't attempt to strip firmware files (silences errors)
+ dostrip -x ${paths[FIRMWARE]}
+
+ # sandbox issues with /dev/nvidiactl and others (bug #904292,#921578)
+ # are widespread and sometime affect revdeps of packages built with
+ # USE=opencl/cuda making it hard to manage in ebuilds (minimal set,
+ # ebuilds should handle manually if need others or addwrite)
+ insinto /etc/sandbox.d
+ newins - 20nvidia <<<'SANDBOX_PREDICT="/dev/nvidiactl:/dev/nvidia-caps:/dev/char"'
+
+ # dracut does not use /etc/modprobe.d if hostonly=no, but want to make sure
+ # our settings are used for bug 932781#c8 and nouveau blacklist if either
+ # modules are included (however, just best-effort without initramfs regen)
+ if use modules; then
+ echo "install_items+=\" ${EPREFIX}/etc/modprobe.d/nvidia.conf \"" >> \
+ "${ED}"/usr/lib/dracut/dracut.conf.d/10-${PN}.conf || die
+ fi
+}
+
+pkg_preinst() {
+ use modules || return
+
+ # set video group id based on live system (bug #491414)
+ local g=$(egetent group video | cut -d: -f3)
+ [[ ${g} =~ ^[0-9]+$ ]] || die "Failed to determine video group id (got '${g}')"
+ sed -i "s/@VIDEOGID@/${g}/" "${ED}"/etc/modprobe.d/nvidia.conf || die
+
+ # try to find driver mismatches using temporary supported-gpus.json
+ for g in $(grep -l 0x10de /sys/bus/pci/devices/*/vendor 2>/dev/null); do
+ g=$(grep -io "\"devid\":\"$(<${g%vendor}device)\"[^}]*branch\":\"[0-9]*" \
+ "${ED}"/usr/share/nvidia/supported-gpus.json 2>/dev/null)
+ if [[ ${g} ]]; then
+ g=$((${g##*\"}+1))
+ if ver_test -ge ${g}; then
+ NV_LEGACY_MASK=">=${CATEGORY}/${PN}-${g}"
+ break
+ fi
+ fi
+ done
+ rm "${ED}"/usr/share/nvidia/supported-gpus.json || die
+}
+
+pkg_postinst() {
+ linux-mod-r1_pkg_postinst
+
+ readme.gentoo_print_elog
+
+ if [[ -r /proc/driver/nvidia/version &&
+ $(</proc/driver/nvidia/version) != *" ${PV} "* ]]; then
+ ewarn "\nCurrently loaded NVIDIA modules do not match the newly installed"
+ ewarn "libraries and may prevent launching GPU-accelerated applications."
+ if use modules; then
+ ewarn "Easiest way to fix this is normally to reboot. If still run into issues"
+ ewarn "(e.g. API mismatch messages in the \`dmesg\` output), please verify"
+ ewarn "that the running kernel is ${KV_FULL} and that (if used) the"
+ ewarn "initramfs does not include NVIDIA modules (or at least, not old ones)."
+ fi
+ fi
+
+ if [[ $(</proc/cmdline) == *slub_debug=[!-]* ]]; then
+ ewarn "\nDetected that the current kernel command line is using 'slub_debug=',"
+ ewarn "this may lead to system instability/freezes with this version of"
+ ewarn "${PN}. Bug: https://bugs.gentoo.org/796329"
+ fi
+
+ if [[ -v NV_LEGACY_MASK ]]; then
+ ewarn "\n***WARNING***"
+ ewarn "\nYou are installing a version of ${PN} known not to work"
+ ewarn "with a GPU of the current system. If unwanted, add the mask:"
+ if [[ -d ${EROOT}/etc/portage/package.mask ]]; then
+ ewarn "\n echo '${NV_LEGACY_MASK}' > ${EROOT}/etc/portage/package.mask/${PN}"
+ else
+ ewarn "\n echo '${NV_LEGACY_MASK}' >> ${EROOT}/etc/portage/package.mask"
+ fi
+ ewarn "\n...then downgrade to a legacy[1] branch if possible (not all old versions"
+ ewarn "are available or fully functional, may need to consider nouveau[2])."
+ ewarn "\n[1] https://www.nvidia.com/object/IO_32667.html"
+ ewarn "[2] https://wiki.gentoo.org/wiki/Nouveau"
+ fi
+
+ if ver_replacing -lt 595; then
+ elog "\n>=${PN}-595 has changes that may or may not need attention:"
+ elog "1. USE=kernel-open was removed and is now always enabled. If for some"
+ elog " reason you really need the closed variant (e.g. Runtime D3 on Turing"
+ elog " GPUs), please use LTS 580.xx instead as Gentoo has no intention to"
+ elog " support both variants anymore going forward"
+ elog "2. systemd/elogind sleep services (nvidia-sleep.sh) were tentatively"
+ elog " removed and replaced by setting NVreg_UseKernelSuspendNotifiers=1 in"
+ elog " ${EROOT}/etc/modprobe.d/nvidia.conf. If using a non-default custom"
+ elog " nvidia.conf, please ensure the option is set. Also, systemd users"
+ elog " may want to ensure that they do not have old sleep/suspend/resume"
+ elog " *nvidia* files in ${EROOT}/etc/systemd to avoid potential issues."
+ elog "3. nvidia-drm.modeset=1 was removed from nvidia.conf because it is now"
+ elog " default enabled regardless (new NVIDIA default)"
+ fi
+}
diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-610.43.02-r1.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-610.43.02-r1.ebuild
new file mode 100644
index 000000000000..ff8aefc2f1a6
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-610.43.02-r1.ebuild
@@ -0,0 +1,557 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+MODULES_OPTIONAL_IUSE=+modules
+inherit desktop dot-a eapi9-pipestatus eapi9-ver flag-o-matic linux-mod-r1
+inherit readme.gentoo-r1 systemd toolchain-funcs unpacker user-info
+
+MODULES_KERNEL_MAX=7.0
+NV_URI="https://download.nvidia.com/XFree86/"
+
+DESCRIPTION="NVIDIA Accelerated Graphics Driver"
+HOMEPAGE="https://www.nvidia.com/"
+SRC_URI="
+ amd64? ( ${NV_URI}Linux-x86_64/${PV}/NVIDIA-Linux-x86_64-${PV}.run )
+ arm64? ( ${NV_URI}Linux-aarch64/${PV}/NVIDIA-Linux-aarch64-${PV}.run )
+ $(printf "${NV_URI}%s/%s-${PV}.tar.bz2 " \
+ nvidia-{installer,modprobe,persistenced,settings,xconfig}{,})
+ ${NV_URI}NVIDIA-kernel-module-source/NVIDIA-kernel-module-source-${PV}.tar.xz
+"
+# nvidia-installer is unused but here for GPL-2's "distribute sources"
+S=${WORKDIR}
+
+LICENSE="
+ NVIDIA-2025 Apache-2.0 Boost-1.0 BSD BSD-2 GPL-2 MIT ZLIB
+ curl openssl public-domain
+"
+SLOT="0/${PV%%.*}"
+KEYWORDS="-* ~amd64 ~arm64"
+IUSE="+X abi_x86_32 abi_x86_64 persistenced powerd +static-libs +tools wayland"
+
+COMMON_DEPEND="
+ acct-group/video
+ X? ( x11-libs/libpciaccess )
+ persistenced? (
+ acct-user/nvpd
+ net-libs/libtirpc:=
+ )
+ tools? (
+ >=app-accessibility/at-spi2-core-2.46:2
+ dev-libs/glib:2
+ dev-libs/jansson:=
+ media-libs/harfbuzz:=
+ x11-libs/cairo
+ x11-libs/gdk-pixbuf:2
+ x11-libs/gtk+:3[X]
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/libXxf86vm
+ x11-libs/pango
+ )
+"
+# egl-wayland2: nvidia currently ships both versions so, to ensure
+# everything works properly, depend on both at same time for now
+# (may use one or the other depending on setup)
+RDEPEND="
+ ${COMMON_DEPEND}
+ || (
+ dev-libs/openssl-compat:3
+ dev-libs/openssl:0/3
+ )
+ sys-devel/gcc:*
+ sys-libs/glibc
+ X? (
+ media-libs/libglvnd[X,abi_x86_32(-)?]
+ x11-libs/libX11[abi_x86_32(-)?]
+ x11-libs/libXext[abi_x86_32(-)?]
+ )
+ powerd? ( sys-apps/dbus[abi_x86_32(-)?] )
+ wayland? (
+ >=gui-libs/egl-gbm-1.1.1-r2[abi_x86_32(-)?]
+ >=gui-libs/egl-wayland-1.1.13.1[abi_x86_32(-)?]
+ gui-libs/egl-wayland2[abi_x86_32(-)?]
+ X? ( gui-libs/egl-x11[abi_x86_32(-)?] )
+ )
+"
+DEPEND="
+ ${COMMON_DEPEND}
+ static-libs? (
+ x11-base/xorg-proto
+ x11-libs/libX11
+ x11-libs/libXext
+ )
+ tools? (
+ dev-util/vulkan-headers
+ media-libs/libglvnd
+ sys-apps/dbus
+ x11-base/xorg-proto
+ x11-libs/libXrandr
+ x11-libs/libXv
+ x11-libs/libvdpau
+ )
+"
+BDEPEND="
+ sys-devel/m4
+ virtual/pkgconfig
+"
+
+# there is some non-prebuilt exceptions but rather not maintain a list
+QA_PREBUILT="lib/firmware/* usr/bin/* usr/lib*"
+
+PATCHES=(
+ "${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch
+ "${FILESDIR}"/nvidia-settings-530.30.02-desktop.patch
+)
+
+pkg_setup() {
+ use modules && [[ ${MERGE_TYPE} != binary ]] || return
+
+ # do early before linux-mod-r1 so can use chkconfig to setup CONFIG_CHECK
+ get_version
+ require_configured_kernel
+
+ local CONFIG_CHECK="
+ PROC_FS
+ ~DRM_KMS_HELPER
+ ~DRM_FBDEV_EMULATION
+ ~SYSVIPC
+ ~!LOCKDEP
+ ~!PREEMPT_RT
+ ~!SLUB_DEBUG_ON
+ !DEBUG_MUTEXES
+ $(usev amd64 'X86_PAT')
+ $(usev powerd '~CPU_FREQ')
+ "
+
+ kernel_is -ge 6 11 && linux_chkconfig_present DRM_FBDEV_EMULATION &&
+ CONFIG_CHECK+=" DRM_TTM_HELPER"
+
+ local drm_helper_msg="Cannot be directly selected in the kernel's config menus, and may need
+ selection of a DRM device even if unused, e.g. CONFIG_DRM_QXL=m or
+ DRM_AMDGPU=m (among others, consult the kernel config's help), can
+ also use DRM_NOUVEAU=m as long as built as module *not* built-in."
+ local ERROR_DRM_KMS_HELPER="CONFIG_DRM_KMS_HELPER: is not set but is needed for wayland support,
+ tty takeover (e.g. for simpledrm), and config-less Xorg auto-detection.
+ ${drm_helper_msg}"
+ local ERROR_DRM_TTM_HELPER="CONFIG_DRM_TTM_HELPER: is not set but is needed to compile when using
+ kernel version 6.11.x or newer while DRM_FBDEV_EMULATION is set.
+ ${drm_helper_msg}"
+ local ERROR_DRM_FBDEV_EMULATION="CONFIG_DRM_FBDEV_EMULATION: is not set but is needed for
+ nvidia-drm.fbdev=1 support (see ${EPREFIX}/etc/modprobe.d/nvidia.conf), may
+ result in a blank console/tty."
+ local ERROR_PREEMPT_RT="CONFIG_PREEMPT_RT: is set but is unsupported by NVIDIA upstream and
+ will fail to build unless the env var IGNORE_PREEMPT_RT_PRESENCE=1 is
+ set. Please do not report issues if run into e.g. kernel panics while
+ ignoring this."
+
+ linux-mod-r1_pkg_setup
+}
+
+src_prepare() {
+ # make patches usable across versions
+ rm nvidia-modprobe && mv nvidia-modprobe{-${PV},} || die
+ rm nvidia-persistenced && mv nvidia-persistenced{-${PV},} || die
+ rm nvidia-settings && mv nvidia-settings{-${PV},} || die
+ rm nvidia-xconfig && mv nvidia-xconfig{-${PV},} || die
+ mv NVIDIA-kernel-module-source-${PV} kernel-module-source || die
+
+ default
+
+ sed 's/__USER__/nvpd/' \
+ nvidia-persistenced/init/systemd/nvidia-persistenced.service.template \
+ > "${T}"/nvidia-persistenced.service || die
+
+ # use alternative vulkan icd option if USE=-X (bug #909181)
+ use X || sed -i 's/"libGLX/"libEGL/' nvidia_{layers,icd}.json || die
+
+ # makefile attempts to install wayland library even if not built
+ use wayland || sed -i 's/ WAYLAND_LIB_install$//' \
+ nvidia-settings/src/Makefile || die
+}
+
+src_compile() {
+ tc-export AR CC CXX LD OBJCOPY OBJDUMP PKG_CONFIG
+
+ # extra flags for the libXNVCtrl.a static library
+ local xnvflags=-fPIC #840389
+ tc-is-lto && xnvflags+=" $(test-flags-CC -ffat-lto-objects)"
+
+ # same as uname -m
+ local target_arch
+ case ${ARCH} in
+ amd64) target_arch=x86_64;;
+ arm64) target_arch=aarch64;;
+ *) die "Unrecognised architecture: ${ARCH}";;
+ esac
+
+ NV_ARGS=(
+ PREFIX="${EPREFIX}"/usr
+ HOST_CC="$(tc-getBUILD_CC)"
+ HOST_LD="$(tc-getBUILD_LD)"
+ BUILD_GTK2LIB=
+ NV_USE_BUNDLED_LIBJANSSON=0
+ NV_VERBOSE=1 DO_STRIP= MANPAGE_GZIP= OUTPUTDIR=out
+ TARGET_ARCH="${target_arch}"
+ WAYLAND_AVAILABLE=$(usex wayland 1 0)
+ XNVCTRL_CFLAGS="${xnvflags}"
+ )
+
+ if use modules; then
+ local o_cflags=${CFLAGS} o_cxxflags=${CXXFLAGS} o_ldflags=${LDFLAGS}
+
+ # environment flags are normally unused for modules, but nvidia uses
+ # them for building the formerly closed "blob" and it is a bit fragile
+ filter-flags -fno-plt #912949
+ filter-lto
+ CC=${KERNEL_CC} CXX=${KERNEL_CXX} strip-unsupported-flags
+ LDFLAGS=$(raw-ldflags)
+
+ # the "blob" uses C++ which is an issue if there is debug symbols
+ # when running pahole, there is a pahole.sh wrapper that tries to
+ # exclude C++ but it did not seem to be enough last time tried
+ linux_chkconfig_present DEBUG_INFO_BTF_MODULES && append-flags -g0
+
+ : video:kernel-module-source:kernel-module-source/kernel-open
+ local modlist=( nvidia{,-drm,-modeset,-peermem,-uvm}=${_} )
+ local modargs=(
+ IGNORE_CC_MISMATCH=yes NV_VERBOSE=1
+ SYSOUT="${KV_OUT_DIR}" SYSSRC="${KV_DIR}"
+ TARGET_ARCH="${target_arch}"
+
+ # kernel takes "x86" and "x86_64" as meaning the same, but nvidia
+ # makes the distinction (since 550.135) and is not happy with "x86"
+ # TODO?: it should be ok/better for tc-arch-kernel to do x86_64
+ $(usev amd64 ARCH=x86_64)
+ )
+
+ # temporary workaround for bug #914468
+ addpredict "${KV_OUT_DIR}"
+
+ linux-mod-r1_src_compile
+ CFLAGS=${o_cflags} CXXFLAGS=${o_cxxflags} LDFLAGS=${o_ldflags}
+ fi
+
+ emake "${NV_ARGS[@]}" -C nvidia-modprobe
+ use persistenced && emake "${NV_ARGS[@]}" -C nvidia-persistenced
+ use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig
+
+ if use tools; then
+ # avoid noisy *very* noisy logs with deprecation warnings
+ CFLAGS="-Wno-deprecated-declarations ${CFLAGS}" \
+ emake "${NV_ARGS[@]}" -C nvidia-settings
+ elif use static-libs; then
+ # pretend GTK+3 is available, not actually used (bug #880879)
+ emake "${NV_ARGS[@]}" BUILD_GTK3LIB=1 \
+ -C nvidia-settings/src out/libXNVCtrl.a
+ fi
+}
+
+src_install() {
+ local libdir=$(get_libdir) libdir32=$(ABI=x86 get_libdir)
+
+ NV_ARGS+=( DESTDIR="${D}" LIBDIR="${ED}"/usr/${libdir} )
+
+ local -A paths=(
+ [APPLICATION_PROFILE]=/usr/share/nvidia
+ [CUDA_ICD]=/etc/OpenCL/vendors
+ [EGL_EXTERNAL_PLATFORM_JSON]=/usr/share/egl/egl_external_platform.d
+ [FIRMWARE]=/lib/firmware/nvidia/${PV}
+ [GBM_BACKEND_LIB_SYMLINK]=/usr/${libdir}/gbm
+ [GLVND_EGL_ICD_JSON]=/usr/share/glvnd/egl_vendor.d
+ [OPENGL_DATA]=/usr/share/nvidia
+ [VULKANSC_ICD_JSON]=/usr/share/vulkansc
+ [VULKAN_ICD_JSON]=/usr/share/vulkan
+ [WINE_LIB]=/usr/${libdir}/nvidia/wine
+ [XORG_OUTPUTCLASS_CONFIG]=/usr/share/X11/xorg.conf.d
+
+ [GLX_MODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules/extensions
+ [GLX_MODULE_SYMLINK]=/usr/${libdir}/xorg/modules
+ [XMODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules
+ )
+
+ local skip_files=(
+ $(usev !X "libGLX_nvidia libglxserver_nvidia")
+ libGLX_indirect # non-glvnd unused fallback
+ libnvidia-{gtk,wayland-client} nvidia-{settings,xconfig} # from source
+ libnvidia-egl-gbm 15_nvidia_gbm # gui-libs/egl-gbm
+ libnvidia-egl-wayland 10_nvidia_wayland # gui-libs/egl-wayland
+ libnvidia-egl-wayland2 09_nvidia_wayland2 # gui-libs/egl-wayland2
+ libnvidia-egl-xcb 20_nvidia_xcb.json # gui-libs/egl-x11
+ libnvidia-egl-xlib 20_nvidia_xlib.json # gui-libs/egl-x11
+ libnvidia-pkcs11.so # using the openssl3 version instead
+ )
+ local skip_modules=(
+ $(usev !X "nvfbc vdpau xdriver")
+ $(usev !modules gsp)
+ $(usev !powerd nvtopps)
+ installer nvpd # handled separately / built from source
+ )
+ local skip_types=(
+ GLVND_LIB GLVND_SYMLINK EGL_CLIENT.\* GLX_CLIENT.\* # media-libs/libglvnd
+ OPENCL_WRAPPER.\* # virtual/opencl
+ DOCUMENTATION DOT_DESKTOP .\*_SRC DKMS_CONF SYSTEMD_UNIT # handled separately / unused
+ )
+
+ local DOCS=(
+ README.txt NVIDIA_Changelog supported-gpus/supported-gpus.json
+ nvidia-settings/doc/{FRAMELOCK,NV-CONTROL-API}.txt
+ )
+ local HTML_DOCS=( html/. )
+ einstalldocs
+
+ local DISABLE_AUTOFORMATTING=yes
+ local DOC_CONTENTS="\
+Trusted users should be in the 'video' group to use NVIDIA devices.
+You can add yourself by using: gpasswd -a my-user video\
+$(usev modules "
+
+Like all out-of-tree kernel modules, it is necessary to rebuild
+${PN} after upgrading or rebuilding the Linux kernel
+by for example running \`emerge @module-rebuild\`. Alternatively,
+if using a distribution kernel (sys-kernel/gentoo-kernel{,-bin}),
+this can be automated by setting USE=dist-kernel globally.
+
+Loaded kernel modules also must not mismatch with the installed
+${PN} version (excluding -r revision), meaning should
+ensure \`eselect kernel list\` points to the kernel that will be
+booted before building and preferably reboot after upgrading
+${PN} (the ebuild will emit a warning if mismatching).
+
+See '${EPREFIX}/etc/modprobe.d/nvidia.conf' for modules options.")\
+$(use amd64 && usev !abi_x86_32 "
+
+Note that without USE=abi_x86_32 on ${PN}, 32bit applications
+(typically using wine / steam) will not be able to use GPU acceleration.")
+
+For additional information or for troubleshooting issues, please see
+https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers and NVIDIA's own
+documentation that is installed alongside this README."
+ readme.gentoo_create_doc
+
+ if use modules; then
+ linux-mod-r1_src_install
+
+ insinto /etc/modprobe.d
+ newins "${FILESDIR}"/nvidia-610.conf nvidia.conf
+
+ # used for gpu verification with binpkgs (not kept, see pkg_preinst)
+ insinto /usr/share/nvidia
+ doins supported-gpus/supported-gpus.json
+ fi
+
+ emake "${NV_ARGS[@]}" -C nvidia-modprobe install
+ fowners :video /usr/bin/nvidia-modprobe #505092
+ fperms 4710 /usr/bin/nvidia-modprobe
+
+ if use persistenced; then
+ emake "${NV_ARGS[@]}" -C nvidia-persistenced install
+ newconfd "${FILESDIR}"/nvidia-persistenced.confd nvidia-persistenced
+ newinitd "${FILESDIR}"/nvidia-persistenced.initd nvidia-persistenced
+ systemd_dounit "${T}"/nvidia-persistenced.service
+ fi
+
+ if use tools; then
+ emake "${NV_ARGS[@]}" -C nvidia-settings install
+
+ doicon nvidia-settings/doc/nvidia-settings.png
+ domenu nvidia-settings/doc/nvidia-settings.desktop
+
+ exeinto /etc/X11/xinit/xinitrc.d
+ newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
+ fi
+
+ if use static-libs; then
+ dolib.a nvidia-settings/src/out/libXNVCtrl.a
+ strip-lto-bytecode
+
+ insinto /usr/include/NVCtrl
+ doins nvidia-settings/src/libXNVCtrl/NVCtrl{Lib,}.h
+ fi
+
+ use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig install
+
+ # mimic nvidia-installer by reading .manifest to install files
+ # 0:file 1:perms 2:type 3+:subtype/arguments -:module
+ local m into
+ while IFS=' ' read -ra m; do
+ ! [[ ${#m[@]} -ge 2 && ${m[-1]} =~ MODULE: ]] ||
+ [[ " ${m[0]##*/}" =~ ^(\ ${skip_files[*]/%/.*|\\} )$ ]] ||
+ [[ " ${m[2]}" =~ ^(\ ${skip_types[*]/%/|\\} )$ ]] ||
+ has ${m[-1]#MODULE:} "${skip_modules[@]}" && continue
+
+ case ${m[2]} in
+ MANPAGE)
+ gzip -dc ${m[0]} | newman - ${m[0]%.gz}
+ pipestatus || die
+ continue
+ ;;
+ GBM_BACKEND_LIB_SYMLINK) m[4]=../${m[4]};; # missing ../
+ VDPAU_SYMLINK) m[4]=vdpau/; m[5]=${m[5]#vdpau/};; # .so to vdpau/
+ esac
+
+ if [[ -v 'paths[${m[2]}]' ]]; then
+ into=${paths[${m[2]}]}
+ elif [[ ${m[2]} == EXPLICIT_PATH ]]; then
+ into=${m[3]}
+ elif [[ ${m[2]} == *_BINARY ]]; then
+ into=/usr/bin
+ elif [[ ${m[3]} == COMPAT32 ]]; then
+ use abi_x86_32 || continue
+ into=/usr/${libdir32}
+ elif [[ ${m[2]} == *_@(LIB|SYMLINK) ]]; then
+ into=/usr/${libdir}
+ else
+ die "No known installation path for ${m[0]}"
+ fi
+ [[ ${m[3]: -2} == ?/ ]] && into+=/${m[3]%/}
+ [[ ${m[4]: -2} == ?/ ]] && into+=/${m[4]%/}
+
+ if [[ ${m[2]} =~ _SYMLINK$ ]]; then
+ [[ ${m[4]: -1} == / ]] && m[4]=${m[5]}
+ dosym ${m[4]} ${into}/${m[0]}
+ continue
+ fi
+ # avoid portage warning due to missing soname links in manifest
+ [[ ${m[0]} =~ ^libnvidia-ngx.so ]] &&
+ dosym ${m[0]} ${into}/${m[0]%.so*}.so.1
+
+ printf -v m[1] %o $((m[1] | 0200)) # 444->644
+ insopts -m${m[1]}
+ insinto ${into}
+ doins ${m[0]}
+ done < .manifest || die
+ insopts -m0644 # reset
+
+ # MODULE:installer non-skipped extras
+ # (sleep services skipped, obsoleted by NVreg_UseKernelSuspendNotifiers=1)
+ dobin nvidia-bug-report.sh
+
+ insinto /usr/share/nvidia/files.d
+ doins sandboxutils-filelist.json
+
+ # needed with >=systemd-256 or may fail to resume with some setups
+ # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1072722
+ : "$(systemd_get_systemunitdir)"
+ local unitdir=${_#"${EPREFIX}"}
+ insinto "${unitdir}"/systemd-homed.service.d
+ newins - 10-nvidia.conf <<-EOF
+ [Service]
+ Environment=SYSTEMD_HOME_LOCK_FREEZE_SESSION=false
+ EOF
+ insinto "${unitdir}"/systemd-suspend.service.d
+ newins systemd/system/systemd-suspend.service.d/nvidia-suspend-nofreeze.conf 10-nvidia.conf
+ dosym -r "${unitdir}"/systemd-{suspend,hibernate}.service.d/10-nvidia.conf
+ dosym -r "${unitdir}"/systemd-{suspend,hybrid-sleep}.service.d/10-nvidia.conf
+ dosym -r "${unitdir}"/systemd-{suspend,suspend-then-hibernate}.service.d/10-nvidia.conf
+
+ # MODULE:powerd extras
+ if use powerd; then
+ newinitd "${FILESDIR}"/nvidia-powerd.initd nvidia-powerd #923117
+ systemd_dounit systemd/system/nvidia-powerd.service
+
+ insinto /usr/share/dbus-1/system.d
+ doins nvidia-dbus.conf
+ fi
+
+ # symlink non-versioned so nvidia-settings can use it even if misdetected
+ dosym nvidia-application-profiles-${PV}-key-documentation \
+ ${paths[APPLICATION_PROFILE]}/nvidia-application-profiles-key-documentation
+
+ # don't attempt to strip firmware files (silences errors)
+ dostrip -x ${paths[FIRMWARE]}
+
+ # sandbox issues with /dev/nvidiactl and others (bug #904292,#921578)
+ # are widespread and sometime affect revdeps of packages built with
+ # USE=opencl/cuda making it hard to manage in ebuilds (minimal set,
+ # ebuilds should handle manually if need others or addwrite)
+ insinto /etc/sandbox.d
+ newins - 20nvidia <<<'SANDBOX_PREDICT="/dev/nvidiactl:/dev/nvidia-caps:/dev/char"'
+
+ # dracut does not use /etc/modprobe.d if hostonly=no, but want to make sure
+ # our settings are used for bug 932781#c8 and nouveau blacklist if either
+ # modules are included (however, just best-effort without initramfs regen)
+ if use modules; then
+ echo "install_items+=\" ${EPREFIX}/etc/modprobe.d/nvidia.conf \"" >> \
+ "${ED}"/usr/lib/dracut/dracut.conf.d/10-${PN}.conf || die
+ fi
+}
+
+pkg_preinst() {
+ use modules || return
+
+ # set video group id based on live system (bug #491414)
+ local g=$(egetent group video | cut -d: -f3)
+ [[ ${g} =~ ^[0-9]+$ ]] || die "Failed to determine video group id (got '${g}')"
+ sed -i "s/@VIDEOGID@/${g}/" "${ED}"/etc/modprobe.d/nvidia.conf || die
+
+ # try to find driver mismatches using temporary supported-gpus.json
+ for g in $(grep -l 0x10de /sys/bus/pci/devices/*/vendor 2>/dev/null); do
+ g=$(grep -io "\"devid\":\"$(<${g%vendor}device)\"[^}]*branch\":\"[0-9]*" \
+ "${ED}"/usr/share/nvidia/supported-gpus.json 2>/dev/null)
+ if [[ ${g} ]]; then
+ g=$((${g##*\"}+1))
+ if ver_test -ge ${g}; then
+ NV_LEGACY_MASK=">=${CATEGORY}/${PN}-${g}"
+ break
+ fi
+ fi
+ done
+ rm "${ED}"/usr/share/nvidia/supported-gpus.json || die
+}
+
+pkg_postinst() {
+ linux-mod-r1_pkg_postinst
+
+ readme.gentoo_print_elog
+
+ if [[ -r /proc/driver/nvidia/version &&
+ $(</proc/driver/nvidia/version) != *" ${PV} "* ]]; then
+ ewarn "\nCurrently loaded NVIDIA modules do not match the newly installed"
+ ewarn "libraries and may prevent launching GPU-accelerated applications."
+ if use modules; then
+ ewarn "Easiest way to fix this is normally to reboot. If still run into issues"
+ ewarn "(e.g. API mismatch messages in the \`dmesg\` output), please verify"
+ ewarn "that the running kernel is ${KV_FULL} and that (if used) the"
+ ewarn "initramfs does not include NVIDIA modules (or at least, not old ones)."
+ fi
+ fi
+
+ if [[ $(</proc/cmdline) == *slub_debug=[!-]* ]]; then
+ ewarn "\nDetected that the current kernel command line is using 'slub_debug=',"
+ ewarn "this may lead to system instability/freezes with this version of"
+ ewarn "${PN}. Bug: https://bugs.gentoo.org/796329"
+ fi
+
+ if [[ -v NV_LEGACY_MASK ]]; then
+ ewarn "\n***WARNING***"
+ ewarn "\nYou are installing a version of ${PN} known not to work"
+ ewarn "with a GPU of the current system. If unwanted, add the mask:"
+ if [[ -d ${EROOT}/etc/portage/package.mask ]]; then
+ ewarn "\n echo '${NV_LEGACY_MASK}' > ${EROOT}/etc/portage/package.mask/${PN}"
+ else
+ ewarn "\n echo '${NV_LEGACY_MASK}' >> ${EROOT}/etc/portage/package.mask"
+ fi
+ ewarn "\n...then downgrade to a legacy[1] branch if possible (not all old versions"
+ ewarn "are available or fully functional, may need to consider nouveau[2])."
+ ewarn "\n[1] https://www.nvidia.com/object/IO_32667.html"
+ ewarn "[2] https://wiki.gentoo.org/wiki/Nouveau"
+ fi
+
+ if ver_replacing -lt 595; then
+ elog "\n>=${PN}-595 has changes that may or may not need attention:"
+ elog "1. USE=kernel-open was removed and is now always enabled. If for some"
+ elog " reason you really need the closed variant (e.g. Runtime D3 on Turing"
+ elog " GPUs), please use LTS 580.xx instead as Gentoo has no intention to"
+ elog " support both variants anymore going forward"
+ elog "2. systemd/elogind sleep services (nvidia-sleep.sh) were tentatively"
+ elog " removed and replaced by setting NVreg_UseKernelSuspendNotifiers=1 in"
+ elog " ${EROOT}/etc/modprobe.d/nvidia.conf. If using a non-default custom"
+ elog " nvidia.conf, please ensure the option is set. Also, systemd users"
+ elog " may want to ensure that they do not have old sleep/suspend/resume"
+ elog " *nvidia* files in ${EROOT}/etc/systemd to avoid potential issues."
+ elog "3. nvidia-drm.modeset=1 was removed from nvidia.conf because it is now"
+ elog " default enabled regardless (new NVIDIA default)"
+ fi
+}
diff --git a/x11-drivers/xf86-input-elographics/Manifest b/x11-drivers/xf86-input-elographics/Manifest
new file mode 100644
index 000000000000..4be52fd2a1a9
--- /dev/null
+++ b/x11-drivers/xf86-input-elographics/Manifest
@@ -0,0 +1 @@
+DIST xf86-input-elographics-1.4.4.tar.xz 262488 BLAKE2B e2f659152beba105e649490119ff9726b5cee70ff7b1e9c64299b8729257b52a3601917c853ea5be755f3541d46b47a393c66406b1ad207e664ba97777f09907 SHA512 6e3d43d020a0805aca626b1f86027f5b76abf1c7aa8c062715e81dc35d3ac61a079c0f9d8c36a74babafdd64b81bebf453e1d11bfda07d436538b7664aa23ae6
diff --git a/x11-drivers/xf86-input-elographics/metadata.xml b/x11-drivers/xf86-input-elographics/metadata.xml
new file mode 100644
index 000000000000..16aca1d058e1
--- /dev/null
+++ b/x11-drivers/xf86-input-elographics/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>x11@gentoo.org</email>
+ <name>X11</name>
+ </maintainer>
+ <origin>baldeagleos-repo</origin>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-input-elographics/xf86-input-elographics-1.4.4.ebuild b/x11-drivers/xf86-input-elographics/xf86-input-elographics-1.4.4.ebuild
new file mode 100644
index 000000000000..ae01e324c5d4
--- /dev/null
+++ b/x11-drivers/xf86-input-elographics/xf86-input-elographics-1.4.4.ebuild
@@ -0,0 +1,9 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit xorg-3
+
+DESCRIPTION="Elographics input driver"
+KEYWORDS="~alpha amd64 arm ~arm64 ~hppa ~loong ppc ppc64 ~sparc x86"
diff --git a/x11-drivers/xf86-input-evdev/Manifest b/x11-drivers/xf86-input-evdev/Manifest
new file mode 100644
index 000000000000..c1d612edb22c
--- /dev/null
+++ b/x11-drivers/xf86-input-evdev/Manifest
@@ -0,0 +1 @@
+DIST xf86-input-evdev-2.11.0.tar.xz 351952 BLAKE2B 11e89f0d102f94499d3d848d7047e97274b173535c22f6aefa7715dd0f7b8058bf1cedd65bde7d3eef954ccfb65b62c37ceda49f349490085098e1c39791d561 SHA512 ccd3727d9726565259a81db1c238aba7e414292c3f91e182c048845ac3caf1705c2b16ff1775f3b35ecb3b7088903257085bc90a20265641ccde05b2fc6966df
diff --git a/x11-drivers/xf86-input-evdev/metadata.xml b/x11-drivers/xf86-input-evdev/metadata.xml
new file mode 100644
index 000000000000..16aca1d058e1
--- /dev/null
+++ b/x11-drivers/xf86-input-evdev/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>x11@gentoo.org</email>
+ <name>X11</name>
+ </maintainer>
+ <origin>baldeagleos-repo</origin>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-input-evdev/xf86-input-evdev-2.11.0.ebuild b/x11-drivers/xf86-input-evdev/xf86-input-evdev-2.11.0.ebuild
new file mode 100644
index 000000000000..390183b993f3
--- /dev/null
+++ b/x11-drivers/xf86-input-evdev/xf86-input-evdev-2.11.0.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit linux-info xorg-3
+
+DESCRIPTION="Generic Linux input driver"
+KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~sparc x86"
+
+RDEPEND="
+ >=x11-base/xorg-server-1.18[udev]
+ dev-libs/libevdev
+ sys-libs/mtdev
+ virtual/libudev:="
+DEPEND="
+ ${RDEPEND}
+ >=sys-kernel/linux-headers-2.6
+ x11-base/xorg-proto"
+
+pkg_pretend() {
+ if use kernel_linux ; then
+ CONFIG_CHECK="~INPUT_EVDEV"
+ fi
+ check_extra_config
+}
diff --git a/x11-drivers/xf86-input-joystick/Manifest b/x11-drivers/xf86-input-joystick/Manifest
new file mode 100644
index 000000000000..9c2ba4b3d62a
--- /dev/null
+++ b/x11-drivers/xf86-input-joystick/Manifest
@@ -0,0 +1 @@
+DIST xf86-input-joystick-1.6.4.tar.xz 296132 BLAKE2B 2e24287bcf426e69ac87d2e000c94ce72807c5590a5399d9573f150e0353c93886d47ffb7d684bad119bb8dcf6cdfee14fe472ddb583f7f2554129ca8341fe30 SHA512 4e9127f125543060f9e6bc4b0aa384bc98a92acc52bfb240c9a114c565e0b24d2e9dcbc0e866845abc8aeb1e1a6c78cd5e3f0c0f22007aa93460b6a1910d67ef
diff --git a/x11-drivers/xf86-input-joystick/metadata.xml b/x11-drivers/xf86-input-joystick/metadata.xml
new file mode 100644
index 000000000000..16aca1d058e1
--- /dev/null
+++ b/x11-drivers/xf86-input-joystick/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>x11@gentoo.org</email>
+ <name>X11</name>
+ </maintainer>
+ <origin>baldeagleos-repo</origin>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-input-joystick/xf86-input-joystick-1.6.4.ebuild b/x11-drivers/xf86-input-joystick/xf86-input-joystick-1.6.4.ebuild
new file mode 100644
index 000000000000..913a68e144e0
--- /dev/null
+++ b/x11-drivers/xf86-input-joystick/xf86-input-joystick-1.6.4.ebuild
@@ -0,0 +1,16 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit xorg-3
+
+DESCRIPTION="X.Org driver for joystick input devices"
+KEYWORDS="~alpha amd64 arm ~arm64 ~hppa ~loong ~m68k ppc ppc64 ~sparc x86"
+
+src_install() {
+ xorg-3_src_install
+
+ insinto /usr/share/X11/xorg.conf.d
+ doins config/50-joystick-all.conf
+}
diff --git a/x11-drivers/xf86-input-libinput/Manifest b/x11-drivers/xf86-input-libinput/Manifest
new file mode 100644
index 000000000000..911e68573f39
--- /dev/null
+++ b/x11-drivers/xf86-input-libinput/Manifest
@@ -0,0 +1 @@
+DIST xf86-input-libinput-1.5.0.tar.xz 330088 BLAKE2B 33c81de8bd621c6c838420747f140689c8937d7fae4c4a5beef7ede65a1ad24e1bb620f2798a002de063eef47a6e6a5a3e8bad405370b02f87aa63c2f7897afb SHA512 03090beb7c162fdf55e9bb9da41ffb8601b20047e4a53895bad27de47b3197fc920e710f26fa23e7322b367ab65fa56ba5f9a195ec69801529af3958632c2d6e
diff --git a/x11-drivers/xf86-input-libinput/metadata.xml b/x11-drivers/xf86-input-libinput/metadata.xml
new file mode 100644
index 000000000000..16aca1d058e1
--- /dev/null
+++ b/x11-drivers/xf86-input-libinput/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>x11@gentoo.org</email>
+ <name>X11</name>
+ </maintainer>
+ <origin>baldeagleos-repo</origin>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-input-libinput/xf86-input-libinput-1.5.0.ebuild b/x11-drivers/xf86-input-libinput/xf86-input-libinput-1.5.0.ebuild
new file mode 100644
index 000000000000..8b02d9b1ae84
--- /dev/null
+++ b/x11-drivers/xf86-input-libinput/xf86-input-libinput-1.5.0.ebuild
@@ -0,0 +1,21 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit linux-info xorg-3
+
+DESCRIPTION="X.org input driver based on libinput"
+
+KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc x86"
+
+RDEPEND=">=dev-libs/libinput-1.23.0:0="
+DEPEND="${RDEPEND}
+ >=x11-base/xorg-proto-2021.5"
+
+DOCS=( "README.md" )
+
+pkg_pretend() {
+ CONFIG_CHECK="~TIMERFD"
+ check_extra_config
+}
diff --git a/x11-drivers/xf86-input-mtrack/Manifest b/x11-drivers/xf86-input-mtrack/Manifest
new file mode 100644
index 000000000000..d3a8f063847f
--- /dev/null
+++ b/x11-drivers/xf86-input-mtrack/Manifest
@@ -0,0 +1 @@
+DIST xf86-input-mtrack-0.5.0.tar.gz 392992 BLAKE2B 7b0697dde374d558eec304a5b26b50d62fe85c8a0bbde916096ae0296b6bae372c499138a4ca8500e4b6bfeaf7782a18512813c60013476decd2ae6a4a838aa6 SHA512 d30551e0b8be47af336fa3d5207537eb115586f0bb078b2eb6d823fed695a2157e2e63bf145757f04b09359b94206211df817dc2d1182813a3f6370a2a126846
diff --git a/x11-drivers/xf86-input-mtrack/metadata.xml b/x11-drivers/xf86-input-mtrack/metadata.xml
new file mode 100644
index 000000000000..16aca1d058e1
--- /dev/null
+++ b/x11-drivers/xf86-input-mtrack/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>x11@gentoo.org</email>
+ <name>X11</name>
+ </maintainer>
+ <origin>baldeagleos-repo</origin>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-input-mtrack/xf86-input-mtrack-0.5.0-r1.ebuild b/x11-drivers/xf86-input-mtrack/xf86-input-mtrack-0.5.0-r1.ebuild
new file mode 100644
index 000000000000..827742b72b77
--- /dev/null
+++ b/x11-drivers/xf86-input-mtrack/xf86-input-mtrack-0.5.0-r1.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit vcs-snapshot
+
+DESCRIPTION="Xorg Driver for Multitouch Trackpads"
+HOMEPAGE="https://github.com/p2rkw/xf86-input-mtrack"
+SRC_URI="https://github.com/p2rkw/xf86-input-mtrack/archive/v${PV/_/-}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~arm x86"
+IUSE="debug"
+
+RDEPEND="
+ >=sys-libs/mtdev-1.0
+ x11-base/xorg-server:="
+DEPEND="${RDEPEND}
+ x11-base/xorg-proto"
+
+src_configure() {
+ econf $(use_enable debug)
+}
+
+src_install() {
+ default
+ find "${ED}" -name '*.la' -delete || die
+}
+
+pkg_postinst() {
+ elog
+ elog "To enable multitouch support add the following lines"
+ elog "to your xorg.conf:"
+ elog
+ elog "Section \"InputClass\""
+ elog " MatchIsTouchpad \"true\""
+ elog " Identifier \"Touchpads\""
+ elog " Driver \"mtrack\""
+ elog "EndSection"
+ elog
+}
diff --git a/x11-drivers/xf86-input-synaptics/Manifest b/x11-drivers/xf86-input-synaptics/Manifest
new file mode 100644
index 000000000000..f267790e22c7
--- /dev/null
+++ b/x11-drivers/xf86-input-synaptics/Manifest
@@ -0,0 +1 @@
+DIST xf86-input-synaptics-1.10.0.tar.xz 431316 BLAKE2B 02b90fca8baba07323141efbca0cc039d52406cc0272de12f6c08ac90769ffb14a7725a5e25f47d6235661f69136b5a9d8edef76203c63a027d7b12b3368f540 SHA512 deb14ba039f423c4575825ecdeb74f31e30f044a4efc7dae9c1634f841dcf7066970cd470be7e63f68eccd4899e0434d602e59c297042cb2f38ff2a3a02d7e91
diff --git a/x11-drivers/xf86-input-synaptics/metadata.xml b/x11-drivers/xf86-input-synaptics/metadata.xml
new file mode 100644
index 000000000000..16aca1d058e1
--- /dev/null
+++ b/x11-drivers/xf86-input-synaptics/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>x11@gentoo.org</email>
+ <name>X11</name>
+ </maintainer>
+ <origin>baldeagleos-repo</origin>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-input-synaptics/xf86-input-synaptics-1.10.0.ebuild b/x11-drivers/xf86-input-synaptics/xf86-input-synaptics-1.10.0.ebuild
new file mode 100644
index 000000000000..c99f9afe6334
--- /dev/null
+++ b/x11-drivers/xf86-input-synaptics/xf86-input-synaptics-1.10.0.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit linux-info xorg-3
+
+DESCRIPTION="Driver for Synaptics touchpads"
+
+KEYWORDS="amd64 arm arm64 ~loong ~mips ppc ppc64 x86"
+
+RDEPEND="
+ >=x11-base/xorg-server-1.14
+ x11-libs/libX11
+ >=x11-libs/libXi-1.2
+ >=x11-libs/libXtst-1.1.0
+ kernel_linux? ( >=dev-libs/libevdev-0.4 )"
+DEPEND="
+ ${RDEPEND}
+ >=sys-kernel/linux-headers-2.6.37
+ x11-base/xorg-proto"
+
+check_reqs() {
+ linux-info_pkg_setup
+
+ # Just a friendly warning
+ if ! linux_config_exists \
+ || ! linux_chkconfig_present INPUT_EVDEV; then
+ ewarn
+ ewarn "This driver requires event interface support in your kernel"
+ ewarn " Device Drivers --->"
+ ewarn " Input device support --->"
+ ewarn " <*> Event interface"
+ ewarn
+ fi
+}
+
+pkg_pretend() {
+ check_reqs
+}
+
+pkg_setup() {
+ check_reqs
+}
diff --git a/x11-drivers/xf86-input-vmmouse/Manifest b/x11-drivers/xf86-input-vmmouse/Manifest
new file mode 100644
index 000000000000..87837f82fbb4
--- /dev/null
+++ b/x11-drivers/xf86-input-vmmouse/Manifest
@@ -0,0 +1 @@
+DIST xf86-input-vmmouse-13.2.0.tar.xz 284684 BLAKE2B a63caa3959b47ee4b43dd4e90e7b68706fc39da2d4018965112218c372b4107cbbcebb19fae8fea05a7c95c86a4a793b414ff6cd49e1391fbce04341b7a9eb9c SHA512 26a01347a679db058abdc7cbd9a363bb4fccd1a727dc18e279d15b8a0dce71f67af5ff54df28b908391da8d2fc311d8c1813f26dcded4e9a2668db7b55ca5687
diff --git a/x11-drivers/xf86-input-vmmouse/metadata.xml b/x11-drivers/xf86-input-vmmouse/metadata.xml
new file mode 100644
index 000000000000..16aca1d058e1
--- /dev/null
+++ b/x11-drivers/xf86-input-vmmouse/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>x11@gentoo.org</email>
+ <name>X11</name>
+ </maintainer>
+ <origin>baldeagleos-repo</origin>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-input-vmmouse/xf86-input-vmmouse-13.2.0.ebuild b/x11-drivers/xf86-input-vmmouse/xf86-input-vmmouse-13.2.0.ebuild
new file mode 100644
index 000000000000..78792df9e1c0
--- /dev/null
+++ b/x11-drivers/xf86-input-vmmouse/xf86-input-vmmouse-13.2.0.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+inherit udev xorg-3
+
+DESCRIPTION="VMWare mouse input driver"
+
+KEYWORDS="amd64 x86"
+
+DEPEND="x11-base/xorg-proto"
+
+src_configure() {
+ local XORG_CONFIGURE_OPTIONS=(
+ --with-hal-bin-dir=/punt
+ --with-hal-callouts-dir=/punt
+ --with-hal-fdi-dir=/punt
+ --with-udev-rules-dir=$(get_udevdir)/rules.d
+ )
+ xorg-3_src_configure
+}
+
+src_install() {
+ xorg-3_src_install
+ rm -r "${ED}"/punt || die
+}
+
+pkg_postinst() {
+ udev_reload
+}
+
+pkg_postrm() {
+ udev_reload
+}
diff --git a/x11-drivers/xf86-input-vmmouse/xf86-input-vmmouse-9999.ebuild b/x11-drivers/xf86-input-vmmouse/xf86-input-vmmouse-9999.ebuild
new file mode 100644
index 000000000000..852093416b9f
--- /dev/null
+++ b/x11-drivers/xf86-input-vmmouse/xf86-input-vmmouse-9999.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+inherit udev xorg-3
+
+DESCRIPTION="VMWare mouse input driver"
+
+DEPEND="x11-base/xorg-proto"
+
+src_configure() {
+ local XORG_CONFIGURE_OPTIONS=(
+ --with-hal-bin-dir=/punt
+ --with-hal-callouts-dir=/punt
+ --with-hal-fdi-dir=/punt
+ --with-udev-rules-dir=$(get_udevdir)/rules.d
+ )
+ xorg-3_src_configure
+}
+
+src_install() {
+ xorg-3_src_install
+ rm -r "${ED}"/punt || die
+}
+
+pkg_postinst() {
+ udev_reload
+}
+
+pkg_postrm() {
+ udev_reload
+}
diff --git a/x11-drivers/xf86-input-void/Manifest b/x11-drivers/xf86-input-void/Manifest
new file mode 100644
index 000000000000..6c773961136e
--- /dev/null
+++ b/x11-drivers/xf86-input-void/Manifest
@@ -0,0 +1 @@
+DIST xf86-input-void-1.4.2.tar.xz 257888 BLAKE2B 864ef551c09af5a9726094d3ce7e1a0d948e0a06d23784270a43e81c4b8904b3bb1abb0e1d9efa59d9c445dcc2be7515c45d956c2e669e2e0d7ccad23c10f30b SHA512 f266494bd0ab62d2e20048d5557cb4724cc704be06b7f04f55970aad070887ca8940341c4a4929bb48a46b4d040e03c4d09ce3ae85b94ce23c70faf28486005d
diff --git a/x11-drivers/xf86-input-void/metadata.xml b/x11-drivers/xf86-input-void/metadata.xml
new file mode 100644
index 000000000000..16aca1d058e1
--- /dev/null
+++ b/x11-drivers/xf86-input-void/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>x11@gentoo.org</email>
+ <name>X11</name>
+ </maintainer>
+ <origin>baldeagleos-repo</origin>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-input-void/xf86-input-void-1.4.2.ebuild b/x11-drivers/xf86-input-void/xf86-input-void-1.4.2.ebuild
new file mode 100644
index 000000000000..6f1db55814aa
--- /dev/null
+++ b/x11-drivers/xf86-input-void/xf86-input-void-1.4.2.ebuild
@@ -0,0 +1,10 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit xorg-3
+
+DESCRIPTION="null input driver"
+
+KEYWORDS="~alpha amd64 arm ~arm64 ~hppa ~loong ~m68k ppc ppc64 ~s390 ~sparc x86"
diff --git a/x11-drivers/xf86-input-wacom/Manifest b/x11-drivers/xf86-input-wacom/Manifest
new file mode 100644
index 000000000000..3138cf11a9d7
--- /dev/null
+++ b/x11-drivers/xf86-input-wacom/Manifest
@@ -0,0 +1 @@
+DIST xf86-input-wacom-1.2.4.tar.bz2 690677 BLAKE2B 305b94e9c0b4ee7e0d75ce02c7f377cb2a7dd3790fe1a9e772ab4e67814ef9035aeb5a23948ef642c487ebe265b4a10e8e76000ddd5f8f2a13eab3d011ffc5d0 SHA512 7c1b62566f3dadad632c730afc0dfd81bf2082514091e2f1af1f04bbbf2e1f96877d6a982d127079f40d08bf503305b8c5ce8f526ff4a7ee5d7b0dcab27329b0
diff --git a/x11-drivers/xf86-input-wacom/metadata.xml b/x11-drivers/xf86-input-wacom/metadata.xml
new file mode 100644
index 000000000000..16aca1d058e1
--- /dev/null
+++ b/x11-drivers/xf86-input-wacom/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>x11@gentoo.org</email>
+ <name>X11</name>
+ </maintainer>
+ <origin>baldeagleos-repo</origin>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-input-wacom/xf86-input-wacom-1.2.4.ebuild b/x11-drivers/xf86-input-wacom/xf86-input-wacom-1.2.4.ebuild
new file mode 100644
index 000000000000..a6a45e17087f
--- /dev/null
+++ b/x11-drivers/xf86-input-wacom/xf86-input-wacom-1.2.4.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit linux-info systemd udev xorg-3 meson
+
+DESCRIPTION="Driver for Wacom tablets and drawing devices"
+HOMEPAGE="https://linuxwacom.github.io/"
+SRC_URI="https://github.com/linuxwacom/${PN}/releases/download/${P}/${P}.tar.bz2"
+
+LICENSE="GPL-2+"
+KEYWORDS="~alpha amd64 arm arm64 ~loong ppc ppc64 ~riscv ~sparc x86"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/libXi
+ x11-libs/libXrandr
+ x11-libs/libXinerama
+ virtual/libudev:="
+DEPEND="${RDEPEND}"
+
+pkg_pretend() {
+ linux-info_pkg_setup
+
+ if ! linux_config_exists \
+ || ! linux_chkconfig_present HID_WACOM; then
+ echo
+ ewarn "If you use a USB Wacom tablet, you need to enable support in your kernel"
+ ewarn " Device Drivers --->"
+ ewarn " HID support --->"
+ ewarn " Special HID drivers --->"
+ ewarn " <*> Wacom Intuos/Graphire tablet support (USB)"
+ echo
+ fi
+}
+
+pkg_setup() {
+ linux-info_pkg_setup
+}
+
+src_configure() {
+ xorg-3_flags_setup
+
+ local emesonargs=(
+ -Dsystemd-unit-dir="$(systemd_get_systemunitdir)"
+ -Dudev-rules-dir="$(get_udevdir)/rules.d"
+ $(meson_feature test unittests)
+ -Dwacom-gobject=disabled
+ )
+ meson_src_configure
+}
+
+pkg_postinst() {
+ udev_reload
+}
+
+pkg_postrm() {
+ udev_reload
+}
diff --git a/x11-drivers/xf86-video-amdgpu/Manifest b/x11-drivers/xf86-video-amdgpu/Manifest
new file mode 100644
index 000000000000..8b391c95d35a
--- /dev/null
+++ b/x11-drivers/xf86-video-amdgpu/Manifest
@@ -0,0 +1 @@
+DIST xf86-video-amdgpu-25.0.0.tar.xz 75000 BLAKE2B 150a8296d9d6806cb8c481707450145169418a0d54389c0e73ad2efb8175fef29df490163def7032bc2402ebae6de4be14d0222035f87bf7fedbb332f895068b SHA512 d143294fead7073c14100299ccab20d1f5eab8b7e36c1770b12aaade958211e1961f4353dc47123c3b9af9f7a911d913def71d25b83dab3dee1d289043869891
diff --git a/x11-drivers/xf86-video-amdgpu/metadata.xml b/x11-drivers/xf86-video-amdgpu/metadata.xml
new file mode 100644
index 000000000000..16aca1d058e1
--- /dev/null
+++ b/x11-drivers/xf86-video-amdgpu/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>x11@gentoo.org</email>
+ <name>X11</name>
+ </maintainer>
+ <origin>baldeagleos-repo</origin>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-amdgpu/xf86-video-amdgpu-25.0.0-r1.ebuild b/x11-drivers/xf86-video-amdgpu/xf86-video-amdgpu-25.0.0-r1.ebuild
new file mode 100644
index 000000000000..c0c29d864d1a
--- /dev/null
+++ b/x11-drivers/xf86-video-amdgpu/xf86-video-amdgpu-25.0.0-r1.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+inherit xorg-meson
+
+if [[ ${PV} != 9999* ]]; then
+ KEYWORDS="amd64 arm64 ~loong ppc64 ~riscv x86"
+fi
+
+DESCRIPTION="Accelerated Open Source driver for AMDGPU cards"
+
+IUSE="udev"
+
+RDEPEND=">=x11-libs/libdrm-2.4.89[video_cards_amdgpu]
+ x11-base/xorg-server[-minimal]
+ udev? ( virtual/libudev:= )"
+DEPEND="${RDEPEND}"
+
+src_configure() {
+ local XORG_CONFIGURE_OPTIONS=(
+ -Dglamor=enabled
+ $(meson_feature udev)
+ )
+ xorg-meson_src_configure
+}
diff --git a/x11-drivers/xf86-video-amdgpu/xf86-video-amdgpu-9999.ebuild b/x11-drivers/xf86-video-amdgpu/xf86-video-amdgpu-9999.ebuild
new file mode 100644
index 000000000000..e0d71ccd22af
--- /dev/null
+++ b/x11-drivers/xf86-video-amdgpu/xf86-video-amdgpu-9999.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+inherit xorg-meson
+
+if [[ ${PV} != 9999* ]]; then
+ KEYWORDS="~amd64 ~arm64 ~loong ~ppc64 ~riscv ~x86"
+fi
+
+DESCRIPTION="Accelerated Open Source driver for AMDGPU cards"
+
+IUSE="udev"
+
+RDEPEND=">=x11-libs/libdrm-2.4.89[video_cards_amdgpu]
+ x11-base/xorg-server[-minimal]
+ udev? ( virtual/libudev:= )"
+DEPEND="${RDEPEND}"
+
+src_configure() {
+ local XORG_CONFIGURE_OPTIONS=(
+ -Dglamor=enabled
+ $(meson_feature udev)
+ )
+ xorg-meson_src_configure
+}
diff --git a/x11-drivers/xf86-video-ast/Manifest b/x11-drivers/xf86-video-ast/Manifest
new file mode 100644
index 000000000000..e30392fd5151
--- /dev/null
+++ b/x11-drivers/xf86-video-ast/Manifest
@@ -0,0 +1 @@
+DIST xf86-video-ast-1.2.1.tar.xz 322180 BLAKE2B 9309f266144551d5512f01ccf45b19f65dd70a707fef1f68dc87e6df97e9c646969d7913544b82335e1faca7d20e2ec05506a2a65e81e0cee9ed3f5af9123762 SHA512 50603333b3780aaf9a44132589e30ba8c9e1c938d769a38361ab3886231896227d2f526428cae36cc4e8f054f3bf8a75b1e4911d9c449298bf36c75c0f962745
diff --git a/x11-drivers/xf86-video-ast/metadata.xml b/x11-drivers/xf86-video-ast/metadata.xml
new file mode 100644
index 000000000000..16aca1d058e1
--- /dev/null
+++ b/x11-drivers/xf86-video-ast/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>x11@gentoo.org</email>
+ <name>X11</name>
+ </maintainer>
+ <origin>baldeagleos-repo</origin>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-ast/xf86-video-ast-1.2.1.ebuild b/x11-drivers/xf86-video-ast/xf86-video-ast-1.2.1.ebuild
new file mode 100644
index 000000000000..7f80c4285631
--- /dev/null
+++ b/x11-drivers/xf86-video-ast/xf86-video-ast-1.2.1.ebuild
@@ -0,0 +1,9 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit xorg-3
+
+DESCRIPTION="X.Org driver for ASpeedTech cards"
+KEYWORDS="amd64 ~loong ~ppc ppc64 x86"
diff --git a/x11-drivers/xf86-video-ati/Manifest b/x11-drivers/xf86-video-ati/Manifest
new file mode 100644
index 000000000000..964eb1c1da71
--- /dev/null
+++ b/x11-drivers/xf86-video-ati/Manifest
@@ -0,0 +1 @@
+DIST xf86-video-ati-22.0.0.tar.xz 755812 BLAKE2B 97349eca2b01e714a44bcfc9489251d175eab2ca622ac5f475797d0d862e082cf9f2bc49d996bc4a8ef39d13f4474953542bd5c5cfa495877b280aff218e4fe2 SHA512 fba9ffc7b0eeb0c369eb1a6f8ef0bb3061cfeca26bc269baf6e3d16dcd943fbf4092f1e37adfb1bc71051cee0b7a0e6fb253f0b8bcd210732ccaf99e8f2356fe
diff --git a/x11-drivers/xf86-video-ati/metadata.xml b/x11-drivers/xf86-video-ati/metadata.xml
new file mode 100644
index 000000000000..16aca1d058e1
--- /dev/null
+++ b/x11-drivers/xf86-video-ati/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>x11@gentoo.org</email>
+ <name>X11</name>
+ </maintainer>
+ <origin>baldeagleos-repo</origin>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-ati/xf86-video-ati-22.0.0.ebuild b/x11-drivers/xf86-video-ati/xf86-video-ati-22.0.0.ebuild
new file mode 100644
index 000000000000..fbc6d6174389
--- /dev/null
+++ b/x11-drivers/xf86-video-ati/xf86-video-ati-22.0.0.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+XORG_DRI=always
+inherit linux-info xorg-3
+
+if [[ ${PV} != 9999* ]]; then
+ KEYWORDS="~alpha amd64 arm64 ~loong ppc ppc64 ~riscv ~sparc x86"
+fi
+
+DESCRIPTION="ATI video driver"
+HOMEPAGE="https://www.x.org/wiki/ati/"
+
+IUSE="udev"
+
+RDEPEND="
+ media-libs/mesa
+ >=x11-libs/libdrm-2.4.89[video_cards_radeon]
+ >=x11-libs/libpciaccess-0.8.0
+ x11-base/xorg-server[-minimal]
+ udev? ( virtual/libudev:= )"
+DEPEND="${RDEPEND}
+ x11-base/xorg-proto"
+
+pkg_pretend() {
+ if use kernel_linux; then
+ if kernel_is -ge 3 9; then
+ CONFIG_CHECK="~!DRM_RADEON_UMS ~!FB_RADEON"
+ else
+ CONFIG_CHECK="~DRM_RADEON_KMS ~!FB_RADEON"
+ fi
+ fi
+ check_extra_config
+}
+
+pkg_setup() {
+ linux-info_pkg_setup
+ xorg-3_pkg_setup
+}
+
+src_configure() {
+ local XORG_CONFIGURE_OPTIONS=(
+ --enable-glamor
+ $(use_enable udev)
+ )
+ xorg-3_src_configure
+}
diff --git a/x11-drivers/xf86-video-ati/xf86-video-ati-9999.ebuild b/x11-drivers/xf86-video-ati/xf86-video-ati-9999.ebuild
new file mode 100644
index 000000000000..0d92004dbe0a
--- /dev/null
+++ b/x11-drivers/xf86-video-ati/xf86-video-ati-9999.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+XORG_DRI=always
+inherit linux-info xorg-3
+
+if [[ ${PV} != 9999* ]]; then
+ KEYWORDS="~alpha ~amd64 ~arm64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86"
+fi
+
+DESCRIPTION="ATI video driver"
+HOMEPAGE="https://www.x.org/wiki/ati/"
+
+IUSE="udev"
+
+RDEPEND="
+ media-libs/mesa
+ >=x11-libs/libdrm-2.4.89[video_cards_radeon]
+ >=x11-libs/libpciaccess-0.8.0
+ x11-base/xorg-server[-minimal]
+ udev? ( virtual/libudev:= )"
+DEPEND="${RDEPEND}
+ x11-base/xorg-proto"
+
+pkg_pretend() {
+ if use kernel_linux; then
+ if kernel_is -ge 3 9; then
+ CONFIG_CHECK="~!DRM_RADEON_UMS ~!FB_RADEON"
+ else
+ CONFIG_CHECK="~DRM_RADEON_KMS ~!FB_RADEON"
+ fi
+ fi
+ check_extra_config
+}
+
+pkg_setup() {
+ linux-info_pkg_setup
+ xorg-3_pkg_setup
+}
+
+src_configure() {
+ local XORG_CONFIGURE_OPTIONS=(
+ --enable-glamor
+ $(use_enable udev)
+ )
+ xorg-3_src_configure
+}
diff --git a/x11-drivers/xf86-video-dummy/Manifest b/x11-drivers/xf86-video-dummy/Manifest
new file mode 100644
index 000000000000..f68ee99fbfbe
--- /dev/null
+++ b/x11-drivers/xf86-video-dummy/Manifest
@@ -0,0 +1 @@
+DIST xf86-video-dummy-0.4.1.tar.xz 262496 BLAKE2B a75a24f2e81713bdee9249d72df45877790c85fa3ba3d25214e46bd552f896df56d71bda8e68a389a93a0ee06c8e85b0a3ee5aaa8909d16125d406a5e04129e9 SHA512 ff7fd8b668e5e9f40a5d27f82599b7a455a8162fc1a247195335c17980f00ce10ae6b2c062239cbaa67d8684c86174f85b398dd7f7065d36f69294bd6f2469de
diff --git a/x11-drivers/xf86-video-dummy/metadata.xml b/x11-drivers/xf86-video-dummy/metadata.xml
new file mode 100644
index 000000000000..16aca1d058e1
--- /dev/null
+++ b/x11-drivers/xf86-video-dummy/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>x11@gentoo.org</email>
+ <name>X11</name>
+ </maintainer>
+ <origin>baldeagleos-repo</origin>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-dummy/xf86-video-dummy-0.4.1.ebuild b/x11-drivers/xf86-video-dummy/xf86-video-dummy-0.4.1.ebuild
new file mode 100644
index 000000000000..8f781d41e276
--- /dev/null
+++ b/x11-drivers/xf86-video-dummy/xf86-video-dummy-0.4.1.ebuild
@@ -0,0 +1,9 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit xorg-3
+
+DESCRIPTION="X.Org driver for dummy cards"
+KEYWORDS="~alpha amd64 arm ~arm64 ~hppa ~loong ~m68k ~mips ppc ppc64 ~s390 ~sparc x86"
diff --git a/x11-drivers/xf86-video-fbdev/Manifest b/x11-drivers/xf86-video-fbdev/Manifest
new file mode 100644
index 000000000000..f7f04b9a4d90
--- /dev/null
+++ b/x11-drivers/xf86-video-fbdev/Manifest
@@ -0,0 +1 @@
+DIST xf86-video-fbdev-0.5.1.tar.xz 269900 BLAKE2B 6f4223898b36bf2d874cf8730470c00a41e59f9f3a52fed3255a0b236599764ef6a548c54f1f30f5beb2b53ad0c4917d5e25cf45d21c9ad6141f35953f16727f SHA512 ab345d796fb6a404c44a5caec31497fd36dce8882befad644b3f6fac1969c0a4ba9243e911e86a29a149ee7b0847ba676a28a49e15f1789238f2726b9dcea1a8
diff --git a/x11-drivers/xf86-video-fbdev/metadata.xml b/x11-drivers/xf86-video-fbdev/metadata.xml
new file mode 100644
index 000000000000..16aca1d058e1
--- /dev/null
+++ b/x11-drivers/xf86-video-fbdev/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>x11@gentoo.org</email>
+ <name>X11</name>
+ </maintainer>
+ <origin>baldeagleos-repo</origin>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-fbdev/xf86-video-fbdev-0.5.1.ebuild b/x11-drivers/xf86-video-fbdev/xf86-video-fbdev-0.5.1.ebuild
new file mode 100644
index 000000000000..032f9cb50b5d
--- /dev/null
+++ b/x11-drivers/xf86-video-fbdev/xf86-video-fbdev-0.5.1.ebuild
@@ -0,0 +1,8 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+inherit xorg-3
+
+DESCRIPTION="video driver for framebuffer device"
+KEYWORDS="~alpha amd64 arm ~arm64 ~hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~sparc x86"
diff --git a/x11-drivers/xf86-video-geode/Manifest b/x11-drivers/xf86-video-geode/Manifest
new file mode 100644
index 000000000000..68a768ceb9a7
--- /dev/null
+++ b/x11-drivers/xf86-video-geode/Manifest
@@ -0,0 +1 @@
+DIST xf86-video-geode-2.18.2.tar.xz 586836 BLAKE2B 487f9de145d3cc26052e4814acdfd748deb27e258e33f45eb507226f49c7b8e9cfa97a99f92a71f8f4e09b4de9dc8574f84d642a97d832560c8d476c75c9401e SHA512 9228db606704494ab4490a676a6d25355d68438fe909b22cba9766040fc92b6484c95ac08a5e7bd09540bff7b37992b37febb4e3de44ec49c026b378836f5478
diff --git a/x11-drivers/xf86-video-geode/metadata.xml b/x11-drivers/xf86-video-geode/metadata.xml
new file mode 100644
index 000000000000..392aa3ec8a2f
--- /dev/null
+++ b/x11-drivers/xf86-video-geode/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>leio@gentoo.org</email>
+ </maintainer>
+ <maintainer type="project">
+ <email>x11@gentoo.org</email>
+ <name>X11</name>
+ </maintainer>
+ <use>
+ <flag name="ztv">Enable building the V4L2 ZTV driver</flag>
+ </use>
+ <origin>baldeagleos-repo</origin>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-geode/xf86-video-geode-2.18.2.ebuild b/x11-drivers/xf86-video-geode/xf86-video-geode-2.18.2.ebuild
new file mode 100644
index 000000000000..561225f8d79a
--- /dev/null
+++ b/x11-drivers/xf86-video-geode/xf86-video-geode-2.18.2.ebuild
@@ -0,0 +1,23 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit xorg-3
+
+DESCRIPTION="AMD Geode GX and LX graphics driver"
+KEYWORDS="x86"
+IUSE="ztv"
+
+DEPEND="
+ ztv? (
+ sys-kernel/linux-headers
+ )
+"
+
+src_configure() {
+ local XORG_CONFIGURE_OPTIONS=(
+ $(use_enable ztv)
+ )
+ xorg-3_src_configure
+}
diff --git a/x11-drivers/xf86-video-intel/Manifest b/x11-drivers/xf86-video-intel/Manifest
new file mode 100644
index 000000000000..8f3e1faef22b
--- /dev/null
+++ b/x11-drivers/xf86-video-intel/Manifest
@@ -0,0 +1 @@
+DIST xf86-video-intel-2.99.917_p20230201.tar.bz2 1250201 BLAKE2B f41aa429079b60b06a4f78289c5d94de9203c55756bcc3f1ff016a9226e7fa01b3559305ea3328acbc88063c8a5a96289a0ba9954e011c4eaeb7ac5d8fc3e240 SHA512 5f37bfead71ca5a671640919c357912d15b809fe8f55f572119927b218e58bbd75f3ec4370a80d74d454debb09c678105b3120f8d7eced3f9ed858878ba9128c
diff --git a/x11-drivers/xf86-video-intel/metadata.xml b/x11-drivers/xf86-video-intel/metadata.xml
new file mode 100644
index 000000000000..55abe23beb7f
--- /dev/null
+++ b/x11-drivers/xf86-video-intel/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>x11@gentoo.org</email>
+ <name>X11</name>
+ </maintainer>
+ <use>
+ <flag name="sna">Enable SandyBridge's New Acceleration (useful on all chipsets, not just SandyBridge)</flag>
+ <flag name="tools">Build the intel-virtual-output tool</flag>
+ <flag name="uxa">Enable UMA Acceleration Architecture</flag>
+ <flag name="xvmc">Enables X-Video Motion Compensation support</flag>
+ </use>
+ <upstream>
+ <remote-id type="cpe">cpe:/a:x:xf86-video-intel</remote-id>
+ </upstream>
+ <origin>baldeagleos-repo</origin>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-intel/xf86-video-intel-2.99.917_p20230201.ebuild b/x11-drivers/xf86-video-intel/xf86-video-intel-2.99.917_p20230201.ebuild
new file mode 100644
index 000000000000..284517e9312b
--- /dev/null
+++ b/x11-drivers/xf86-video-intel/xf86-video-intel-2.99.917_p20230201.ebuild
@@ -0,0 +1,98 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+XORG_DRI=dri
+XORG_EAUTORECONF=yes
+inherit linux-info xorg-3 flag-o-matic
+
+if [[ ${PV} != 9999* ]]; then
+ KEYWORDS="amd64 x86"
+ COMMIT_ID="b74b67f0f321875492968f7097b9d6e82a66d7df"
+ SRC_URI="https://gitlab.freedesktop.org/xorg/driver/xf86-video-intel/-/archive/${COMMIT_ID}/${P}.tar.bz2"
+ S="${WORKDIR}/${PN}-${COMMIT_ID}"
+fi
+
+DESCRIPTION="X.Org driver for Intel cards"
+
+IUSE="debug +sna tools +udev uxa valgrind xvmc"
+
+REQUIRED_USE="
+ || ( sna uxa )
+ uxa? ( dri )
+"
+RDEPEND="
+ x11-libs/libXext
+ x11-libs/libXfixes
+ x11-libs/libXScrnSaver
+ >=x11-libs/pixman-0.27.1
+ >=x11-libs/libdrm-2.4.52[video_cards_intel]
+ >=x11-base/xorg-server-1.18
+ tools? (
+ x11-libs/libX11
+ x11-libs/libxcb
+ x11-libs/libXcursor
+ x11-libs/libXdamage
+ x11-libs/libXinerama
+ x11-libs/libXrandr
+ x11-libs/libXrender
+ x11-libs/libxshmfence
+ x11-libs/libXtst
+ )
+ udev? (
+ virtual/libudev:=
+ )
+ xvmc? (
+ >=x11-libs/libXvMC-1.0.12-r1
+ >=x11-libs/libxcb-1.5
+ x11-libs/xcb-util
+ )
+"
+DEPEND="
+ ${RDEPEND}
+ x11-base/xorg-proto
+ valgrind? ( dev-debug/valgrind )
+"
+
+pkg_setup() {
+ linux-info_pkg_setup
+ xorg-3_pkg_setup
+}
+
+src_configure() {
+ # bug #582910
+ replace-flags -Os -O2
+ # Uses the 'flatten' attribute which explodes with LTO (bug #864379)
+ filter-lto
+
+ local XORG_CONFIGURE_OPTIONS=(
+ --disable-dri1
+ $(use_enable debug)
+ $(use_enable dri)
+ $(use_enable dri dri3)
+ $(usex dri "--with-default-dri=3" "")
+ $(use_enable sna)
+ $(use_enable tools)
+ $(use_enable udev)
+ $(use_enable uxa)
+ $(use_enable valgrind)
+ $(use_enable xvmc)
+ )
+ xorg-3_src_configure
+}
+
+pkg_postinst() {
+ if linux_config_exists && \
+ kernel_is -lt 4 3 && ! linux_chkconfig_present DRM_I915_KMS; then
+ echo
+ ewarn "This driver requires KMS support in your kernel"
+ ewarn " Device Drivers --->"
+ ewarn " Graphics support --->"
+ ewarn " Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) --->"
+ ewarn " <*> Intel 830M, 845G, 852GM, 855GM, 865G (i915 driver) --->"
+ ewarn " i915 driver"
+ ewarn " [*] Enable modesetting on intel by default"
+ echo
+ fi
+}
diff --git a/x11-drivers/xf86-video-intel/xf86-video-intel-9999.ebuild b/x11-drivers/xf86-video-intel/xf86-video-intel-9999.ebuild
new file mode 100644
index 000000000000..0fde7595ecff
--- /dev/null
+++ b/x11-drivers/xf86-video-intel/xf86-video-intel-9999.ebuild
@@ -0,0 +1,98 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+XORG_DRI=dri
+XORG_EAUTORECONF=yes
+inherit linux-info xorg-3 flag-o-matic
+
+if [[ ${PV} != 9999* ]]; then
+ KEYWORDS="~amd64 ~x86"
+ COMMIT_ID=""
+ SRC_URI="https://gitlab.freedesktop.org/xorg/driver/xf86-video-intel/-/archive/${COMMIT_ID}/${P}.tar.bz2"
+ S="${WORKDIR}/${PN}-${COMMIT_ID}"
+fi
+
+DESCRIPTION="X.Org driver for Intel cards"
+
+IUSE="debug +sna tools +udev uxa valgrind xvmc"
+
+REQUIRED_USE="
+ || ( sna uxa )
+ uxa? ( dri )
+"
+RDEPEND="
+ x11-libs/libXext
+ x11-libs/libXfixes
+ x11-libs/libXScrnSaver
+ >=x11-libs/pixman-0.27.1
+ >=x11-libs/libdrm-2.4.52[video_cards_intel]
+ >=x11-base/xorg-server-1.18
+ tools? (
+ x11-libs/libX11
+ x11-libs/libxcb
+ x11-libs/libXcursor
+ x11-libs/libXdamage
+ x11-libs/libXinerama
+ x11-libs/libXrandr
+ x11-libs/libXrender
+ x11-libs/libxshmfence
+ x11-libs/libXtst
+ )
+ udev? (
+ virtual/libudev:=
+ )
+ xvmc? (
+ >=x11-libs/libXvMC-1.0.12-r1
+ >=x11-libs/libxcb-1.5
+ x11-libs/xcb-util
+ )
+"
+DEPEND="
+ ${RDEPEND}
+ x11-base/xorg-proto
+ valgrind? ( dev-debug/valgrind )
+"
+
+pkg_setup() {
+ linux-info_pkg_setup
+ xorg-3_pkg_setup
+}
+
+src_configure() {
+ # bug #582910
+ replace-flags -Os -O2
+ # Uses the 'flatten' attribute which explodes with LTO (bug #864379)
+ filter-lto
+
+ local XORG_CONFIGURE_OPTIONS=(
+ --disable-dri1
+ $(use_enable debug)
+ $(use_enable dri)
+ $(use_enable dri dri3)
+ $(usex dri "--with-default-dri=3" "")
+ $(use_enable sna)
+ $(use_enable tools)
+ $(use_enable udev)
+ $(use_enable uxa)
+ $(use_enable valgrind)
+ $(use_enable xvmc)
+ )
+ xorg-3_src_configure
+}
+
+pkg_postinst() {
+ if linux_config_exists && \
+ kernel_is -lt 4 3 && ! linux_chkconfig_present DRM_I915_KMS; then
+ echo
+ ewarn "This driver requires KMS support in your kernel"
+ ewarn " Device Drivers --->"
+ ewarn " Graphics support --->"
+ ewarn " Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) --->"
+ ewarn " <*> Intel 830M, 845G, 852GM, 855GM, 865G (i915 driver) --->"
+ ewarn " i915 driver"
+ ewarn " [*] Enable modesetting on intel by default"
+ echo
+ fi
+}
diff --git a/x11-drivers/xf86-video-mga/Manifest b/x11-drivers/xf86-video-mga/Manifest
new file mode 100644
index 000000000000..55c6849aeb5b
--- /dev/null
+++ b/x11-drivers/xf86-video-mga/Manifest
@@ -0,0 +1 @@
+DIST xf86-video-mga-2.1.0.tar.xz 395480 BLAKE2B 8314bf3ceb0b41bc9e863c0f640f818e0e6b86c95f57cea95311ba46bcff14ea2ea1d93961b700a7722cb90ebec82ab80b5bbf36c64cafac1940837e08f19080 SHA512 b5c83ad96004cfecd1a081440d2d0bb4a43d1ce1cd202c0ab69c0ded92cbedbc8fbe2d3e06fcb960fcac9719c56b45465b4a853f6e7d80ffb47af371403294b6
diff --git a/x11-drivers/xf86-video-mga/metadata.xml b/x11-drivers/xf86-video-mga/metadata.xml
new file mode 100644
index 000000000000..16aca1d058e1
--- /dev/null
+++ b/x11-drivers/xf86-video-mga/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>x11@gentoo.org</email>
+ <name>X11</name>
+ </maintainer>
+ <origin>baldeagleos-repo</origin>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-mga/xf86-video-mga-2.1.0.ebuild b/x11-drivers/xf86-video-mga/xf86-video-mga-2.1.0.ebuild
new file mode 100644
index 000000000000..ea1f23340507
--- /dev/null
+++ b/x11-drivers/xf86-video-mga/xf86-video-mga-2.1.0.ebuild
@@ -0,0 +1,17 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit xorg-3
+
+DESCRIPTION="Matrox video driver"
+
+KEYWORDS="~alpha amd64 ~loong ppc ppc64 ~sparc x86"
+
+src_configure() {
+ local XORG_CONFIGURE_OPTIONS=(
+ --disable-dri
+ )
+ xorg-3_src_configure
+}
diff --git a/x11-drivers/xf86-video-nouveau/Manifest b/x11-drivers/xf86-video-nouveau/Manifest
new file mode 100644
index 000000000000..79ea20872b84
--- /dev/null
+++ b/x11-drivers/xf86-video-nouveau/Manifest
@@ -0,0 +1 @@
+DIST xf86-video-nouveau-1.0.18.tar.xz 548956 BLAKE2B a68cbd07686a8c7a270a9a0c19d8d62382cc54fab6030f3d713644497430c356e251a306c52c725c5c1db75a3cfd6e53ebfc65c8781ef5f53373a8203d644739 SHA512 1330fa72f76a6fdc13e7bfa932627091d2735ddb277f6a24d4fefa79fad5f354c6bb661093f26b33770275deca435c3b018f451a6e6254fe35892c59c13e28dc
diff --git a/x11-drivers/xf86-video-nouveau/metadata.xml b/x11-drivers/xf86-video-nouveau/metadata.xml
new file mode 100644
index 000000000000..16aca1d058e1
--- /dev/null
+++ b/x11-drivers/xf86-video-nouveau/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>x11@gentoo.org</email>
+ <name>X11</name>
+ </maintainer>
+ <origin>baldeagleos-repo</origin>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-nouveau/xf86-video-nouveau-1.0.18.ebuild b/x11-drivers/xf86-video-nouveau/xf86-video-nouveau-1.0.18.ebuild
new file mode 100644
index 000000000000..9b74fd50879f
--- /dev/null
+++ b/x11-drivers/xf86-video-nouveau/xf86-video-nouveau-1.0.18.ebuild
@@ -0,0 +1,19 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+XORG_DRI="always"
+inherit xorg-3
+
+DESCRIPTION="Accelerated Open Source driver for nVidia cards"
+HOMEPAGE="
+ https://nouveau.freedesktop.org/
+ https://gitlab.freedesktop.org/xorg/driver/xf86-video-nouveau
+"
+
+KEYWORDS="amd64 ~arm64 ~loong ppc ppc64 ~riscv x86"
+
+RDEPEND=">=x11-libs/libdrm-2.4.60[video_cards_nouveau]
+ virtual/libudev:="
+DEPEND="${RDEPEND}"
diff --git a/x11-drivers/xf86-video-qxl/Manifest b/x11-drivers/xf86-video-qxl/Manifest
new file mode 100644
index 000000000000..140dd9e56019
--- /dev/null
+++ b/x11-drivers/xf86-video-qxl/Manifest
@@ -0,0 +1 @@
+DIST xf86-video-qxl-0.1.6.tar.xz 438844 BLAKE2B 2236b8678975288e5a8d28689dc58c2808bfce6bc3d1a14fffd271695b3b5a4f322addb1cf43d96dfe636ef52d654574e45a5a877299a40debd8cfd26165f22e SHA512 f6a42355915d2e8f8a842dc24fe6d012d123aa6d23eedea1a4771fb08f88e0298d76741755b88304d76c66b3aae15f9fca74d062be395e499a82ee8f4507c7e0
diff --git a/x11-drivers/xf86-video-qxl/metadata.xml b/x11-drivers/xf86-video-qxl/metadata.xml
new file mode 100644
index 000000000000..96ca122afd0e
--- /dev/null
+++ b/x11-drivers/xf86-video-qxl/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>x11@gentoo.org</email>
+ <name>X11</name>
+ </maintainer>
+ <use>
+ <flag name="xspice">Include Xspice, a standard X server that is also a Spice server</flag>
+ </use>
+ <origin>baldeagleos-repo</origin>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-qxl/xf86-video-qxl-0.1.6.ebuild b/x11-drivers/xf86-video-qxl/xf86-video-qxl-0.1.6.ebuild
new file mode 100644
index 000000000000..0827eb1f217e
--- /dev/null
+++ b/x11-drivers/xf86-video-qxl/xf86-video-qxl-0.1.6.ebuild
@@ -0,0 +1,44 @@
+# Copyright 2021-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{13..14} )
+inherit python-single-r1 xorg-3
+
+DESCRIPTION="QEMU QXL paravirt video driver"
+
+KEYWORDS="amd64 ~loong x86"
+IUSE="xspice"
+REQUIRED_USE="xspice? ( ${PYTHON_REQUIRED_USE} )"
+
+RDEPEND="
+ xspice? (
+ app-emulation/spice
+ ${PYTHON_DEPS}
+ )
+ x11-base/xorg-server[-minimal]
+ >=x11-libs/libdrm-2.4.46"
+DEPEND="
+ ${RDEPEND}
+ >=app-emulation/spice-protocol-0.12.0
+ x11-base/xorg-proto"
+BDEPEND="virtual/pkgconfig"
+
+pkg_setup() {
+ use xspice && python-single-r1_pkg_setup
+ xorg-3_pkg_setup
+}
+
+src_prepare() {
+ xorg-3_src_prepare
+
+ use xspice && python_fix_shebang scripts
+}
+
+src_configure() {
+ local XORG_CONFIGURE_OPTIONS=(
+ $(use_enable xspice)
+ )
+ xorg-3_src_configure
+}
diff --git a/x11-drivers/xf86-video-r128/Manifest b/x11-drivers/xf86-video-r128/Manifest
new file mode 100644
index 000000000000..6fbc81755a35
--- /dev/null
+++ b/x11-drivers/xf86-video-r128/Manifest
@@ -0,0 +1 @@
+DIST xf86-video-r128-6.13.0.tar.xz 437696 BLAKE2B ebac432479ceee42073ae3cb040fa51f2f130479667c499f087c80444eb3dc2d638b2860b65d1150edb38abe45ebb39d3077e57b12a9e23cf77571c0b7943f82 SHA512 6eae2a4f3a563d00c357025ffd3206c2b20cd35327af21add052a28447da9c0f642569bfb423cacb8989995bc92fc73cddd96d673e64438d1d7569eb926fb2ae
diff --git a/x11-drivers/xf86-video-r128/metadata.xml b/x11-drivers/xf86-video-r128/metadata.xml
new file mode 100644
index 000000000000..16aca1d058e1
--- /dev/null
+++ b/x11-drivers/xf86-video-r128/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>x11@gentoo.org</email>
+ <name>X11</name>
+ </maintainer>
+ <origin>baldeagleos-repo</origin>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-r128/xf86-video-r128-6.13.0.ebuild b/x11-drivers/xf86-video-r128/xf86-video-r128-6.13.0.ebuild
new file mode 100644
index 000000000000..8ed60f44b282
--- /dev/null
+++ b/x11-drivers/xf86-video-r128/xf86-video-r128-6.13.0.ebuild
@@ -0,0 +1,20 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit flag-o-matic xorg-3
+
+DESCRIPTION="ATI Rage128 video driver"
+
+KEYWORDS="~alpha amd64 ~loong ppc ppc64 ~sparc x86"
+
+src_configure() {
+ # always use C11 semantics
+ append-cflags -std=gnu11
+
+ local XORG_CONFIGURE_OPTIONS=(
+ --disable-dri
+ )
+ xorg-3_src_configure
+}
diff --git a/x11-drivers/xf86-video-siliconmotion/Manifest b/x11-drivers/xf86-video-siliconmotion/Manifest
new file mode 100644
index 000000000000..c19cfd59486d
--- /dev/null
+++ b/x11-drivers/xf86-video-siliconmotion/Manifest
@@ -0,0 +1 @@
+DIST xf86-video-siliconmotion-1.7.10.tar.xz 347056 BLAKE2B 436d2348d69976336ef83c2ee542615d65681fe0abf38887c223234a05255d194beeee0f3e0b1b8c2a0dfbf1c453e2189c39720d65eb8348dff6ddc957f23ef0 SHA512 d8bb90e636598ed20a32bdc049fe42420d9e6093429f09c3a886a7e78d3813c8533abf67c4fed084be97dd7553a1934c49aa9f94d1083dfa64ab36867ae55fca
diff --git a/x11-drivers/xf86-video-siliconmotion/metadata.xml b/x11-drivers/xf86-video-siliconmotion/metadata.xml
new file mode 100644
index 000000000000..16aca1d058e1
--- /dev/null
+++ b/x11-drivers/xf86-video-siliconmotion/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>x11@gentoo.org</email>
+ <name>X11</name>
+ </maintainer>
+ <origin>baldeagleos-repo</origin>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-siliconmotion/xf86-video-siliconmotion-1.7.10.ebuild b/x11-drivers/xf86-video-siliconmotion/xf86-video-siliconmotion-1.7.10.ebuild
new file mode 100644
index 000000000000..9c00dc2fbb73
--- /dev/null
+++ b/x11-drivers/xf86-video-siliconmotion/xf86-video-siliconmotion-1.7.10.ebuild
@@ -0,0 +1,10 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit xorg-3
+
+DESCRIPTION="Silicon Motion video driver"
+
+KEYWORDS="amd64 ~mips x86"
diff --git a/x11-drivers/xf86-video-vesa/Manifest b/x11-drivers/xf86-video-vesa/Manifest
new file mode 100644
index 000000000000..a40bd58bc66f
--- /dev/null
+++ b/x11-drivers/xf86-video-vesa/Manifest
@@ -0,0 +1 @@
+DIST xf86-video-vesa-2.6.0.tar.xz 275572 BLAKE2B 18a4aae9125c03da183aea07403c2e0809adf18c963c4acda8b55130a2a22c9fa1b0dc02dbb3ea836a4e735396a660a1e55bec6482707c019f9bfd756442d6b9 SHA512 494e117c1e6e0ce4c66ac7798de54667862c62605bfd76dd9373447d40dcd0521100810c9285cbe9c159440e217954c0cad6d5219c5894e075509c7c0bc353c7
diff --git a/x11-drivers/xf86-video-vesa/metadata.xml b/x11-drivers/xf86-video-vesa/metadata.xml
new file mode 100644
index 000000000000..16aca1d058e1
--- /dev/null
+++ b/x11-drivers/xf86-video-vesa/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>x11@gentoo.org</email>
+ <name>X11</name>
+ </maintainer>
+ <origin>baldeagleos-repo</origin>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-vesa/xf86-video-vesa-2.6.0.ebuild b/x11-drivers/xf86-video-vesa/xf86-video-vesa-2.6.0.ebuild
new file mode 100644
index 000000000000..cd26bda676d9
--- /dev/null
+++ b/x11-drivers/xf86-video-vesa/xf86-video-vesa-2.6.0.ebuild
@@ -0,0 +1,22 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit linux-info xorg-3
+
+DESCRIPTION="Generic VESA video driver"
+KEYWORDS="-* ~alpha amd64 x86"
+
+pkg_pretend() {
+ linux-info_pkg_setup
+
+ if ! linux_config_exists || ! linux_chkconfig_present DEVMEM; then
+ echo
+ ewarn "This driver requires /dev/mem support in your kernel"
+ ewarn " Device Drivers --->"
+ ewarn " Character devices --->"
+ ewarn " [*] /dev/mem virtual device support"
+ echo
+ fi
+}
diff --git a/x11-drivers/xf86-video-vmware/Manifest b/x11-drivers/xf86-video-vmware/Manifest
new file mode 100644
index 000000000000..c2c853dfe7a5
--- /dev/null
+++ b/x11-drivers/xf86-video-vmware/Manifest
@@ -0,0 +1 @@
+DIST xf86-video-vmware-13.4.0.tar.xz 416296 BLAKE2B 37dc0b0fc8c4a44f64ff640aae8ee595b0d285ac2c85f531cf91f1cd059d165cd9937249c6739a566eca628950142f566d693f8b092cecdb5886142b6abe2c94 SHA512 7cacde21a490501dd9c2e9121040274c1f6ef64e6dc0ef49946b400f6297fab73a6e9548e45fe8930cee9028e65e45aaff9ba489dd69ac75a5133114726bf55d
diff --git a/x11-drivers/xf86-video-vmware/metadata.xml b/x11-drivers/xf86-video-vmware/metadata.xml
new file mode 100644
index 000000000000..16aca1d058e1
--- /dev/null
+++ b/x11-drivers/xf86-video-vmware/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>x11@gentoo.org</email>
+ <name>X11</name>
+ </maintainer>
+ <origin>baldeagleos-repo</origin>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-vmware/xf86-video-vmware-13.4.0-r1.ebuild b/x11-drivers/xf86-video-vmware/xf86-video-vmware-13.4.0-r1.ebuild
new file mode 100644
index 000000000000..28b34d0e70df
--- /dev/null
+++ b/x11-drivers/xf86-video-vmware/xf86-video-vmware-13.4.0-r1.ebuild
@@ -0,0 +1,17 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+XORG_DRI=always
+inherit xorg-3
+
+DESCRIPTION="VMware SVGA video driver"
+KEYWORDS="amd64 ~arm64 x86"
+
+RDEPEND="
+ kernel_linux? (
+ >=x11-libs/libdrm-2.4.96[video_cards_vmware]
+ <media-libs/mesa-25.2[xa]
+ )"
+DEPEND="${RDEPEND}"