1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 sip,
6 pyqt-builder,
7 qt6Packages,
8 pythonOlder,
9 pyqt6,
10 python,
11 mesa,
12}:
13
14buildPythonPackage rec {
15 pname = "pyqt6-charts";
16 version = "6.9.0";
17 pyproject = true;
18
19 disabled = pythonOlder "3.9";
20
21 src = fetchPypi {
22 pname = "pyqt6_charts";
23 inherit version;
24 hash = "sha256-fvvpu35q1PmEUhGg7+D5HKXhT5Ni7RuoTVXyuFFQkfc=";
25 };
26
27 # fix include path and increase verbosity
28 postPatch = ''
29 sed -i \
30 '/\[tool.sip.project\]/a\
31 verbose = true\
32 sip-include-dirs = [\"${pyqt6}/${python.sitePackages}/PyQt6/bindings\"]' \
33 pyproject.toml
34 '';
35
36 enableParallelBuilding = true;
37 # HACK: paralellize compilation of make calls within pyqt's setup.py
38 # pkgs/stdenv/generic/setup.sh doesn't set this for us because
39 # make gets called by python code and not its build phase
40 # format=pyproject means the pip-build-hook hook gets used to build this project
41 # pkgs/development/interpreters/python/hooks/pip-build-hook.sh
42 # does not use the enableParallelBuilding flag
43 preBuild = ''
44 export MAKEFLAGS+="''${enableParallelBuilding:+-j$NIX_BUILD_CORES}"
45 '';
46
47 dontWrapQtApps = true;
48
49 build-system = [
50 sip
51 pyqt-builder
52 ];
53
54 dependencies = [
55 pyqt6
56 ];
57
58 nativeBuildInputs = with qt6Packages; [
59 qtcharts
60 qmake
61 ];
62
63 buildInputs = with qt6Packages; [ qtcharts ];
64
65 dontConfigure = true;
66
67 # has no tests
68 doCheck = false;
69
70 pythonImportsCheck = [ "PyQt6.QtCharts" ];
71
72 meta = {
73 description = "Python bindings for Qt6 QtCharts";
74 homepage = "https://riverbankcomputing.com/";
75 license = lib.licenses.gpl3Only;
76 inherit (mesa.meta) platforms;
77 maintainers = with lib.maintainers; [ dandellion ];
78 };
79}