Skip to content

check CARGO_HOME env var #850

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions Makefile.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
env_scripts = [
'''
env_scripts = ['''
#!@duckscript
crates = get_env CRATES
crates = array %{crates}
Expand Down Expand Up @@ -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",
] } }
19 changes: 11 additions & 8 deletions scripts/tool_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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