2023-09-20 20:11:40 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
|
|
|
, python3Packages
|
|
|
|
}:
|
2023-04-11 21:23:40 +00:00
|
|
|
|
|
|
|
python3Packages.buildPythonPackage rec {
|
|
|
|
pname = "cc2538-bsl";
|
2023-12-03 00:06:15 +00:00
|
|
|
version = "2.1-unstable-2023-10-03";
|
2023-09-20 20:11:40 +00:00
|
|
|
format = "pyproject";
|
2023-04-11 21:23:40 +00:00
|
|
|
|
2023-07-18 18:18:43 +00:00
|
|
|
src = fetchFromGitHub {
|
2023-04-11 21:23:40 +00:00
|
|
|
owner = "JelmerT";
|
2023-09-20 20:11:40 +00:00
|
|
|
repo = "cc2538-bsl";
|
2023-12-03 00:06:15 +00:00
|
|
|
rev = "4d64ac633dbaf29d098842c5937ed6eea2fd7c45";
|
|
|
|
hash = "sha256-NX2jPYAz15bSucj/YR5E/0eJy/cbszSrNxyJHRsbXxo=";
|
2023-04-11 21:23:40 +00:00
|
|
|
};
|
|
|
|
|
2023-08-12 01:26:46 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
2023-09-20 20:11:40 +00:00
|
|
|
# fix extras specification in setup.py; https://github.com/JelmerT/cc2538-bsl/pull/143
|
|
|
|
url = "https://github.com/JelmerT/cc2538-bsl/commit/c70f58ec0222357db8020176711d6d45cf24da35.patch";
|
|
|
|
hash = "sha256-Rxm/TRcm87WgRfq60cu0loyrbJmZou09XYR7uhrhhj8=";
|
2023-08-12 01:26:46 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
env.SETUPTOOLS_SCM_PRETEND_VERSION = "0.1.dev0+g${lib.substring 0 7 src.rev}";
|
|
|
|
|
|
|
|
nativeBuildInputs = with python3Packages; [
|
|
|
|
setuptools-scm
|
|
|
|
];
|
2023-04-11 21:23:40 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = with python3Packages; [
|
|
|
|
intelhex
|
|
|
|
pyserial
|
|
|
|
python-magic
|
|
|
|
];
|
|
|
|
|
2023-08-12 01:26:46 +00:00
|
|
|
nativeCheckInputs = with python3Packages; [
|
|
|
|
pytestCheckHook
|
|
|
|
scripttest
|
|
|
|
];
|
2023-04-11 21:23:40 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
# Remove .py from binary
|
|
|
|
mv $out/bin/cc2538-bsl.py $out/bin/cc2538-bsl
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/JelmerT/cc2538-bsl";
|
|
|
|
description = "Flash TI SimpleLink chips (CC2538, CC13xx, CC26xx) over serial";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ lorenz ];
|
2023-11-27 01:17:53 +00:00
|
|
|
mainProgram = "cc2538-bsl";
|
2023-04-11 21:23:40 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|