2021-02-05 17:12:51 +00:00
|
|
|
{ lib, fetchFromGitHub, python3, openssl }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
python3.pkgs.buildPythonApplication rec {
|
|
|
|
pname = "esptool";
|
2021-07-21 07:28:18 +00:00
|
|
|
version = "3.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "espressif";
|
|
|
|
repo = "esptool";
|
|
|
|
rev = "v${version}";
|
2021-07-21 07:28:18 +00:00
|
|
|
sha256 = "sha256-GaGrV8L//pU4kt4HJmY88l5BNtT0IcZox7b24AFjPCI=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-12-25 13:55:36 +00:00
|
|
|
checkInputs = with python3.pkgs;
|
|
|
|
[ flake8 flake8-future-import flake8-import-order openssl ];
|
|
|
|
propagatedBuildInputs = with python3.pkgs;
|
|
|
|
[ pyserial pyaes ecdsa reedsolo bitstring cryptography ];
|
|
|
|
|
|
|
|
# wrapPythonPrograms will overwrite esptool.py with a bash script,
|
|
|
|
# but espefuse.py tries to import it. Since we don't add any binary paths,
|
|
|
|
# use patchPythonScript directly.
|
|
|
|
dontWrapPythonPrograms = true;
|
|
|
|
postFixup = ''
|
|
|
|
buildPythonPath "$out $pythonPath"
|
|
|
|
for f in $out/bin/*.py; do
|
|
|
|
echo "Patching $f"
|
|
|
|
patchPythonScript "$f"
|
|
|
|
done
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "ESP8266 and ESP32 serial bootloader utility";
|
|
|
|
homepage = "https://github.com/espressif/esptool";
|
2021-07-21 07:28:18 +00:00
|
|
|
license = licenses.gpl2Plus;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ dezgeg dotlambda ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|