|
1 | 1 | #!/bin/bash
|
2 | 2 |
|
3 | 3 | export PLATFORMIO_ESP32_PATH="$HOME/.platformio/packages/framework-arduinoespressif32"
|
4 |
| -PLATFORMIO_ESP32_URL="https://github.com/platformio/platform-espressif32.git#feature/idf-master" |
| 4 | +PLATFORMIO_ESP32_URL="https://github.com/platformio/platform-espressif32.git#feature/arduino-idf-master" |
| 5 | + |
| 6 | +XTENSA32_TOOLCHAIN_VERSION="8.4.0+2021r1" |
| 7 | +XTENSA32S2_TOOLCHAIN_VERSION="8.4.0+2021r1" |
| 8 | +RISCV_TOOLCHAIN_VERSION="8.4.0+2021r1" |
| 9 | +ESPTOOLPY_VERSION="~1.30100.0" |
| 10 | +ESPRESSIF_ORGANIZATION_NAME="espressif" |
5 | 11 |
|
6 | 12 | echo "Installing Python Wheel ..."
|
7 | 13 | pip install wheel > /dev/null 2>&1
|
8 | 14 |
|
9 | 15 | echo "Installing PlatformIO ..."
|
10 |
| -pip install -U https://github.com/platformio/platformio/archive/develop.zip > /dev/null 2>&1 |
| 16 | +pip install -U https://github.com/platformio/platformio/archive/master.zip > /dev/null 2>&1 |
11 | 17 |
|
12 | 18 | echo "Installing Platform ESP32 ..."
|
13 |
| -python -m platformio platform install $PLATFORMIO_ESP32_URL > /dev/null 2>&1 |
14 |
| - |
15 |
| -echo "Replacing the framework version ..." |
16 |
| -python -c "import json; import os; fp=open(os.path.expanduser('~/.platformio/platforms/espressif32/platform.json'), 'r+'); data=json.load(fp); data['packages']['framework-arduinoespressif32']['version'] = '*'; fp.seek(0); fp.truncate(); json.dump(data, fp); fp.close()" |
| 19 | +python -m platformio platform install $PLATFORMIO_ESP32_URL > /dev/null 2>&1 |
| 20 | + |
| 21 | +echo "Replacing the package versions ..." |
| 22 | +replace_script="import json; import os;" |
| 23 | +replace_script+="fp=open(os.path.expanduser('~/.platformio/platforms/espressif32/platform.json'), 'r+');" |
| 24 | +replace_script+="data=json.load(fp);" |
| 25 | +# Use framework sources from the repository |
| 26 | +replace_script+="data['packages']['framework-arduinoespressif32']['version'] = '*';" |
| 27 | +replace_script+="del data['packages']['framework-arduinoespressif32']['owner'];" |
| 28 | +# Use toolchain packages from the "espressif" organization |
| 29 | +replace_script+="data['packages']['toolchain-xtensa-esp32']['owner']='$ESPRESSIF_ORGANIZATION_NAME';" |
| 30 | +replace_script+="data['packages']['toolchain-xtensa-esp32s2']['owner']='$ESPRESSIF_ORGANIZATION_NAME';" |
| 31 | +replace_script+="data['packages']['toolchain-riscv32-esp']['owner']='$ESPRESSIF_ORGANIZATION_NAME';" |
| 32 | +# Update versions to use the upstream |
| 33 | +replace_script+="data['packages']['toolchain-xtensa-esp32']['version']='$XTENSA32_TOOLCHAIN_VERSION';" |
| 34 | +replace_script+="data['packages']['toolchain-xtensa-esp32s2']['version']='$XTENSA32S2_TOOLCHAIN_VERSION';" |
| 35 | +replace_script+="data['packages']['toolchain-riscv32-esp']['version']='$RISCV_TOOLCHAIN_VERSION';" |
| 36 | +# esptool.py may require an upstream version (for now platformio is the owner) |
| 37 | +replace_script+="data['packages']['tool-esptoolpy']['version']='$ESPTOOLPY_VERSION';" |
| 38 | +# Save results |
| 39 | +replace_script+="fp.seek(0);fp.truncate();json.dump(data, fp, indent=2);fp.close()" |
| 40 | +python -c "$replace_script" |
17 | 41 |
|
18 | 42 | if [ "$GITHUB_REPOSITORY" == "espressif/arduino-esp32" ]; then
|
19 | 43 | echo "Linking Core..."
|
|
0 commit comments