Received: by mail.netbsd.org (Postfix, from userid 605) id 0A11284D2D; Fri, 14 Aug 2020 20:44:18 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 845C584CEE for ; Fri, 14 Aug 2020 20:44:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([127.0.0.1]) by localhost (mail.netbsd.org [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id kKoHjjQ0fK9s for ; Fri, 14 Aug 2020 20:44:17 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.netbsd.org [199.233.217.197]) by mail.netbsd.org (Postfix) with ESMTP id D225184CEC for ; Fri, 14 Aug 2020 20:44:16 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id C735FFB28; Fri, 14 Aug 2020 20:44:16 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_1597437856179720" MIME-Version: 1.0 Date: Fri, 14 Aug 2020 20:44:16 +0000 From: "Tobias Nygren" Subject: CVS commit: pkgsrc/lang/rust To: pkgsrc-changes@NetBSD.org Reply-To: tnn@netbsd.org X-Mailer: log_accum Message-Id: <20200814204416.C735FFB28@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: pkgsrc-changes.NetBSD.org Precedence: bulk List-Unsubscribe: This is a multi-part message in MIME format. --_----------=_1597437856179720 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: tnn Date: Fri Aug 14 20:44:16 UTC 2020 Modified Files: pkgsrc/lang/rust: cargo.mk Log Message: rust/cargo.mk: add a default do-build target to reduce copypasta To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 pkgsrc/lang/rust/cargo.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_1597437856179720 Content-Disposition: inline Content-Length: 1358 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Modified files: Index: pkgsrc/lang/rust/cargo.mk diff -u pkgsrc/lang/rust/cargo.mk:1.19 pkgsrc/lang/rust/cargo.mk:1.20 --- pkgsrc/lang/rust/cargo.mk:1.19 Fri Aug 14 11:05:00 2020 +++ pkgsrc/lang/rust/cargo.mk Fri Aug 14 20:44:16 2020 @@ -1,4 +1,4 @@ -# $NetBSD: cargo.mk,v 1.19 2020/08/14 11:05:00 tnn Exp $ +# $NetBSD: cargo.mk,v 1.20 2020/08/14 20:44:16 tnn 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 @@ -9,12 +9,9 @@ # # CARGO_CRATE_DEPENDS+= sha1-0.20 # .include "../../lang/rust/cargo.mk" -# do-build: -# cargo build --offline -# # # If modifying the list of dependencies, re-run the build once without -# --offline to generate a new valid Cargo.lock. +# --offline in CARGO_ARGS to generate a new valid Cargo.lock. # # a list of CARGO_CRATE_DEPENDS can be generated via "make show-cargo-depends". # @@ -61,3 +58,14 @@ show-cargo-depends: /^source = / { \ print "CARGO_CRATE_DEPENDS+=\t" name "-" vers; \ }' ${WRKSRC}/Cargo.lock + +DEFAULT_CARGO_ARGS= build --offline --release -j${_MAKE_JOBS_N} +CARGO_ARGS?= ${DEFAULT_CARGO_ARGS} + +.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} --_----------=_1597437856179720--