2022-12-02 08:20:57 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
2022-12-17 10:02:37 +00:00
|
|
|
, fetchpatch
|
2022-12-02 08:20:57 +00:00
|
|
|
, python3
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
python3.pkgs.buildPythonApplication rec {
|
|
|
|
pname = "esptool";
|
2022-12-02 08:20:57 +00:00
|
|
|
version = "4.4";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "espressif";
|
|
|
|
repo = "esptool";
|
|
|
|
rev = "v${version}";
|
2022-12-02 08:20:57 +00:00
|
|
|
hash = "sha256-haLwf3loOvqdqQN/iuVBciQ6nCnuc9AqqOGKvDwLBHE=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-12-02 08:20:57 +00:00
|
|
|
patches = [
|
|
|
|
./test-call-bin-directly.patch
|
2022-12-17 10:02:37 +00:00
|
|
|
(fetchpatch {
|
|
|
|
name = "bitstring-4-compatibility.patch";
|
|
|
|
url = "https://github.com/espressif/esptool/commit/ee27a6437576797d5f58c31e1c39f3a232a71df0.patch";
|
|
|
|
hash = "sha256-8/AzR3HK79eQQRSaGEKU4YKn/piPCPjm/G9pvizKuUE=";
|
|
|
|
})
|
2022-12-02 08:20:57 +00:00
|
|
|
];
|
2022-05-18 14:49:53 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = with python3.pkgs; [
|
|
|
|
bitstring
|
|
|
|
cryptography
|
|
|
|
ecdsa
|
|
|
|
pyserial
|
|
|
|
reedsolo
|
|
|
|
];
|
2020-12-25 13:55:36 +00:00
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
checkInputs = with python3.pkgs; [
|
|
|
|
pyelftools
|
2022-12-02 08:20:57 +00:00
|
|
|
pytest
|
2022-05-18 14:49:53 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
# tests mentioned in `.github/workflows/test_esptool.yml`
|
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
|
2022-12-02 08:20:57 +00:00
|
|
|
export ESPSECURE_PY=$out/bin/espsecure.py
|
2022-05-18 14:49:53 +00:00
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
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;
|
2022-06-16 17:23:12 +00:00
|
|
|
maintainers = with maintainers; [ dezgeg dotlambda ] ++ teams.lumiguide.members;
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|