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 9E50C13933E for ; Sat, 3 Jul 2021 07:03:11 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6E0E4E082B; Sat, 3 Jul 2021 07:03:10 +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 4DD4BE082B for ; Sat, 3 Jul 2021 07:03:10 +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 A50FC335D4B for ; Sat, 3 Jul 2021 07:03:08 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id F1653798 for ; Sat, 3 Jul 2021 07:03:06 +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: <1625295549.e24170cba4af14df622c4a2d465534583d30d625.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: e24170cba4af14df622c4a2d465534583d30d625 X-VCS-Branch: master Date: Sat, 3 Jul 2021 07:03:06 +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: fa7c0594-f374-4135-a2ce-ff8825866b44 X-Archives-Hash: ab96a0edf3eea53f718da90a1706241a commit: e24170cba4af14df622c4a2d465534583d30d625 Author: Georgy Yakovlev gentoo org> AuthorDate: Fri Jul 2 00:34:04 2021 +0000 Commit: Georgy Yakovlev gentoo org> CommitDate: Sat Jul 3 06:59:09 2021 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e24170cb cargo.eclass: support EAPI=8, misc changes remove cargo-snapshot* unpacker, it was needed for separate dev-util/cargo we used to have. Bug: https://bugs.gentoo.org/715890 Signed-off-by: Georgy Yakovlev gentoo.org> eclass/cargo.eclass | 39 ++++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass index 15b9d455bde..9923b1c9deb 100644 --- a/eclass/cargo.eclass +++ b/eclass/cargo.eclass @@ -7,20 +7,33 @@ # @AUTHOR: # Doug Goldstein # Georgy Yakovlev -# @SUPPORTED_EAPIS: 7 +# @SUPPORTED_EAPIS: 7 8 # @BLURB: common functions and variables for cargo builds if [[ -z ${_CARGO_ECLASS} ]]; then _CARGO_ECLASS=1 -# we need this for 'cargo vendor' subcommand and net.offline config knob -RUST_DEPEND=">=virtual/rust-1.37.0" +# check and document RUST_DEPEND and options we need below in case conditions. +# https://github.com/rust-lang/cargo/blob/master/CHANGELOG.md +RUST_DEPEND="virtual/rust" case "${EAPI:-0}" in 0|1|2|3|4|5|6) die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" ;; 7) + # 1.37 added 'cargo vendor' subcommand and net.offline config knob + RUST_DEPEND=">=virtual/rust-1.37.0" + ;; + + 8) + # 1.39 added --workspace + # 1.46 added --target dir + # 1.48 added term.progress config option + # 1.51 added split-debuginfo profile option + # 1.52 may need setting RUSTC_BOOTSTRAP envvar for some crates + # 1.53 added cargo update --offline, can be used to update vulnerable crates from pre-fetched registry without editing toml + RUST_DEPEND=">=virtual/rust-1.53" ;; *) die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" @@ -184,15 +197,6 @@ cargo_src_unpack() { fi eend $? ;; - cargo-snapshot*) - ebegin "Unpacking ${archive}" - mkdir -p "${S}"/target/snapshot - tar -xzf "${DISTDIR}"/${archive} -C "${S}"/target/snapshot --strip-components 2 || die - # cargo's makefile needs this otherwise it will try to - # download it - touch "${S}"/target/snapshot/bin/cargo || die - eend $? - ;; *) unpack ${archive} ;; @@ -376,7 +380,16 @@ cargo_src_install() { rm -f "${ED}/usr/.crates.toml" || die rm -f "${ED}/usr/.crates2.json" || die - [ -d "${S}/man" ] && doman "${S}/man" || return 0 + # it turned out to be non-standard dir, so get rid of it future EAPI + # and only run for EAPI=7 + # https://bugs.gentoo.org/715890 + case ${EAPI:-0} in + 7) + if [ -d "${S}/man" ]; then + doman "${S}/man" || return 0 + fi + ;; + esac } # @FUNCTION: cargo_src_test