From 160574330c99ea75ae2020838531a85d19bd87b0 Mon Sep 17 00:00:00 2001 From: Nicolas Frandeboeuf Date: Thu, 6 Jul 2023 09:05:41 +0200 Subject: [PATCH] Try autodetect with ynh --- scripts/install | 10 +++++++++- scripts/upgrade | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 6856843..c95b6ee 100644 --- a/scripts/install +++ b/scripts/install @@ -134,7 +134,15 @@ ynh_exec_as $app virtualenv --python=python3 --system-site-packages "${final_pat source "${final_path}/venv/bin/activate" set -o nounset - ynh_exec_warn_less ynh_exec_as $app RUSTUP_HOME="$final_path"/.rustup CARGO_HOME="$final_path"/.cargo bash -c 'curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain stable-arm-unknown-linux-gnueabihf -q -y' + # Rustup has an issue with the autodetection of armfh + # see https://github.com/rust-lang/rustup/issues/3342 + rustup_toolchain="stable" + if [ $YNH_ARCH == "armfh" ]; + then + $rustup_toolchain="stable-arm-unknown-linux-gnueabihf" + fi + + ynh_exec_warn_less ynh_exec_as $app RUSTUP_HOME="$final_path"/.rustup CARGO_HOME="$final_path"/.cargo bash -c 'curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain '"$rustup_toolchain"' -q -y' export PATH="$final_path/.cargo/bin:$PATH" ynh_exec_warn_less ynh_exec_as $app env PATH=$PATH pip install --upgrade pip ynh_exec_warn_less ynh_exec_as $app env PATH=$PATH pip install --upgrade setuptools diff --git a/scripts/upgrade b/scripts/upgrade index 37961cc..6e2d3bd 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -165,7 +165,15 @@ ynh_exec_as $app virtualenv --python=python3 --system-site-packages "${final_pat source "${final_path}/venv/bin/activate" set -o nounset - ynh_exec_warn_less ynh_exec_as $app RUSTUP_HOME="$final_path"/.rustup CARGO_HOME="$final_path"/.cargo bash -c 'curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain stable-arm-unknown-linux-gnueabihf -q -y' + # Rustup has an issue with the autodetection of armfh + # see https://github.com/rust-lang/rustup/issues/3342 + rustup_toolchain="stable" + if [ $YNH_ARCH == "armfh" ]; + then + $rustup_toolchain="stable-arm-unknown-linux-gnueabihf" + fi + + ynh_exec_warn_less ynh_exec_as $app RUSTUP_HOME="$final_path"/.rustup CARGO_HOME="$final_path"/.cargo bash -c 'curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain '"$rustup_toolchain"' -q -y' export PATH="$final_path/.cargo/bin:$PATH" ynh_exec_warn_less ynh_exec_as $app env PATH=$PATH pip install --upgrade pip ynh_exec_warn_less ynh_exec_as $app env PATH=$PATH pip install --upgrade setuptools