1{ lib, fetchurl, pythonPackages, pkgconfig, qtbase, qtsvg, qtwebkit, qtwebengine, dbus_libs
2, lndir, makeWrapper, qmake }:
3
4let
5 version = "5.8.1";
6 inherit (pythonPackages) buildPythonPackage python dbus-python sip;
7in buildPythonPackage {
8 name = "PyQt-${version}";
9 format = "other";
10
11 meta = with lib; {
12 description = "Python bindings for Qt5";
13 homepage = http://www.riverbankcomputing.co.uk;
14 license = licenses.gpl3;
15 platforms = platforms.mesaPlatforms;
16 maintainers = with maintainers; [ sander ];
17 };
18
19 src = fetchurl {
20 url = "mirror://sourceforge/pyqt/PyQt5/PyQt-${version}/PyQt5_gpl-${version}.tar.gz";
21 sha256 = "0biak7l574i2gc8lj1s45skajbxsmmx66nlvs6xaakzkc6r293qy";
22 };
23
24 nativeBuildInputs = [ pkgconfig makeWrapper qmake ];
25
26 buildInputs = [
27 lndir qtbase qtsvg qtwebkit qtwebengine dbus_libs
28 ];
29
30 propagatedBuildInputs = [ sip ];
31
32 configurePhase = ''
33 runHook preConfigure
34
35 mkdir -p $out
36 lndir ${dbus-python} $out
37 rm -rf "$out/nix-support"
38
39 export PYTHONPATH=$PYTHONPATH:$out/lib/${python.libPrefix}/site-packages
40
41 substituteInPlace configure.py \
42 --replace 'install_dir=pydbusmoddir' "install_dir='$out/lib/${python.libPrefix}/site-packages/dbus/mainloop'" \
43 --replace "ModuleMetadata(qmake_QT=['webkitwidgets'])" "ModuleMetadata(qmake_QT=['webkitwidgets', 'printsupport'])"
44
45 ${python.executable} configure.py -w \
46 --confirm-license \
47 --dbus=${dbus_libs.dev}/include/dbus-1.0 \
48 --qmake=$QMAKE \
49 --no-qml-plugin \
50 --bindir=$out/bin \
51 --destdir=$out/${python.sitePackages} \
52 --stubsdir=$out/${python.sitePackages}/PyQt5 \
53 --sipdir=$out/share/sip/PyQt5 \
54 --designer-plugindir=$out/plugins/designer
55
56 runHook postConfigure
57 '';
58
59 postInstall = ''
60 for i in $out/bin/*; do
61 wrapProgram $i --prefix PYTHONPATH : "$PYTHONPATH"
62 done
63 '';
64
65 enableParallelBuilding = true;
66}