nongnu: nvidia-driver: Install GBM and VDPAU library to correct path.

* nongnu/packages/nvidia.scm (nvidia-driver)[arguments]<#:phases>: Install GBM
and VDPAU library to correct path.

Signed-off-by: John Kehayias <john.kehayias@protonmail.com>
This commit is contained in:
Hilton Chain 2024-01-24 22:41:57 +08:00 committed by John Kehayias
parent 732cce2c90
commit 0ae85eb25e
No known key found for this signature in database
GPG key ID: 499097AE5EA815D9

View file

@ -320,13 +320,27 @@ ACTION==\"unbind\", SUBSYSTEM==\"pci\", ATTR{vendor}==\"0x10de\", ATTR{class}==\
'("nvidia-smi"))))) '("nvidia-smi")))))
(add-before 'patch-elf 'relocate-libraries (add-before 'patch-elf 'relocate-libraries
(lambda _ (lambda _
(let* ((libdir (string-append #$output "/lib")) (let* ((version #$(package-version this-package))
(libdir (string-append #$output "/lib"))
(gbmdir (string-append libdir "/gbm"))
(vdpaudir (string-append libdir "/vdpau"))
(xorgmoddir (string-append libdir "/xorg/modules")) (xorgmoddir (string-append libdir "/xorg/modules"))
(xorgdrvdir (string-append xorgmoddir "/drivers")) (xorgdrvdir (string-append xorgmoddir "/drivers"))
(xorgextdir (string-append xorgmoddir "/extensions")) (xorgextdir (string-append xorgmoddir "/extensions"))
(move-to-dir (lambda (file dir) (move-to-dir (lambda (file dir)
(install-file file dir) (install-file file dir)
(delete-file file)))) (delete-file file))))
(for-each
(lambda (file)
(mkdir-p gbmdir)
(with-directory-excursion gbmdir
(symlink file "nvidia-drm_gbm.so")))
(find-files libdir "libnvidia-allocator\\.so\\."))
(for-each
(cut move-to-dir <> vdpaudir)
(find-files libdir "libvdpau_nvidia\\.so\\."))
(for-each (for-each
(cut move-to-dir <> xorgdrvdir) (cut move-to-dir <> xorgdrvdir)
(find-files libdir "nvidia_drv\\.so$")) (find-files libdir "nvidia_drv\\.so$"))