Skip to content

Commit

Permalink
Reverted changes regarding tool installation paths
Browse files Browse the repository at this point in the history
Implemented comments regarding shell variable names

I will handle tool installatin paths via direnv.

My .envrc is simple:

  layout Sming

With Sming extracte in my home directory my
`~/.config/direnv/direnvrc` then contains:

  layout_Sming() {

      _SMIG_BASE=${HOME}/Sming
      _SMIG_TOOLS=${_SMIG_BASE}/.tools
      export ESP_HOME=${_SMIG_TOOLS}/esp-quick-toolchain
      export IDF_PATH=${_SMIG_TOOLS}/esp-idf
      export IDF_TOOLS_PATH=${_SMIG_TOOLS}/esp32
      export PICO_TOOLCHAIN_PATH=${_SMIG_TOOLS}/rp2040

      . ${_SMIG_BASE}/Tools/export.sh
  }
  • Loading branch information
berhoel committed Sep 23, 2024
1 parent 7aae7e1 commit 772f25a
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 39 deletions.
6 changes: 0 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,3 @@ GPATH
.submodule
*.built
*.completed

/esp-idf*
/esp-quick-toolchain/
/esp32/
/rp2040/
/samples/Basic_Serial/files/
40 changes: 20 additions & 20 deletions Sming/Arch/Esp32/Tools/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,26 +32,26 @@ case $DIST in
;;

*)
_OK=1
_COMMANDS=(dfu-util bison flex gperf)
for _COMMAND in "${_COMMANDS[@]}"; do
if ! [ -x $(command -v "${_COMMAND}") ]; then
_OK=0
echo "Install programm ${_COMMAND}"
fi
done
_INCLUDES=("/usr/include/ffi.h" "/usr/include/ssl/ssl.h")
for _INCLUDE in "${_INCLUDES[@]}"; do
if ! [ -f "${_INCLUDE}" ]; then
_OK=0
echo "Install development package providing ${_INCLUDE}"
fi
done
if [ $_OK != 1 ]; then
echo "ABORTING"
exit 1
fi
PACKAGES=()
TOOLS_MISSING=0
COMMANDS=(dfu-util bison flex gperf)
for COMMAND in "${COMMANDS[@]}"; do
if ! [ -x $(command -v "${COMMAND}") ]; then
TOOLS_MISSING=1
echo "Install programm ${COMMAND}"
fi
done
INCLUDES=("/usr/include/ffi.h" "/usr/include/ssl/ssl.h")
for INCLUDE in "${INCLUDES[@]}"; do
if ! [ -f "${INCLUDE}" ]; then
TOOLS_MISSING=1
echo "Install development package providing ${INCLUDE}"
fi
done
if [ $TOOLS_MISSING != 0 ]; then
echo "ABORTING"
exit 1
fi
PACKAGES=()
;;

esac
Expand Down
11 changes: 5 additions & 6 deletions Tools/export.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ if [ -z "$SMING_HOME" ]; then
else
_SOURCEDIR=$(dirname "${BASH_SOURCE[0]}")
fi
_SMIG_BASE=$(realpath "$_SOURCEDIR/..")
SMING_HOME=${_SMIG_BASE}"/Sming"
SMING_HOME=$(realpath "$_SOURCEDIR/../Sming")
export SMING_HOME
echo "SMING_HOME: $SMING_HOME"
fi
Expand All @@ -34,14 +33,14 @@ fi
export PYTHON=${PYTHON:=$(which python3)}

# Esp8266
export ESP_HOME=${ESP_HOME:=${_SMIG_BASE}/esp-quick-toolchain}
export ESP_HOME=${ESP_HOME:=/opt/esp-quick-toolchain}

# Esp32
export IDF_PATH=${IDF_PATH:=${_SMIG_BASE}/esp-idf}
export IDF_TOOLS_PATH=${IDF_TOOLS_PATH:=${_SMIG_BASE}/esp32}
export IDF_PATH=${IDF_PATH:=/opt/esp-idf}
export IDF_TOOLS_PATH=${IDF_TOOLS_PATH:=/opt/esp32}

# Rp2040
export PICO_TOOLCHAIN_PATH=${PICO_TOOLCHAIN_PATH:=${_SMIG_BASE}/rp2040}
export PICO_TOOLCHAIN_PATH=${PICO_TOOLCHAIN_PATH:=/opt/rp2040}

# Provide non-apple CLANG (e.g. for rbpf library)
if [ -n "$GITHUB_ACTIONS" ] && [ "$(uname)" = "Darwin" ]; then
Expand Down
14 changes: 7 additions & 7 deletions Tools/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ elif [ -n "$(command -v dnf)" ]; then
DIST=fedora
PKG_INSTALL="sudo dnf install -y"
else
_OK=1
TOOLS_MISSING=0
echo "Unsupported distribution"
_REQUIRED_TOOLS=(
REQUIRED_TOOLS=(
ccache \
cmake \
curl \
Expand All @@ -114,13 +114,13 @@ else
pip3 \
wget \
)
for _TOOL in "${_REQUIRED_TOOLS[@]}"; do
if ! [ -x $(command -v "${_TOOL}") ]; then
_OK=0
echo "Install required tool ${_TOOL}"
for TOOL in "${REQUIRED_TOOLS[@]}"; do
if ! [ -x $(command -v "${TOOL}") ]; then
TOOLS_MISSING=1
echo "Install required tool ${TOOL}"
fi
done
if [ $_OK != 1 ]; then
if [ $TOOLS_MISSING != 0 ]; then
if [ $sourced = 1 ]; then
return 1
else
Expand Down
1 change: 1 addition & 0 deletions samples/Basic_Serial/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/files/

0 comments on commit 772f25a

Please sign in to comment.