gnu: alacritty: Update how we patch libraries.
* gnu/packages/terminals.scm (alacritty)[arguments]: Rewrite the 'add-absolute-library-references phase to search all of the rust sources and patch the necessary libraries.
This commit is contained in:
parent
79e9a70c94
commit
2d98244c9d
1 changed files with 21 additions and 34 deletions
|
|
@ -1435,8 +1435,6 @@ basic input/output.")
|
||||||
("rust-embed-resource" ,rust-embed-resource-1)
|
("rust-embed-resource" ,rust-embed-resource-1)
|
||||||
("rust-fnv" ,rust-fnv-1)
|
("rust-fnv" ,rust-fnv-1)
|
||||||
("rust-gl-generator" ,rust-gl-generator-0.14)
|
("rust-gl-generator" ,rust-gl-generator-0.14)
|
||||||
;; XXX: Adjust `add-absolute-library-references' phase when updating
|
|
||||||
;; glutin input.
|
|
||||||
("rust-glutin" ,rust-glutin-0.30)
|
("rust-glutin" ,rust-glutin-0.30)
|
||||||
("rust-libc" ,rust-libc-0.2)
|
("rust-libc" ,rust-libc-0.2)
|
||||||
("rust-log" ,rust-log-0.4)
|
("rust-log" ,rust-log-0.4)
|
||||||
|
|
@ -1464,39 +1462,28 @@ basic input/output.")
|
||||||
(substitute* "alacritty/src/config/ui_config.rs"
|
(substitute* "alacritty/src/config/ui_config.rs"
|
||||||
(("xdg-open") (search-input-file inputs "/bin/xdg-open")))))
|
(("xdg-open") (search-input-file inputs "/bin/xdg-open")))))
|
||||||
(add-after 'configure 'add-absolute-library-references
|
(add-after 'configure 'add-absolute-library-references
|
||||||
(lambda* (#:key inputs cargo-inputs vendor-dir #:allow-other-keys)
|
(lambda* (#:key inputs vendor-dir #:allow-other-keys)
|
||||||
(let* ((glutin-name ,(package-name rust-glutin-0.30))
|
;; Fix dlopen()ing some libraries on pure Wayland (no $DISPLAY):
|
||||||
(glutin-version ,(package-version rust-glutin-0.30))
|
;; Failed to initialize any backend! Wayland status: NoWaylandLib
|
||||||
(glutin-api (string-append glutin-name "-" glutin-version
|
;; XXX We patch transitive dependencies that aren't even direct
|
||||||
".tar.gz/src/api/"))
|
;; inputs to this package, because of the way Guix's Rust build
|
||||||
(smithay-client-toolkit-name
|
;; system currently works. <http://issues.guix.gnu.org/46399>
|
||||||
,(package-name rust-smithay-client-toolkit-0.16))
|
;; might fix this and allow patching them directly.
|
||||||
(smithay-client-toolkit-version
|
(substitute* (find-files vendor-dir "\\.rs$")
|
||||||
,(package-version rust-smithay-client-toolkit-0.16))
|
(("libEGL\\.so")
|
||||||
(smithay-client-toolkit-src
|
(search-input-file inputs "lib/libEGL.so"))
|
||||||
(string-append smithay-client-toolkit-name "-"
|
(("libGL\\.so")
|
||||||
smithay-client-toolkit-version ".tar.gz/src"))
|
(search-input-file inputs "lib/libGL.so"))
|
||||||
(libxkbcommon (assoc-ref inputs "libxkbcommon"))
|
;; Lots of libraries from rust-x11-dl.
|
||||||
(mesa (assoc-ref inputs "mesa")))
|
;; XXX: Not all X11 libraries are inside the build enclosure.
|
||||||
;; Fix dlopen()ing some libraries on pure Wayland (no $DISPLAY):
|
;(("libX.*\\.so" all)
|
||||||
;; Failed to initialize any backend! Wayland status: NoWaylandLib
|
; (search-input-file inputs (string-append "lib/" all)))
|
||||||
;; XXX We patch transitive dependencies that aren't even direct
|
|
||||||
;; inputs to this package, because of the way Guix's Rust build
|
|
||||||
;; system currently works. <http://issues.guix.gnu.org/46399>
|
|
||||||
;; might fix this and allow patching them directly.
|
|
||||||
(substitute* (string-append vendor-dir "/"
|
|
||||||
smithay-client-toolkit-src
|
|
||||||
"/seat/keyboard/ffi.rs")
|
|
||||||
(("libxkbcommon\\.so")
|
|
||||||
(string-append libxkbcommon "/lib/libxkbcommon.so")))
|
|
||||||
|
|
||||||
;; Mesa is needed everywhere.
|
;; There are several libwayland libraries.
|
||||||
(substitute*
|
(("libwayland-.*\\.so" all)
|
||||||
(string-append vendor-dir "/" glutin-api "glx/mod.rs")
|
(search-input-file inputs (string-append "lib/" all)))
|
||||||
(("libGL.so") (string-append mesa "/lib/libGL.so")))
|
(("libxkbcommon\\.so")
|
||||||
(substitute*
|
(search-input-file inputs "lib/libxkbcommon.so")))))
|
||||||
(string-append vendor-dir "/" glutin-api "egl/mod.rs")
|
|
||||||
(("libEGL.so") (string-append mesa "/lib/libEGL.so"))))))
|
|
||||||
(replace 'install
|
(replace 'install
|
||||||
;; Upstream install script only takes care of executable.
|
;; Upstream install script only takes care of executable.
|
||||||
(lambda* (#:key inputs outputs #:allow-other-keys)
|
(lambda* (#:key inputs outputs #:allow-other-keys)
|
||||||
|
|
|
||||||
Reference in a new issue