[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
76/194: gnu: rust: Wrap rust-analyzer with rust source.
From: |
guix-commits |
Subject: |
76/194: gnu: rust: Wrap rust-analyzer with rust source. |
Date: |
Tue, 3 Oct 2023 14:57:30 -0400 (EDT) |
efraim pushed a commit to branch rust-team
in repository guix.
commit 0f47a0ad5cb5d8d231044247abe67d43d6086cf0
Author: Efraim Flashner <efraim@flashner.co.il>
AuthorDate: Sun Oct 1 19:48:59 2023 +0300
gnu: rust: Wrap rust-analyzer with rust source.
* gnu/packages/rust.scm (rust)[outputs]: Add rust-src output.
[arguments]: Add a phase to install the rust sources and a phase to wrap
the rust-analyzer binary with the path to the rust sources.
---
gnu/packages/rust.scm | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
index 34511f283e..0dc60c8991 100644
--- a/gnu/packages/rust.scm
+++ b/gnu/packages/rust.scm
@@ -760,7 +760,7 @@ safety and thread safety guarantees.")
(let ((base-rust rust-1.70))
(package
(inherit base-rust)
- (outputs (cons "tools" (package-outputs base-rust)))
+ (outputs (cons* "rust-src" "tools" (package-outputs base-rust)))
(arguments
(substitute-keyword-arguments (package-arguments base-rust)
((#:tests? _ #f)
@@ -919,7 +919,21 @@ safety and thread safety guarantees.")
(format #f "prefix = ~s" (assoc-ref outputs "tools"))))
(invoke "./x.py" "install" "clippy")
(invoke "./x.py" "install" "rust-analyzer")
- (invoke "./x.py" "install" "rustfmt")))))))
+ (invoke "./x.py" "install" "rustfmt")))
+ (add-after 'install 'install-rust-src
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "rust-src"))
+ (dest "/lib/rustlib/src/rust"))
+ (mkdir-p (string-append out dest))
+ (copy-recursively "library" (string-append out dest
"/library"))
+ (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"))))))))))
;; Add test inputs.
(native-inputs (cons* `("gdb" ,gdb/pinned)
`("procps" ,procps)
- 79/194: gnu: Add rust-fastrand-2., (continued)
- 79/194: gnu: Add rust-fastrand-2., guix-commits, 2023/10/03
- 82/194: gnu: rust-xdg-2: Update to 2.5.2., guix-commits, 2023/10/03
- 69/194: gnu: rust-wasm-bindgen-macro-support-0.2: Update to 0.2.87., guix-commits, 2023/10/03
- 85/194: gnu: rust-clang-ast-0.1: Update to 0.1.20., guix-commits, 2023/10/03
- 90/194: gnu: rust-cxxbridge-macro-1: Update to 1.0.107., guix-commits, 2023/10/03
- 49/194: gnu: rust-quote-1: Update to 1.0.33., guix-commits, 2023/10/03
- 62/194: gnu: Add rust-to-shmem-0.0.0., guix-commits, 2023/10/03
- 64/194: gnu: Add rust-vek-0.15., guix-commits, 2023/10/03
- 70/194: gnu: rust-wasm-bindgen-shared-0.2: Update to 0.2.87., guix-commits, 2023/10/03
- 71/194: gnu: rust-wasm-bindgen-test-0.3: Update to 0.3.37., guix-commits, 2023/10/03
- 76/194: gnu: rust: Wrap rust-analyzer with rust source.,
guix-commits <=
- 94/194: gnu: rust-miniz-oxide-0.5: Update to 0.5.4., guix-commits, 2023/10/03
- 102/194: gnu: rust-mio-0.8: Update to 0.8.8., guix-commits, 2023/10/03
- 103/194: gnu: Add rust-mio-aio-0.7., guix-commits, 2023/10/03
- 108/194: gnu: Add rust-serial-test-derive-2., guix-commits, 2023/10/03
- 100/194: gnu: Add rust-linux-raw-sys-0.4., guix-commits, 2023/10/03
- 80/194: gnu: rust-unicode-width-0.1: Update to 0.1.11., guix-commits, 2023/10/03
- 86/194: gnu: rust-cxx-1: Update to 1.0.107., guix-commits, 2023/10/03
- 89/194: gnu: rust-cxxbridge-flags-1: Update to 1.0.107., guix-commits, 2023/10/03
- 87/194: gnu: rust-cxx-build-1: Update to 1.0.107., guix-commits, 2023/10/03
- 91/194: gnu: rust-flate2-1: Update to 1.0.27., guix-commits, 2023/10/03