2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, buildPythonPackage
|
2021-05-20 23:08:51 +00:00
|
|
|
, cython
|
|
|
|
, git
|
|
|
|
, pkgconfig
|
|
|
|
, setuptools-scm
|
|
|
|
, future
|
2020-04-24 23:36:52 +00:00
|
|
|
, numpy
|
2021-05-20 23:08:51 +00:00
|
|
|
, pyusb
|
|
|
|
, mock
|
|
|
|
, pytestCheckHook
|
|
|
|
, zipp
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
# 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 ];
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "seabreeze";
|
2021-04-26 19:14:03 +00:00
|
|
|
version = "1.3.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ap--";
|
|
|
|
repo = "python-seabreeze";
|
2021-04-26 19:14:03 +00:00
|
|
|
rev = "v${version}";
|
2021-05-20 23:08:51 +00:00
|
|
|
sha256 = "1hm9aalpb9sdp8s7ckn75xvyiacp5678pv9maybm5nz0z2h29ibq";
|
|
|
|
leaveDotGit = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace '"pytest-runner",' ""
|
|
|
|
'';
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cython
|
|
|
|
git
|
|
|
|
pkgconfig
|
|
|
|
setuptools-scm
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
future
|
|
|
|
numpy
|
|
|
|
pyusb
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/etc/udev/rules.d
|
2021-05-20 23:08:51 +00:00
|
|
|
cp os_support/10-oceanoptics.rules $out/etc/udev/rules.d/10-oceanoptics.rules
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
# few backends enabled, but still some tests
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-05-20 23:08:51 +00:00
|
|
|
pytestCheckHook
|
|
|
|
mock
|
|
|
|
zipp
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
setupPyBuildFlags = [ "--without-cseabreeze" ];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/ap--/python-seabreeze";
|
|
|
|
description = "A python library to access Ocean Optics spectrometers";
|
|
|
|
maintainers = [];
|
|
|
|
license = licenses.mit;
|
|
|
|
};
|
|
|
|
}
|