1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchPypi,
6 pyqt5,
7 pyqt-builder,
8 python,
9 pythonOlder,
10 qtcharts,
11 setuptools,
12 sip,
13}:
14
15buildPythonPackage rec {
16 pname = "pyqtchart";
17 version = "5.15.6";
18 format = "pyproject";
19
20 disabled = pythonOlder "3.7";
21
22 src = fetchPypi {
23 pname = "PyQtChart";
24 inherit version;
25 hash = "sha256-JpF5b+kqKUphdZKlxcNeeF3JH3dZ3vnrItp532N2Izk=";
26 };
27
28 postPatch = ''
29 substituteInPlace pyproject.toml \
30 --replace "[tool.sip.project]" "[tool.sip.project]''\nsip-include-dirs = [\"${pyqt5}/${python.sitePackages}/PyQt5/bindings\"]"
31 '';
32
33 outputs = [
34 "out"
35 "dev"
36 ];
37
38 enableParallelBuilding = true;
39 # HACK: paralellize compilation of make calls within pyqt's setup.py
40 # pkgs/stdenv/generic/setup.sh doesn't set this for us because
41 # make gets called by python code and not its build phase
42 # format=pyproject means the pip-build-hook hook gets used to build this project
43 # pkgs/development/interpreters/python/hooks/pip-build-hook.sh
44 # does not use the enableParallelBuilding flag
45 preBuild = ''
46 export MAKEFLAGS+="''${enableParallelBuilding:+-j$NIX_BUILD_CORES}"
47 '';
48
49 dontWrapQtApps = true;
50
51 nativeBuildInputs = [
52 sip
53 qtcharts
54 setuptools
55 pyqt-builder
56 ];
57
58 buildInputs = [ qtcharts ];
59
60 propagatedBuildInputs = [ pyqt5 ];
61
62 dontConfigure = true;
63
64 # has no tests
65 doCheck = false;
66
67 pythonImportsCheck = [ "PyQt5.QtChart" ];
68
69 meta = with lib; {
70 description = "Python bindings for the Qt Charts library";
71 homepage = "https://riverbankcomputing.com/";
72 license = licenses.gpl3Only;
73 maintainers = with maintainers; [ panicgh ];
74 };
75}