[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
390/436: gnu: rust: Allow using custom rust-src for rust-analyzer.
From: |
guix-commits |
Subject: |
390/436: gnu: rust: Allow using custom rust-src for rust-analyzer. |
Date: |
Sun, 5 Nov 2023 05:29:59 -0500 (EST) |
efraim pushed a commit to branch rust-team
in repository guix.
commit 9c227b7c67e43b74d5facdf23602ddf6dd18d448
Author: Efraim Flashner <efraim@flashner.co.il>
AuthorDate: Sun Nov 5 08:55:31 2023 +0200
gnu: rust: Allow using custom rust-src for rust-analyzer.
* gnu/packages/rust.scm (rust)[arguments]: Rewrite 'wrap-rust-analyzer
phase to allow using a custom RUST_SRC_PATH.
Change-Id: Id811bc8d09c0f955ece9c9e6267a0ae96e61f105
---
gnu/packages/rust.scm | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
index 87bd578e9e..e11148e89e 100644
--- a/gnu/packages/rust.scm
+++ b/gnu/packages/rust.scm
@@ -1030,11 +1030,19 @@ safety and thread safety guarantees.")
(copy-recursively "src" (string-append out dest "/src")))))
(add-after 'install-rust-src 'wrap-rust-analyzer
(lambda* (#:key outputs #:allow-other-keys)
- (wrap-program (string-append (assoc-ref outputs "tools")
- "/bin/rust-analyzer")
- `("RUST_SRC_PATH" ":" =
- (,(string-append (assoc-ref outputs "rust-src")
- "/lib/rustlib/src/rust/library"))))))))))
+ (let ((bin (string-append (assoc-ref outputs "tools")
"/bin")))
+ (rename-file (string-append bin "/rust-analyzer")
+ (string-append bin "/.rust-analyzer-real"))
+ (call-with-output-file (string-append bin "/rust-analyzer")
+ (lambda (port)
+ (format port "#!~a
+if test -z \"${RUST_SRC_PATH}\";then export RUST_SRC_PATH=~S;fi;
+exec -a \"$0\" \"~a\" \"$@\""
+ (which "bash")
+ (string-append (assoc-ref outputs "rust-src")
+ "/lib/rustlib/src/rust/library")
+ (string-append bin "/.rust-analyzer-real"))))
+ (chmod (string-append bin "/rust-analyzer") #o755))))))))
;; Add test inputs.
(native-inputs (cons* `("gdb" ,gdb/pinned)
`("procps" ,procps)
- 361/436: gnu: rust-memchr-1: Fix inputs., (continued)
- 361/436: gnu: rust-memchr-1: Fix inputs., guix-commits, 2023/11/05
- 367/436: gnu: rust-propfuzz-macro-0.0.1: Skip tests., guix-commits, 2023/11/05
- 376/436: gnu: rust-tokio-rustls-0.14: Skip tests., guix-commits, 2023/11/05
- 369/436: gnu: rust-ron-0.5: Fix tests., guix-commits, 2023/11/05
- 366/436: gnu: rust-polyval-0.4: Update to 0.4.5., guix-commits, 2023/11/05
- 374/436: gnu: rust-tendril-0.4: Fix tests., guix-commits, 2023/11/05
- 384/436: gnu: rust-ufmt-0.1: Update to 0.1.2., guix-commits, 2023/11/05
- 381/436: gnu: rust-speedy-derive-0.8: Update to 0.8.6., guix-commits, 2023/11/05
- 380/436: gnu: rust-mimalloc-0.1: Add missing input., guix-commits, 2023/11/05
- 392/436: gnu: Add rust-indextree-4., guix-commits, 2023/11/05
- 390/436: gnu: rust: Allow using custom rust-src for rust-analyzer.,
guix-commits <=
- 396/436: gnu: Add rust-wee-alloc-0.4., guix-commits, 2023/11/05
- 397/436: gnu: Add rust-slugify-0.1., guix-commits, 2023/11/05
- 403/436: gnu: Add rust-serial-test-0.7., guix-commits, 2023/11/05
- 412/436: gnu: Add rust-partition-identity-0.3., guix-commits, 2023/11/05
- 414/436: gnu: rust-phf-shared-0.11: Update to 0.11.2., guix-commits, 2023/11/05
- 415/436: gnu: rust-phf-macros-0.11: Update to 0.11.2., guix-commits, 2023/11/05
- 416/436: gnu: rust-phf-0.11: Update to 0.11.2., guix-commits, 2023/11/05
- 428/436: gnu: rust-dbus-0.9: Update to 0.9.7., guix-commits, 2023/11/05
- 421/436: gnu: Add rust-git2-0.18., guix-commits, 2023/11/05
- 431/436: gnu: Add rust-syslog-6., guix-commits, 2023/11/05