diff --git a/.gitignore b/.gitignore index 180c1a5cc0..1a46d1347a 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,9 @@ GPATH .submodule *.built *.completed + +/esp-idf* +/esp-quick-toolchain/ +/esp32/ +/rp2040/ +/samples/Basic_Serial/files/ diff --git a/Sming/Arch/Esp32/Tools/install.sh b/Sming/Arch/Esp32/Tools/install.sh index 0a872db39d..b563e0ccd3 100755 --- a/Sming/Arch/Esp32/Tools/install.sh +++ b/Sming/Arch/Esp32/Tools/install.sh @@ -31,6 +31,29 @@ case $DIST in darwin) ;; + *) + _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=() + ;; + esac $PKG_INSTALL "${PACKAGES[@]}" diff --git a/Tools/export.sh b/Tools/export.sh index 602bc4423a..f52b5449d7 100755 --- a/Tools/export.sh +++ b/Tools/export.sh @@ -24,7 +24,8 @@ if [ -z "$SMING_HOME" ]; then else _SOURCEDIR=$(dirname "${BASH_SOURCE[0]}") fi - SMING_HOME=$(realpath "$_SOURCEDIR/../Sming") + _SMIG_BASE=$(realpath "$_SOURCEDIR/..") + SMING_HOME=${_SMIG_BASE}"/Sming" export SMING_HOME echo "SMING_HOME: $SMING_HOME" fi @@ -33,14 +34,14 @@ fi export PYTHON=${PYTHON:=$(which python3)} # Esp8266 -export ESP_HOME=${ESP_HOME:=/opt/esp-quick-toolchain} +export ESP_HOME=${ESP_HOME:=${_SMIG_BASE}/esp-quick-toolchain} # Esp32 -export IDF_PATH=${IDF_PATH:=/opt/esp-idf} -export IDF_TOOLS_PATH=${IDF_TOOLS_PATH:=/opt/esp32} +export IDF_PATH=${IDF_PATH:=${_SMIG_BASE}/esp-idf} +export IDF_TOOLS_PATH=${IDF_TOOLS_PATH:=${_SMIG_BASE}/esp32} # Rp2040 -export PICO_TOOLCHAIN_PATH=${PICO_TOOLCHAIN_PATH:=/opt/rp2040} +export PICO_TOOLCHAIN_PATH=${PICO_TOOLCHAIN_PATH:=${_SMIG_BASE}/rp2040} # Provide non-apple CLANG (e.g. for rbpf library) if [ -n "$GITHUB_ACTIONS" ] && [ "$(uname)" = "Darwin" ]; then diff --git a/Tools/install.sh b/Tools/install.sh index 4b85fd5dd1..b52b618e7c 100755 --- a/Tools/install.sh +++ b/Tools/install.sh @@ -99,12 +99,34 @@ elif [ -n "$(command -v dnf)" ]; then DIST=fedora PKG_INSTALL="sudo dnf install -y" else + _OK=1 echo "Unsupported distribution" + _REQUIRED_TOOLS=( + ccache \ + cmake \ + curl \ + git \ + make \ + ninja \ + unzip \ + g++ \ + python3 \ + pip3 \ + wget \ + ) + for _TOOL in "${_REQUIRED_TOOLS[@]}"; do + if ! [ -x "$(command -v $_TOOL)" ]; then + _OK=0 + echo "Install required tool ${_TOOL}" + fi + done + if [ $_OK != 1 ]; then if [ $sourced = 1 ]; then return 1 else exit 1 fi + fi fi # Common install @@ -183,9 +205,11 @@ case $DIST in esac +if [ $(/usr/bin/python -c "import sys;print(sys.version_info[0])") != 3 ]; then if [ "$DIST" != "darwin" ]; then sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 100 fi +fi set -e