mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-03-14 21:16:37 +01:00
This commit was created by a combination of scripts and tools: - an ast-grep script to prefix things in meta with `lib.`, - a modified nixf-diagnose / nixf combination to remove unused `with lib;`, and - regular nixfmt. Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
59 lines
1.2 KiB
Nix
59 lines
1.2 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
buildPythonPackage,
|
|
fetchPypi,
|
|
pkg-config,
|
|
xcbuild,
|
|
cython,
|
|
setuptools,
|
|
hidapi,
|
|
libusb1,
|
|
udev,
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "hidapi";
|
|
version = "0.15.0";
|
|
pyproject = true;
|
|
|
|
src = fetchPypi {
|
|
inherit pname version;
|
|
hash = "sha256-7LwmXL6Le4h1X0IeC6JfCECR7FUMK5D/no3dT81UAxE=";
|
|
};
|
|
|
|
build-system = [
|
|
cython
|
|
setuptools
|
|
];
|
|
|
|
nativeBuildInputs = [ pkg-config ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ xcbuild ];
|
|
|
|
buildInputs = lib.optionals stdenv.hostPlatform.isLinux [
|
|
hidapi
|
|
libusb1
|
|
];
|
|
|
|
env = lib.optionalAttrs stdenv.hostPlatform.isLinux {
|
|
HIDAPI_SYSTEM_HIDAPI = true;
|
|
};
|
|
|
|
propagatedBuildInputs = lib.optionals stdenv.hostPlatform.isLinux [ udev ];
|
|
|
|
pythonImportsCheck = [ "hid" ];
|
|
|
|
meta = {
|
|
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 lib.licenses; [
|
|
bsd3
|
|
gpl3Only
|
|
];
|
|
maintainers = with lib.maintainers; [
|
|
np
|
|
prusnak
|
|
];
|
|
};
|
|
}
|