From dcce54a0a765389288d66bdc518d76984c5cd0b4 Mon Sep 17 00:00:00 2001 From: Dominic Shelton Date: Thu, 20 Jun 2024 12:42:26 +1000 Subject: [PATCH] python3Packages.libusbsio 2.1.11 -> 2.1.12 Its version is no longer in sync with libusbsio --- .../python-modules/libusbsio/default.nix | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/pkgs/development/python-modules/libusbsio/default.nix b/pkgs/development/python-modules/libusbsio/default.nix index 7e60f9ab22897..4ebd50e349ece 100644 --- a/pkgs/development/python-modules/libusbsio/default.nix +++ b/pkgs/development/python-modules/libusbsio/default.nix @@ -1,25 +1,26 @@ { lib, buildPythonPackage, + fetchPypi, libusbsio, }: buildPythonPackage rec { pname = "libusbsio"; format = "setuptools"; - inherit (libusbsio) version; + version = "2.1.12"; + # If the versions come back into sync switch back to inheriting from c lib + # inherit (libusbsio) version; - src = "${libusbsio.src}/python"; - - # The source includes both the python module directly and also a source tarball for it. - # The direct files lack setup information, the tarball includes unwanted binaries. - # This takes only the setup files from the tarball. - postUnpack = '' - tar -C python --strip-components=1 -xf python/dist/libusbsio-${version}.tar.gz libusbsio-${version}/{setup.py,setup.cfg,pyproject.toml} - rm -r python/dist - ''; + src = fetchPypi { + inherit pname version; + hash = "sha256-RdUhwilBOwg19ay3Po3zsxqlBV9FTy3btJDbO4YEKS8="; + }; + # The source includes both the python module directly and also prebuilt binaries + # Delete the binaries and patch the wrapper to use binary from Nixpkgs instead postPatch = '' + rm -rf libusbsio/bin substituteInPlace libusbsio/libusbsio.py \ --replace "dllpath = LIBUSBSIO._lookup_dll_path(dfltdir, dllname)" 'dllpath = "${libusbsio}/lib/" + dllname' ''; @@ -31,8 +32,8 @@ buildPythonPackage rec { pythonImportsCheck = [ "libusbsio" ]; meta = with lib; { - description = "NXP Secure Provisioning SDK"; - homepage = "https://github.com/NXPmicro/spsdk"; + description = "LIBUSBSIO Host Library for USB Enabled MCUs"; + homepage = "https://www.nxp.com/design/design-center/software/development-software/libusbsio-host-library-for-usb-enabled-mcus:LIBUSBSIO"; license = licenses.bsd3; maintainers = with maintainers; [ frogamic