nongnu: nvidia-driver: Split post-install phase.

* nongnu/packages/nvidia.scm (nvidia-driver)[arguments]<#:phases>: Split
post-install phase into patch-elf and create-short-name-symlinks phases.

Signed-off-by: Jonathan Brielmaier <jonathan.brielmaier@web.de>
This commit is contained in:
Hilton Chain 2022-11-21 13:23:22 +08:00 committed by Jonathan Brielmaier
parent 3c0e54efbf
commit 09b37c490e
No known key found for this signature in database
GPG key ID: ECFC83988B4E4B9F

View file

@ -171,10 +171,8 @@ KERNEL==\"nvidia_uvm\", RUN+=\"@sh@ -c '@mknod@ -m 666 /dev/nvidia-uvm-tools c $
(substitute* rules (substitute* rules
(("@\\<(sh|grep|mknod|cut)\\>@" all cmd) (("@\\<(sh|grep|mknod|cut)\\>@" all cmd)
(search-input-file inputs (string-append "/bin/" cmd))))))) (search-input-file inputs (string-append "/bin/" cmd)))))))
(add-after 'install 'post-install (add-after 'install 'patch-elf
(lambda _ (lambda _
;; ------------------------------
;; patchelf
(let* ((ld.so (string-append #$(this-package-input "glibc") (let* ((ld.so (string-append #$(this-package-input "glibc")
#$(glibc-dynamic-linker))) #$(glibc-dynamic-linker)))
(rpath (string-join (rpath (string-join
@ -203,10 +201,9 @@ KERNEL==\"nvidia_uvm\", RUN+=\"@sh@ -c '@mknod@ -m 666 /dev/nvidia-uvm-tools c $
(when (elf-file? file) (when (elf-file? file)
(patch-elf file))) (patch-elf file)))
(append (find-files #$output ".*\\.so") (append (find-files #$output ".*\\.so")
(find-files (string-append #$output "/bin"))))) (find-files (string-append #$output "/bin")))))))
(add-after 'patch-elf 'create-short-name-symlinks
;; ------------------------------ (lambda _
;; Create short name symbolic links
(define (get-soname file) (define (get-soname file)
(when elf-file? file (when elf-file? file
(let* ((cmd (string-append "patchelf --print-soname " file)) (let* ((cmd (string-append "patchelf --print-soname " file))