khal: add patch for pytz support

This commit is contained in:
Fabian Affolter 2022-10-01 00:01:13 +02:00
parent a5a5849f27
commit 5f78f8116e

View file

@ -1,32 +1,71 @@
{ lib, stdenv, pkgs, python3, fetchpatch, glibcLocales, installShellFiles }: { lib
, stdenv
, fetchFromGitHub
, fetchpatch
, glibcLocales
, installShellFiles
, python3
}:
with python3.pkgs; buildPythonApplication rec { python3.pkgs.buildPythonApplication rec {
pname = "khal"; pname = "khal";
version = "0.10.5"; version = "0.10.5";
src = fetchPypi { src = fetchFromGitHub {
inherit pname version; owner = "pimutils";
sha256 = "sha256-Tu+3rDAqJthgbbOSgXWHpO2UwnoVvy6iEWFKRk/PDHY="; repo = pname;
rev = "v${version}";
hash = "sha256-FneJmoAOb7WjSgluCwlspf27IU3MsQZFKryL9OSSsUw=";
}; };
propagatedBuildInputs = [ SETUPTOOLS_SCM_PRETEND_VERSION = version;
nativeBuildInputs = [
glibcLocales
installShellFiles
] ++ (with python3.pkgs; [
setuptools-scm
sphinx
sphinxcontrib_newsfeed
]);
propagatedBuildInputs = with python3.pkgs;[
atomicwrites atomicwrites
click click
click-log click-log
configobj configobj
python-dateutil freezegun
icalendar icalendar
lxml lxml
pkginfo
pkgs.vdirsyncer pkgs.vdirsyncer
python-dateutil
pytz pytz
pyxdg pyxdg
requests-toolbelt requests-toolbelt
tzlocal tzlocal
urwid urwid
pkginfo
freezegun
]; ];
nativeBuildInputs = [ setuptools-scm sphinx sphinxcontrib_newsfeed installShellFiles ];
checkInputs = with python3.pkgs;[
freezegun
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"
];
})
];
postInstall = '' postInstall = ''
# shell completions # shell completions
@ -38,19 +77,14 @@ with python3.pkgs; buildPythonApplication rec {
# man page # man page
PATH="${python3.withPackages (ps: with ps; [ sphinx sphinxcontrib_newsfeed ])}/bin:$PATH" \ PATH="${python3.withPackages (ps: with ps; [ sphinx sphinxcontrib_newsfeed ])}/bin:$PATH" \
make -C doc man make -C doc man
install -Dm755 doc/build/man/khal.1 -t $out/share/man/man1 installManPage doc/build/man/khal.1
# desktop # .desktop file
install -Dm755 misc/khal.desktop -t $out/share/applications install -Dm755 misc/khal.desktop -t $out/share/applications
''; '';
doCheck = !stdenv.isAarch64; doCheck = !stdenv.isAarch64;
checkInputs = [
glibcLocales
pytestCheckHook
];
LC_ALL = "en_US.UTF-8"; LC_ALL = "en_US.UTF-8";
disabledTests = [ disabledTests = [
@ -59,10 +93,10 @@ with python3.pkgs; buildPythonApplication rec {
]; ];
meta = with lib; { meta = with lib; {
broken = stdenv.isDarwin;
homepage = "http://lostpackets.de/khal/";
description = "CLI calendar application"; description = "CLI calendar application";
homepage = "http://lostpackets.de/khal/";
license = licenses.mit; license = licenses.mit;
maintainers = with maintainers; [ gebner ]; maintainers = with maintainers; [ gebner ];
broken = stdenv.isDarwin;
}; };
} }