Files
nixpkgs/pkgs/by-name/hi/hidapi/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

57 lines
1.2 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
cmake,
pkg-config,
libusb1,
udev,
testers,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "hidapi";
version = "0.15.0";
src = fetchFromGitHub {
owner = "libusb";
repo = "hidapi";
rev = "hidapi-${finalAttrs.version}";
sha256 = "sha256-o6IZRG42kTa7EQib9eaV1HGyjaGgeCabk+8fyQTm/0s=";
};
nativeBuildInputs = [
cmake
pkg-config
];
buildInputs = lib.optionals stdenv.hostPlatform.isLinux [
libusb1
udev
];
enableParallelBuilding = true;
passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
meta = with lib; {
description = "Library for communicating with USB and Bluetooth HID devices";
homepage = "https://github.com/libusb/hidapi";
maintainers = with maintainers; [ prusnak ];
# You can choose between GPLv3, BSD or HIDAPI license (even more liberal)
license = with licenses; [
bsd3 # or
gpl3Only
];
pkgConfigModules =
lib.optionals stdenv.hostPlatform.isDarwin [
"hidapi"
]
++ lib.optionals stdenv.hostPlatform.isLinux [
"hidapi-hidraw"
"hidapi-libusb"
];
platforms = platforms.unix ++ platforms.windows;
};
})