Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib 2, buildPythonPackage 3, fetchFromGitHub 4, bottle 5, importlib-resources 6, proxy_tools 7, pygobject3 8, pyqtwebengine 9, pytest 10, pythonOlder 11, qt5 12, qtpy 13, six 14, xvfb-run 15}: 16 17buildPythonPackage rec { 18 pname = "pywebview"; 19 version = "4.1"; 20 format = "setuptools"; 21 22 disabled = pythonOlder "3.5"; 23 24 src = fetchFromGitHub { 25 owner = "r0x0r"; 26 repo = "pywebview"; 27 rev = "refs/tags/${version}"; 28 hash = "sha256-oqyWT0GaZ201OMVRcRpm1dma6NonTMmTx5SKnjzQl3M="; 29 }; 30 31 nativeBuildInputs = [ 32 qt5.wrapQtAppsHook 33 ]; 34 35 propagatedBuildInputs = [ 36 bottle 37 pyqtwebengine 38 proxy_tools 39 six 40 ] ++ lib.optionals (pythonOlder "3.7") [ 41 importlib-resources 42 ]; 43 44 nativeCheckInputs = [ 45 pygobject3 46 pytest 47 qtpy 48 xvfb-run 49 ]; 50 51 checkPhase = '' 52 # Cannot create directory /homeless-shelter/.... Error: FILE_ERROR_ACCESS_DENIED 53 export HOME=$TMPDIR 54 # QStandardPaths: XDG_RUNTIME_DIR not set 55 export XDG_RUNTIME_DIR=$HOME/xdg-runtime-dir 56 57 pushd tests 58 substituteInPlace run.sh \ 59 --replace "PYTHONPATH=.." "PYTHONPATH=$PYTHONPATH" \ 60 --replace "pywebviewtest test_js_api.py::test_concurrent ''${PYTEST_OPTIONS}" "# skip flaky test_js_api.py::test_concurrent" 61 62 patchShebangs run.sh 63 wrapQtApp run.sh 64 65 xvfb-run -s '-screen 0 800x600x24' ./run.sh 66 popd 67 ''; 68 69 pythonImportsCheck = [ 70 "webview" 71 ]; 72 73 meta = with lib; { 74 description = "Lightweight cross-platform wrapper around a webview"; 75 homepage = "https://github.com/r0x0r/pywebview"; 76 license = licenses.bsd3; 77 maintainers = with maintainers; [ jojosch ]; 78 }; 79}