mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-27 04:59:27 -05:00
gnu: mesa-opencl-icd: Use absolute path for the library.
* gnu/packages/gl.scm (mesa-opencl-icd): Use absolute path for OpenCL platform library in "mesa.icd" file. With this patch setting LD_LIBRARY_PATH=$LIBRARY_PATH is no longer needed to run OpenCL applications. Signed-off-by: Guillaume Le Vaillant <glv@posteo.net>
This commit is contained in:
parent
78daf9e02e
commit
8cfd9ef831
1 changed files with 21 additions and 4 deletions
|
@ -14,6 +14,7 @@
|
||||||
;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
|
;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
|
||||||
;;; Copyright © 2020 Giacomo Leidi <goodoldpaul@autistici.org>
|
;;; Copyright © 2020 Giacomo Leidi <goodoldpaul@autistici.org>
|
||||||
;;; Copyright © 2020 Kei Kebreau <kkebreau@posteo.net>
|
;;; Copyright © 2020 Kei Kebreau <kkebreau@posteo.net>
|
||||||
|
;;; Copyright © 2021 Ivan Gankevich <i.gankevich@spbu.ru>
|
||||||
;;;
|
;;;
|
||||||
;;; This file is part of GNU Guix.
|
;;; This file is part of GNU Guix.
|
||||||
;;;
|
;;;
|
||||||
|
@ -475,10 +476,26 @@ (define-public mesa-opencl-icd
|
||||||
(package/inherit mesa-opencl
|
(package/inherit mesa-opencl
|
||||||
(name "mesa-opencl-icd")
|
(name "mesa-opencl-icd")
|
||||||
(arguments
|
(arguments
|
||||||
(substitute-keyword-arguments (package-arguments mesa)
|
(substitute-keyword-arguments (package-arguments mesa)
|
||||||
((#:configure-flags flags)
|
((#:configure-flags flags)
|
||||||
`(cons "-Dgallium-opencl=icd"
|
`(cons "-Dgallium-opencl=icd"
|
||||||
,(delete "-Dgallium-opencl=standalone" flags)))))))
|
,(delete "-Dgallium-opencl=standalone" flags)))
|
||||||
|
((#:phases phases)
|
||||||
|
`(modify-phases ,phases
|
||||||
|
(add-after 'install 'mesa-icd-absolute-path
|
||||||
|
(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))
|
||||||
|
(let* ((out (assoc-ref %outputs "out"))
|
||||||
|
(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))))
|
||||||
|
(if (file-exists? new-path)
|
||||||
|
(call-with-output-file mesa-icd
|
||||||
|
(lambda (port) (format port "~a\n" new-path)))))))))))))
|
||||||
|
|
||||||
(define-public mesa-headers
|
(define-public mesa-headers
|
||||||
(package/inherit mesa
|
(package/inherit mesa
|
||||||
|
|
Loading…
Reference in a new issue