Unverified Commit 43b7d775 authored by Sandro Jäckel's avatar Sandro Jäckel Committed by GitHub
Browse files

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

parents edd47f7c 72632208
Loading
Loading
Loading
Loading
+64 −0
Original line number Diff line number Diff line
{
  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"
    ];
  };
}
+49 −17
Original line number Diff line number Diff line
@@ -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"
  ];

  pythonRemoveDeps = [
    # Remove unneeded unfree package. pyocd-pemicro is only used when
    # generating a pyinstaller package, which we don't do.
  pythonRemoveDeps = [ "pyocd-pemicro" ];
    "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" ];

  pythonImportsCheck = [ "spsdk" ];

  passthru.tests.version = testers.testVersion { package = spsdk; };
  disabledTests = [
    # Missing rotk private key
    "test_general_notebooks"
  ];

  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
    ];
+2 −0
Original line number Diff line number Diff line
@@ -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;
  };