pkgsrc-Changes archive

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

CVS commit: pkgsrc/lang/rust



Module Name:    pkgsrc
Committed By:   jperkin
Date:           Wed Oct  6 10:25:32 UTC 2021

Modified Files:
        pkgsrc/lang/rust: cargo.mk

Log Message:
rust: Add support for CARGO_WRKSRC.

This defaults to WRKSRC and allows packages that aren't primarily
written in rust, but have a rust component that needs to be built, to
support the correct operation of cargo within their source tree.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 pkgsrc/lang/rust/cargo.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/lang/rust/cargo.mk
diff -u pkgsrc/lang/rust/cargo.mk:1.28 pkgsrc/lang/rust/cargo.mk:1.29
--- pkgsrc/lang/rust/cargo.mk:1.28      Wed Oct  6 10:20:24 2021
+++ pkgsrc/lang/rust/cargo.mk   Wed Oct  6 10:25:32 2021
@@ -1,4 +1,4 @@
-# $NetBSD: cargo.mk,v 1.28 2021/10/06 10:20:24 jperkin Exp $
+# $NetBSD: cargo.mk,v 1.29 2021/10/06 10:25:32 jperkin 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
@@ -27,6 +27,7 @@ CHECK_SSP_SUPPORTED=  no
 
 USE_TOOLS+=            bsdtar
 CARGO_VENDOR_DIR=      ${WRKDIR}/vendor
+CARGO_WRKSRC?=         ${WRKSRC}
 
 DISTFILES?=                    ${DEFAULT_DISTFILES}
 .for crate in ${CARGO_CRATE_DEPENDS}
@@ -46,8 +47,8 @@ post-extract: cargo-vendor-crates
 .PHONY: 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}${MKDIR} ${CARGO_WRKSRC}/.cargo
+       ${RUN}${PRINTF} "[source.crates-io]\nreplace-with = \"vendored-sources\"\n[source.vendored-sources]\ndirectory = \"${CARGO_VENDOR_DIR}\"\n" > ${CARGO_WRKSRC}/.cargo/config
        ${RUN}${MKDIR} ${CARGO_VENDOR_DIR}
 .for crate in ${CARGO_CRATE_DEPENDS}
        ${RUN}${PRINTF} '{"package":"%s","files":{}}'   \
@@ -66,7 +67,7 @@ print-cargo-depends:
                /^version = / { split($$3, a, "\""); vers=a[2]; }       \
                /^source = / {                                          \
                        print "CARGO_CRATE_DEPENDS+=\t" name "-" vers;  \
-                       }' ${WRKSRC}/Cargo.lock
+                       }' ${CARGO_WRKSRC}/Cargo.lock
 
 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/}      \
@@ -82,4 +83,4 @@ do-build: do-cargo-build
 
 .PHONY: do-cargo-build
 do-cargo-build:
-       ${RUN} cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${PREFIX}/bin/cargo ${CARGO_ARGS}
+       ${RUN} cd ${CARGO_WRKSRC} && ${SETENV} ${MAKE_ENV} ${PREFIX}/bin/cargo ${CARGO_ARGS}



Home | Main Index | Thread Index | Old Index