summaryrefslogtreecommitdiff
path: root/guix/build-system/cargo.scm
diff options
context:
space:
mode:
authorIvan Petkov <ivanppetkov@gmail.com>2019-04-02 03:02:51 -0700
committerChris Marusich <cmmarusich@gmail.com>2019-04-09 03:09:00 -0700
commit1d3acde5087d50af6a4901fd7614f0940eb7b41d (patch)
treeaf0447b8e6ebd2c1035e06627c6d28f509a74065 /guix/build-system/cargo.scm
parent23635b2ee95c2deb5041329fc2124636319a6333 (diff)
build-system/cargo: refactor phases to successfully build
* guix/build-system/cargo.scm (%cargo-build-system-modules): Add (json parser). (cargo-build): [vendor-dir]: Define flag and pass it to builder code. [cargo-test-flags]: Likewise. [skip-build?]: Likewise. * guix/build/cargo-build/system.scm (#:use-module): use (json parser). (package-name->crate-name): Delete it. (manifest-targets): Add it. (has-executable-target?): Add it. (configure): Add #:vendor-dir name and use it. Don't touch Cargo.toml. Don't symlink to duplicate inputs. Remove useless registry line from cargo config. Define RUSTFLAGS to lift lint restrictions. (build): Add #:skip-build? flag and use it. (check): Likewise. Add #:cargo-test-flags and pass it to cargo. (install): Factor source logic to install-source. Define #:skip-build? flag and use it. Only install if executable targets are present. (install-source): Copy entire crate directory not just src. [generate-checksums] pass dummy file for unused second argument. (%standard-phases): Add install-source phase. Signed-off-by: Chris Marusich <cmmarusich@gmail.com>
Diffstat (limited to 'guix/build-system/cargo.scm')
-rw-r--r--guix/build-system/cargo.scm9
1 files changed, 8 insertions, 1 deletions
diff --git a/guix/build-system/cargo.scm b/guix/build-system/cargo.scm
index 7ff4e90f71..dc137421e9 100644
--- a/guix/build-system/cargo.scm
+++ b/guix/build-system/cargo.scm
@@ -59,13 +59,17 @@ to NAME and VERSION."
(define %cargo-build-system-modules
;; Build-side modules imported by default.
`((guix build cargo-build-system)
+ (json parser)
,@%cargo-utils-modules))
(define* (cargo-build store name inputs
#:key
(tests? #t)
(test-target #f)
+ (vendor-dir "guix-vendor")
(cargo-build-flags ''("--release"))
+ (cargo-test-flags ''("--release"))
+ (skip-build? #f)
(phases '(@ (guix build cargo-build-system)
%standard-phases))
(outputs '("out"))
@@ -90,8 +94,11 @@ to NAME and VERSION."
source))
#:system ,system
#:test-target ,test-target
+ #:vendor-dir ,vendor-dir
#:cargo-build-flags ,cargo-build-flags
- #:tests? ,tests?
+ #:cargo-test-flags ,cargo-test-flags
+ #:skip-build? ,skip-build?
+ #:tests? ,(and tests? (not skip-build?))
#:phases ,phases
#:outputs %outputs
#:search-paths ',(map search-path-specification->sexp