4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
39 lines
1.1 KiB
Nix
39 lines
1.1 KiB
Nix
{ lib, stdenv, fetchFromGitHub, python3, openssl }:
|
|
|
|
python3.pkgs.buildPythonApplication rec {
|
|
pname = "esptool";
|
|
version = "3.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "espressif";
|
|
repo = "esptool";
|
|
rev = "v${version}";
|
|
sha256 = "1y022qlcdgdx5a88lkc3sqavklz494afbfyh100lp7xfk3f2mjln";
|
|
};
|
|
|
|
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
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "ESP8266 and ESP32 serial bootloader utility";
|
|
homepage = "https://github.com/espressif/esptool";
|
|
license = licenses.gpl2;
|
|
maintainers = with maintainers; [ dezgeg dotlambda ];
|
|
platforms = platforms.linux;
|
|
};
|
|
}
|