[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
142/281: build: cargo-build-system: Don't try to package when skipping b
From: |
guix-commits |
Subject: |
142/281: build: cargo-build-system: Don't try to package when skipping build. |
Date: |
Wed, 22 Feb 2023 05:41:02 -0500 (EST) |
efraim pushed a commit to branch rust-team
in repository guix.
commit f89b31ff2ef0c3859fc1c268788cbf5908858a19
Author: Efraim Flashner <efraim@flashner.co.il>
AuthorDate: Wed Nov 10 19:48:12 2021 +0200
build: cargo-build-system: Don't try to package when skipping build.
* guix/build/cargo-build-system.scm (package): If the package isn't
going to be built then use the source instead.
---
guix/build/cargo-build-system.scm | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/guix/build/cargo-build-system.scm
b/guix/build/cargo-build-system.scm
index 41766228c2..5d7bfc8eb3 100644
--- a/guix/build/cargo-build-system.scm
+++ b/guix/build/cargo-build-system.scm
@@ -210,12 +210,28 @@ directory = '" port)
#t))
(define* (package #:key
+ source
+ skip-build?
install-source?
(cargo-package-flags '("--no-metadata" "--no-verify"))
#:allow-other-keys)
"Run 'cargo-package' for a given Cargo package."
(if install-source?
- (apply invoke `("cargo" "package" ,@cargo-package-flags))
+ (if skip-build?
+ (begin
+ (install-file source "target/package")
+ (with-directory-excursion "target/package"
+ (for-each
+ (lambda (file)
+ (make-file-writable file)
+ ;; Strip the hash and replace '.tar.gz' with '.crate'.
+ (rename-file file
+ (string-append (string-drop-right
+ (string-drop file 35)
+ (string-length ".tar.gz"))
+ ".crate")))
+ (find-files "." "\\.tar\\.gz$"))))
+ (apply invoke `("cargo" "package" ,@cargo-package-flags)))
(format #t "Not installing cargo sources, skipping `cargo package`.~%"))
#t)
- 131/281: gnu: rust-windows-i686-gnu: Remove bundled library., (continued)
- 131/281: gnu: rust-windows-i686-gnu: Remove bundled library., guix-commits, 2023/02/22
- 135/281: gnu: rust-windows-x86-64-msvc: Remove bundled library., guix-commits, 2023/02/22
- 139/281: gnu: rav1e: Fix building., guix-commits, 2023/02/22
- 140/281: gnu: librsvg: Adjust test suite., guix-commits, 2023/02/22
- 128/281: gnu: librsvg: Update to 2.54.4., guix-commits, 2023/02/22
- 155/281: gnu: Add rust-botan-sys-0.8., guix-commits, 2023/02/22
- 159/281: gnu: Add rust-cipher-0.4., guix-commits, 2023/02/22
- 161/281: gnu: Add rust-concolor-query-0.1., guix-commits, 2023/02/22
- 138/281: gnu: Add rust-1.67., guix-commits, 2023/02/22
- 130/281: gnu: rust-windows-aarch64-msvc: Remove bundled library., guix-commits, 2023/02/22
- 142/281: build: cargo-build-system: Don't try to package when skipping build.,
guix-commits <=
- 144/281: gnu: rust: Update to 1.67., guix-commits, 2023/02/22
- 145/281: gnu: Add rust-toml-datetime-0.6., guix-commits, 2023/02/22
- 148/281: gnu: rust-1.55: Explicitly use llvm-13., guix-commits, 2023/02/22
- 152/281: gnu: Add rust-base64-0.21., guix-commits, 2023/02/22
- 110/281: gnu: rust-ryu-1: Update to 1.0.12., guix-commits, 2023/02/22
- 107/281: gnu: rust-rand-pcg-0.3: Update to 0.3.1., guix-commits, 2023/02/22
- 116/281: gnu: rust-curl-sys-0.4: Update to 0.4.53+curl-7.82.0., guix-commits, 2023/02/22
- 115/281: gnu: rust-curl-0.4: Update to 0.4.43., guix-commits, 2023/02/22
- 125/281: gnu: newsboat: Update to 2.30.1., guix-commits, 2023/02/22
- 136/281: gnu: rust.scm: Sort packages alphabetically., guix-commits, 2023/02/22