gnu: libical: Update to 3.0.2.
[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) #:prefix license:)
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 glib)
39 #:use-module (gnu packages icu4c)
40 #:use-module (gnu packages perl)
41 #:use-module (gnu packages pkg-config)
42 #:use-module (gnu packages python)
43 #:use-module (gnu packages time)
44 #:use-module (gnu packages xml)
45 #:use-module (srfi srfi-26))
46
47 (define-public libical
48 (package
49 (name "libical")
50 (version "3.0.2")
51 (source (origin
52 (method url-fetch)
53 (uri (string-append
54 "https://github.com/libical/libical/releases/download/v"
55 version "/libical-" version ".tar.gz"))
56 (sha256
57 (base32
58 "03k45dg79bf8lgymn94z2in1c3926v93h76xsap1svln63b3zg0c"))))
59 (build-system cmake-build-system)
60 (arguments
61 '(#:tests? #f ; test suite appears broken
62 #:configure-flags '("-DSHARED_ONLY=true")
63 #:phases
64 (modify-phases %standard-phases
65 (add-before 'configure 'patch-paths
66 (lambda* (#:key inputs #:allow-other-keys)
67 ;; FIXME: This should be patched to use TZDIR so we can drop
68 ;; the tzdata dependency.
69 (let ((tzdata (assoc-ref inputs "tzdata")))
70 (substitute* "src/libical/icaltz-util.c"
71 (("\\\"/usr/share/zoneinfo\\\",")
72 (string-append "\"" tzdata "/share/zoneinfo\""))
73 (("\\\"/usr/lib/zoneinfo\\\",") "")
74 (("\\\"/etc/zoneinfo\\\",") "")
75 (("\\\"/usr/share/lib/zoneinfo\\\"") "")))
76 #t)))))
77 (native-inputs
78 `(("perl" ,perl)
79 ("pkg-config" ,pkg-config)))
80 (inputs
81 `(("glib" ,glib)
82 ("libxml2" ,libxml2)
83 ("tzdata" ,tzdata)))
84 (propagated-inputs
85 ;; In Requires.private of libical.pc.
86 `(("icu4c" ,icu4c)))
87 (home-page "https://libical.github.io/libical/")
88 (synopsis "iCalendar protocols and data formats implementation")
89 (description
90 "Libical is an implementation of the iCalendar protocols and protocol
91 data units.")
92 ;; Can be used with either license. See COPYING.
93 (license (list license:lgpl2.1 license:mpl2.0))))
94
95 (define-public khal
96 (package
97 (name "khal")
98 (version "0.9.8")
99 (source (origin
100 (method url-fetch)
101 (uri (pypi-uri "khal" version))
102 (sha256
103 (base32
104 "1blx3gxnv7sj302biqphfw7i6ilzl2xlmvzp130n3113scg9w17y"))))
105 (build-system python-build-system)
106 (arguments
107 `(#:phases (modify-phases %standard-phases
108 ;; Building the manpage requires khal to be installed.
109 (add-after 'install 'manpage
110 (lambda* (#:key inputs outputs #:allow-other-keys)
111 ;; Make installed package available for running the tests
112 (add-installed-pythonpath inputs outputs)
113 (and
114 (zero? (system* "make" "--directory=doc/" "man"))
115 (install-file
116 "doc/build/man/khal.1"
117 (string-append (assoc-ref outputs "out") "/share/man/man1")))))
118 (replace 'check
119 (lambda* (#:key inputs #:allow-other-keys)
120 ;; The tests require us to choose a timezone.
121 (setenv "TZ"
122 (string-append (assoc-ref inputs "tzdata")
123 "/share/zoneinfo/Zulu"))
124 (zero? (system* "py.test" "tests" "-k"
125 (string-append
126 ;; These tests are known to fail in when not
127 ;; running in a TTY:
128 ;; https://github.com/pimutils/khal/issues/683
129 "not test_printics_read_from_stdin "
130 "and not test_import_from_stdin"))))))))
131 (native-inputs
132 `(("python-pytest" ,python-pytest)
133 ("python-pytest-cov" ,python-pytest-cov)
134 ("python-setuptools-scm" ,python-setuptools-scm)
135 ;; Required for tests
136 ("python-freezegun" ,python-freezegun)
137 ("tzdata" ,tzdata)
138 ("vdirsyncer" ,vdirsyncer)
139 ;; Required to build manpage
140 ("python-sphinxcontrib-newsfeed" ,python-sphinxcontrib-newsfeed)
141 ("python-sphinx" ,python-sphinx)))
142 (inputs
143 `(("sqlite" ,sqlite)))
144 (propagated-inputs
145 `(("python-configobj" ,python-configobj)
146 ("python-dateutil" ,python-dateutil)
147 ("python-icalendar" ,python-icalendar)
148 ("python-tzlocal" ,python-tzlocal)
149 ("python-urwid" ,python-urwid)
150 ("python-pyxdg" ,python-pyxdg)))
151 (synopsis "Console calendar program")
152 (description "Khal is a standards based console calendar program,
153 able to synchronize with CalDAV servers through vdirsyncer.")
154 (home-page "http://lostpackets.de/khal/")
155 (license license:expat)))
156
157 (define-public remind
158 (package
159 (name "remind")
160 (version "3.1.15")
161 (source
162 (origin
163 (method url-fetch)
164 (uri (string-append "https://www.roaringpenguin.com/files/download/"
165 "remind-"
166 (string-join (map (cut string-pad <> 2 #\0)
167 (string-split version #\.))
168 ".")
169 ".tar.gz"))
170 (sha256
171 (base32
172 "1hcfcxz5fjzl7606prlb7dgls5kr8z3wb51h48s6qm8ang0b9nla"))))
173 (build-system gnu-build-system)
174 (arguments
175 '(#:tests? #f)) ;no "check" target
176 (home-page "http://www.roaringpenguin.com/products/remind/")
177 (synopsis "Sophisticated calendar and alarm program")
178 (description
179 "Remind allows you to remind yourself of upcoming events and appointments.
180 Each reminder or alarm can consist of a message sent to standard output, or a
181 program to be executed. It also features: sophisticated date calculation,
182 moon phases, sunrise/sunset, Hebrew calendar, alarms, PostScript output and
183 proper handling of holidays.")
184 (license license:gpl2)))
185
186 (define-public libhdate
187 (package
188 (name "libhdate")
189 (version "1.6.02")
190 (source
191 (origin
192 (method url-fetch)
193 (uri (string-append "mirror://sourceforge/libhdate/libhdate/libhdate-"
194 version "/" name "-" version ".tar.bz2"))
195 (sha256
196 (base32
197 "0qkpq412p78znw8gckwcx3l0wcss9s0dgw1pvjb1ih2pxf6hm4rw"))))
198 (build-system gnu-build-system)
199 (home-page "http://libhdate.sourceforge.net/")
200 (synopsis "Library to use Hebrew dates")
201 (description "LibHdate is a small library for the Hebrew calendar and times
202 of day, written in C, and including bindings for C++, pascal, perl, php, python,
203 and ruby. It includes two illustrative command-line programs, @code{hcal} and
204 @code{hdate}, and some snippets and scripts written in the binding languages.")
205 (license license:gpl3+)))