esphome: fix compilation for esp-idf framework devices (#451760)

This commit is contained in:
Martin Weinelt
2025-11-13 00:48:09 +00:00
committed by GitHub

View File

@@ -8,7 +8,6 @@
platformio, platformio,
esptool, esptool,
git, git,
inetutils,
versionCheckHook, versionCheckHook,
nixosTests, nixosTests,
}: }:
@@ -65,6 +64,10 @@ python.pkgs.buildPythonApplication rec {
pythonRemoveDeps = [ pythonRemoveDeps = [
"esptool" "esptool"
"platformio" "platformio"
# esp-idf v5.1 uses esp-idf-kconfig instead:
# https://github.com/espressif/esp-idf/blob/release/v5.1/tools/requirements/requirements.core.txt#L15
# Can be removed once this pr is released: https://github.com/esphome/esphome/pull/11210
"kconfiglib"
]; ];
postPatch = '' postPatch = ''
@@ -76,10 +79,6 @@ python.pkgs.buildPythonApplication rec {
# Remove esptool and platformio from requirements # Remove esptool and platformio from requirements
env.ESPHOME_USE_SUBPROCESS = ""; env.ESPHOME_USE_SUBPROCESS = "";
# esphome has optional dependencies it does not declare, they are
# loaded when certain config blocks are used.
# They have validation functions like:
# - validate_cryptography_installed for the wifi component
dependencies = with python.pkgs; [ dependencies = with python.pkgs; [
aioesphomeapi aioesphomeapi
argcomplete argcomplete
@@ -92,35 +91,30 @@ python.pkgs.buildPythonApplication rec {
freetype-py freetype-py
icmplib icmplib
jinja2 jinja2
kconfiglib
packaging
paho-mqtt paho-mqtt
pillow pillow
platformio platformio
protobuf
puremagic puremagic
pyparsing pyparsing
pyserial pyserial
pyyaml pyyaml
requests
ruamel-yaml ruamel-yaml
tornado tornado
tzdata tzdata
tzlocal tzlocal
voluptuous voluptuous
zeroconf
]; ];
makeWrapperArgs = [ makeWrapperArgs = [
# platformio is used in esphome/platformio_api.py # platformio is used in esphome/platformio_api.py
# esptool is used in esphome/__main__.py # esptool is used in esphome/__main__.py
# git is used in esphome/writer.py # git is used in esphome/git.py
# inetutils is used in esphome/dashboard/status/ping.py
"--prefix PATH : ${ "--prefix PATH : ${
lib.makeBinPath [ lib.makeBinPath [
platformio platformio
esptool esptool
git git
inetutils
] ]
}" }"
"--prefix PYTHONPATH : ${python.pkgs.makePythonPath dependencies}" # will show better error messages "--prefix PYTHONPATH : ${python.pkgs.makePythonPath dependencies}" # will show better error messages
@@ -134,7 +128,7 @@ python.pkgs.buildPythonApplication rec {
__darwinAllowLocalNetworking = true; __darwinAllowLocalNetworking = true;
nativeCheckInputs = nativeCheckInputs =
with python3Packages; with python.pkgs;
[ [
hypothesis hypothesis
mock mock
@@ -156,7 +150,7 @@ python.pkgs.buildPythonApplication rec {
postInstall = postInstall =
let let
argcomplete = lib.getExe' python3Packages.argcomplete "register-python-argcomplete"; argcomplete = lib.getExe' python.pkgs.argcomplete "register-python-argcomplete";
in in
'' ''
installShellCompletion --cmd esphome \ installShellCompletion --cmd esphome \
@@ -198,6 +192,7 @@ python.pkgs.buildPythonApplication rec {
]; ];
maintainers = with lib.maintainers; [ maintainers = with lib.maintainers; [
hexa hexa
thanegill
]; ];
mainProgram = "esphome"; mainProgram = "esphome";
}; };