2020-07-02 09:01:17 +01:00
|
|
|
{ lib, python3, platformio, esptool, git, protobuf3_11, fetchpatch }:
|
2019-04-05 09:34:33 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
python = python3.override {
|
|
|
|
packageOverrides = self: super: {
|
2020-01-12 18:07:57 +00:00
|
|
|
protobuf = super.protobuf.override {
|
2020-07-02 09:01:17 +01:00
|
|
|
protobuf = protobuf3_11;
|
2020-01-12 18:07:57 +00:00
|
|
|
};
|
2019-04-05 09:34:33 +01:00
|
|
|
};
|
|
|
|
};
|
2019-01-10 18:38:38 +00:00
|
|
|
|
2019-04-05 09:34:33 +01:00
|
|
|
in python.pkgs.buildPythonApplication rec {
|
2019-01-18 15:13:58 +00:00
|
|
|
pname = "esphome";
|
2020-06-30 06:07:06 +01:00
|
|
|
version = "1.14.5";
|
2019-01-10 18:38:38 +00:00
|
|
|
|
2019-04-05 09:34:33 +01:00
|
|
|
src = python.pkgs.fetchPypi {
|
2019-01-10 18:38:38 +00:00
|
|
|
inherit pname version;
|
2020-06-30 06:07:06 +01:00
|
|
|
sha256 = "176mi361677d5cqbi0hn52kky845byjs6gdad8pdhihyjgv7a9y9";
|
2019-01-10 18:38:38 +00:00
|
|
|
};
|
|
|
|
|
2019-01-18 15:13:58 +00:00
|
|
|
ESPHOME_USE_SUBPROCESS = "";
|
2019-01-10 18:38:38 +00:00
|
|
|
|
2019-04-05 09:34:33 +01:00
|
|
|
propagatedBuildInputs = with python.pkgs; [
|
2019-01-10 18:38:38 +00:00
|
|
|
voluptuous pyyaml paho-mqtt colorlog
|
2019-01-18 15:13:58 +00:00
|
|
|
tornado protobuf tzlocal pyserial ifaddr
|
2020-07-02 15:35:02 +01:00
|
|
|
protobuf click
|
2019-01-18 15:13:58 +00:00
|
|
|
];
|
|
|
|
|
2020-04-09 19:00:22 +01:00
|
|
|
# remove all version pinning (E.g tornado==5.1.1 -> tornado)
|
2019-11-02 21:47:53 +00:00
|
|
|
postPatch = ''
|
2020-04-09 19:00:22 +01:00
|
|
|
sed -i -e "s/==[0-9.]*//" setup.py
|
2019-11-02 21:47:53 +00:00
|
|
|
'';
|
|
|
|
|
2019-01-18 15:13:58 +00:00
|
|
|
makeWrapperArgs = [
|
|
|
|
# platformio is used in esphomeyaml/platformio_api.py
|
|
|
|
# esptool is used in esphomeyaml/__main__.py
|
|
|
|
# git is used in esphomeyaml/writer.py
|
|
|
|
"--prefix PATH : ${lib.makeBinPath [ platformio esptool git ]}"
|
|
|
|
"--set ESPHOME_USE_SUBPROCESS ''"
|
2019-01-10 18:38:38 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
# Platformio will try to access the network
|
2020-04-09 19:00:22 +01:00
|
|
|
# Instead, run the executable
|
|
|
|
checkPhase = ''
|
|
|
|
$out/bin/esphome --help > /dev/null
|
|
|
|
'';
|
2019-01-10 18:38:38 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Make creating custom firmwares for ESP32/ESP8266 super easy";
|
2020-04-09 19:00:22 +01:00
|
|
|
homepage = "https://esphome.io/";
|
2019-01-10 18:38:38 +00:00
|
|
|
license = licenses.mit;
|
2019-08-20 18:36:05 +01:00
|
|
|
maintainers = with maintainers; [ dotlambda globin ];
|
2019-01-10 18:38:38 +00:00
|
|
|
};
|
|
|
|
}
|