Source-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/lang/rust cargo.mk: some improvements



details:   https://anonhg.NetBSD.org/pkgsrc/rev/6c99f8138b08
branches:  trunk
changeset: 437035:6c99f8138b08
user:      tnn <tnn%pkgsrc.org@localhost>
date:      Fri Aug 14 21:12:03 2020 +0000

description:
cargo.mk: some improvements

- rename show-cargo-depends to print-cargo-depends (but keep a compat alias)
- make it print an RCS id preamble with a comment

This allows one to do "make print-cargo-depends > cargo-depends.mk"
and reference cargo-depends.mk from the packages main Makefile.
Makes updating packages easier.

diffstat:

 lang/rust/cargo.mk |  17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)

diffs (32 lines):

diff -r d3a6cf599756 -r 6c99f8138b08 lang/rust/cargo.mk
--- a/lang/rust/cargo.mk        Fri Aug 14 21:05:47 2020 +0000
+++ b/lang/rust/cargo.mk        Fri Aug 14 21:12:03 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: cargo.mk,v 1.20 2020/08/14 20:44:16 tnn Exp $
+# $NetBSD: cargo.mk,v 1.21 2020/08/14 21:12:03 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
@@ -51,12 +51,17 @@
          > ${CARGO_VENDOR_DIR}/${crate}/.cargo-checksum.json
 .endfor
 
+# Legacy name
 .PHONY: show-cargo-depends
-show-cargo-depends:
-       ${RUN}${AWK} '/^name = / { split($$3, a, "\""); name=a[2]; } \
-               /^version = / { split($$3, a, "\""); vers=a[2]; } \
-               /^source = / { \
-                       print "CARGO_CRATE_DEPENDS+=\t" name "-" vers; \
+show-cargo-depends: print-cargo-depends
+
+.PHONY: print-cargo-depends
+print-cargo-depends:
+       ${RUN}${AWK} 'BEGIN {print "# $$Net" "BSD$$"; print;}           \
+               /^name = / { split($$3, a, "\""); name=a[2]; }          \
+               /^version = / { split($$3, a, "\""); vers=a[2]; }       \
+               /^source = / {                                          \
+                       print "CARGO_CRATE_DEPENDS+=\t" name "-" vers;  \
                        }' ${WRKSRC}/Cargo.lock
 
 DEFAULT_CARGO_ARGS=    build --offline --release -j${_MAKE_JOBS_N}



Home | Main Index | Thread Index | Old Index