1{ lib, fetchurl, fetchpatch, pythonPackages, pkgconfig
2, qmake, lndir, qtbase, qtsvg, qtwebengine, dbus
3, withConnectivity ? false, qtconnectivity
4, withWebKit ? false, qtwebkit
5, withWebSockets ? false, qtwebsockets
6}:
7
8let
9
10 inherit (pythonPackages) buildPythonPackage python isPy3k dbus-python enum34;
11
12 sip = pythonPackages.sip.override { sip-module = "PyQt5.sip"; };
13
14in buildPythonPackage rec {
15 pname = "PyQt";
16 version = "5.11.3";
17 format = "other";
18
19 src = fetchurl {
20 url = "mirror://sourceforge/pyqt/PyQt5/PyQt-${version}/PyQt5_gpl-${version}.tar.gz";
21 sha256 = "0wqh4srqkcc03rvkwrcshaa028psrq58xkys6npnyhqxc0apvdf9";
22 };
23
24 outputs = [ "out" "dev" ];
25
26 nativeBuildInputs = [ pkgconfig qmake lndir sip ];
27
28 buildInputs = [ dbus sip ];
29
30 propagatedBuildInputs = [ qtbase qtsvg qtwebengine ]
31 ++ lib.optional (!isPy3k) enum34
32 ++ lib.optional withConnectivity qtconnectivity
33 ++ lib.optional withWebKit qtwebkit
34 ++ lib.optional withWebSockets qtwebsockets;
35
36 configurePhase = ''
37 runHook preConfigure
38
39 mkdir -p $out
40 lndir ${dbus-python} $out
41 rm -rf "$out/nix-support"
42
43 export PYTHONPATH=$PYTHONPATH:$out/${python.sitePackages}
44
45 ${python.executable} configure.py -w \
46 --confirm-license \
47 --dbus=${dbus.dev}/include/dbus-1.0 \
48 --no-qml-plugin \
49 --bindir=$out/bin \
50 --destdir=$out/${python.sitePackages} \
51 --stubsdir=$out/${python.sitePackages}/PyQt5 \
52 --sipdir=$out/share/sip/PyQt5 \
53 --designer-plugindir=$out/plugins/designer
54
55 runHook postConfigure
56 '';
57
58 postInstall = ''
59 ln -s ${sip}/${python.sitePackages}/PyQt5/sip.* $out/${python.sitePackages}/PyQt5/
60 for i in $out/bin/*; do
61 wrapProgram $i --prefix PYTHONPATH : "$PYTHONPATH"
62 done
63 '';
64
65 enableParallelBuilding = true;
66
67 meta = with lib; {
68 description = "Python bindings for Qt5";
69 homepage = http://www.riverbankcomputing.co.uk;
70 license = licenses.gpl3;
71 platforms = platforms.mesaPlatforms;
72 maintainers = with maintainers; [ sander ];
73 };
74}