[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
17/459: build: cargo-build-system: Don't try to package when skipping bu
From: |
guix-commits |
Subject: |
17/459: build: cargo-build-system: Don't try to package when skipping build. |
Date: |
Mon, 24 Apr 2023 15:01:40 -0400 (EDT) |
efraim pushed a commit to branch rust-team
in repository guix.
commit 3fc9f48d380e5b515e054f9665338f172e47a4e7
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)
- 09/459: gnu: rust-windows-x86-64-gnu: Remove bundled library., (continued)
- 09/459: gnu: rust-windows-x86-64-gnu: Remove bundled library., guix-commits, 2023/04/24
- 11/459: gnu: rust-windows-x86-64-msvc: Remove bundled library., guix-commits, 2023/04/24
- 12/459: gnu: rust.scm: Sort packages alphabetically., guix-commits, 2023/04/24
- 13/459: gnu: Add rust-1.66., guix-commits, 2023/04/24
- 14/459: gnu: Add rust-1.67., guix-commits, 2023/04/24
- 23/459: gnu: rust-1.55: Explicitly use llvm-13., guix-commits, 2023/04/24
- 24/459: gnu: Add rust-aead-0.5., guix-commits, 2023/04/24
- 10/459: gnu: rust-windows-x86-64-gnullvm-0.42: Remove bundled library., guix-commits, 2023/04/24
- 15/459: gnu: librsvg: Adjust test suite., guix-commits, 2023/04/24
- 16/459: gnu: librsvg: Update to 2.54.5., guix-commits, 2023/04/24
- 17/459: build: cargo-build-system: Don't try to package when skipping build.,
guix-commits <=
- 19/459: gnu: rust: Update to 1.67., guix-commits, 2023/04/24
- 20/459: gnu: Add rust-toml-datetime-0.6., guix-commits, 2023/04/24
- 25/459: gnu: Add rust-aes-0.8., guix-commits, 2023/04/24
- 22/459: gnu: rust-bootstrap: Explicitly use llvm-13., guix-commits, 2023/04/24
- 32/459: gnu: Add rust-cargo-util-0.2., guix-commits, 2023/04/24
- 35/459: gnu: Add rust-concolor-query-0.1., guix-commits, 2023/04/24
- 18/459: gnu: librsvg-bootstrap: Remove more precompiled libraries., guix-commits, 2023/04/24
- 27/459: gnu: Add rust-base64-0.21., guix-commits, 2023/04/24
- 28/459: gnu: Add rust-block-padding-0.3., guix-commits, 2023/04/24
- 30/459: gnu: Add rust-botan-sys-0.8., guix-commits, 2023/04/24