{ lib , fetchFromGitHub , python3 }: python3.pkgs.buildPythonApplication rec { pname = "esptool"; version = "4.5.1"; src = fetchFromGitHub { owner = "espressif"; repo = "esptool"; rev = "v${version}"; hash = "sha256-FKFw7czXzC8F3OXjlLoJEFaqsSgqWz0ZEqd7KjCy5Ik="; }; propagatedBuildInputs = with python3.pkgs; [ bitstring cryptography ecdsa pyserial reedsolo ]; nativeCheckInputs = with python3.pkgs; [ pyelftools pytestCheckHook ]; # tests mentioned in `.github/workflows/test_esptool.yml` checkPhase = '' runHook preCheck pytest test/test_imagegen.py pytest test/test_espsecure.py pytest test/test_merge_bin.py pytest test/test_image_info.py pytest test/test_modules.py runHook postCheck ''; meta = with lib; { description = "ESP8266 and ESP32 serial bootloader utility"; homepage = "https://github.com/espressif/esptool"; license = licenses.gpl2Plus; maintainers = with maintainers; [ dezgeg dotlambda ] ++ teams.lumiguide.members; platforms = with platforms; linux ++ darwin; mainProgram = "esptool.py"; }; }