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:   wiz
Date:           Mon May 15 20:07:36 UTC 2023

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

Log Message:
rust/cargo.mk: add default install target


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 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.33 pkgsrc/lang/rust/cargo.mk:1.34
--- pkgsrc/lang/rust/cargo.mk:1.33      Tue Mar 21 19:53:25 2023
+++ pkgsrc/lang/rust/cargo.mk   Mon May 15 20:07:36 2023
@@ -1,4 +1,4 @@
-# $NetBSD: cargo.mk,v 1.33 2023/03/21 19:53:25 nikita Exp $
+# $NetBSD: cargo.mk,v 1.34 2023/05/15 20:07:36 wiz 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,11 +70,12 @@ print-cargo-depends:
                        print "CARGO_CRATE_DEPENDS+=\t" name "-" vers;  \
                        }' ${CARGO_WRKSRC}/Cargo.lock
 
-DEFAULT_CARGO_ARGS=    build --offline --release -j${_MAKE_JOBS_N}     \
+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}   \
                          ${CARGO_FEATURES:S/ /,/Wg}
-CARGO_ARGS?=           ${DEFAULT_CARGO_ARGS}
+CARGO_ARGS?=           build --release ${DEFAULT_CARGO_ARGS}
+CARGO_INSTALL_ARGS?=   install --path . --root ${DESTDIR}${PREFIX} ${DEFAULT_CARGO_ARGS}
 
 MAKE_ENV+=             RUSTFLAGS=${RUSTFLAGS:Q}
 
@@ -85,3 +86,14 @@ do-build: do-cargo-build
 .PHONY: do-cargo-build
 do-cargo-build:
        ${RUN} cd ${CARGO_WRKSRC} && ${SETENV} ${MAKE_ENV} ${PREFIX}/bin/cargo ${CARGO_ARGS}
+
+.if !target(do-install)
+do-install: do-cargo-install
+.endif
+
+.PHONY: do-cargo-install
+do-cargo-install:
+       ${RUN} cd ${CARGO_WRKSRC} && ${SETENV} ${MAKE_ENV} ${PREFIX}/bin/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