From 70030a7ff3d5f46a57b52ac223f0aea23543072f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Thu, 12 May 2022 08:41:03 +0000 Subject: [PATCH] esptool: 3.3 -> 3.3.1 https://github.com/espressif/esptool/releases/tag/v3.3.1 --- pkgs/tools/misc/esptool/default.nix | 37 ++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/pkgs/tools/misc/esptool/default.nix b/pkgs/tools/misc/esptool/default.nix index e1ec37063de..b4439363d4a 100644 --- a/pkgs/tools/misc/esptool/default.nix +++ b/pkgs/tools/misc/esptool/default.nix @@ -2,19 +2,27 @@ python3.pkgs.buildPythonApplication rec { pname = "esptool"; - version = "3.3"; + version = "3.3.1"; src = fetchFromGitHub { owner = "espressif"; repo = "esptool"; rev = "v${version}"; - sha256 = "sha256-CmGie+M3AboOk8X+LkRhIxTRQZgDlklouzmz8kiIZuI="; + hash = "sha256-9WmiLji7Zoad5WIzgkpvkI9t96sfdkCtFh6zqVxF7qo="; }; - checkInputs = with python3.pkgs; - [ flake8 flake8-future-import flake8-import-order openssl ]; - propagatedBuildInputs = with python3.pkgs; - [ pyserial pyaes ecdsa reedsolo bitstring cryptography ]; + postPatch = '' + substituteInPlace test/test_imagegen.py \ + --replace "sys.executable, ESPTOOL_PY" "ESPTOOL_PY" + ''; + + propagatedBuildInputs = with python3.pkgs; [ + bitstring + cryptography + ecdsa + pyserial + reedsolo + ]; # wrapPythonPrograms will overwrite esptool.py with a bash script, # but espefuse.py tries to import it. Since we don't add any binary paths, @@ -28,6 +36,23 @@ python3.pkgs.buildPythonApplication rec { done ''; + checkInputs = with python3.pkgs; [ + pyelftools + ]; + + # tests mentioned in `.github/workflows/test_esptool.yml` + checkPhase = '' + runHook preCheck + + export ESPTOOL_PY=$out/bin/esptool.py + ${python3.interpreter} test/test_imagegen.py + ${python3.interpreter} test/test_espsecure.py + ${python3.interpreter} test/test_merge_bin.py + ${python3.interpreter} test/test_modules.py + + runHook postCheck + ''; + meta = with lib; { description = "ESP8266 and ESP32 serial bootloader utility"; homepage = "https://github.com/espressif/esptool";