rustc-independent musl detection, take 2

This commit is contained in:
Taiki Endo
2022-12-14 10:47:48 +09:00
parent 8bc4e50568
commit 83639e6b24

13
main.sh
View File

@@ -169,6 +169,15 @@ if [[ -n "${tool}" ]]; then
while read -rd,; do tools+=("${REPLY}"); done <<<"${tool}," while read -rd,; do tools+=("${REPLY}"); done <<<"${tool},"
fi fi
# Refs: https://github.com/rust-lang/rustup/blob/HEAD/rustup-init.sh
case "${OSTYPE}" in
linux*)
host_env="gnu"
if (ldd --version 2>&1 || true) | grep -q 'musl'; then
host_env="musl"
fi
;;
esac
exe="" exe=""
case "${OSTYPE}" in case "${OSTYPE}" in
cygwin* | msys*) exe=".exe" ;; cygwin* | msys*) exe=".exe" ;;
@@ -309,8 +318,8 @@ for tool in "${tools[@]}"; do
case "${OSTYPE}" in case "${OSTYPE}" in
linux*) linux*)
host_triple host_triple
case "${host}" in case "${host_env}" in
*-linux-gnu*) url="https://get.nexte.st/${version}/linux" ;; gnu) url="https://get.nexte.st/${version}/linux" ;;
*) url="https://get.nexte.st/${version}/linux-musl" ;; *) url="https://get.nexte.st/${version}/linux-musl" ;;
esac esac
;; ;;