summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMike Gilbert <floppym@gentoo.org>2024-11-12 20:33:50 -0500
committerMatt Jolly <kangie@gentoo.org>2024-11-13 16:14:01 +1000
commitf8b206fd6688628bd9bbb2f2c5e3d3eb627d76dc (patch)
treecd85fb091c2fd5d76ed9c6b69ee8afe9a60f6028 /eclass
parentapp-crypt/loop-aes-losetup: use HTTPS again (diff)
downloadgentoo-f8b206fd6688628bd9bbb2f2c5e3d3eb627d76dc.tar.gz
gentoo-f8b206fd6688628bd9bbb2f2c5e3d3eb627d76dc.tar.bz2
gentoo-f8b206fd6688628bd9bbb2f2c5e3d3eb627d76dc.zip
rust.eclass: cross compile fixes
Change _get_rust_slot to default to -b/BROOT. Reuse _get_rust_slot result in pkg_setup. Pass along arguments from get_rust_prefix to _get_rust_slot. Signed-off-by: Mike Gilbert <floppym@gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/39298 Signed-off-by: Matt Jolly <kangie@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r--eclass/rust.eclass12
1 files changed, 6 insertions, 6 deletions
diff --git a/eclass/rust.eclass b/eclass/rust.eclass
index 3a8a93718787..f293e96d7ce8 100644
--- a/eclass/rust.eclass
+++ b/eclass/rust.eclass
@@ -259,10 +259,10 @@ unset -f _rust_set_globals
# and print its version number (i.e. SLOT) and type (source or bin[ary]).
#
# If -b is specified, the checks are performed relative to BROOT,
-# and BROOT-path is returned.
+# and BROOT-path is returned. -b is the default.
#
# If -d is specified, the checks are performed relative to ESYSROOT,
-# and ESYSROOT-path is returned. -d is the default.
+# and ESYSROOT-path is returned.
#
# If RUST_M{AX,IN}_SLOT is non-zero, then only Rust versions that
# are not newer or older than the specified slot(s) will be considered.
@@ -278,7 +278,7 @@ unset -f _rust_set_globals
_get_rust_slot() {
debug-print-function ${FUNCNAME} "$@"
- local hv_switch=-d
+ local hv_switch=-b
while [[ ${1} == -* ]]; do
case ${1} in
-b|-d) hv_switch="${1}";;
@@ -412,7 +412,7 @@ get_rust_prefix() {
[[ ${1} == -d ]] && prefix=${ESYSROOT}
local slot rust_type
- read -r slot rust_type <<< $(_get_rust_slot)
+ read -r slot rust_type <<< $(_get_rust_slot "$@")
get_rust_path "${prefix}" "${slot}" "${rust_type}"
}
@@ -451,9 +451,9 @@ rust_pkg_setup() {
debug-print-function ${FUNCNAME} "$@"
if [[ ${MERGE_TYPE} != binary ]]; then
- read -r RUST_SLOT RUST_TYPE <<< $(_get_rust_slot)
+ read -r RUST_SLOT RUST_TYPE <<< $(_get_rust_slot -b)
rust_prepend_path "${RUST_SLOT}" "${RUST_TYPE}"
- local prefix=$(get_rust_prefix)
+ local prefix=$(get_rust_path "${BROOT}" "${RUST_SLOT}" "${RUST_TYPE}")
CARGO="${prefix}bin/cargo"
RUSTC="${prefix}bin/rustc"
export CARGO RUSTC