cc2538-bsl: 2.1-unstable-2025-01-14 -> 2.1-unstable-2025-03-28 (#428557)

Co-authored-by: lorenz <lorenz@brun.one>
This commit is contained in:
nixpkgs-merge-bot[bot] 2025-08-03 00:16:37 +00:00 committed by GitHub
commit 54b5c7b431
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 62 additions and 16 deletions

View File

@ -0,0 +1,22 @@
diff --git a/cc2538_bsl/cc2538_bsl.py b/cc2538_bsl/cc2538_bsl.py
index b62ea64..f38d872 100755
--- a/cc2538_bsl/cc2538_bsl.py
+++ b/cc2538_bsl/cc2538_bsl.py
@@ -1050,16 +1050,7 @@ def parse_page_address_range(device, pg_range):
def version():
- # Get the version using "git describe".
- try:
- p = Popen(['git', 'describe', '--tags', '--match', '[0-9]*'],
- stdout=PIPE, stderr=PIPE)
- p.stderr.close()
- line = p.stdout.readlines()[0]
- return line.decode('utf-8').strip()
- except:
- # We're not in a git repo, or git failed, use fixed version string.
- return __version__
+ return __version__
def cli_setup():

View File

@ -4,45 +4,69 @@
python3Packages,
}:
python3Packages.buildPythonApplication rec {
pname = "cc2538-bsl";
version = "2.1-unstable-2025-01-14";
pyproject = true;
let
pypkgs = python3Packages;
version = "2.1-unstable-2025-03-28";
src = fetchFromGitHub {
owner = "JelmerT";
repo = "cc2538-bsl";
rev = "bb6471103c2bddd319e5fda46fe4e872ce1de407";
hash = "sha256-iVdwwZozoFsHpLMiZq3i9wldfusAsCCZy6isKfvGqKo=";
rev = "250e8616e6cb00f1b23cb251154de984ce506f7b";
hash = "sha256-SNWHCSbaeO4s4W29Jly9bAEhFjfej9J9qn+mxxpoe30=";
};
env.SETUPTOOLS_SCM_PRETEND_VERSION = "0.1.dev0+g${lib.substring 0 7 src.rev}";
version' = "${lib.versions.majorMinor version}.dev0+g${lib.substring 0 7 src.rev}";
build-system = with python3Packages; [
in
pypkgs.buildPythonApplication rec {
pname = "cc2538-bsl";
inherit version src;
pyproject = true;
# if you happen to run cc2538-bsl from a git repository of any kind, you will get the
# version of *that* rather than the application itself because it will run 'git describe'
patches = [ ./do_not_run_git.patch ];
postPatch = ''
substituteInPlace cc2538_bsl/cc2538_bsl.py \
--replace-fail '__version__ = "2.1"' '__version__ = "${version'}"'
'';
env.SETUPTOOLS_SCM_PRETEND_VERSION = version';
build-system = with pypkgs; [
setuptools-scm
];
dependencies = with python3Packages; [
dependencies = with pypkgs; [
intelhex
pyserial
python-magic
];
nativeCheckInputs = with python3Packages; [
nativeCheckInputs = with pypkgs; [
pytestCheckHook
scripttest
];
postInstall = ''
# Remove .py from binary
mv $out/bin/cc2538-bsl.py $out/bin/cc2538-bsl
# we need to patch these tests to make them work inside our sandbox, so just disable them for
# now as we run this in `postInstallCheck`
disabledTests = [
"test_help_output"
"test_version"
];
# this is just to ensure that `meta.mainProgram` exists and is executable since we disable `test_help_output`
postInstallCheck = ''
$out/bin/${meta.mainProgram} --help
'';
meta = with lib; {
meta = {
homepage = "https://github.com/JelmerT/cc2538-bsl";
description = "Flash TI SimpleLink chips (CC2538, CC13xx, CC26xx) over serial";
license = licenses.bsd3;
maintainers = with maintainers; [ lorenz ];
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ lorenz ];
mainProgram = "cc2538-bsl";
};
}