Files
nixpkgs/pkgs/development/python-modules/hidapi/default.nix
Robin Krahl 43b7e27aaa python3Packages.hidapi: Remove libusb dependency
Since version v0.14.0.post2, hidapi defaults to the hidraw backend so
libusb is no longer required.

See also: https://github.com/NixOS/nixpkgs/pull/329704
2024-11-08 16:58:14 +01:00

52 lines
1.1 KiB
Nix

{
lib,
stdenv,
buildPythonPackage,
fetchPypi,
xcbuild,
cython_0,
udev,
darwin,
}:
buildPythonPackage rec {
pname = "hidapi";
version = "0.14.0.post2";
format = "setuptools";
src = fetchPypi {
inherit pname version;
sha256 = "sha256-bA6XumsFmjCdUbSVqPDV77zqh1a2QNmLb2u5/e8kWKw=";
};
nativeBuildInputs = [ cython_0 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ xcbuild ];
propagatedBuildInputs =
lib.optionals stdenv.hostPlatform.isLinux [ udev ]
++ lib.optionals stdenv.hostPlatform.isDarwin (
with darwin.apple_sdk.frameworks;
[
AppKit
CoreFoundation
IOKit
]
);
pythonImportsCheck = [ "hid" ];
meta = with lib; {
description = "Cython interface to the hidapi from https://github.com/libusb/hidapi";
homepage = "https://github.com/trezor/cython-hidapi";
# license can actually be either bsd3 or gpl3
# see https://github.com/trezor/cython-hidapi/blob/master/LICENSE-orig.txt
license = with licenses; [
bsd3
gpl3Only
];
maintainers = with maintainers; [
np
prusnak
];
};
}