2021-01-25 08:26:54 +00:00
|
|
|
{ lib
|
2019-05-06 13:04:11 +01:00
|
|
|
, fetchFromGitHub
|
|
|
|
, buildPythonPackage
|
2021-05-07 19:35:48 +01:00
|
|
|
, cython
|
|
|
|
, git
|
|
|
|
, pkgconfig
|
|
|
|
, pytest-runner
|
|
|
|
, setuptools-scm
|
|
|
|
, future
|
2019-05-06 13:04:11 +01:00
|
|
|
, numpy
|
2021-05-07 19:35:48 +01:00
|
|
|
, pyusb
|
|
|
|
, mock
|
|
|
|
, pytestCheckHook
|
|
|
|
, zipp
|
2019-05-06 13:04:11 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
## Usage
|
2020-03-11 06:28:51 +00:00
|
|
|
# In NixOS, add the package to services.udev.packages for non-root plugdev
|
|
|
|
# users to get device access permission:
|
|
|
|
# services.udev.packages = [ pkgs.python3Packages.seabreeze ];
|
2019-05-06 13:04:11 +01:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "seabreeze";
|
2021-03-24 17:41:56 +00:00
|
|
|
version = "1.3.0";
|
2019-05-06 13:04:11 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ap--";
|
|
|
|
repo = "python-seabreeze";
|
2021-03-24 17:41:56 +00:00
|
|
|
rev = "v${version}";
|
2021-05-07 19:35:48 +01:00
|
|
|
sha256 = "1hm9aalpb9sdp8s7ckn75xvyiacp5678pv9maybm5nz0z2h29ibq";
|
|
|
|
leaveDotGit = true;
|
2019-05-06 13:04:11 +01:00
|
|
|
};
|
|
|
|
|
2021-05-07 19:35:48 +01:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cython
|
|
|
|
git
|
|
|
|
pkgconfig
|
|
|
|
pytest-runner
|
|
|
|
setuptools-scm
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
future
|
|
|
|
numpy
|
|
|
|
pyusb
|
|
|
|
];
|
|
|
|
|
2019-05-06 13:04:11 +01:00
|
|
|
postInstall = ''
|
2020-03-11 06:28:51 +00:00
|
|
|
mkdir -p $out/etc/udev/rules.d
|
2021-05-07 19:35:48 +01:00
|
|
|
cp os_support/10-oceanoptics.rules $out/etc/udev/rules.d/10-oceanoptics.rules
|
2019-05-06 13:04:11 +01:00
|
|
|
'';
|
|
|
|
|
2021-05-07 19:35:48 +01:00
|
|
|
# few backends enabled, but still some tests
|
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
mock
|
|
|
|
zipp
|
|
|
|
];
|
2019-05-06 13:04:11 +01:00
|
|
|
|
|
|
|
setupPyBuildFlags = [ "--without-cseabreeze" ];
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2019-05-06 13:04:11 +01:00
|
|
|
homepage = "https://github.com/ap--/python-seabreeze";
|
|
|
|
description = "A python library to access Ocean Optics spectrometers";
|
|
|
|
maintainers = [];
|
|
|
|
license = licenses.mit;
|
|
|
|
};
|
|
|
|
}
|