diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b23c7d7b..d100d49c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,8 +5,10 @@ * Replace `makehtml.py` with `svd2html` * Updated to svd2rust 0.28.0, svdtools 0.3.0, use tools binaries for CI * files in devices/common_patches moved to subdirectories +* check `CARGO_HOME` env var before put binary into default place (#850) * remove excutable file perm bit from yaml file ([#854]) +[#850]: https://github.com/stm32-rs/stm32-rs/pull/850 [#854]: https://github.com/stm32-rs/stm32-rs/pull/854 ## [v0.15.1] 2022-07-04 diff --git a/Makefile.toml b/Makefile.toml index c1d1a9b70..916445c6f 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -1,5 +1,4 @@ -env_scripts = [ -''' +env_scripts = [''' #!@duckscript crates = get_env CRATES crates = array %{crates} @@ -318,4 +317,6 @@ script = "rm -r .deps" [env] PYTHON = { value = "python3", condition = { env_not_set = ["PYTHON"] } } SVDTOOLS = { value = "svdtools", condition = { env_not_set = ["SVDTOOLS"] } } -CRATES = { value = "stm32c0 stm32f0 stm32f1 stm32f2 stm32f3 stm32f4 stm32f7 stm32h5 stm32h7 stm32l0 stm32l1 stm32l4 stm32l5 stm32g0 stm32g4 stm32mp1 stm32wl stm32wb stm32u5", condition = { env_not_set = ["CRATES"] } } +CRATES = { value = "stm32c0 stm32f0 stm32f1 stm32f2 stm32f3 stm32f4 stm32f7 stm32h5 stm32h7 stm32l0 stm32l1 stm32l4 stm32l5 stm32g0 stm32g4 stm32mp1 stm32wl stm32wb stm32u5", condition = { env_not_set = [ + "CRATES", +] } } diff --git a/scripts/tool_install.sh b/scripts/tool_install.sh index 1351cd28a..5b04325a2 100755 --- a/scripts/tool_install.sh +++ b/scripts/tool_install.sh @@ -29,26 +29,29 @@ case "${1:-}" in ;; esac +# check CARGO_HOME env var +CARGO_BIN_DIR="${CARGO_HOME:-${HOME}/.cargo}/bin" + if [ "${form:-}" ]; then echo "form = ${form}" - curl -sSfL https://github.com/djmcgill/form/releases/download/$form/form-x86_64-unknown-linux-gnu.gz | gzip -d - > ~/.cargo/bin/form - chmod +x ~/.cargo/bin/form + curl -sSfL https://github.com/djmcgill/form/releases/download/$form/form-x86_64-unknown-linux-gnu.gz | gzip -d - > "${CARGO_BIN_DIR}/form" + chmod +x "${CARGO_BIN_DIR}/form" fi if [ "${svdtools:-}" ]; then echo "svdtools = ${svdtools}" - curl -sSfL https://github.com/stm32-rs/svdtools/releases/download/$svdtools/svdtools-x86_64-unknown-linux-gnu.gz | gzip -d - > ~/.cargo/bin/svdtools - chmod +x ~/.cargo/bin/svdtools + curl -sSfL https://github.com/stm32-rs/svdtools/releases/download/$svdtools/svdtools-x86_64-unknown-linux-gnu.gz | gzip -d - > "${CARGO_BIN_DIR}/svdtools" + chmod +x "${CARGO_BIN_DIR}/svdtools" fi if [ "${svd2rust:-}" ]; then echo "svd2rust = ${svd2rust}" - curl -sSfL https://github.com/rust-embedded/svd2rust/releases/download/$svd2rust/svd2rust-x86_64-unknown-linux-gnu.gz | gzip -d - > ~/.cargo/bin/svd2rust - chmod +x ~/.cargo/bin/svd2rust + curl -sSfL https://github.com/rust-embedded/svd2rust/releases/download/$svd2rust/svd2rust-x86_64-unknown-linux-gnu.gz | gzip -d - > "${CARGO_BIN_DIR}/svd2rust" + chmod +x "${CARGO_BIN_DIR}/svd2rust" fi if [ "${svd2html:-}" ]; then echo "svd2html = ${svd2html}" - curl -sSfL https://github.com/burrbull/svd2html/releases/download/$svd2html/svd2html-x86_64-unknown-linux-gnu.gz | gzip -d - > ~/.cargo/bin/svd2html - chmod +x ~/.cargo/bin/svd2html + curl -sSfL https://github.com/burrbull/svd2html/releases/download/$svd2html/svd2html-x86_64-unknown-linux-gnu.gz | gzip -d - > "${CARGO_BIN_DIR}/svd2html" + chmod +x "${CARGO_BIN_DIR}/svd2html" fi