python312Packages.spsdk: 2.2.1 -> 2.4.0 (#359513)

This commit is contained in:
Sandro 2024-11-28 21:48:05 +01:00 committed by GitHub
commit 43b7d77530
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 116 additions and 18 deletions

View File

@ -0,0 +1,64 @@
{
lib,
stdenv,
buildPythonPackage,
fetchPypi,
setuptools,
setuptools-scm,
autoPatchelfHook,
pytestCheckHook,
udev,
}:
buildPythonPackage rec {
pname = "libuuu";
version = "1.5.182";
pyproject = true;
src = fetchPypi {
inherit pname version;
hash = "sha256-k6JwGxYeFbGNl7zcuKN6SbRq8Z4yD1dXXL3ORyGqhYE=";
};
build-system = [
setuptools
setuptools-scm
];
nativeBuildInputs = lib.optionals stdenv.isLinux [
autoPatchelfHook
];
buildInputs = lib.optionals stdenv.isLinux [
udev
];
dependencies = [
setuptools-scm
];
pythonImportsCheck = [
"libuuu"
];
# Prevent tests to load the plugin from the source files instead of the installed ones
preCheck = ''
rm -rf libuuu
'';
nativeCheckInputs = [
pytestCheckHook
];
meta = {
description = "Python wraper for libuuu";
homepage = "https://github.com/nxp-imx/mfgtools/tree/master/wrapper";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ GaetanLepage ];
badPlatforms = [
# The pypi archive does not contain the pre-built library for these platforms
"aarch64-linux"
"x86_64-darwin"
];
};
}

View File

@ -2,6 +2,12 @@
lib,
buildPythonPackage,
fetchFromGitHub,
# build-system
setuptools,
setuptools-scm,
# dependencies
asn1crypto,
bincopy,
bitstring,
@ -13,8 +19,10 @@
cryptography,
deepmerge,
fastjsonschema,
filelock,
hexdump,
libusbsio,
libuuu,
oscrypto,
packaging,
platformdirs,
@ -23,30 +31,41 @@
pyserial,
requests,
ruamel-yaml,
setuptools-scm,
sly,
spsdk,
testers,
typing-extensions,
# tests
ipykernel,
pytest-notebook,
pytestCheckHook,
voluptuous,
versionCheckHook,
}:
buildPythonPackage rec {
pname = "spsdk";
version = "2.2.1";
version = "2.4.0";
pyproject = true;
src = fetchFromGitHub {
owner = "nxp-mcuxpresso";
repo = "spsdk";
rev = "refs/tags/${version}";
hash = "sha256-qFgG9jdF667EtMqXGGk/oxTEi+6J2s/3gKokP+JaFVw=";
rev = "refs/tags/v${version}";
hash = "sha256-WRR4YyA4HaYoyOZSt/RYivhH2E/20DKLXExWg2yOL48=";
};
build-system = [ setuptools-scm ];
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail "setuptools>=72.1,<74" "setuptools"
substituteInPlace setup.py \
--replace-fail "setuptools>=72.1,<74" "setuptools"
'';
build-system = [
setuptools
setuptools-scm
];
pythonRelaxDeps = [
"cryptography"
@ -55,9 +74,11 @@ buildPythonPackage rec {
"typing-extensions"
];
# Remove unneeded unfree package. pyocd-pemicro is only used when
# generating a pyinstaller package, which we don't do.
pythonRemoveDeps = [ "pyocd-pemicro" ];
pythonRemoveDeps = [
# Remove unneeded unfree package. pyocd-pemicro is only used when
# generating a pyinstaller package, which we don't do.
"pyocd-pemicro"
];
dependencies = [
asn1crypto
@ -71,8 +92,10 @@ buildPythonPackage rec {
cryptography
deepmerge
fastjsonschema
filelock
hexdump
libusbsio
libuuu
oscrypto
packaging
platformdirs
@ -85,23 +108,32 @@ buildPythonPackage rec {
typing-extensions
];
pythonImportsCheck = [ "spsdk" ];
preInstallCheck = ''
export HOME="$(mktemp -d)"
'';
nativeCheckInputs = [
ipykernel
pytest-notebook
pytestCheckHook
voluptuous
versionCheckHook
];
versionCheckProgramArg = [ "--version" ];
disabledTests = [
# Missing rotk private key
"test_general_notebooks"
];
pythonImportsCheck = [ "spsdk" ];
passthru.tests.version = testers.testVersion { package = spsdk; };
meta = with lib; {
changelog = "https://github.com/nxp-mcuxpresso/spsdk/blob/${src.rev}/docs/release_notes.rst";
meta = {
changelog = "https://github.com/nxp-mcuxpresso/spsdk/blob/v${version}/docs/release_notes.rst";
description = "NXP Secure Provisioning SDK";
homepage = "https://github.com/nxp-mcuxpresso/spsdk";
license = licenses.bsd3;
maintainers = with maintainers; [
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [
frogamic
sbruder
];

View File

@ -7362,6 +7362,8 @@ self: super: with self; {
inherit (pkgs) libusbsio;
};
libuuu = callPackage ../development/python-modules/libuuu { };
libversion = callPackage ../development/python-modules/libversion {
inherit (pkgs) libversion;
};