Merge branch 'staging' 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 ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
9 ;;;
10 ;;; This file is part of GNU Guix.
11 ;;;
12 ;;; GNU Guix is free software; you can redistribute it and/or modify it
13 ;;; under the terms of the GNU General Public License as published by
14 ;;; the Free Software Foundation; either version 3 of the License, or (at
15 ;;; your option) any later version.
16 ;;;
17 ;;; GNU Guix is distributed in the hope that it will be useful, but
18 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;;; GNU General Public License for more details.
21 ;;;
22 ;;; You should have received a copy of the GNU General Public License
23 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24
25 (define-module (gnu packages calendar)
26 #:use-module (gnu packages)
27 #:use-module ((guix licenses) #:prefix license:)
28 #:use-module (guix packages)
29 #:use-module (guix download)
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 dav)
36 #:use-module (gnu packages freedesktop)
37 #:use-module (gnu packages glib)
38 #:use-module (gnu packages gtk)
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 python-xyz)
44 #:use-module (gnu packages sphinx)
45 #:use-module (gnu packages sqlite)
46 #:use-module (gnu packages time)
47 #:use-module (gnu packages xml)
48 #:use-module (srfi srfi-26))
49
50 (define-public libical
51 (package
52 (name "libical")
53 (version "3.0.5")
54 (source (origin
55 (method url-fetch)
56 (uri (string-append
57 "https://github.com/libical/libical/releases/download/v"
58 version "/libical-" version ".tar.gz"))
59 (sha256
60 (base32
61 "1rkq9qkvbv76n6k6kc8pxhwj9vhyigkb6flfcn1rk6wwqk451mbs"))))
62 (build-system cmake-build-system)
63 (arguments
64 '(#:tests? #f ; test suite appears broken
65 #:configure-flags '("-DSHARED_ONLY=true")
66 #:phases
67 (modify-phases %standard-phases
68 (add-before 'configure 'patch-paths
69 (lambda* (#:key inputs #:allow-other-keys)
70 ;; FIXME: This should be patched to use TZDIR so we can drop
71 ;; the tzdata dependency.
72 (let ((tzdata (assoc-ref inputs "tzdata")))
73 (substitute* "src/libical/icaltz-util.c"
74 (("\\\"/usr/share/zoneinfo\\\",")
75 (string-append "\"" tzdata "/share/zoneinfo\""))
76 (("\\\"/usr/lib/zoneinfo\\\",") "")
77 (("\\\"/etc/zoneinfo\\\",") "")
78 (("\\\"/usr/share/lib/zoneinfo\\\"") "")))
79 #t)))))
80 (native-inputs
81 `(("gtk-doc" ,gtk-doc)
82 ("perl" ,perl)
83 ("pkg-config" ,pkg-config)))
84 (inputs
85 `(("glib" ,glib)
86 ("libxml2" ,libxml2)
87 ("tzdata" ,tzdata)))
88 (propagated-inputs
89 ;; In Requires.private of libical.pc.
90 `(("icu4c" ,icu4c)))
91 (home-page "https://libical.github.io/libical/")
92 (synopsis "iCalendar protocols and data formats implementation")
93 (description
94 "Libical is an implementation of the iCalendar protocols and protocol
95 data units.")
96 ;; Can be used with either license. See COPYING.
97 (license (list license:lgpl2.1 license:mpl2.0))))
98
99 (define-public khal
100 (package
101 (name "khal")
102 (version "0.10.1")
103 (source (origin
104 (method url-fetch)
105 (uri (pypi-uri "khal" version))
106 (sha256
107 (base32
108 "1r8bkgjwkh7i8ygvsv51h1cnax50sb183vafg66x5snxf3dgjl6l"))))
109 (build-system python-build-system)
110 (arguments
111 `(#:phases (modify-phases %standard-phases
112 ;; Building the manpage requires khal to be installed.
113 (add-after 'install 'manpage
114 (lambda* (#:key inputs outputs #:allow-other-keys)
115 ;; Make installed package available for running the tests
116 (add-installed-pythonpath inputs outputs)
117 (invoke "make" "--directory=doc/" "man")
118 (install-file
119 "doc/build/man/khal.1"
120 (string-append (assoc-ref outputs "out") "/share/man/man1"))
121 #t))
122 (replace 'check
123 (lambda* (#:key inputs #:allow-other-keys)
124 ;; The tests require us to choose a timezone.
125 (setenv "TZ"
126 (string-append (assoc-ref inputs "tzdata")
127 "/share/zoneinfo/Zulu"))
128 (invoke "py.test" "tests"))))))
129 (native-inputs
130 `(("python-pytest" ,python-pytest)
131 ("python-pytest-cov" ,python-pytest-cov)
132 ("python-setuptools-scm" ,python-setuptools-scm)
133 ;; Required for tests
134 ("python-freezegun" ,python-freezegun)
135 ("tzdata" ,tzdata-for-tests)
136 ("vdirsyncer" ,vdirsyncer)
137 ;; Required to build manpage
138 ("python-sphinxcontrib-newsfeed" ,python-sphinxcontrib-newsfeed)
139 ("python-sphinx" ,python-sphinx)))
140 (inputs
141 `(("sqlite" ,sqlite)))
142 (propagated-inputs
143 `(("python-configobj" ,python-configobj)
144 ("python-dateutil" ,python-dateutil)
145 ("python-icalendar" ,python-icalendar)
146 ("python-tzlocal" ,python-tzlocal)
147 ("python-urwid" ,python-urwid)
148 ("python-pyxdg" ,python-pyxdg)))
149 (synopsis "Console calendar program")
150 (description "Khal is a standards based console calendar program,
151 able to synchronize with CalDAV servers through vdirsyncer.")
152 (home-page "https://lostpackets.de/khal/")
153 (license license:expat)))
154
155 (define-public remind
156 (package
157 (name "remind")
158 (version "3.1.16")
159 (source
160 (origin
161 (method url-fetch)
162 (uri (string-append "https://dianne.skoll.ca/projects/remind/download/"
163 "remind-"
164 (string-join (map (cut string-pad <> 2 #\0)
165 (string-split version #\.))
166 ".")
167 ".tar.gz"))
168 (sha256
169 (base32 "14yavwqmimba8rdpwx3wlav9sfb0v5rcd1iyzqrs08wx07a9pdzf"))))
170 (build-system gnu-build-system)
171 (arguments
172 '(#:tests? #f)) ; no "check" target
173 (home-page "https://dianne.skoll.ca/projects/remind/")
174 (synopsis "Sophisticated calendar and alarm program")
175 (description
176 "Remind allows you to remind yourself of upcoming events and appointments.
177 Each reminder or alarm can consist of a message sent to standard output, or a
178 program to be executed. It also features: sophisticated date calculation,
179 moon phases, sunrise/sunset, Hebrew calendar, alarms, PostScript output and
180 proper handling of holidays.")
181 (license license:gpl2)))
182
183 (define-public libhdate
184 (package
185 (name "libhdate")
186 (version "1.6.02")
187 (source
188 (origin
189 (method url-fetch)
190 (uri (string-append "mirror://sourceforge/libhdate/libhdate/libhdate-"
191 version "/" name "-" version ".tar.bz2"))
192 (sha256
193 (base32
194 "0qkpq412p78znw8gckwcx3l0wcss9s0dgw1pvjb1ih2pxf6hm4rw"))))
195 (build-system gnu-build-system)
196 (home-page "http://libhdate.sourceforge.net/")
197 (synopsis "Library to use Hebrew dates")
198 (description "LibHdate is a small library for the Hebrew calendar and times
199 of day, written in C, and including bindings for C++, pascal, perl, php, python,
200 and ruby. It includes two illustrative command-line programs, @code{hcal} and
201 @code{hdate}, and some snippets and scripts written in the binding languages.")
202 (license license:gpl3+)))