2022-10-06 18:32:54 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
|
|
|
, glibcLocales
|
|
|
|
, installShellFiles
|
|
|
|
, python3
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-10-06 18:32:54 +00:00
|
|
|
python3.pkgs.buildPythonApplication rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "khal";
|
2022-07-14 12:49:19 +00:00
|
|
|
version = "0.10.5";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-10-06 18:32:54 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pimutils";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
|
|
|
hash = "sha256-FneJmoAOb7WjSgluCwlspf27IU3MsQZFKryL9OSSsUw=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-10-06 18:32:54 +00:00
|
|
|
SETUPTOOLS_SCM_PRETEND_VERSION = version;
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
glibcLocales
|
|
|
|
installShellFiles
|
|
|
|
] ++ (with python3.pkgs; [
|
|
|
|
setuptools-scm
|
|
|
|
sphinx
|
|
|
|
sphinxcontrib_newsfeed
|
|
|
|
]);
|
|
|
|
|
|
|
|
propagatedBuildInputs = with python3.pkgs;[
|
2020-04-24 23:36:52 +00:00
|
|
|
atomicwrites
|
|
|
|
click
|
|
|
|
click-log
|
|
|
|
configobj
|
2022-10-06 18:32:54 +00:00
|
|
|
freezegun
|
2020-04-24 23:36:52 +00:00
|
|
|
icalendar
|
|
|
|
lxml
|
2022-10-06 18:32:54 +00:00
|
|
|
pkginfo
|
2020-04-24 23:36:52 +00:00
|
|
|
pkgs.vdirsyncer
|
2022-10-06 18:32:54 +00:00
|
|
|
python-dateutil
|
2020-04-24 23:36:52 +00:00
|
|
|
pytz
|
|
|
|
pyxdg
|
2021-07-24 12:14:16 +00:00
|
|
|
requests-toolbelt
|
2020-04-24 23:36:52 +00:00
|
|
|
tzlocal
|
|
|
|
urwid
|
2022-10-06 18:32:54 +00:00
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = with python3.pkgs;[
|
2020-04-24 23:36:52 +00:00
|
|
|
freezegun
|
2022-10-06 18:32:54 +00:00
|
|
|
hypothesis
|
|
|
|
packaging
|
|
|
|
pytestCheckHook
|
|
|
|
vdirsyncer
|
|
|
|
];
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
# Tests working with latest pytz version, https://github.com/pimutils/khal/pull/1183
|
|
|
|
(fetchpatch {
|
|
|
|
name = "support-later-pytz.patch";
|
|
|
|
url = "https://github.com/pimutils/khal/commit/53eb8a7426d5c09478c78d809c4df4391438e246.patch";
|
|
|
|
sha256 = "sha256-drGtvJlQ3qFUdeukRWCFycPSZGWG/FSRqnbwJzFKITc=";
|
|
|
|
excludes = [
|
|
|
|
"CHANGELOG.rst"
|
|
|
|
];
|
|
|
|
})
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
2022-07-14 12:49:19 +00:00
|
|
|
# shell completions
|
|
|
|
installShellCompletion --cmd khal \
|
|
|
|
--bash <(_KHAL_COMPLETE=bash_source $out/bin/khal) \
|
2022-09-09 14:08:57 +00:00
|
|
|
--zsh <(_KHAL_COMPLETE=zsh_source $out/bin/khal) \
|
|
|
|
--fish <(_KHAL_COMPLETE=fish_source $out/bin/khal)
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# man page
|
|
|
|
PATH="${python3.withPackages (ps: with ps; [ sphinx sphinxcontrib_newsfeed ])}/bin:$PATH" \
|
|
|
|
make -C doc man
|
2022-10-06 18:32:54 +00:00
|
|
|
installManPage doc/build/man/khal.1
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-10-06 18:32:54 +00:00
|
|
|
# .desktop file
|
2020-04-24 23:36:52 +00:00
|
|
|
install -Dm755 misc/khal.desktop -t $out/share/applications
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = !stdenv.isAarch64;
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
LC_ALL = "en_US.UTF-8";
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# timing based
|
|
|
|
"test_etag"
|
2023-01-11 07:51:40 +00:00
|
|
|
"test_bogota"
|
|
|
|
"test_event_no_dst"
|
2022-08-12 12:06:08 +00:00
|
|
|
];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "CLI calendar application";
|
2022-10-06 18:32:54 +00:00
|
|
|
homepage = "http://lostpackets.de/khal/";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ gebner ];
|
2022-10-06 18:32:54 +00:00
|
|
|
broken = stdenv.isDarwin;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|