From 0318d0385acc2dc790087a81421982fc2de21357 Mon Sep 17 00:00:00 2001 From: Rasmus Thomsen Date: Sun, 16 Sep 2018 21:39:23 +0200 Subject: [PATCH] build-style/cargo.sh: add --- Manual.md | 4 +++ common/build-style/cargo.sh | 35 +++++++++++++++++++++++++ common/environment/build-style/cargo.sh | 10 +++++++ 3 files changed, 49 insertions(+) create mode 100644 common/build-style/cargo.sh create mode 100644 common/environment/build-style/cargo.sh diff --git a/Manual.md b/Manual.md index 42e1c0ddbe2..0f0f0503288 100644 --- a/Manual.md +++ b/Manual.md @@ -734,6 +734,10 @@ The current list of available `build_style` scripts is the following: `do_configure()`, `do_build()`, etc., and may overwrite default `do_fetch()` and `do_extract()` that fetch and extract files defined in `distfiles` variable. +- `cargo` For packages written in rust that use Cargo for building. +Configuration arguments (such as `--features`) can be defined in the variable +`configure_args` and are passed to cargo during `do_build`. + - `cmake` For packages that use the CMake build system, configuration arguments can be passed in via `configure_args`. The `cmake_builddir` variable may be defined to specify the directory for building under `build_wrksrc` instead of diff --git a/common/build-style/cargo.sh b/common/build-style/cargo.sh new file mode 100644 index 00000000000..4f4809be8ba --- /dev/null +++ b/common/build-style/cargo.sh @@ -0,0 +1,35 @@ +# +# This helper is for building rust projects which use cargo for building +# + +do_configure() { + mkdir -p .cargo + # respect makejobs, do cross stuff + cat > .cargo/config <