diff --git a/pkgs/development/python-modules/hid/default.nix b/pkgs/development/python-modules/hid/default.nix new file mode 100644 index 000000000000..c45cf3d9a65e --- /dev/null +++ b/pkgs/development/python-modules/hid/default.nix @@ -0,0 +1,34 @@ +{ lib +, stdenv +, buildPythonPackage +, fetchPypi +, hidapi +, nose +}: + +buildPythonPackage rec { + pname = "hid"; + version = "1.0.4"; + + src = fetchPypi { + inherit pname version; + sha256 = "sha256-9hsDgvN6M0vIuoYEvIS5SHXuT1lPu6+CssOz6CeIP8E="; + }; + + propagatedBuildInputs = [ hidapi ]; + + checkInputs = [ nose ]; + + postPatch = lib.optionalString stdenv.isLinux '' + hidapi=${hidapi}/lib/ + test -d $hidapi || { echo "ERROR: $hidapi doesn't exist, please update/fix this build expression."; exit 1; } + sed -i -e "s|libhidapi|$hidapi/libhidapi|" hid/__init__.py + ''; + + meta = with lib; { + description = "hidapi bindings in ctypes"; + homepage = "https://github.com/apmorton/pyhidapi"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ AndersonTorres ]; + }; +} diff --git a/pkgs/development/python-modules/milc/default.nix b/pkgs/development/python-modules/milc/default.nix index afdab1194b78..ebf4d1d2d224 100644 --- a/pkgs/development/python-modules/milc/default.nix +++ b/pkgs/development/python-modules/milc/default.nix @@ -4,29 +4,33 @@ , appdirs , argcomplete , colorama +, halo , nose2 , semver }: buildPythonPackage rec { pname = "milc"; - version = "1.3.0"; + version = "1.4.2"; src = fetchFromGitHub { owner = "clueboard"; repo = "milc"; rev = version; - sha256 = "sha256-koyOBz+pB/vkTHOR1p77ACO11/ULDIBzqsszUUpnE88="; + sha256 = "sha256-aX6cTpIN9+9xuEGYHVlM5SjTPLcudJFEuOI4CiN3byE="; }; - propagatedBuildInputs = [ appdirs argcomplete colorama ]; + propagatedBuildInputs = [ + appdirs + argcomplete + colorama + halo + ]; - checkInputs = [ nose2 semver ]; - - checkPhase = '' - patchShebangs example hello + checkInputs = [ nose2 - ''; + semver + ]; pythonImportsCheck = [ "milc" ]; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index d5b2c614cec8..a9c8a74789c0 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3230,6 +3230,10 @@ in { hickle = callPackage ../development/python-modules/hickle { }; + hid = callPackage ../development/python-modules/hid { + inherit (pkgs) hidapi; + }; + hidapi = callPackage ../development/python-modules/hidapi { inherit (pkgs) udev libusb1; };