1 { lib, pythonPackages, pkg-config
2 , qmake, qtbase, qtsvg, qtwebengine
8 inherit (pythonPackages) buildPythonPackage python isPy3k pyqt5 enum34;
10 # source: https://www.riverbankcomputing.com/pipermail/pyqt/2020-June/042985.html
11 patches = lib.optional (lib.hasPrefix "5.14" pyqt5.version)
12 [ ./fix-build-with-qt-514.patch ]
15 in buildPythonPackage rec {
16 pname = "PyQtWebEngine";
20 src = pythonPackages.fetchPypi {
21 inherit pname version;
22 sha256 = "06fc35hzg346a9c86dk7vzm1fakkgzn5l52jfq3bix3587sjip6f";
27 outputs = [ "out" "dev" ];
45 propagatedBuildInputs = [ pyqt5 ]
46 ++ lib.optional (!isPy3k) enum34;
48 dontWrapQtApps = true;
53 mkdir -p "$out/share/sip/PyQt5"
55 # FIXME: Without --no-dist-info, I get
56 # unable to create /nix/store/yv4pzx3lxk3lscq0pw3hqzs7k4x76xsm-python3-3.7.2/lib/python3.7/site-packages/PyQtWebEngine-5.12.dist-info
57 ${python.executable} configure.py -w \
58 --destdir="$out/${python.sitePackages}/PyQt5" \
60 --apidir="$out/api/${python.libPrefix}" \
61 --sipdir="$out/share/sip/PyQt5" \
62 --pyqt-sipdir="${pyqt5}/share/sip/PyQt5" \
63 --stubsdir="$out/${python.sitePackages}/PyQt5"
69 # Let's make it a namespace package
70 cat << EOF > $out/${python.sitePackages}/PyQt5/__init__.py
71 from pkgutil import extend_path
72 __path__ = extend_path(__path__, __name__)
76 installCheckPhase = let
79 "PyQt5.QtWebEngineWidgets"
81 imports = lib.concatMapStrings (module: "import ${module};") modules;
83 echo "Checking whether modules can be imported..."
84 PYTHONPATH=$PYTHONPATH:$out/${python.sitePackages} ${python.interpreter} -c "${imports}"
89 enableParallelBuilding = true;
92 inherit wrapQtAppsHook;
96 description = "Python bindings for Qt5";
97 homepage = "http://www.riverbankcomputing.co.uk";
98 license = licenses.gpl3;
99 platforms = platforms.mesaPlatforms;