From a9a9ca29a68b5c3cd870b6c86ecfe157fd542501 Mon Sep 17 00:00:00 2001 From: Mae PUGIN <48982737+mornepousse@users.noreply.github.com> Date: Fri, 14 Aug 2026 12:07:07 +0200 Subject: [PATCH] esp-idf: export ESP_IDF_VERSION from version.txt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Derived as major.minor, matching ESP-IDF's own tools/idf_tools.py, which matches '^v([0-9]+\.[0-9]+).*' against version.txt. Components such as esp_wifi_remote — the Wi-Fi path for the ESP32-P4 — compare against that two-part form, so emitting the patch level would not help them. Fixes #124. --- pkgs/esp-idf/setup-hook.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/esp-idf/setup-hook.sh b/pkgs/esp-idf/setup-hook.sh index 2c17272..e469cd6 100755 --- a/pkgs/esp-idf/setup-hook.sh +++ b/pkgs/esp-idf/setup-hook.sh @@ -7,6 +7,11 @@ addIdfEnvVars() { export IDF_TOOLS_PATH="$IDF_PATH/tools" export IDF_PYTHON_CHECK_CONSTRAINTS=no export IDF_PYTHON_ENV_PATH="$(readlink $IDF_PATH/python-env)" + # Same major.minor derivation as ESP-IDF's own tools/idf_tools.py, which + # matches '^v([0-9]+\.[0-9]+).*' against version.txt. Components such as + # esp_wifi_remote compare against that two-part form, so emitting the + # patch level here (5.5.2 instead of 5.5) would not help them. + export ESP_IDF_VERSION="$(sed -E 's/^v([0-9]+\.[0-9]+).*/\1/' "$1/version.txt")" addToSearchPath PATH "$IDF_TOOLS_PATH" # Extra paths from `export.sh` in the ESP-IDF repo.