depot/third_party/nixpkgs/pkgs/os-specific/linux/usbrelay/default.nix
Default email 9c6ee729d6 Project import generated by Copybara.
GitOrigin-RevId: 6cee3b5893090b0f5f0a06b4cf42ca4e60e5d222
2023-07-15 19:15:38 +02:00

38 lines
860 B
Nix

{ stdenv, lib, fetchFromGitHub, hidapi, installShellFiles }:
stdenv.mkDerivation (finalAttrs: {
pname = "usbrelay";
version = "1.2";
src = fetchFromGitHub {
owner = "darrylb123";
repo = "usbrelay";
rev = finalAttrs.version;
sha256 = "sha256-oJyHzbXOBKxLmPFZMS2jLF80frkiKjPJ89UwkenjIzs=";
};
nativeBuildInputs = [
installShellFiles
];
buildInputs = [
hidapi
];
makeFlags = [
"DIR_VERSION=${finalAttrs.version}"
"PREFIX=${placeholder "out"}"
"LDCONFIG=${stdenv.cc.libc.bin}/bin/ldconfig"
];
postInstall = ''
installManPage usbrelay.1
'';
meta = with lib; {
description = "Tool to control USB HID relays";
homepage = "https://github.com/darrylb123/usbrelay";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ wentasah ];
platforms = platforms.linux;
};
})