at 23.05-pre 138 lines 3.2 kB view raw
1{ lib 2, buildPythonPackage 3, isPy27 4, fetchPypi 5, pkg-config 6, dbus 7, lndir 8, setuptools 9, dbus-python 10, sip 11, pyqt6-sip 12, pyqt-builder 13, qt6Packages 14, pythonOlder 15, withMultimedia ? true 16, withWebSockets ? true 17# FIXME: Once QtLocation is available for Qt6 enable this 18# https://bugreports.qt.io/browse/QTBUG-96795 19#, withLocation ? true 20# Not currently part of PyQt6 21#, withConnectivity ? true 22}: 23 24buildPythonPackage rec { 25 pname = "PyQt6"; 26 version = "6.4.0"; 27 format = "pyproject"; 28 29 disabled = pythonOlder "3.6"; 30 31 src = fetchPypi { 32 inherit pname version; 33 sha256 = "sha256-kTkkab4fSRkF+p54+k5AWaiathbd8uz9UlvB1lwmu5M="; 34 }; 35 36 patches = [ 37 # Fix some wrong assumptions by ./project.py 38 # TODO: figure out how to send this upstream 39 # FIXME: make a version for PyQt6? 40 # ./pyqt5-fix-dbus-mainloop-support.patch 41 # confirm license when installing via pyqt6_sip 42 ./pyqt5-confirm-license.patch 43 ]; 44 45 # be more verbose 46 postPatch = '' 47 cat >> pyproject.toml <<EOF 48 [tool.sip.project] 49 verbose = true 50 EOF 51 ''; 52 53 enableParallelBuilding = true; 54 # HACK: paralellize compilation of make calls within pyqt's setup.py 55 # pkgs/stdenv/generic/setup.sh doesn't set this for us because 56 # make gets called by python code and not its build phase 57 # format=pyproject means the pip-build-hook hook gets used to build this project 58 # pkgs/development/interpreters/python/hooks/pip-build-hook.sh 59 # does not use the enableParallelBuilding flag 60 postUnpack = '' 61 export MAKEFLAGS+=" -j$NIX_BUILD_CORES -l$NIX_BUILD_CORES" 62 ''; 63 64 outputs = [ "out" "dev" ]; 65 66 dontWrapQtApps = true; 67 68 nativeBuildInputs = with qt6Packages; [ 69 pkg-config 70 lndir 71 sip 72 qtbase 73 qtsvg 74 qtdeclarative 75 qtwebchannel 76 qmake 77 qtquick3d 78 qtquicktimeline 79 ] 80 # ++ lib.optional withConnectivity qtconnectivity 81 ++ lib.optional withMultimedia qtmultimedia 82 ++ lib.optional withWebSockets qtwebsockets 83 # ++ lib.optional withLocation qtlocation 84 ; 85 86 buildInputs = with qt6Packages; [ 87 dbus 88 qtbase 89 qtsvg 90 qtdeclarative 91 pyqt-builder 92 qtquick3d 93 qtquicktimeline 94 ] 95 # ++ lib.optional withConnectivity qtconnectivity 96 ++ lib.optional withWebSockets qtwebsockets 97 # ++ lib.optional withLocation qtlocation 98 ; 99 100 propagatedBuildInputs = [ 101 dbus-python 102 pyqt6-sip 103 setuptools 104 ]; 105 106 passthru = { 107 inherit sip pyqt6-sip; 108 multimediaEnabled = withMultimedia; 109 WebSocketsEnabled = withWebSockets; 110 }; 111 112 dontConfigure = true; 113 114 # Checked using pythonImportsCheck, has no tests 115 doCheck = true; 116 117 pythonImportsCheck = [ 118 "PyQt6" 119 "PyQt6.QtCore" 120 "PyQt6.QtQml" 121 "PyQt6.QtWidgets" 122 "PyQt6.QtGui" 123 "PyQt6.QtQuick" 124 ] 125 ++ lib.optional withWebSockets "PyQt6.QtWebSockets" 126 ++ lib.optional withMultimedia "PyQt6.QtMultimedia" 127 # ++ lib.optional withConnectivity "PyQt6.QtConnectivity" 128 # ++ lib.optional withLocation "PyQt6.QtPositioning" 129 ; 130 131 meta = with lib; { 132 description = "Python bindings for Qt6"; 133 homepage = "https://riverbankcomputing.com/"; 134 license = licenses.gpl3Only; 135 platforms = platforms.mesaPlatforms; 136 maintainers = with maintainers; [ LunNova ]; 137 }; 138}