Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / pyqtdarktheme / default.nix
blob0d60c8039898f29a16852360744a6824fd5d985f
1 { lib
2 , buildPythonPackage
3 , pythonOlder
4 , fetchFromGitHub
6 , darkdetect
7 , poetry-core
9 , pyqt5
10 , pytest-mock
11 , pytest-qt
12 , pytestCheckHook
13 , qt5
16 buildPythonPackage rec {
17   pname = "pyqtdarktheme";
18   version = "2.1.0";
19   pyproject = true;
21   disabled = pythonOlder "3.7";
23   src = fetchFromGitHub {
24     owner = "5yutan5";
25     repo = "PyQtDarkTheme";
26     rev = "v${version}";
27     hash = "sha256-jK+wnIyPE8Bav0pzbvVisYYCzdRshYw1S2t0H3Pro5M=";
28   };
30   patches = [
31     ./add-missing-argument-to-the-proxy-style-initializer.patch
32   ];
34   nativeBuildInputs = [
35     poetry-core
36   ];
38   propagatedBuildInputs = [
39     darkdetect
40   ];
42   nativeCheckInputs = [
43     pyqt5
44     pytest-mock
45     pytest-qt
46     pytestCheckHook
47   ];
49   pythonImportsCheck = [
50     "qdarktheme"
51   ];
53   prePatch = ''
54     sed -i 's#darkdetect = ".*"#darkdetect = "*"#' pyproject.toml
55   '';
57   preCheck = ''
58     export HOME=$(mktemp -d)
59     export QT_PLUGIN_PATH="${qt5.qtbase.bin}/${qt5.qtbase.qtPluginPrefix}"
60     export QT_QPA_PLATFORM_PLUGIN_PATH="${qt5.qtbase.bin}/lib/qt-${qt5.qtbase.version}/plugins";
61     export QT_QPA_PLATFORM=offscreen
62   '';
64   meta = with lib; {
65     description = "A flat dark theme for PySide and PyQt";
66     homepage = "https://pyqtdarktheme.readthedocs.io/en/stable";
67     license = licenses.mit;
68     maintainers = with maintainers; [ paveloom ];
69   };