Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / calendar.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015 David Thompson <davet@gnu.org>
3 ;;; Copyright © 2015, 2016, 2017 Leo Famulari <leo@famulari.name>
4 ;;; Copyright © 2016 Kei Kebreau <kkebreau@posteo.net>
5 ;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
6 ;;; Copyright © 2016 Troy Sankey <sankeytms@gmail.com>
7 ;;; Copyright © 2016 Stefan Reichoer <stefan@xsteve.at>
8 ;;;
9 ;;; This file is part of GNU Guix.
10 ;;;
11 ;;; GNU Guix is free software; you can redistribute it and/or modify it
12 ;;; under the terms of the GNU General Public License as published by
13 ;;; the Free Software Foundation; either version 3 of the License, or (at
14 ;;; your option) any later version.
15 ;;;
16 ;;; GNU Guix is distributed in the hope that it will be useful, but
17 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;;; GNU General Public License for more details.
20 ;;;
21 ;;; You should have received a copy of the GNU General Public License
22 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23
24 (define-module (gnu packages calendar)
25 #:use-module (gnu packages)
26 #:use-module (guix licenses)
27 #:use-module (guix packages)
28 #:use-module (guix download)
29 #:use-module (guix build utils)
30 #:use-module (guix build-system gnu)
31 #:use-module (guix build-system cmake)
32 #:use-module (guix build-system python)
33 #:use-module (gnu packages base)
34 #:use-module (gnu packages check)
35 #:use-module (gnu packages databases)
36 #:use-module (gnu packages dav)
37 #:use-module (gnu packages freedesktop)
38 #:use-module (gnu packages icu4c)
39 #:use-module (gnu packages perl)
40 #:use-module (gnu packages python)
41 #:use-module (gnu packages time)
42 #:use-module (srfi srfi-26))
43
44 (define-public libical
45 (package
46 (name "libical")
47 (version "2.0.0")
48 (source (origin
49 (method url-fetch)
50 (uri (string-append
51 "https://github.com/libical/libical/releases/download/v"
52 version "/libical-" version ".tar.gz"))
53 (sha256
54 (base32
55 "1njn2kr0rrjqv5g3hdhpdzrhankyj4fl1bgn76z3g4n1b7vi2k35"))))
56 (build-system cmake-build-system)
57 (arguments
58 '(#:tests? #f ; test suite appears broken
59 #:phases
60 (modify-phases %standard-phases
61 (add-before 'configure 'patch-paths
62 (lambda _
63 (let ((tzdata (assoc-ref %build-inputs "tzdata")))
64 (substitute* "src/libical/icaltz-util.c"
65 (("\\\"/usr/share/zoneinfo\\\",")
66 (string-append "\"" tzdata "/share/zoneinfo\""))
67 (("\\\"/usr/lib/zoneinfo\\\",") "")
68 (("\\\"/etc/zoneinfo\\\",") "")
69 (("\\\"/usr/share/lib/zoneinfo\\\"") "")))
70 #t)))))
71 (native-inputs
72 `(("perl" ,perl)))
73 (inputs
74 `(("icu4c" ,icu4c)
75 ("tzdata" ,tzdata)))
76 (home-page "https://libical.github.io/libical/")
77 (synopsis "iCalendar protocols and data formats implementation")
78 (description
79 "Libical is an implementation of the iCalendar protocols and protocol
80 data units.")
81 (license lgpl2.1)))
82
83 (define-public khal
84 (package
85 (name "khal")
86 (version "0.9.8")
87 (source (origin
88 (method url-fetch)
89 (uri (pypi-uri "khal" version))
90 (sha256
91 (base32
92 "1blx3gxnv7sj302biqphfw7i6ilzl2xlmvzp130n3113scg9w17y"))))
93 (build-system python-build-system)
94 (arguments
95 `(#:phases (modify-phases %standard-phases
96 ;; Building the manpage requires khal to be installed.
97 (add-after 'install 'manpage
98 (lambda* (#:key inputs outputs #:allow-other-keys)
99 ;; Make installed package available for running the tests
100 (add-installed-pythonpath inputs outputs)
101 (and
102 (zero? (system* "make" "--directory=doc/" "man"))
103 (install-file
104 "doc/build/man/khal.1"
105 (string-append (assoc-ref outputs "out") "/share/man/man1")))))
106 (replace 'check
107 (lambda* (#:key inputs #:allow-other-keys)
108 ;; The tests require us to choose a timezone.
109 (setenv "TZ"
110 (string-append (assoc-ref inputs "tzdata")
111 "/share/zoneinfo/Zulu"))
112 (zero? (system* "py.test" "tests" "-k"
113 (string-append
114 ;; These tests are known to fail in when not
115 ;; running in a TTY:
116 ;; https://github.com/pimutils/khal/issues/683
117 "not test_printics_read_from_stdin "
118 "and not test_import_from_stdin"))))))))
119 (native-inputs
120 `(("python-pytest" ,python-pytest)
121 ("python-pytest-cov" ,python-pytest-cov)
122 ("python-setuptools-scm" ,python-setuptools-scm)
123 ;; Required for tests
124 ("python-freezegun" ,python-freezegun)
125 ("tzdata" ,tzdata)
126 ("vdirsyncer" ,vdirsyncer)
127 ;; Required to build manpage
128 ("python-sphinxcontrib-newsfeed" ,python-sphinxcontrib-newsfeed)
129 ("python-sphinx" ,python-sphinx)))
130 (inputs
131 `(("sqlite" ,sqlite)))
132 (propagated-inputs
133 `(("python-configobj" ,python-configobj)
134 ("python-dateutil" ,python-dateutil)
135 ("python-icalendar" ,python-icalendar)
136 ("python-tzlocal" ,python-tzlocal)
137 ("python-urwid" ,python-urwid)
138 ("python-pyxdg" ,python-pyxdg)))
139 (synopsis "Console calendar program")
140 (description "Khal is a standards based console calendar program,
141 able to synchronize with CalDAV servers through vdirsyncer.")
142 (home-page "http://lostpackets.de/khal/")
143 (license expat)))
144
145 (define-public remind
146 (package
147 (name "remind")
148 (version "3.1.15")
149 (source
150 (origin
151 (method url-fetch)
152 (uri (string-append "https://www.roaringpenguin.com/files/download/"
153 "remind-"
154 (string-join (map (cut string-pad <> 2 #\0)
155 (string-split version #\.))
156 ".")
157 ".tar.gz"))
158 (sha256
159 (base32
160 "1hcfcxz5fjzl7606prlb7dgls5kr8z3wb51h48s6qm8ang0b9nla"))))
161 (build-system gnu-build-system)
162 (arguments
163 '(#:tests? #f)) ;no "check" target
164 (home-page "http://www.roaringpenguin.com/products/remind/")
165 (synopsis "Sophisticated calendar and alarm program")
166 (description
167 "Remind allows you to remind yourself of upcoming events and appointments.
168 Each reminder or alarm can consist of a message sent to standard output, or a
169 program to be executed. It also features: sophisticated date calculation,
170 moon phases, sunrise/sunset, Hebrew calendar, alarms, PostScript output and
171 proper handling of holidays.")
172 (license gpl2)))
173
174 (define-public libhdate
175 (package
176 (name "libhdate")
177 (version "1.6.02")
178 (source
179 (origin
180 (method url-fetch)
181 (uri (string-append "mirror://sourceforge/libhdate/libhdate/libhdate-"
182 version "/" name "-" version ".tar.bz2"))
183 (sha256
184 (base32
185 "0qkpq412p78znw8gckwcx3l0wcss9s0dgw1pvjb1ih2pxf6hm4rw"))))
186 (build-system gnu-build-system)
187 (home-page "http://libhdate.sourceforge.net/")
188 (synopsis "Library to use Hebrew dates")
189 (description "LibHdate is a small library for the Hebrew calendar and times
190 of day, written in C, and including bindings for C++, pascal, perl, php, python,
191 and ruby. It includes two illustrative command-line programs, @code{hcal} and
192 @code{hdate}, and some snippets and scripts written in the binding languages.")
193 (license gpl3+)))