nongnu: nvda: Avoid hardcoding inputs.

* nongnu/packages/nvidia.scm (nvda)[arguments]: Avoid hardcoding inputs and
locate them via relative paths instead.
[description]: Adjust style.

Signed-off-by: Jonathan Brielmaier <jonathan.brielmaier@web.de>
This commit is contained in:
Hilton Chain 2022-10-21 12:50:49 +08:00 committed by Jonathan Brielmaier
parent 6874c66ddc
commit fb5a3d0e97
No known key found for this signature in database
GPG key ID: ECFC83988B4E4B9F

View file

@ -630,24 +630,27 @@ configuration, creating application profiles, gpu monitoring and more.")
(build-system trivial-build-system) (build-system trivial-build-system)
(arguments (arguments
(list #:modules '((guix build union)) (list #:modules '((guix build union))
#:builder #~(begin #:builder
(use-modules (guix build union) #~(begin
(srfi srfi-1) (use-modules (guix build union)
(ice-9 regex)) (srfi srfi-1)
(union-build (assoc-ref %outputs "out") (ice-9 regex))
(list #$mesa #$nvidia-libs) (union-build #$output
#:resolve-collision (lambda (files) (let ((file (list #$(this-package-input "mesa")
(if (string-match "nvidia-libs" (first files)) #$(this-package-input "nvidia-libs"))
(first files) #:resolve-collision
(last files)))) (lambda (files)
(format #t "chosen ~a ~%" file) (let ((file (if (string-match "nvidia-libs"
file)))))) (first files))
(description "These are the libraries of the evil Nvidia driver, (first files)
packaged in such a way that you can use the transformation option (last files))))
@code{--with-graft=mesa=nvda} to use the nvidia driver with a package that requires mesa.") (format #t "chosen ~a ~%" file)
(inputs file))))))
(list mesa (description
nvidia-libs)) "These are the libraries of the evil NVIDIA driver, packaged in such a
way that you can use the transformation option @code{--with-graft=mesa=nvda}
to use the NVIDIA driver with a package that requires mesa.")
(inputs (list mesa nvidia-libs))
(outputs '("out")))) (outputs '("out"))))
(define mesa/fake (define mesa/fake