diff options
author | tnn <tnn@pkgsrc.org> | 2020-10-20 19:03:07 +0000 |
---|---|---|
committer | tnn <tnn@pkgsrc.org> | 2020-10-20 19:03:07 +0000 |
commit | 3cc4c78e0023e49f083177b61dfef894c9a3c1ed (patch) | |
tree | 24ccc7cecb8c7ed76b9d07bb300503ce4cf1b496 /lang/rust/cargo.mk | |
parent | 9bcbad6f6df646ff48ed617f7203e23c0e0c1d67 (diff) | |
download | pkgsrc-3cc4c78e0023e49f083177b61dfef894c9a3c1ed.tar.gz |
cargo.mk: move CARGO_FEATURES from lang/ncspot to here
It seems to be a generally useful feature. If a package supports
optional cargo dependencies then you may now (instead of messing with
CARGO_ARGS directly) set in your Makefile for example:
CARGO_NO_DEFAULT_FEATURES= YES
CARGO_FEATURES+= dbus pulseaudio
Diffstat (limited to 'lang/rust/cargo.mk')
-rw-r--r-- | lang/rust/cargo.mk | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lang/rust/cargo.mk b/lang/rust/cargo.mk index ebc8867e9fd..148d2ccb6b7 100644 --- a/lang/rust/cargo.mk +++ b/lang/rust/cargo.mk @@ -1,4 +1,4 @@ -# $NetBSD: cargo.mk,v 1.22 2020/08/14 21:19:22 tnn Exp $ +# $NetBSD: cargo.mk,v 1.23 2020/10/20 19:03:07 tnn Exp $ # # Common logic that can be used by packages that depend on cargo crates # from crates.io. This lets existing pkgsrc infrastructure fetch and verify @@ -66,7 +66,10 @@ print-cargo-depends: print "CARGO_CRATE_DEPENDS+=\t" name "-" vers; \ }' ${WRKSRC}/Cargo.lock -DEFAULT_CARGO_ARGS= build --offline --release -j${_MAKE_JOBS_N} +DEFAULT_CARGO_ARGS= build --offline --release -j${_MAKE_JOBS_N} \ + ${CARGO_NO_DEFAULT_FEATURES:M[yY][eE][sS]:C/[yY][eE][sS]/--no-default-features/} \ + ${CARGO_FEATURES:C/.*/--features/W} \ + ${CARGO_FEATURES:S/ /,/Wg} CARGO_ARGS?= ${DEFAULT_CARGO_ARGS} .if !target(do-build) |