2020-04-04 03:55:03 +01:00
|
|
|
{ lib, pythonPackages, pkgconfig
|
2019-02-25 16:21:32 +00:00
|
|
|
, qmake, qtbase, qtsvg, qtwebengine
|
2019-08-17 21:24:46 +01:00
|
|
|
, wrapQtAppsHook
|
2019-02-25 16:21:32 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
inherit (pythonPackages) buildPythonPackage python isPy3k pyqt5 enum34;
|
|
|
|
inherit (pyqt5) sip;
|
2020-10-07 16:14:02 +01:00
|
|
|
# source: https://www.riverbankcomputing.com/pipermail/pyqt/2020-June/042985.html
|
|
|
|
patches = lib.optional (lib.hasPrefix "5.14" pyqt5.version)
|
|
|
|
[ ./fix-build-with-qt-514.patch ]
|
|
|
|
;
|
2019-02-25 16:21:32 +00:00
|
|
|
|
|
|
|
in buildPythonPackage rec {
|
2020-04-04 03:55:03 +01:00
|
|
|
pname = "PyQtWebEngine";
|
2020-07-06 20:43:50 +01:00
|
|
|
version = "5.15.0";
|
2019-02-25 16:21:32 +00:00
|
|
|
format = "other";
|
|
|
|
|
2020-04-04 03:55:03 +01:00
|
|
|
src = pythonPackages.fetchPypi {
|
|
|
|
inherit pname version;
|
2020-07-06 20:43:50 +01:00
|
|
|
sha256 = "0xdzhl07x3mzfnr5cf4d640168vxi7fyl0fz1pvpbgs0irl14237";
|
2019-02-25 16:21:32 +00:00
|
|
|
};
|
|
|
|
|
2020-10-07 16:14:02 +01:00
|
|
|
inherit patches;
|
2020-07-30 13:06:52 +01:00
|
|
|
|
2019-02-25 16:21:32 +00:00
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pkgconfig
|
|
|
|
qmake
|
|
|
|
sip
|
|
|
|
qtbase
|
|
|
|
qtsvg
|
|
|
|
qtwebengine
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
sip
|
|
|
|
qtbase
|
|
|
|
qtsvg
|
|
|
|
qtwebengine
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ pyqt5 ]
|
|
|
|
++ lib.optional (!isPy3k) enum34;
|
|
|
|
|
|
|
|
configurePhase = ''
|
|
|
|
runHook preConfigure
|
|
|
|
|
|
|
|
mkdir -p "$out/share/sip/PyQt5"
|
|
|
|
|
|
|
|
# FIXME: Without --no-dist-info, I get
|
|
|
|
# unable to create /nix/store/yv4pzx3lxk3lscq0pw3hqzs7k4x76xsm-python3-3.7.2/lib/python3.7/site-packages/PyQtWebEngine-5.12.dist-info
|
|
|
|
${python.executable} configure.py -w \
|
|
|
|
--destdir="$out/${python.sitePackages}/PyQt5" \
|
|
|
|
--no-dist-info \
|
|
|
|
--apidir="$out/api/${python.libPrefix}" \
|
|
|
|
--sipdir="$out/share/sip/PyQt5" \
|
|
|
|
--pyqt-sipdir="${pyqt5}/share/sip/PyQt5" \
|
|
|
|
--stubsdir="$out/${python.sitePackages}/PyQt5"
|
|
|
|
|
|
|
|
runHook postConfigure
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
# Let's make it a namespace package
|
|
|
|
cat << EOF > $out/${python.sitePackages}/PyQt5/__init__.py
|
|
|
|
from pkgutil import extend_path
|
|
|
|
__path__ = extend_path(__path__, __name__)
|
|
|
|
EOF
|
|
|
|
'';
|
|
|
|
|
|
|
|
installCheckPhase = let
|
|
|
|
modules = [
|
|
|
|
"PyQt5.QtWebEngine"
|
|
|
|
"PyQt5.QtWebEngineWidgets"
|
|
|
|
];
|
|
|
|
imports = lib.concatMapStrings (module: "import ${module};") modules;
|
|
|
|
in ''
|
|
|
|
echo "Checking whether modules can be imported..."
|
|
|
|
PYTHONPATH=$PYTHONPATH:$out/${python.sitePackages} ${python.interpreter} -c "${imports}"
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2019-08-17 21:24:46 +01:00
|
|
|
passthru = {
|
|
|
|
inherit wrapQtAppsHook;
|
|
|
|
};
|
|
|
|
|
2019-02-25 16:21:32 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Python bindings for Qt5";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://www.riverbankcomputing.co.uk";
|
2019-02-25 16:21:32 +00:00
|
|
|
license = licenses.gpl3;
|
|
|
|
platforms = platforms.mesaPlatforms;
|
|
|
|
};
|
|
|
|
}
|