summary refs log tree commit diff
path: root/pkgs/development/python-modules/pyqtgraph/default.nix
blob: 54a136d5dcd4521b7c34bdc31fd5235e2d1c53b5 (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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{ lib
, buildPythonPackage
, fetchFromGitHub
, scipy
, numpy
, pyqt5
, pyopengl
, qt5
, python
, pytestCheckHook
, freefont_ttf
, makeFontsConf
, fetchpatch
}:

let
  fontsConf = makeFontsConf {
    fontDirectories = [ freefont_ttf ];
  };
in
buildPythonPackage rec {
  pname = "pyqtgraph";
  version = "0.12.2";

  src = fetchFromGitHub {
    owner = "pyqtgraph";
    repo = "pyqtgraph";
    rev = "pyqtgraph-${version}";
    sha256 = "093kkxwj75nb508vz7px4x7lxrwpaff10pl15m4h74hjwyvbsg3d";
  };

  # TODO: remove when updating to 0.12.3
  patches = [
    (fetchpatch {
      url = "https://github.com/pyqtgraph/pyqtgraph/commit/2de5cd78da92b48e48255be2f41ae332cf8bb675.patch";
      sha256 = "1hy86psqyl6ipvbg23zvackkd6f7ajs6qll0mbs0x2zmrj92hk00";
    })
  ];

  propagatedBuildInputs = [
    numpy
    pyqt5
    scipy
    pyopengl
  ];

  checkInputs = [ pytestCheckHook ];

  preCheck = ''
    export QT_PLUGIN_PATH="${qt5.qtbase.bin}/${qt5.qtbase.qtPluginPrefix}"
    export QT_QPA_PLATFORM=offscreen
    export DYLD_FRAMEWORK_PATH=/System/Library/Frameworks
    export FONTCONFIG_FILE=${fontsConf}
  '';

  meta = with lib; {
    description = "Scientific Graphics and GUI Library for Python";
    homepage = "http://www.pyqtgraph.org/";
    changelog = "https://github.com/pyqtgraph/pyqtgraph/blob/master/CHANGELOG";
    license = licenses.mit;
    platforms = platforms.unix;
    maintainers = with maintainers; [ koral ];
  };

}