diff options
author | Efraim Flashner <efraim@flashner.co.il> | 2021-11-10 19:48:12 +0200 |
---|---|---|
committer | Efraim Flashner <efraim@flashner.co.il> | 2021-11-10 19:48:12 +0200 |
commit | 32d8ab65eefd2967554be2c24c689cc7fc0afbc4 (patch) | |
tree | 240e2838ebb177733fac46cddc4169fa6db42cb4 | |
parent | 648b81211fa1d14048a39fff59397ae90a5fef91 (diff) | |
download | guix-32d8ab65eefd2967554be2c24c689cc7fc0afbc4.tar.gz |
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.
-rw-r--r-- | guix/build/cargo-build-system.scm | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/guix/build/cargo-build-system.scm b/guix/build/cargo-build-system.scm index 0a95672b00..464ef2ab0b 100644 --- a/guix/build/cargo-build-system.scm +++ b/guix/build/cargo-build-system.scm @@ -209,12 +209,26 @@ 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) + (rename-file file + (string-append (string-drop-right + (string-drop file 35) + 7) ".crate"))) + (find-files "." "\\.tar\\.gz")))) + (apply invoke `("cargo" "package" ,@cargo-package-flags))) (format #t "Not installing cargo sources, skipping `cargo package`.~%")) #t) |