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