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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 11FC015838C for ; Tue, 23 Jan 2024 03:32:31 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 78CBBE2A14; Tue, 23 Jan 2024 03:32:26 +0000 (UTC) Received: from mx1.riseup.net (mx1.riseup.net [198.252.153.129]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 349D3E29D4 for ; Tue, 23 Jan 2024 03:32:26 +0000 (UTC) Received: from fews02-sea.riseup.net (fews02-sea-pn.riseup.net [10.0.1.112]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx1.riseup.net (Postfix) with ESMTPS id 4TJt211B3wzDqQG for ; Tue, 23 Jan 2024 03:32:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1705980745; bh=rC44dSaqv9CVwXM2BMIHkYrnvOqvyXdVPHthVbB/5lw=; h=Date:From:To:Subject:In-Reply-To:References:From; b=YePFAaV+2V9EmLcKxGlRQXxJzZZhUGp5KunyyHv4QAZG7G+aeThC3vVBV97y9Eodg OEJKCaoYJP5EcpjCgJ9wBJ3nzqRTCNPlgxaynIugTmsOChtMGS1bzXMdyc1IfAikot OA6zebdNWR2B88oUQaZCAZyNL8uZO0XJyCQ0sUsU= X-Riseup-User-ID: 67824347329042900330511AE563180BFB0E6561F68EEC7086511755216F8F99 Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews02-sea.riseup.net (Postfix) with ESMTPSA id 4TJt206TmszFw5f for ; Tue, 23 Jan 2024 03:32:24 +0000 (UTC) Date: Mon, 22 Jan 2024 19:32:22 -0800 From: orbea To: gentoo-dev@lists.gentoo.org Subject: [gentoo-dev] [PATCH] cargo.eclass: add CARGO_TOML_DIR Message-ID: <20240122193222.7d9a5b0e@Akita> In-Reply-To: <20240122161434.991554-1-sam@gentoo.org> References: <20240122161434.991554-1-sam@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Archives-Salt: 8af86de9-2e1c-4f03-9739-a040046fc560 X-Archives-Hash: d22bd4d5a9d0800cdcd922dbf6898f06 This is required when cargo_live_src_unpack needs to be find a Cargo.toml file in a directory other than ${S} Signed-off-by: orbea --- eclass/cargo.eclass | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass index 3bdbb5e3ec64..692623382c56 100644 --- a/eclass/cargo.eclass +++ b/eclass/cargo.eclass @@ -116,6 +116,15 @@ ECARGO_VENDOR="${ECARGO_HOME}/gentoo" # other src_functions of this eclass. # Note that cargo_gen_config is automatically called by cargo_src_unpack. +# @ECLASS_VARIABLE: CARGO_TOML_DIR +# @DEFAULT_UNSET +# @DESCRIPTION: +# Optional variable containing the directory path to the Cargo.toml file. +# Should be defined before calling cargo_live_src_unpack. +# +# This is required for live ebuilds when Cargo.toml in a directory other +# than ${S}. + # @ECLASS_VARIABLE: myfeatures # @DEFAULT_UNSET # @DESCRIPTION: @@ -403,7 +412,7 @@ cargo_live_src_unpack() { umask "${EVCS_UMASK}" || die "Bad options to umask: ${EVCS_UMASK}" fi - pushd "${S}" > /dev/null || die + pushd "${CARGO_TOML_DIR:-$S}" > /dev/null || die # Respect user settings before cargo_gen_config is called. if [[ ! ${CARGO_TERM_COLOR} ]]; then -- 2.41.0