diff --git a/pkgs/development/python-modules/pywebview/default.nix b/pkgs/development/python-modules/pywebview/default.nix index 545fb2367322..a020517dcce2 100644 --- a/pkgs/development/python-modules/pywebview/default.nix +++ b/pkgs/development/python-modules/pywebview/default.nix @@ -1,25 +1,53 @@ -{ lib, buildPythonPackage, fetchFromGitHub, pythonOlder -, importlib-resources, pytest, xvfb_run }: +{ lib +, buildPythonPackage +, fetchFromGitHub +, importlib-resources +, pyqtwebengine +, pytest +, pythonOlder +, qt5 +, xvfb_run +}: buildPythonPackage rec { pname = "pywebview"; - version = "3.3.1"; + version = "3.4"; disabled = pythonOlder "3.5"; src = fetchFromGitHub { owner = "r0x0r"; repo = "pywebview"; rev = version; - sha256 = "015z7n0hdgkzn0p7aw1xsv6lwc260p8q67jx0zyd1zghnwyj8k79"; + sha256 = "sha256-3JHwtw8oReolEl4k8cdt7GCVGNkfWWJN6EnZYHxzDO8="; }; - propagatedBuildInputs = lib.optionals (pythonOlder "3.7") [ importlib-resources ]; + nativeBuildInputs = [ + qt5.wrapQtAppsHook + ]; - checkInputs = [ pytest xvfb_run ]; + propagatedBuildInputs = [ + pyqtwebengine + ] ++ lib.optionals (pythonOlder "3.7") [ importlib-resources ]; + + checkInputs = [ + pytest + xvfb_run + ]; checkPhase = '' + # 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 + pushd tests + 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" + patchShebangs run.sh + wrapQtApp run.sh + xvfb-run -s '-screen 0 800x600x24' ./run.sh popd '';