nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 fetchpatch,
6 glibcLocales,
7 installShellFiles,
8 python3Packages,
9 sphinxHook,
10}:
11
12python3Packages.buildPythonApplication rec {
13 pname = "khal";
14 version = "0.13.0";
15 pyproject = true;
16
17 src = fetchFromGitHub {
18 owner = "pimutils";
19 repo = "khal";
20 tag = "v${version}";
21 hash = "sha256-pbBdScyYQMdT2NjCk2dKPkR75Zcizzco2IkXpHkgPR8=";
22 };
23
24 patches = [
25 # https://github.com/pimutils/khal/pull/1418/
26 (fetchpatch {
27 name = "fix_calendar_popup";
28 url = "https://github.com/pimutils/khal/commit/3fadf020bb65c9c95bba46b5d3695c2565cceacd.patch";
29 hash = "sha256-KhqP0RLLOXm1d/4rCVAb5f7v0q7N0/U2iM23+TcnJhY=";
30 })
31 ];
32
33 build-system = with python3Packages; [
34 setuptools
35 setuptools-scm
36 ];
37
38 nativeBuildInputs = [
39 glibcLocales
40 installShellFiles
41 sphinxHook
42 python3Packages.sphinx-rtd-theme
43 python3Packages.sphinxcontrib-newsfeed
44 ];
45
46 dependencies = with python3Packages; [
47 click
48 click-log
49 configobj
50 freezegun
51 icalendar
52 lxml
53 pkginfo
54 vdirsyncer
55 python-dateutil
56 pytz
57 pyxdg
58 requests-toolbelt
59 tzlocal
60 urwid
61 ];
62
63 nativeCheckInputs = with python3Packages; [
64 freezegun
65 hypothesis
66 packaging
67 pytestCheckHook
68 vdirsyncer
69 ];
70
71 outputs = [
72 "out"
73 "doc"
74 "man"
75 ];
76 sphinxBuilders = [
77 "html"
78 "man"
79 ];
80
81 postInstall = ''
82 # shell completions
83 installShellCompletion --cmd khal \
84 --bash <(_KHAL_COMPLETE=bash_source $out/bin/khal) \
85 --zsh <(_KHAL_COMPLETE=zsh_source $out/bin/khal) \
86 --fish <(_KHAL_COMPLETE=fish_source $out/bin/khal)
87
88 # .desktop file
89 install -Dm755 misc/khal.desktop -t $out/share/applications
90 '';
91
92 doCheck = !stdenv.hostPlatform.isAarch64;
93
94 env.LC_ALL = "en_US.UTF-8";
95
96 disabledTests = [
97 # timing based
98 "test_etag"
99 "test_bogota"
100 "test_event_no_dst"
101 ];
102
103 meta = {
104 description = "CLI calendar application";
105 homepage = "https://lostpackets.de/khal/";
106 changelog = "https://github.com/pimutils/khal/releases/tag/v${version}";
107 license = lib.licenses.mit;
108 maintainers = with lib.maintainers; [ antonmosich ];
109 };
110}