Loading
+20 −20
Original line number Diff line number Diff line
@@ -7,14 +7,14 @@

python3Packages.buildPythonApplication rec {
  pname = "esptool";
  version = "4.9.0";
  version = "5.0.2";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "espressif";
    repo = "esptool";
    tag = "v${version}";
    hash = "sha256-iIFjInqiqjeqiDYL7BU3vT99pCVnu8OhU7u9uKwe/SI=";
    hash = "sha256-oRvtEBp88tmgjjIuoQS5ySm4I0aD/Zs8VLRUZo0sh/I=";
  };

  postPatch = ''
@@ -29,14 +29,14 @@ python3Packages.buildPythonApplication rec {
  ];

  dependencies = with python3Packages; [
    argcomplete
    bitstring
    click
    cryptography
    ecdsa
    intelhex
    pyserial
    reedsolo
    pyyaml
    reedsolo
    rich-click
  ];

  optional-dependencies = with python3Packages; {
@@ -48,39 +48,39 @@ python3Packages.buildPythonApplication rec {
    [
      pyelftools
      pytestCheckHook
      requests
      softhsm
    ]
    ++ lib.flatten (lib.attrValues optional-dependencies);

  # tests mentioned in `.github/workflows/test_esptool.yml`
  checkPhase = ''
    runHook preCheck
  preCheck = ''
    export PATH="$out/bin:$PATH"
  '';

  pytestFlags = [
    "-m"
    "host_test"
  ];

  postCheck = ''
    export SOFTHSM2_CONF=$(mktemp)
    echo "directories.tokendir = $(mktemp -d)" > "$SOFTHSM2_CONF"
    ./ci/setup_softhsm2.sh

    pytest test/test_imagegen.py
    pytest test/test_espsecure.py
    pytest test/test_espsecure_hsm.py
    pytest test/test_merge_bin.py
    pytest test/test_image_info.py
    pytest test/test_modules.py

    runHook postCheck
  '';

  meta = with lib; {
  meta = {
    changelog = "https://github.com/espressif/esptool/blob/${src.tag}/CHANGELOG.md";
    description = "ESP8266 and ESP32 serial bootloader utility";
    homepage = "https://github.com/espressif/esptool";
    license = licenses.gpl2Plus;
    maintainers = with maintainers; [
    license = lib.licenses.gpl2Plus;
    maintainers = with lib.maintainers; [
      dezgeg
      dotlambda
    ];
    teams = [ lib.teams.lumiguide ];
    platforms = with platforms; linux ++ darwin;
    mainProgram = "esptool.py";
    platforms = with lib.platforms; linux ++ darwin;
    mainProgram = "esptool";
  };
}