1{ stdenv
2, fetchFromGitHub
3, buildPythonPackage
4, pyusb
5, numpy
6}:
7
8## Usage
9# In NixOS, add the package to services.udev.packages for non-root plugdev
10# users to get device access permission:
11# services.udev.packages = [ pkgs.python3Packages.seabreeze ];
12
13buildPythonPackage rec {
14 pname = "seabreeze";
15 version = "0.6.0";
16
17 src = fetchFromGitHub {
18 owner = "ap--";
19 repo = "python-seabreeze";
20 rev = "python-seabreeze-v${version}";
21 sha256 = "0bc2s9ic77gz9m40w89snixphxlzib60xa4f49n4zasjrddfz1l8";
22 };
23
24 postInstall = ''
25 mkdir -p $out/etc/udev/rules.d
26 cp misc/10-oceanoptics.rules $out/etc/udev/rules.d/10-oceanoptics.rules
27 '';
28
29 # underlying c libraries are tested and fail
30 # (c libs are used with anaconda, which we don't care about as we use the alternative path, being that of pyusb).
31 doCheck = false;
32
33 propagatedBuildInputs = [ pyusb numpy ];
34
35 setupPyBuildFlags = [ "--without-cseabreeze" ];
36
37 meta = with stdenv.lib; {
38 homepage = "https://github.com/ap--/python-seabreeze";
39 description = "A python library to access Ocean Optics spectrometers";
40 maintainers = [];
41 license = licenses.mit;
42 };
43}