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