* guix/build/cargo-build-system.scm (crate-src?): New procedure.
(configure): Use the new procedure to expand crate tarballs in the vendor
directory.
Signed-off-by: Chris Marusich <cmmarusich@gmail.com>
* 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>
* guix/build/cargo-build-system.scm (generate-checksums): Remove store
reference from comment. This comment was matching
assert-no-store-file-names regexp in Makefile.am.
Also, edit procedure docstring to precise that DIR-NAME is a store
directory.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* guix/build/cargo-build-system.scm (configure): Remove proprietary
dependencies. Add rust dependencies and configure Cargo to find them.
(build): Also build libraries, not just applications.
(file-sha256): New variable.
(generate-checksums): New variable. Export it.
(touch): New variable.
(install): Generate checksums so Cargo accepts the package.
* guix/build-system/cargo.scm (cargo-build): Add src output.
(private-keywords): Add #:outputs.
* guix/build/cargo-build-system.scm (configure): Use /share/rust-source
when replacing inputs.
(build, check): Don't do anything when there isn't a Cargo.lock file
present.
(install): Install sources to src output. When a Cargo.lock file is
present use cargo install to install binaries to out.
* guix/import/crate.scm (make-crate-sexp): Importer uses the src output
for crate inputs by default.
* guix/import/utils.scm (package-names->package-inputs, maybe-inputs,
maybe-native-inputs): Take an optional output argument.
* tests/crate.scm (crate->guix-package test): Update.
Problem reported by Francisco Gómez García <espectalll@kydara.com>.
* guix/build/cargo-build-system.scm (configure): Make sure Cargo.toml
is writeable before attempting modification.
Problem reported by Danny Milosavljevic <dannym@scratchpost.org>.