summary refs log tree commit diff
path: root/pkgs/development/python-modules/seabreeze/default.nix
blob: 7cf062765d3bed5cfd1f319e09000e32346cefbd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{ stdenv
, fetchFromGitHub
, buildPythonPackage
, pyusb
, numpy
}:

## 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";
  version = "0.6.0";

  src = fetchFromGitHub {
    owner = "ap--";
    repo = "python-seabreeze";
    rev = "python-seabreeze-v${version}";
    sha256 = "0bc2s9ic77gz9m40w89snixphxlzib60xa4f49n4zasjrddfz1l8";
  };

  postInstall = ''
    mkdir -p $out/etc/udev/rules.d
    cp misc/10-oceanoptics.rules $out/etc/udev/rules.d/10-oceanoptics.rules
  '';

  # underlying c libraries are tested and fail
  # (c libs are used with anaconda, which we don't care about as we use the alternative path, being that of pyusb).
  doCheck = false;

  propagatedBuildInputs = [ pyusb numpy ];

  setupPyBuildFlags = [ "--without-cseabreeze" ];

  meta = with stdenv.lib; {
    homepage = "https://github.com/ap--/python-seabreeze";
    description = "A python library to access Ocean Optics spectrometers";
    maintainers = [];
    license = licenses.mit;
  };
}