[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
76/276: gnu: rust: Wrap rust-analyzer with rust source.
From: |
guix-commits |
Subject: |
76/276: gnu: rust: Wrap rust-analyzer with rust source. |
Date: |
Wed, 18 Oct 2023 04:49:22 -0400 (EDT) |
efraim pushed a commit to branch rust-team
in repository guix.
commit 020aca2a1f5720f9ebe45a6c389e2567d15b3885
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)
- 40/276: gnu: rust-lock-api-0.4: Update to 0.4.10., (continued)
- 40/276: gnu: rust-lock-api-0.4: Update to 0.4.10., guix-commits, 2023/10/18
- 51/276: gnu: rust-rayon-core-1: Update to 1.12.0., guix-commits, 2023/10/18
- 59/276: gnu: Add rust-simba-0.8., guix-commits, 2023/10/18
- 64/276: gnu: Add rust-vek-0.15., guix-commits, 2023/10/18
- 69/276: gnu: rust-wasm-bindgen-macro-support-0.2: Update to 0.2.87., guix-commits, 2023/10/18
- 71/276: gnu: rust-wasm-bindgen-test-0.3: Update to 0.3.37., guix-commits, 2023/10/18
- 66/276: gnu: rust-wasm-bindgen-backend-0.2: Update to 0.2.87., guix-commits, 2023/10/18
- 74/276: gnu: Add rust-yeslogic-fontconfig-sys-4., guix-commits, 2023/10/18
- 78/276: gnu: rust-curl-sys-0.4: Update to 0.4.66., guix-commits, 2023/10/18
- 65/276: gnu: rust-wasm-bindgen-0.2: Update to 0.2.87., guix-commits, 2023/10/18
- 76/276: gnu: rust: Wrap rust-analyzer with rust source.,
guix-commits <=
- 87/276: gnu: rust-cxx-build-1: Update to 1.0.107., guix-commits, 2023/10/18
- 82/276: gnu: rust-xdg-2: Update to 2.5.2., guix-commits, 2023/10/18
- 90/276: gnu: rust-cxxbridge-macro-1: Update to 1.0.107., guix-commits, 2023/10/18
- 86/276: gnu: rust-cxx-1: Update to 1.0.107., guix-commits, 2023/10/18
- 91/276: gnu: rust-flate2-1: Update to 1.0.27., guix-commits, 2023/10/18
- 92/276: gnu: rust-link-cplusplus-1: Update to 1.0.9., guix-commits, 2023/10/18
- 37/276: gnu: Add rust-glam-0.18., guix-commits, 2023/10/18
- 39/276: gnu: rust-js-sys-0.3: Update to 0.3.64., guix-commits, 2023/10/18
- 45/276: gnu: rust-parking-lot-core-0.9: Update to 0.9.8., guix-commits, 2023/10/18
- 47/276: gnu: Add rust-paste-test-suite-0.0.0., guix-commits, 2023/10/18