2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
pythonPackages,
|
|
|
|
fetchPypi,
|
|
|
|
pkg-config,
|
|
|
|
qmake,
|
|
|
|
qtbase,
|
|
|
|
qtsvg,
|
|
|
|
qtwebengine,
|
|
|
|
qtwebchannel,
|
|
|
|
qtdeclarative,
|
|
|
|
wrapQtAppsHook,
|
|
|
|
darwin,
|
|
|
|
buildPackages,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2024-06-05 15:53:02 +00:00
|
|
|
inherit (pythonPackages)
|
|
|
|
buildPythonPackage
|
|
|
|
python
|
|
|
|
isPy27
|
|
|
|
pyqt5
|
|
|
|
sip
|
|
|
|
pyqt-builder
|
|
|
|
;
|
2023-02-02 18:25:31 +00:00
|
|
|
inherit (darwin) autoSignDarwinBinariesHook;
|
2024-06-05 15:53:02 +00:00
|
|
|
in
|
|
|
|
buildPythonPackage (
|
|
|
|
rec {
|
|
|
|
pname = "pyqtwebengine";
|
|
|
|
version = "5.15.6";
|
|
|
|
format = "pyproject";
|
2021-06-28 23:13:55 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
disabled = isPy27;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
src = fetchPypi {
|
|
|
|
pname = "PyQtWebEngine";
|
|
|
|
inherit version;
|
|
|
|
sha256 = "sha256-riQe8qYceCk5xYtSwq6lOtmbMPOTTINY1eCm67P9ByE=";
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace "[tool.sip.project]" "[tool.sip.project]''\nsip-include-dirs = [\"${pyqt5}/${python.sitePackages}/PyQt5/bindings\"]"
|
|
|
|
'';
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
outputs = [
|
|
|
|
"out"
|
|
|
|
"dev"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs =
|
|
|
|
[
|
|
|
|
pkg-config
|
|
|
|
qmake
|
|
|
|
]
|
|
|
|
++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ sip ]
|
|
|
|
++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
|
|
|
|
python.pythonOnBuildForHost.pkgs.sip
|
|
|
|
]
|
|
|
|
++ [
|
|
|
|
qtbase
|
|
|
|
qtsvg
|
|
|
|
qtwebengine
|
|
|
|
pyqt-builder
|
|
|
|
pythonPackages.setuptools
|
|
|
|
]
|
|
|
|
++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ qtdeclarative ]
|
|
|
|
++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [ autoSignDarwinBinariesHook ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
buildInputs =
|
|
|
|
[
|
|
|
|
sip
|
|
|
|
qtbase
|
|
|
|
qtsvg
|
|
|
|
qtwebengine
|
|
|
|
]
|
|
|
|
++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
|
|
|
|
qtwebchannel
|
|
|
|
qtdeclarative
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
propagatedBuildInputs = [ pyqt5 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
dontWrapQtApps = true;
|
2021-02-19 19:06:45 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# Avoid running qmake, which is in nativeBuildInputs
|
|
|
|
dontConfigure = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# Checked using pythonImportsCheck
|
|
|
|
doCheck = false;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"PyQt5.QtWebEngine"
|
|
|
|
"PyQt5.QtWebEngineWidgets"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
enableParallelBuilding = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
passthru = {
|
|
|
|
inherit wrapQtAppsHook;
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Python bindings for Qt5";
|
|
|
|
homepage = "http://www.riverbankcomputing.co.uk";
|
|
|
|
license = licenses.gpl3;
|
|
|
|
hydraPlatforms = lib.lists.intersectLists qtwebengine.meta.platforms platforms.mesaPlatforms;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
// lib.optionalAttrs (stdenv.buildPlatform != stdenv.hostPlatform) {
|
|
|
|
# TODO: figure out why the env hooks aren't adding these inclusions automatically
|
|
|
|
env.NIX_CFLAGS_COMPILE = lib.concatStringsSep " " [
|
2023-11-16 04:20:00 +00:00
|
|
|
"-I${lib.getDev qtbase}/include/QtPrintSupport/"
|
|
|
|
"-I${lib.getDev qtwebchannel}/include/QtWebChannel/"
|
|
|
|
];
|
2024-06-05 15:53:02 +00:00
|
|
|
}
|
|
|
|
)
|