snagboot: init at 1.0

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
This commit is contained in:
Otavio Salvador 2023-05-24 14:14:55 -03:00 committed by Anderson Torres
parent 281deb5e89
commit 4c1fb21f84
2 changed files with 78 additions and 0 deletions

View file

@ -0,0 +1,76 @@
{ lib
, stdenv
, fetchPypi
, pythonRelaxDepsHook
, python3
, snagboot
, testers
, gitUpdater
}:
python3.pkgs.buildPythonApplication rec {
pname = "snagboot";
version = "1.0";
format = "pyproject";
src = fetchPypi {
inherit pname version;
hash = "sha256-wtIcrd3s/ZfdYqi2a2+IvVYnJie5txJy6d2m+GjuhxU=";
};
passthru = {
updateScript = gitUpdater {
rev-prefix = "v";
ignoredVersions = ".(rc|beta).*";
};
tests.version = testers.testVersion {
package = snagboot;
command = "snagrecover --version";
version = "v${version}";
};
};
nativeBuildInputs = [
pythonRelaxDepsHook
];
pythonRemoveDeps = [
"pylibfdt"
"swig"
];
propagatedBuildInputs = with python3.pkgs; [
setuptools
pyusb
pyserial
hid
crccheck
six
xmodem
pyyaml
libfdt
tftpy
];
postInstall = lib.optionalString stdenv.isLinux ''
rules="src/snagrecover/80-snagboot.rules"
if [ ! -f "$rules" ]; then
echo "$rules is missing, must update the Nix file."
exit 1
fi
mkdir -p "$out/lib/udev/rules.d"
cp "$rules" "$out/lib/udev/rules.d/80-snagboot.rules"
'';
# There are no tests
doCheck = false;
meta = {
homepage = "https://github.com/bootlin/snagboot";
description = "Generic recovery and reflashing tool for embedded platforms";
license = lib.licenses.gpl2;
maintainers = with lib.maintainers; [ otavio ];
};
}

View file

@ -1705,6 +1705,8 @@ with pkgs;
shell-genie = callPackage ../applications/misc/shell-genie { };
snagboot = python3.pkgs.callPackage ../applications/misc/snagboot { };
simple-dlna-browser = callPackage ../tools/networking/simple-dlna-browser { };
sorted-grep = callPackage ../tools/text/sorted-grep { };