gnu: make-rust-sysroot/implementation: Use gexps.

* gnu/packages/rust.scm (make-rust-sysroot/implementation): Use gexps.

Change-Id: Ie35ca201c2a55f00023dad02a0d1121b6f298812
This commit is contained in:
Maxim Cournoyer 2024-01-25 09:45:42 -05:00 committed by Ludovic Courtès
parent e5ee9403af
commit f719373583
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5

View File

@ -1353,7 +1353,7 @@ exec -a \"$0\" \"~a\" \"$@\""
(substitute-keyword-arguments (package-arguments base-rust)
((#:tests? _ #f) #f) ; This package for cross-building.
((#:phases phases)
`(modify-phases ,phases
#~(modify-phases #$phases
(add-after 'unpack 'unbundle-xz
(lambda _
(delete-file-recursively "vendor/lzma-sys/xz-5.2")
@ -1361,7 +1361,7 @@ exec -a \"$0\" \"~a\" \"$@\""
;; This is necessary for building the sysroot.
(substitute* "vendor/lzma-sys/build.rs"
(("!want_static && ") ""))))
,@(if (target-mingw? target)
#$@(if (target-mingw? target)
`((add-after 'set-env 'patch-for-mingw
(lambda* (#:key inputs #:allow-other-keys)
(setenv "LIBRARY_PATH"
@ -1401,13 +1401,13 @@ exec -a \"$0\" \"~a\" \"$@\""
(setenv "CROSS_LIBRARY_PATH" (getenv "LIBRARY_PATH"))
(setenv "CROSS_CPLUS_INCLUDE_PATH" (getenv "CPLUS_INCLUDE_PATH"))
(when (assoc-ref inputs (string-append "glibc-cross-" ,target))
(when (assoc-ref inputs (string-append "glibc-cross-" #$target))
(setenv "LIBRARY_PATH"
(string-join
(delete
(string-append
(assoc-ref inputs
(string-append "glibc-cross-" ,target))
(string-append "glibc-cross-" #$target))
"/lib")
(string-split (getenv "LIBRARY_PATH") #\:))
":"))
@ -1416,7 +1416,7 @@ exec -a \"$0\" \"~a\" \"$@\""
(delete
(string-append
(assoc-ref inputs
(string-append "glibc-cross-" ,target))
(string-append "glibc-cross-" #$target))
"/include")
(string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
":")))))
@ -1425,7 +1425,7 @@ exec -a \"$0\" \"~a\" \"$@\""
(let* ((out (assoc-ref outputs "out"))
(target-cc
(search-input-file
inputs (string-append "/bin/" ,(cc-for-target target)))))
inputs (string-append "/bin/" #$(cc-for-target target)))))
(call-with-output-file "config.toml"
(lambda (port)
(display (string-append "
@ -1437,7 +1437,7 @@ docs = false
python = \"" (which "python") "\"
vendor = true
submodules = false
target = [\"" ,(platform-rust-target (lookup-platform-by-target target)) "\"]
target = [\"" #$(platform-rust-target (lookup-platform-by-target target)) "\"]
[install]
prefix = \"" out "\"
sysconfdir = \"etc\"
@ -1446,19 +1446,19 @@ debug = false
jemalloc = false
default-linker = \"" target-cc "\"
channel = \"stable\"
[target." ,(platform-rust-target (lookup-platform-by-system (%current-system))) "]
[target." #$(platform-rust-target (lookup-platform-by-system (%current-system))) "]
# These are all native tools
llvm-config = \"" (search-input-file inputs "/bin/llvm-config") "\"
linker = \"" (which "gcc") "\"
cc = \"" (which "gcc") "\"
cxx = \"" (which "g++") "\"
ar = \"" (which "ar") "\"
[target." ,(platform-rust-target (lookup-platform-by-target target)) "]
[target." #$(platform-rust-target (lookup-platform-by-target target)) "]
llvm-config = \"" (search-input-file inputs "/bin/llvm-config") "\"
linker = \"" target-cc "\"
cc = \"" target-cc "\"
cxx = \"" (search-input-file inputs (string-append "/bin/" ,(cxx-for-target target))) "\"
ar = \"" (search-input-file inputs (string-append "/bin/" ,(ar-for-target target))) "\"
cxx = \"" (search-input-file inputs (string-append "/bin/" #$(cxx-for-target target))) "\"
ar = \"" (search-input-file inputs (string-append "/bin/" #$(ar-for-target target))) "\"
[dist]
") port))))))
(replace 'build
@ -1503,8 +1503,7 @@ ar = \"" (search-input-file inputs (string-append "/bin/" ,(ar-for-target target
(cross-libc target)
(cross-binutils target)))))
(properties
`((hidden? . #t)
,(package-properties base-rust))))))
`((hidden? . #t) ,(package-properties base-rust))))))
(define-public rust-analyzer
(package