Replace, not append to WRKSRC/.cargo/config.

This may cause problems if there's already one.
Needed by rust librsvg.

Tested all cargo.mk users in pkgsrc.
This commit is contained in:
maya 2018-11-27 14:02:11 +00:00
parent 94e34fbc6e
commit be76eea594

View file

@ -1,4 +1,4 @@
# $NetBSD: cargo.mk,v 1.4 2018/10/23 16:39:29 minskim Exp $
# $NetBSD: cargo.mk,v 1.5 2018/11/27 14:02:11 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
@ -37,7 +37,7 @@ post-extract: cargo-vendor-crates
cargo-vendor-crates:
@${STEP_MSG} "Extracting local cargo crates"
${RUN}${MKDIR} ${WRKSRC}/.cargo
${RUN}${PRINTF} "[source.crates-io]\nreplace-with = \"vendored-sources\"\n[source.vendored-sources]\ndirectory = \"${CARGO_VENDOR_DIR}\"\n" >> ${WRKSRC}/.cargo/config
${RUN}${PRINTF} "[source.crates-io]\nreplace-with = \"vendored-sources\"\n[source.vendored-sources]\ndirectory = \"${CARGO_VENDOR_DIR}\"\n" > ${WRKSRC}/.cargo/config
${RUN}${MKDIR} ${CARGO_VENDOR_DIR}
.for _crate in ${CARGO_CRATE_DEPENDS}
${RUN}${PRINTF} '{"package":"%s","files":{}}' \