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