nongnu: nvidia: update driver to 495+
This commit is contained in:
parent
35533c763a
commit
bb64f4c6ce
|
@ -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)
|
||||||
|
@ -75,7 +76,7 @@
|
||||||
(chdir ,(format #f "NVIDIA-Linux-x86_64-~a" version))
|
(chdir ,(format #f "NVIDIA-Linux-x86_64-~a" version))
|
||||||
#t)))
|
#t)))
|
||||||
(replace 'build
|
(replace 'build
|
||||||
(lambda* (#:key inputs outputs #:allow-other-keys)
|
(lambda* (#:key inputs outputs #:allow-other-keys)
|
||||||
;; We cannot use with-directory-excursion, because the install
|
;; We cannot use with-directory-excursion, because the install
|
||||||
;; phase needs to be in the kernel folder. Otherwise no .ko
|
;; phase needs to be in the kernel folder. Otherwise no .ko
|
||||||
;; would be installed.
|
;; would be installed.
|
||||||
|
@ -127,7 +128,7 @@
|
||||||
(rules (string-append out "/lib/udev/rules.d/90-nvidia.rules"))
|
(rules (string-append out "/lib/udev/rules.d/90-nvidia.rules"))
|
||||||
(sh (string-append (assoc-ref inputs "bash-minimal") "/bin/sh"))
|
(sh (string-append (assoc-ref inputs "bash-minimal") "/bin/sh"))
|
||||||
(mknod (string-append (assoc-ref inputs "coreutils") "/bin/mknod"))
|
(mknod (string-append (assoc-ref inputs "coreutils") "/bin/mknod"))
|
||||||
(cut (string-append (assoc-ref inputs "coreutils") "/bin/cut"))
|
(cut (string-append (assoc-ref inputs "coreutils") "/bin/cut"))
|
||||||
(grep (string-append (assoc-ref inputs "grep") "/bin/grep")))
|
(grep (string-append (assoc-ref inputs "grep") "/bin/grep")))
|
||||||
(mkdir-p rulesdir)
|
(mkdir-p rulesdir)
|
||||||
(call-with-output-file rules
|
(call-with-output-file rules
|
||||||
|
@ -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)
|
||||||
|
@ -298,7 +303,7 @@ Further xorg should be configured by adding:
|
||||||
(delete 'build)
|
(delete 'build)
|
||||||
(delete 'check)
|
(delete 'check)
|
||||||
(add-after 'install 'patch-symlink
|
(add-after 'install 'patch-symlink
|
||||||
(lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
|
(lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
|
||||||
(use-modules (ice-9 ftw)
|
(use-modules (ice-9 ftw)
|
||||||
(ice-9 regex)
|
(ice-9 regex)
|
||||||
(ice-9 textual-ports))
|
(ice-9 textual-ports))
|
||||||
|
@ -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
|
||||||
|
@ -365,9 +371,9 @@ Further xorg should be configured by adding:
|
||||||
(format #t "Linking ~a to ~a ...~%" mid file)
|
(format #t "Linking ~a to ~a ...~%" mid file)
|
||||||
(symlink (basename file) mid-file))))
|
(symlink (basename file) mid-file))))
|
||||||
(find-files libdir "\\.so\\."))
|
(find-files libdir "\\.so\\."))
|
||||||
#t))))
|
#t))))
|
||||||
#:install-plan
|
#:install-plan
|
||||||
,@(match (%current-system)
|
,@(match (%current-system)
|
||||||
("x86_64-linux" '(`(("." "lib" #:include-regexp ("^./[^/]+\\.so")))))
|
("x86_64-linux" '(`(("." "lib" #:include-regexp ("^./[^/]+\\.so")))))
|
||||||
("i686-linux" '(`(("32" "lib" #:include-regexp ("^./[^/]+\\.so")))))
|
("i686-linux" '(`(("32" "lib" #:include-regexp ("^./[^/]+\\.so")))))
|
||||||
(_ '()))))
|
(_ '()))))
|
||||||
|
@ -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
|
||||||
(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 (assoc-ref %build-inputs "mesa") (assoc-ref %build-inputs "nvidia-libs"))
|
(union-build (assoc-ref %outputs "out")
|
||||||
#:resolve-collision (lambda (files) (let ((file
|
(list (assoc-ref %build-inputs "mesa")
|
||||||
(if (string-match "nvidia-libs" (first files))
|
(assoc-ref %build-inputs "nvidia-libs"))
|
||||||
(first files)
|
#:resolve-collision
|
||||||
(last files))))
|
(lambda (files)
|
||||||
(format #t "chosen ~a ~%" file)
|
(let ((file
|
||||||
file)))
|
(if (string-match "nvidia-libs" (first files))
|
||||||
#t)))
|
(first files)
|
||||||
|
(last files))))
|
||||||
|
(format #t "library collision: chosen ~a ~%" file)
|
||||||
|
file)))
|
||||||
|
#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)))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user