summaryrefslogtreecommitdiff
path: root/lang/rust
diff options
context:
space:
mode:
authormaya <maya@pkgsrc.org>2018-05-06 01:59:36 +0000
committermaya <maya@pkgsrc.org>2018-05-06 01:59:36 +0000
commit8ebe63bb69ccb21adcc2c7e3ee18d140ffd5fa17 (patch)
tree86732f841911d05f58d5062133493e7568b46b6d /lang/rust
parent01e487070c7f67666c052ef8a79fe2f5c20b3caf (diff)
downloadpkgsrc-8ebe63bb69ccb21adcc2c7e3ee18d140ffd5fa17.tar.gz
Add a show-cargo-depends target, sparing the effort of listing cargo
dependencies manually. Document a bit and give some helpful tips.
Diffstat (limited to 'lang/rust')
-rw-r--r--lang/rust/cargo.mk12
1 files changed, 11 insertions, 1 deletions
diff --git a/lang/rust/cargo.mk b/lang/rust/cargo.mk
index 5cc7d4f7084..8050107d4ad 100644
--- a/lang/rust/cargo.mk
+++ b/lang/rust/cargo.mk
@@ -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 @@ cargo-vendor-crates:
$$(${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