2022-05-17 20:24:54 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, python3
|
2023-08-15 22:49:37 +00:00
|
|
|
, softhsm
|
2022-05-17 20:24:54 +00:00
|
|
|
}:
|
2017-05-23 23:44:38 +00:00
|
|
|
|
|
|
|
python3.pkgs.buildPythonApplication rec {
|
2018-07-17 23:16:57 +00:00
|
|
|
pname = "esptool";
|
2024-02-04 16:40:48 +00:00
|
|
|
version = "4.7.0";
|
2023-08-15 22:49:37 +00:00
|
|
|
|
|
|
|
format = "setuptools";
|
2017-05-23 23:44:38 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "espressif";
|
|
|
|
repo = "esptool";
|
|
|
|
rev = "v${version}";
|
2024-02-04 16:40:48 +00:00
|
|
|
hash = "sha256-yrEwCg0e+8jZorL6jcqeuKUCFoV0oP9HVFh1n/ezjPg=";
|
2017-05-23 23:44:38 +00:00
|
|
|
};
|
|
|
|
|
2023-08-15 22:49:37 +00:00
|
|
|
postPatch = ''
|
|
|
|
patchShebangs ci
|
|
|
|
|
|
|
|
substituteInPlace test/test_espsecure_hsm.py \
|
|
|
|
--replace "/usr/lib/softhsm" "${lib.getLib softhsm}/lib/softhsm"
|
|
|
|
'';
|
|
|
|
|
2022-05-12 08:41:03 +00:00
|
|
|
propagatedBuildInputs = with python3.pkgs; [
|
|
|
|
bitstring
|
|
|
|
cryptography
|
|
|
|
ecdsa
|
2024-02-04 16:40:48 +00:00
|
|
|
intelhex
|
2022-05-12 08:41:03 +00:00
|
|
|
pyserial
|
|
|
|
reedsolo
|
2023-08-15 22:49:37 +00:00
|
|
|
pyyaml
|
|
|
|
python-pkcs11
|
2022-05-12 08:41:03 +00:00
|
|
|
];
|
2020-11-12 15:24:42 +00:00
|
|
|
|
2023-01-21 12:00:00 +00:00
|
|
|
nativeCheckInputs = with python3.pkgs; [
|
2022-05-12 08:41:03 +00:00
|
|
|
pyelftools
|
2023-02-14 21:40:38 +00:00
|
|
|
pytestCheckHook
|
2023-08-15 22:49:37 +00:00
|
|
|
softhsm
|
2022-05-12 08:41:03 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
# tests mentioned in `.github/workflows/test_esptool.yml`
|
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
|
2023-08-15 22:49:37 +00:00
|
|
|
export SOFTHSM2_CONF=$(mktemp)
|
|
|
|
echo "directories.tokendir = $(mktemp -d)" > "$SOFTHSM2_CONF"
|
|
|
|
./ci/setup_softhsm2.sh
|
|
|
|
|
2023-02-14 21:40:38 +00:00
|
|
|
pytest test/test_imagegen.py
|
|
|
|
pytest test/test_espsecure.py
|
2023-08-15 22:49:37 +00:00
|
|
|
pytest test/test_espsecure_hsm.py
|
2023-02-14 21:40:38 +00:00
|
|
|
pytest test/test_merge_bin.py
|
|
|
|
pytest test/test_image_info.py
|
|
|
|
pytest test/test_modules.py
|
2022-05-12 08:41:03 +00:00
|
|
|
|
|
|
|
runHook postCheck
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2017-05-23 23:44:38 +00:00
|
|
|
description = "ESP8266 and ESP32 serial bootloader utility";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/espressif/esptool";
|
2021-07-09 17:20:34 +00:00
|
|
|
license = licenses.gpl2Plus;
|
2022-05-24 10:16:25 +00:00
|
|
|
maintainers = with maintainers; [ dezgeg dotlambda ] ++ teams.lumiguide.members;
|
2023-03-01 17:05:54 +00:00
|
|
|
platforms = with platforms; linux ++ darwin;
|
2023-05-22 17:47:32 +00:00
|
|
|
mainProgram = "esptool.py";
|
2017-05-23 23:44:38 +00:00
|
|
|
};
|
|
|
|
}
|