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