pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/lang/rust Add a show-cargo-depends target, sparing the...
details: https://anonhg.NetBSD.org/pkgsrc/rev/d1d8b35f51e0
branches: trunk
changeset: 379763:d1d8b35f51e0
user: maya <maya%pkgsrc.org@localhost>
date: Sun May 06 01:59:36 2018 +0000
description:
Add a show-cargo-depends target, sparing the effort of listing cargo
dependencies manually.
Document a bit and give some helpful tips.
diffstat:
lang/rust/cargo.mk | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
diffs (30 lines):
diff -r f3196f40b78b -r d1d8b35f51e0 lang/rust/cargo.mk
--- a/lang/rust/cargo.mk Sun May 06 01:58:26 2018 +0000
+++ b/lang/rust/cargo.mk Sun May 06 01:59:36 2018 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: cargo.mk,v 1.1 2017/11/08 13:40:10 tnn Exp $
+# $NetBSD: cargo.mk,v 1.2 2018/05/06 01:59:36 maya 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
@@ -12,6 +12,12 @@
# do-build:
# cargo build --locked --frozen
#
+#
+# If modifying the list of dependencies, re-run the build once without
+# --locked --frozen to generate a new valid Cargo.lock.
+#
+# a list of CARGO_CRATE_DEPENDS can be generated via "make show-cargo-depends".
+#
# See also www/geckodriver for a full example.
USE_TOOLS+= bsdtar digest
@@ -36,3 +42,7 @@
$$(${DIGEST} sha256 < ${WRKDIR}/${_crate}.crate) \
> ${CARGO_VENDOR_DIR}/${_crate}/.cargo-checksum.json
.endfor
+
+.PHONY: show-cargo-depends
+show-cargo-depends:
+ ${RUN}${AWK} '/^\"checksum/ { print "CARGO_CRATE_DEPENDS+=\t" $$2 "-" $$3""; next } ' ${WRKSRC}/Cargo.lock
Home |
Main Index |
Thread Index |
Old Index