python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / applications / misc / khal / default.nix
blobb4819b70a93333318cd359c259c3b6462ba4905f
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , fetchpatch
5 , glibcLocales
6 , installShellFiles
7 , python3
8 }:
10 python3.pkgs.buildPythonApplication rec {
11   pname = "khal";
12   version = "0.10.5";
14   src = fetchFromGitHub {
15     owner = "pimutils";
16     repo = pname;
17     rev = "v${version}";
18     hash = "sha256-FneJmoAOb7WjSgluCwlspf27IU3MsQZFKryL9OSSsUw=";
19   };
21   SETUPTOOLS_SCM_PRETEND_VERSION = version;
23   nativeBuildInputs = [
24     glibcLocales
25     installShellFiles
26   ] ++ (with python3.pkgs; [
27     setuptools-scm
28     sphinx
29     sphinxcontrib_newsfeed
30   ]);
32   propagatedBuildInputs = with python3.pkgs;[
33     atomicwrites
34     click
35     click-log
36     configobj
37     freezegun
38     icalendar
39     lxml
40     pkginfo
41     pkgs.vdirsyncer
42     python-dateutil
43     pytz
44     pyxdg
45     requests-toolbelt
46     tzlocal
47     urwid
48   ];
50   checkInputs = with python3.pkgs;[
51     freezegun
52     hypothesis
53     packaging
54     pytestCheckHook
55     vdirsyncer
56   ];
58   patches = [
59     # Tests working with latest pytz version, https://github.com/pimutils/khal/pull/1183
60     (fetchpatch {
61       name = "support-later-pytz.patch";
62       url = "https://github.com/pimutils/khal/commit/53eb8a7426d5c09478c78d809c4df4391438e246.patch";
63       sha256 = "sha256-drGtvJlQ3qFUdeukRWCFycPSZGWG/FSRqnbwJzFKITc=";
64       excludes = [
65         "CHANGELOG.rst"
66       ];
67     })
68   ];
70   postInstall = ''
71     # shell completions
72     installShellCompletion --cmd khal \
73       --bash <(_KHAL_COMPLETE=bash_source $out/bin/khal) \
74       --zsh <(_KHAL_COMPLETE=zsh_source $out/bin/khal) \
75       --fish <(_KHAL_COMPLETE=fish_source $out/bin/khal)
77     # man page
78     PATH="${python3.withPackages (ps: with ps; [ sphinx sphinxcontrib_newsfeed ])}/bin:$PATH" \
79     make -C doc man
80     installManPage doc/build/man/khal.1
82     # .desktop file
83     install -Dm755 misc/khal.desktop -t $out/share/applications
84   '';
86   doCheck = !stdenv.isAarch64;
88   LC_ALL = "en_US.UTF-8";
90   disabledTests = [
91     # timing based
92     "test_etag"
93   ];
95   meta = with lib; {
96     description = "CLI calendar application";
97     homepage = "http://lostpackets.de/khal/";
98     license = licenses.mit;
99     maintainers = with maintainers; [ gebner ];
100     broken = stdenv.isDarwin;
101   };