2021-01-19 06:50:56 +00:00
|
|
|
{ lib, pythonPackages, pkg-config
|
2019-02-25 16:21:32 +00:00
|
|
|
, qmake, qtbase, qtsvg, qtwebengine
|
2019-08-17 20:24:46 +00:00
|
|
|
, wrapQtAppsHook
|
2019-02-25 16:21:32 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
|
2021-05-17 09:30:30 +00:00
|
|
|
inherit (pythonPackages) buildPythonPackage python isPy3k pyqt5 enum34 pyqt-builder;
|
2019-02-25 16:21:32 +00:00
|
|
|
inherit (pyqt5) sip;
|
2020-10-07 15:14:02 +00: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 02:55:03 +00:00
|
|
|
pname = "PyQtWebEngine";
|
2021-03-18 07:30:26 +00:00
|
|
|
version = "5.15.4";
|
2021-05-17 09:30:30 +00:00
|
|
|
format = if isPy3k then "pyproject" else "other";
|
2019-02-25 16:21:32 +00:00
|
|
|
|
2020-04-04 02:55:03 +00:00
|
|
|
src = pythonPackages.fetchPypi {
|
|
|
|
inherit pname version;
|
2021-03-18 07:30:26 +00:00
|
|
|
sha256 = "06fc35hzg346a9c86dk7vzm1fakkgzn5l52jfq3bix3587sjip6f";
|
2019-02-25 16:21:32 +00:00
|
|
|
};
|
|
|
|
|
2020-10-07 15:14:02 +00:00
|
|
|
inherit patches;
|
2020-07-30 12:06:52 +00:00
|
|
|
|
2021-05-17 09:30:30 +00:00
|
|
|
postPatch = lib.optionalString isPy3k ''
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace "[tool.sip.project]" "[tool.sip.project]''\nsip-include-dirs = [\"${pyqt5}/${python.sitePackages}/PyQt5/bindings\"]"
|
|
|
|
'';
|
|
|
|
|
2019-02-25 16:21:32 +00:00
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2021-01-19 06:50:56 +00:00
|
|
|
pkg-config
|
2019-02-25 16:21:32 +00:00
|
|
|
qmake
|
|
|
|
sip
|
|
|
|
qtbase
|
|
|
|
qtsvg
|
|
|
|
qtwebengine
|
2021-05-17 09:30:30 +00:00
|
|
|
] ++ lib.optional isPy3k pyqt-builder;
|
2019-02-25 16:21:32 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
sip
|
|
|
|
qtbase
|
|
|
|
qtsvg
|
|
|
|
qtwebengine
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ pyqt5 ]
|
|
|
|
++ lib.optional (!isPy3k) enum34;
|
|
|
|
|
2021-01-12 11:50:23 +00:00
|
|
|
dontWrapQtApps = true;
|
|
|
|
|
2021-05-17 09:30:30 +00:00
|
|
|
# Configure only needed when building with sip 4 (python 2)
|
|
|
|
dontConfigure = isPy3k;
|
|
|
|
|
2019-02-25 16:21:32 +00:00
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
2021-05-17 09:30:30 +00:00
|
|
|
postInstall = lib.optionalString (!isPy3k) ''
|
2019-02-25 16:21:32 +00:00
|
|
|
# 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
|
|
|
|
'';
|
|
|
|
|
2021-05-17 09:30:30 +00:00
|
|
|
# Checked using pythonImportsCheck
|
|
|
|
doCheck = false;
|
2019-02-25 16:21:32 +00:00
|
|
|
|
2021-05-17 09:30:30 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"PyQt5.QtWebEngine"
|
|
|
|
"PyQt5.QtWebEngineWidgets"
|
|
|
|
];
|
2019-02-25 16:21:32 +00:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2019-08-17 20:24:46 +00:00
|
|
|
passthru = {
|
|
|
|
inherit wrapQtAppsHook;
|
|
|
|
};
|
|
|
|
|
2019-02-25 16:21:32 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Python bindings for Qt5";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "http://www.riverbankcomputing.co.uk";
|
2019-02-25 16:21:32 +00:00
|
|
|
license = licenses.gpl3;
|
|
|
|
platforms = platforms.mesaPlatforms;
|
|
|
|
};
|
|
|
|
}
|