biome: 1.9.2 -> 1.9.3
[NixPkgs.git] / pkgs / applications / misc / khal / default.nix
blobb4151a9c5095cdebcaa04628e6e06addff8a80d6
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   glibcLocales,
6   installShellFiles,
7   python3,
8 }:
10 let
11   python = python3.override {
12     packageOverrides = self: super: {
13       # https://github.com/pimutils/khal/issues/1361
14       icalendar = super.icalendar.overridePythonAttrs (old: rec {
15         version = "5.0.13";
16         src = fetchFromGitHub {
17           owner = "collective";
18           repo = "icalendar";
19           rev = "refs/tags/v${version}";
20           hash = "sha256-2gpWfLXR4HThw23AWxY2rY9oiK6CF3Qiad8DWHCs4Qk=";
21         };
22         patches = [ ];
23         build-system = with self; [ setuptools ];
24         dependencies = with self; [
25           python-dateutil
26           pytz
27         ];
28       });
29     };
30   };
32 python.pkgs.buildPythonApplication rec {
33   pname = "khal";
34   version = "0.11.3";
35   pyproject = true;
37   src = fetchFromGitHub {
38     owner = "pimutils";
39     repo = "khal";
40     rev = "refs/tags/v${version}";
41     hash = "sha256-YP2kQ/qXPDwvFvlHf+A2Ymvk49dmt5tAnTaOhrOV92M=";
42   };
44   build-system = with python.pkgs; [
45     setuptools
46     setuptools-scm
47   ];
49   nativeBuildInputs = [
50     glibcLocales
51     installShellFiles
52   ];
54   dependencies = with python.pkgs; [
55     atomicwrites
56     click
57     click-log
58     configobj
59     freezegun
60     icalendar
61     lxml
62     pkginfo
63     vdirsyncer
64     python-dateutil
65     pytz
66     pyxdg
67     requests-toolbelt
68     tzlocal
69     urwid
70   ];
72   nativeCheckInputs = with python.pkgs; [
73     freezegun
74     hypothesis
75     packaging
76     pytestCheckHook
77     vdirsyncer
78   ];
80   postInstall = ''
81     # shell completions
82     installShellCompletion --cmd khal \
83       --bash <(_KHAL_COMPLETE=bash_source $out/bin/khal) \
84       --zsh <(_KHAL_COMPLETE=zsh_source $out/bin/khal) \
85       --fish <(_KHAL_COMPLETE=fish_source $out/bin/khal)
87     # man page
88     PATH="${
89       python3.withPackages (
90         ps: with ps; [
91           sphinx
92           sphinxcontrib-newsfeed
93         ]
94       )
95     }/bin:$PATH" \
96       make -C doc man
97     installManPage doc/build/man/khal.1
99     # .desktop file
100     install -Dm755 misc/khal.desktop -t $out/share/applications
101   '';
103   doCheck = !stdenv.hostPlatform.isAarch64;
105   env.LC_ALL = "en_US.UTF-8";
107   disabledTests = [
108     # timing based
109     "test_etag"
110     "test_bogota"
111     "test_event_no_dst"
112   ];
114   meta = with lib; {
115     description = "CLI calendar application";
116     homepage = "http://lostpackets.de/khal/";
117     changelog = "https://github.com/pimutils/khal/releases/tag/v${version}";
118     license = licenses.mit;
119     maintainers = with maintainers; [ gebner ];
120   };