nongnu: nvidia: update driver to 495+

This commit is contained in:
Samuel Culpepper 2022-02-09 18:26:32 +01:00
parent 35533c763a
commit bb64f4c6ce
No known key found for this signature in database
GPG Key ID: EE20E25391AAB9BB

View File

@ -21,6 +21,7 @@
;;; along with this program. If not, see <https://www.gnu.org/licenses/>. ;;; along with this program. If not, see <https://www.gnu.org/licenses/>.
(define-module (nongnu packages nvidia) (define-module (nongnu packages nvidia)
#:use-module (gnu packages xdisorg)
#:use-module (guix packages) #:use-module (guix packages)
#:use-module (guix download) #:use-module (guix download)
#:use-module (guix utils) #:use-module (guix utils)
@ -54,13 +55,13 @@
(define-public nvidia-driver (define-public nvidia-driver
(package (package
(name "nvidia-driver") (name "nvidia-driver")
(version "470.86") (version "495.46")
(source (source
(origin (origin
(uri (format #f "http://us.download.nvidia.com/XFree86/Linux-x86_64/~a/~a.run" (uri (format #f "http://us.download.nvidia.com/XFree86/Linux-x86_64/~a/~a.run"
version version
(format #f "NVIDIA-Linux-x86_64-~a" version))) (format #f "NVIDIA-Linux-x86_64-~a" version)))
(sha256 (base32 "0krwcxc0j19vjnk8sv6mx1lin2rm8hcfhc2hg266846jvcws1dsg")) (sha256 (base32 "1xb23kimlfsailpwy7kv4l217id5jpmdc4svm9kldid0gp8pffyq"))
(method url-fetch) (method url-fetch)
(file-name (string-append "nvidia-driver-" version "-checkout")))) (file-name (string-append "nvidia-driver-" version "-checkout"))))
(build-system linux-module-build-system) (build-system linux-module-build-system)
@ -196,6 +197,8 @@
(string-append (assoc-ref inputs "cairo") "/lib") (string-append (assoc-ref inputs "cairo") "/lib")
(string-append (assoc-ref inputs "gdk-pixbuf") "/lib") (string-append (assoc-ref inputs "gdk-pixbuf") "/lib")
(string-append (assoc-ref inputs "wayland") "/lib") (string-append (assoc-ref inputs "wayland") "/lib")
(string-append (assoc-ref inputs "libdrm") "/lib") ; libdrm.so
(string-append (assoc-ref inputs "mesa") "/lib") ; libgbm.so
(string-append (assoc-ref inputs "gcc:lib") "/lib")) (string-append (assoc-ref inputs "gcc:lib") "/lib"))
":"))) ":")))
(define (patch-elf file) (define (patch-elf file)
@ -258,6 +261,8 @@
("gtk2" ,gtk+-2) ("gtk2" ,gtk+-2)
("kmod" ,kmod) ("kmod" ,kmod)
("libc" ,glibc) ("libc" ,glibc)
("libdrm" ,libdrm)
("mesa" ,mesa)
("libx11" ,libx11) ("libx11" ,libx11)
("libxext" ,libxext) ("libxext" ,libxext)
("linux" ,linux-lts) ("linux" ,linux-lts)
@ -276,13 +281,13 @@ Further xorg should be configured by adding:
(define-public nvidia-libs (define-public nvidia-libs
(package (package
(name "nvidia-libs") (name "nvidia-libs")
(version "470.86") (version "495.46")
(source (source
(origin (origin
(uri (format #f "http://us.download.nvidia.com/XFree86/Linux-x86_64/~a/~a.run" (uri (format #f "http://us.download.nvidia.com/XFree86/Linux-x86_64/~a/~a.run"
version version
(format #f "NVIDIA-Linux-x86_64-~a" version))) (format #f "NVIDIA-Linux-x86_64-~a" version)))
(sha256 (base32 "0krwcxc0j19vjnk8sv6mx1lin2rm8hcfhc2hg266846jvcws1dsg")) (sha256 (base32 "1xb23kimlfsailpwy7kv4l217id5jpmdc4svm9kldid0gp8pffyq"))
(method url-fetch) (method url-fetch)
(file-name (string-append "nvidia-driver-" version "-checkout")))) (file-name (string-append "nvidia-driver-" version "-checkout"))))
(build-system copy-build-system) (build-system copy-build-system)
@ -326,6 +331,8 @@ Further xorg should be configured by adding:
(string-append (assoc-ref inputs "libx11") "/lib") (string-append (assoc-ref inputs "libx11") "/lib")
(string-append (assoc-ref inputs "libxext") "/lib") (string-append (assoc-ref inputs "libxext") "/lib")
(string-append (assoc-ref inputs "pango") "/lib") (string-append (assoc-ref inputs "pango") "/lib")
(string-append (assoc-ref inputs "libdrm") "/lib") ; libdrm.so
(string-append (assoc-ref inputs "mesa") "/lib") ; libgbm.so
(string-append (assoc-ref inputs "wayland") "/lib")) (string-append (assoc-ref inputs "wayland") "/lib"))
":"))) ":")))
(define (patch-elf file) (define (patch-elf file)
@ -343,7 +350,6 @@ Further xorg should be configured by adding:
(for-each (lambda (file) (for-each (lambda (file)
(let* ((short (regexp-substitute (let* ((short (regexp-substitute
#f #f
(string-match "([^/]*\\.so).*" file) (string-match "([^/]*\\.so).*" file)
1)) 1))
(major (cond (major (cond
@ -388,14 +394,15 @@ Further xorg should be configured by adding:
("gtk2" ,gtk+-2) ("gtk2" ,gtk+-2)
("libc" ,glibc) ("libc" ,glibc)
("libx11" ,libx11) ("libx11" ,libx11)
("libdrm" ,libdrm)
("mesa" ,mesa)
("libxext" ,libxext) ("libxext" ,libxext)
("wayland" ,wayland))) ("wayland" ,wayland)))
(home-page "https://www.nvidia.com") (home-page "https://www.nvidia.com")
(synopsis "Libraries of the proprietary Nvidia driver") (synopsis "Libraries of the proprietary Nvidia driver")
(description "These are the libraries of the evil Nvidia driver compatible (description "These are the libraries of the evil Nvidia driver compatible with the ones
with the ones usually provided by Mesa. To use these libraries with usually provided by Mesa. To use these libraries with packages that have been
packages that have been compiled with a mesa output, take a look at the nvda compiled with a mesa output, take a look at the nvda package.")
package.")
(license (license:nonfree (format #f "file:///share/doc/nvidia-driver-~a/LICENSE" version))))) (license (license:nonfree (format #f "file:///share/doc/nvidia-driver-~a/LICENSE" version)))))
;; nvda is used as a name because it has the same length as mesa which is ;; nvda is used as a name because it has the same length as mesa which is
@ -408,22 +415,27 @@ package.")
(build-system trivial-build-system) (build-system trivial-build-system)
(arguments (arguments
'(#:modules ((guix build union)) '(#:modules ((guix build union))
#:builder (begin #:builder
(begin
(use-modules (guix build union) (use-modules (guix build union)
(srfi srfi-1) (srfi srfi-1)
(ice-9 regex)) (ice-9 regex))
(union-build (assoc-ref %outputs "out") (union-build (assoc-ref %outputs "out")
(list (assoc-ref %build-inputs "mesa") (assoc-ref %build-inputs "nvidia-libs")) (list (assoc-ref %build-inputs "mesa")
#:resolve-collision (lambda (files) (let ((file (assoc-ref %build-inputs "nvidia-libs"))
#:resolve-collision
(lambda (files)
(let ((file
(if (string-match "nvidia-libs" (first files)) (if (string-match "nvidia-libs" (first files))
(first files) (first files)
(last files)))) (last files))))
(format #t "chosen ~a ~%" file) (format #t "library collision: chosen ~a ~%" file)
file))) file)))
#t))) #t)))
(description "These are the libraries of the evil Nvidia driver, (description "These are the libraries of the evil Nvidia driver,
packaged in such a way that you can use the transformation option 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.") @code{--with-graft=mesa=nvda} to use the nvidia driver with a package that
requires mesa.")
(inputs (inputs
`(("nvidia-libs" ,nvidia-libs) `(("nvidia-libs" ,nvidia-libs)
("mesa" ,mesa))) ("mesa" ,mesa)))