From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 3DC30138359 for ; Wed, 11 Nov 2020 05:09:09 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7401AE0B51; Wed, 11 Nov 2020 05:09:08 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 513A5E0B46 for ; Wed, 11 Nov 2020 05:09:08 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id D0B00340C98 for ; Wed, 11 Nov 2020 05:09:06 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 5201C3A1 for ; Wed, 11 Nov 2020 05:09:05 +0000 (UTC) From: "Georgy Yakovlev" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Georgy Yakovlev" Message-ID: <1605070826.eb149fd45c96a1d7900b3a55a44130a7d8d56828.gyakovlev@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/ X-VCS-Repository: repo/gentoo X-VCS-Files: eclass/cargo.eclass X-VCS-Directories: eclass/ X-VCS-Committer: gyakovlev X-VCS-Committer-Name: Georgy Yakovlev X-VCS-Revision: eb149fd45c96a1d7900b3a55a44130a7d8d56828 X-VCS-Branch: master Date: Wed, 11 Nov 2020 05:09:05 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 8a809311-3b61-4237-98d8-03f085008bda X-Archives-Hash: 6eb1b32caf8d636f3d61ab2c0743dc02 commit: eb149fd45c96a1d7900b3a55a44130a7d8d56828 Author: Georgy Yakovlev gentoo org> AuthorDate: Wed Nov 11 00:04:48 2020 +0000 Commit: Georgy Yakovlev gentoo org> CommitDate: Wed Nov 11 05:00:26 2020 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=eb149fd4 eclass/cargo.eclass: add CARGO_OPTIONAL condition Signed-off-by: Georgy Yakovlev gentoo.org> eclass/cargo.eclass | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass index e6fec844d27..4d549f60bb9 100644 --- a/eclass/cargo.eclass +++ b/eclass/cargo.eclass @@ -15,20 +15,41 @@ _CARGO_ECLASS=1 # we need this for 'cargo vendor' subcommand and net.offline config knob RUST_DEPEND=">=virtual/rust-1.37.0" -case ${EAPI} in - 7) BDEPEND="${RUST_DEPEND}";; - *) die "EAPI=${EAPI:-0} is not supported" ;; +case "${EAPI:-0}" in + 0|1|2|3|4|5|6) + die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" + ;; + 7) + ;; + *) + die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" + ;; esac inherit multiprocessing toolchain-funcs -EXPORT_FUNCTIONS src_unpack src_configure src_compile src_install src_test +if [[ ! ${CARGO_OPTIONAL} ]]; then + BDEPEND="${RUST_DEPEND}" + EXPORT_FUNCTIONS src_unpack src_configure src_compile src_install src_test +fi IUSE="${IUSE} debug" ECARGO_HOME="${WORKDIR}/cargo_home" ECARGO_VENDOR="${ECARGO_HOME}/gentoo" +# @ECLASS-VARIABLE: CARGO_OPTIONAL +# @DEFAULT_UNSET +# @PRE_INHERIT +# @DESCRIPTION: +# If set to a non-null value, before inherit cargo part of the ebuild will +# be considered optional. No dependencies will be added and no phase +# functions will be exported. +# +# If you enable CARGO_OPTIONAL, you have to set BDEPEND on virtual/rust +# for your package and call at least cargo_gen_config manually before using +# other src_ functions of this eclass. + # @VARIABLE: myfeatures # @DEFAULT_UNSET # @DESCRIPTION: