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:   js
Date:           Sat Aug 10 11:17:31 UTC 2024

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

Log Message:
cargo.mk: Add support for RUST_TYPE=native


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 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.37 pkgsrc/lang/rust/cargo.mk:1.38
--- pkgsrc/lang/rust/cargo.mk:1.37      Sat May  4 20:06:55 2024
+++ pkgsrc/lang/rust/cargo.mk   Sat Aug 10 11:17:31 2024
@@ -1,4 +1,4 @@
-# $NetBSD: cargo.mk,v 1.37 2024/05/04 20:06:55 tnn Exp $
+# $NetBSD: cargo.mk,v 1.38 2024/08/10 11:17:31 js 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
@@ -70,6 +70,11 @@ print-cargo-depends:
                        print "CARGO_CRATE_DEPENDS+=\t" name "-" vers;  \
                        }' ${CARGO_WRKSRC}/Cargo.lock
 
+.if ${RUST_TYPE} == "native"
+CARGO=                 cargo
+.else
+CARGO=                 ${PREFIX}/bin/cargo
+.endif
 DEFAULT_CARGO_ARGS=    --offline -j${_MAKE_JOBS_N}     \
                          ${CARGO_NO_DEFAULT_FEATURES:M[yY][eE][sS]:C/[yY][eE][sS]/--no-default-features/}      \
                          ${CARGO_FEATURES:C/.*/--features/W}   \
@@ -86,7 +91,7 @@ do-build: do-cargo-build
 
 .PHONY: do-cargo-build
 do-cargo-build:
-       ${RUN} cd ${CARGO_WRKSRC} && ${SETENV} ${MAKE_ENV} ${PREFIX}/bin/cargo ${CARGO_ARGS}
+       ${RUN} cd ${CARGO_WRKSRC} && ${SETENV} ${MAKE_ENV} ${CARGO} ${CARGO_ARGS}
 
 .if !target(do-install) && ${GNU_CONFIGURE:Uno:tl} == no
 do-install: do-cargo-install
@@ -94,7 +99,7 @@ do-install: do-cargo-install
 
 .PHONY: do-cargo-install
 do-cargo-install:
-       ${RUN} cd ${CARGO_WRKSRC} && ${SETENV} ${MAKE_ENV} ${PREFIX}/bin/cargo ${CARGO_INSTALL_ARGS}
+       ${RUN} cd ${CARGO_WRKSRC} && ${SETENV} ${MAKE_ENV} ${CARGO} ${CARGO_INSTALL_ARGS}
        # remove files cargo uses for tracking installations
        ${RM} -f ${DESTDIR}${PREFIX}/.crates.toml
        ${RM} -f ${DESTDIR}${PREFIX}/.crates2.json



Home | Main Index | Thread Index | Old Index