pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc cargo.mk: move CARGO_FEATURES from lang/ncspot to here



details:   https://anonhg.NetBSD.org/pkgsrc/rev/071b93584dd2
branches:  trunk
changeset: 440870:071b93584dd2
user:      tnn <tnn%pkgsrc.org@localhost>
date:      Tue Oct 20 19:03:07 2020 +0000

description:
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:

 audio/ncspot/Makefile |  6 +++---
 lang/rust/cargo.mk    |  7 +++++--
 2 files changed, 8 insertions(+), 5 deletions(-)

diffs (42 lines):

diff -r 01d36da2cbd7 -r 071b93584dd2 audio/ncspot/Makefile
--- a/audio/ncspot/Makefile     Tue Oct 20 18:40:31 2020 +0000
+++ b/audio/ncspot/Makefile     Tue Oct 20 19:03:07 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.6 2020/10/20 18:40:31 tnn Exp $
+# $NetBSD: Makefile,v 1.7 2020/10/20 19:03:07 tnn Exp $
 
 DISTNAME=      ncspot-0.2.3
 PKGREVISION=   1
@@ -428,9 +428,9 @@
 RUSTFLAGS+=    -C link-arg=${COMPILER_RPATH_FLAG}${BUILDLINK_PREFIX.libxcb}/lib
 RUSTFLAGS+=    -C link-arg=-L${BUILDLINK_PREFIX.libxcb}/lib
 MAKE_ENV+=     RUSTFLAGS=${RUSTFLAGS:Q}
-CARGO_ARGS=    ${DEFAULT_CARGO_ARGS} --no-default-features --features ${CARGO_FEATURES:S/ /,/Wg}
 
-CARGO_FEATURES+=       share_clipboard
+CARGO_NO_DEFAULT_FEATURES=     YES
+CARGO_FEATURES+=               share_clipboard
 
 .include "options.mk"
 
diff -r 01d36da2cbd7 -r 071b93584dd2 lang/rust/cargo.mk
--- a/lang/rust/cargo.mk        Tue Oct 20 18:40:31 2020 +0000
+++ b/lang/rust/cargo.mk        Tue Oct 20 19:03:07 2020 +0000
@@ -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_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)



Home | Main Index | Thread Index | Old Index