aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2023-05-15 13:00:53 +0300
committerEfraim Flashner <efraim@flashner.co.il>2023-05-15 13:06:07 +0300
commit2d98244c9da7ce23f6c342239c9ff904f664a088 (patch)
tree289a120d1b0b506d1beb0eda775fdfa051ddfb43
parent79e9a70c94728272386c7e023a93aa33ebd27d34 (diff)
downloadguix-2d98244c9da7ce23f6c342239c9ff904f664a088.tar.gz
guix-2d98244c9da7ce23f6c342239c9ff904f664a088.zip
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.
-rw-r--r--gnu/packages/terminals.scm55
1 files changed, 21 insertions, 34 deletions
diff --git a/gnu/packages/terminals.scm b/gnu/packages/terminals.scm
index 570de2259e..f76351b17f 100644
--- a/gnu/packages/terminals.scm
+++ b/gnu/packages/terminals.scm
@@ -1435,8 +1435,6 @@ basic input/output.")
("rust-embed-resource" ,rust-embed-resource-1)
("rust-fnv" ,rust-fnv-1)
("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-libc" ,rust-libc-0.2)
("rust-log" ,rust-log-0.4)
@@ -1464,39 +1462,28 @@ basic input/output.")
(substitute* "alacritty/src/config/ui_config.rs"
(("xdg-open") (search-input-file inputs "/bin/xdg-open")))))
(add-after 'configure 'add-absolute-library-references
- (lambda* (#:key inputs cargo-inputs vendor-dir #:allow-other-keys)
- (let* ((glutin-name ,(package-name rust-glutin-0.30))
- (glutin-version ,(package-version rust-glutin-0.30))
- (glutin-api (string-append glutin-name "-" glutin-version
- ".tar.gz/src/api/"))
- (smithay-client-toolkit-name
- ,(package-name rust-smithay-client-toolkit-0.16))
- (smithay-client-toolkit-version
- ,(package-version rust-smithay-client-toolkit-0.16))
- (smithay-client-toolkit-src
- (string-append smithay-client-toolkit-name "-"
- smithay-client-toolkit-version ".tar.gz/src"))
- (libxkbcommon (assoc-ref inputs "libxkbcommon"))
- (mesa (assoc-ref inputs "mesa")))
- ;; Fix dlopen()ing some libraries on pure Wayland (no $DISPLAY):
- ;; Failed to initialize any backend! Wayland status: NoWaylandLib
- ;; 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")))
+ (lambda* (#:key inputs vendor-dir #:allow-other-keys)
+ ;; Fix dlopen()ing some libraries on pure Wayland (no $DISPLAY):
+ ;; Failed to initialize any backend! Wayland status: NoWaylandLib
+ ;; 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* (find-files vendor-dir "\\.rs$")
+ (("libEGL\\.so")
+ (search-input-file inputs "lib/libEGL.so"))
+ (("libGL\\.so")
+ (search-input-file inputs "lib/libGL.so"))
+ ;; Lots of libraries from rust-x11-dl.
+ ;; XXX: Not all X11 libraries are inside the build enclosure.
+ ;(("libX.*\\.so" all)
+ ; (search-input-file inputs (string-append "lib/" all)))
- ;; Mesa is needed everywhere.
- (substitute*
- (string-append vendor-dir "/" glutin-api "glx/mod.rs")
- (("libGL.so") (string-append mesa "/lib/libGL.so")))
- (substitute*
- (string-append vendor-dir "/" glutin-api "egl/mod.rs")
- (("libEGL.so") (string-append mesa "/lib/libEGL.so"))))))
+ ;; There are several libwayland libraries.
+ (("libwayland-.*\\.so" all)
+ (search-input-file inputs (string-append "lib/" all)))
+ (("libxkbcommon\\.so")
+ (search-input-file inputs "lib/libxkbcommon.so")))))
(replace 'install
;; Upstream install script only takes care of executable.
(lambda* (#:key inputs outputs #:allow-other-keys)