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