2021-04-08 16:26:57 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, importlib-resources
|
2022-04-27 09:35:20 +00:00
|
|
|
, proxy_tools
|
|
|
|
, pygobject3
|
2021-04-08 16:26:57 +00:00
|
|
|
, pyqtwebengine
|
|
|
|
, pytest
|
|
|
|
, pythonOlder
|
|
|
|
, qt5
|
2022-04-27 09:35:20 +00:00
|
|
|
, qtpy
|
|
|
|
, six
|
2021-05-20 23:08:51 +00:00
|
|
|
, xvfb-run
|
2021-04-08 16:26:57 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pywebview";
|
2023-01-20 10:41:00 +00:00
|
|
|
version = "3.7.2";
|
2022-04-27 09:35:20 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
disabled = pythonOlder "3.5";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "r0x0r";
|
|
|
|
repo = "pywebview";
|
2022-11-04 12:27:35 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2023-01-20 10:41:00 +00:00
|
|
|
hash = "sha256-5e05XkyxvOGLaEwKljYFppHQ99BxDQ7wPkViRlRo1VI=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-04-08 16:26:57 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
qt5.wrapQtAppsHook
|
|
|
|
];
|
2020-07-18 16:06:22 +00:00
|
|
|
|
2021-04-08 16:26:57 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
pyqtwebengine
|
2021-12-21 02:18:32 +00:00
|
|
|
proxy_tools
|
2022-04-27 09:35:20 +00:00
|
|
|
six
|
|
|
|
] ++ lib.optionals (pythonOlder "3.7") [
|
|
|
|
importlib-resources
|
|
|
|
];
|
2021-04-08 16:26:57 +00:00
|
|
|
|
|
|
|
checkInputs = [
|
2022-04-27 09:35:20 +00:00
|
|
|
pygobject3
|
2021-04-08 16:26:57 +00:00
|
|
|
pytest
|
2022-04-27 09:35:20 +00:00
|
|
|
qtpy
|
2021-05-20 23:08:51 +00:00
|
|
|
xvfb-run
|
2021-04-08 16:26:57 +00:00
|
|
|
];
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
checkPhase = ''
|
2021-04-08 16:26:57 +00:00
|
|
|
# Cannot create directory /homeless-shelter/.... Error: FILE_ERROR_ACCESS_DENIED
|
|
|
|
export HOME=$TMPDIR
|
|
|
|
# QStandardPaths: XDG_RUNTIME_DIR not set
|
|
|
|
export XDG_RUNTIME_DIR=$HOME/xdg-runtime-dir
|
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
pushd tests
|
2021-04-08 16:26:57 +00:00
|
|
|
substituteInPlace run.sh \
|
|
|
|
--replace "PYTHONPATH=.." "PYTHONPATH=$PYTHONPATH" \
|
|
|
|
--replace "pywebviewtest test_js_api.py::test_concurrent ''${PYTEST_OPTIONS}" "# skip flaky test_js_api.py::test_concurrent"
|
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
patchShebangs run.sh
|
2021-04-08 16:26:57 +00:00
|
|
|
wrapQtApp run.sh
|
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
xvfb-run -s '-screen 0 800x600x24' ./run.sh
|
|
|
|
popd
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"webview"
|
|
|
|
];
|
2021-12-21 02:18:32 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
2020-07-18 16:06:22 +00:00
|
|
|
description = "Lightweight cross-platform wrapper around a webview";
|
2022-04-27 09:35:20 +00:00
|
|
|
homepage = "https://github.com/r0x0r/pywebview";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ jojosch ];
|
|
|
|
};
|
|
|
|
}
|