pkgsrc-WIP-changes archive

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

rust: reduce diff to main pkgsrc by applying 1.27-1.29: * pass RUSTFLAGS via MAKE_ENV * drop digest from USE_TOOLS * introduce CARGO_WRKSRC



Module Name:	pkgsrc-wip
Committed By:	Havard Eidnes <he%NetBSD.org@localhost>
Pushed By:	he
Date:		Sat Nov 20 15:56:28 2021 +0100
Changeset:	55cb89d772ebea9298f48176d7c10d6252e7d096

Modified Files:
	rust/cargo.mk

Log Message:
rust: reduce diff to main pkgsrc by applying 1.27-1.29:
 * pass RUSTFLAGS via MAKE_ENV
 * drop digest from USE_TOOLS
 * introduce CARGO_WRKSRC

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=55cb89d772ebea9298f48176d7c10d6252e7d096

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

diffstat:
 rust/cargo.mk | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diffs:
diff --git a/rust/cargo.mk b/rust/cargo.mk
index cfd6833616..f6dd04c541 100644
--- a/rust/cargo.mk
+++ b/rust/cargo.mk
@@ -25,8 +25,9 @@ CHECK_SSP_SUPPORTED=	no
 
 .include "../../lang/rust/rust.mk"
 
-USE_TOOLS+=		bsdtar digest
+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/}	\
@@ -74,10 +75,12 @@ DEFAULT_CARGO_ARGS=	build --offline --release -j${_MAKE_JOBS_N}	\
 			  ${CARGO_FEATURES:S/ /,/Wg}
 CARGO_ARGS?=		${DEFAULT_CARGO_ARGS}
 
+MAKE_ENV+=		RUSTFLAGS=${RUSTFLAGS:Q}
+
 .if !target(do-build)
 do-build: do-cargo-build
 .endif
 
 .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