gnu: mesa-opencl-icd: Deprecate in favor of mesa-opencl.

The previously used Clover backend has been removed.

* gnu/packages/gl.scm (mesa-opencl-icd): Define as deprecated, using as
replacement...
(mesa-opencl): ... this, absorbing its icd file adjusting phase.
[#:modules]: New field.
[#:phases] {use-absolute-file-name-in-rusticl}: New phase.

Change-Id: If7ff766557dd37928e70d8e3ae03d7f1f467ab8a
This commit is contained in:
Maxim Cournoyer 2025-10-01 08:07:19 +09:00
parent e2f6d4f961
commit b733de0dce
No known key found for this signature in database
GPG key ID: 1260E46482E63562

View file

@ -655,37 +655,36 @@ from software emulation to complete hardware acceleration for modern GPUs.")
(inherit (package-source mesa))))
(arguments
(substitute-keyword-arguments (package-arguments mesa)
((#:modules modules)
(cons '(ice-9 textual-ports) modules))
((#:configure-flags flags)
#~(cons* "-Dgallium-rusticl=true"
;; Enable all drivers by default.
(string-append "-Dgallium-rusticl-enable-drivers="
"iris,llvmpipe,nouveau,panfrost,radeonsi,r600")
#$flags))))))
(define-public mesa-opencl-icd
(package/inherit mesa-opencl
(name "mesa-opencl-icd")
(arguments
(substitute-keyword-arguments (package-arguments mesa)
((#:configure-flags flags)
#~(cons "-Dgallium-opencl=icd"
(delete "-Dgallium-opencl=standalone" #$flags)))
((#:phases phases)
#~(modify-phases #$phases
(add-after 'install 'mesa-icd-absolute-path
#$flags))
((#:phases phases)
#~(modify-phases #$phases
(add-after 'install 'use-absolute-file-name-in-rusticl.icd
(lambda _
;; Use absolute path for OpenCL platform library.
;; Otherwise we would have to set LD_LIBRARY_PATH=LIBRARY_PATH
;; for ICD in our applications to find OpenCL platform.
(use-modules (guix build utils)
(ice-9 textual-ports))
;; Use absolute path for OpenCL platform library. Otherwise
;; we would have to set LD_LIBRARY_PATH=LIBRARY_PATH for
;; Rusticl in our applications to find the OpenCL platform.
(let* ((out #$output)
(mesa-icd (string-append out "/etc/OpenCL/vendors/mesa.icd"))
(old-path (call-with-input-file mesa-icd get-string-all))
(new-path (string-append out "/lib/" (string-trim-both old-path))))
(rusticl.icd (string-append
out "/etc/OpenCL/vendors/rusticl.icd"))
(old-path (call-with-input-file rusticl.icd
get-string-all))
(new-path (string-append out "/lib/"
(string-trim-both old-path))))
(if (file-exists? new-path)
(call-with-output-file mesa-icd
(lambda (port) (format port "~a\n" new-path)))))))))))))
(call-with-output-file rusticl.icd
(lambda (port) (format port "~a\n" new-path)))))))))))))
;;; ICD was part of the Gallium (Clover) OpenCL driver, which was replaced
;;; with Rusticl.
(define-public mesa-opencl-icd
(deprecated-package "mesa-opencl-icd" mesa-opencl))
(define-public mesa-headers
(package/inherit mesa