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