1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 substituteAll,
6 fetchPypi,
7 cython,
8 fontconfig,
9 freetype-py,
10 hsluv,
11 kiwisolver,
12 libGL,
13 numpy,
14 oldest-supported-numpy,
15 packaging,
16 pythonOlder,
17 setuptools,
18 setuptools-scm,
19 wheel,
20}:
21
22buildPythonPackage rec {
23 pname = "vispy";
24 version = "0.14.2";
25 pyproject = true;
26
27 disabled = pythonOlder "3.7";
28
29 src = fetchPypi {
30 inherit pname version;
31 hash = "sha256-7ti0TW9ch70pWySqmi4OTm3GqQXM7gGy1ByPvwp2ez0=";
32 };
33
34 patches = [
35 (substituteAll {
36 src = ./library-paths.patch;
37 fontconfig = "${fontconfig.lib}/lib/libfontconfig${stdenv.hostPlatform.extensions.sharedLibrary}";
38 gl = "${libGL.out}/lib/libGL${stdenv.hostPlatform.extensions.sharedLibrary}";
39 })
40 ];
41
42 nativeBuildInputs = [
43 cython
44 oldest-supported-numpy
45 setuptools
46 setuptools-scm
47 wheel
48 ];
49
50 buildInputs = [ libGL ];
51
52 propagatedBuildInputs = [
53 freetype-py
54 hsluv
55 kiwisolver
56 numpy
57 packaging
58 ];
59
60 doCheck = false; # otherwise runs OSX code on linux.
61
62 pythonImportsCheck = [
63 "vispy"
64 "vispy.color"
65 "vispy.geometry"
66 "vispy.gloo"
67 "vispy.glsl"
68 "vispy.io"
69 "vispy.plot"
70 "vispy.scene"
71 "vispy.util"
72 "vispy.visuals"
73 ];
74
75 meta = with lib; {
76 description = "Interactive scientific visualization in Python";
77 homepage = "https://vispy.org/index.html";
78 changelog = "https://github.com/vispy/vispy/blob/v${version}/CHANGELOG.md";
79 license = licenses.bsd3;
80 maintainers = with maintainers; [ goertzenator ];
81 };
82}