2023-07-05 00:42:08 +02:00
|
|
|
{ pkgs ? import <nixpkgs> { }
|
|
|
|
, local ? false
|
|
|
|
, full ? true
|
|
|
|
}:
|
|
|
|
pkgs.stdenv.mkDerivation rec {
|
2024-11-25 06:15:39 +01:00
|
|
|
pname = "usb-drivers";
|
2023-07-05 00:42:08 +02:00
|
|
|
version = "master";
|
|
|
|
|
|
|
|
nativeBuildInputs = with pkgs; [
|
|
|
|
cmake
|
|
|
|
pkg-config
|
|
|
|
help2man
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = with pkgs; [
|
|
|
|
libusb
|
2024-11-25 06:15:39 +01:00
|
|
|
hidapi
|
2023-07-05 00:42:08 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
src = if local then
|
|
|
|
builtins.path {
|
|
|
|
path = ../${pname}/git;
|
|
|
|
name = "${pname}";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
fetchGit {
|
|
|
|
url = "https://git.janouch.name/p/${pname}.git";
|
|
|
|
submodules = true;
|
|
|
|
ref = "master";
|
|
|
|
};
|
|
|
|
|
2024-11-25 06:15:39 +01:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DSETUID="
|
|
|
|
];
|
|
|
|
|
2023-07-05 00:42:08 +02:00
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
meta = with pkgs.lib; {
|
2024-11-25 06:15:39 +01:00
|
|
|
description = "User space USB drivers";
|
2023-07-05 00:42:08 +02:00
|
|
|
homepage = "https://git.janouch.name/p/${pname}";
|
|
|
|
platforms = platforms.all;
|
|
|
|
license = licenses.bsd0;
|
|
|
|
};
|
|
|
|
}
|