2022-07-26 10:41:34 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
2024-06-20 02:42:26 +00:00
|
|
|
fetchPypi,
|
2022-07-26 10:41:34 +00:00
|
|
|
libusbsio,
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "libusbsio";
|
2023-12-07 03:53:02 +00:00
|
|
|
format = "setuptools";
|
2024-06-20 02:42:26 +00:00
|
|
|
version = "2.1.12";
|
|
|
|
# If the versions come back into sync switch back to inheriting from c lib
|
|
|
|
# inherit (libusbsio) version;
|
2022-07-26 10:41:34 +00:00
|
|
|
|
2024-06-20 02:42:26 +00:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
|
|
|
hash = "sha256-RdUhwilBOwg19ay3Po3zsxqlBV9FTy3btJDbO4YEKS8=";
|
|
|
|
};
|
2022-07-26 10:41:34 +00:00
|
|
|
|
2024-06-20 02:42:26 +00:00
|
|
|
# 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
|
2022-07-26 10:41:34 +00:00
|
|
|
postPatch = ''
|
2024-06-20 02:42:26 +00:00
|
|
|
rm -rf libusbsio/bin
|
2022-07-26 10:41:34 +00:00
|
|
|
substituteInPlace libusbsio/libusbsio.py \
|
|
|
|
--replace "dllpath = LIBUSBSIO._lookup_dll_path(dfltdir, dllname)" 'dllpath = "${libusbsio}/lib/" + dllname'
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildInputs = [ libusbsio ];
|
|
|
|
|
|
|
|
doCheck = false; # they require a device to be connected over USB
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "libusbsio" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
2024-06-20 02:42:26 +00:00
|
|
|
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";
|
2022-07-26 10:41:34 +00:00
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [
|
|
|
|
frogamic
|
|
|
|
sbruder
|
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|