Merge branch 'master' into staging
[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, 2020 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 ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com
10 ;;; Copyright © 2020 Brendan Tildesley <mail@brendan.scot>
11 ;;; Copyright © 2020 Tanguy Le Carrour <tanguy@bioneland.org>
12 ;;;
13 ;;; This file is part of GNU Guix.
14 ;;;
15 ;;; GNU Guix is free software; you can redistribute it and/or modify it
16 ;;; under the terms of the GNU General Public License as published by
17 ;;; the Free Software Foundation; either version 3 of the License, or (at
18 ;;; your option) any later version.
19 ;;;
20 ;;; GNU Guix is distributed in the hope that it will be useful, but
21 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 ;;; GNU General Public License for more details.
24 ;;;
25 ;;; You should have received a copy of the GNU General Public License
26 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
27
28 (define-module (gnu packages calendar)
29 #:use-module (gnu packages)
30 #:use-module ((guix licenses) #:prefix license:)
31 #:use-module (guix git-download)
32 #:use-module (guix packages)
33 #:use-module (guix download)
34 #:use-module (guix build-system gnu)
35 #:use-module (guix build-system cmake)
36 #:use-module (guix build-system python)
37 #:use-module (gnu packages base)
38 #:use-module (gnu packages check)
39 #:use-module (gnu packages dav)
40 #:use-module (gnu packages docbook)
41 #:use-module (gnu packages freedesktop)
42 #:use-module (gnu packages glib)
43 #:use-module (gnu packages gnome)
44 #:use-module (gnu packages gtk)
45 #:use-module (gnu packages icu4c)
46 #:use-module (gnu packages perl)
47 #:use-module (gnu packages pkg-config)
48 #:use-module (gnu packages python)
49 #:use-module (gnu packages python-xyz)
50 #:use-module (gnu packages qt)
51 #:use-module (gnu packages sphinx)
52 #:use-module (gnu packages sqlite)
53 #:use-module (gnu packages time)
54 #:use-module (gnu packages xml)
55 #:use-module (srfi srfi-26))
56
57 (define-public date
58 ;; We make the same choice as the Arch package maintainer by choosing a
59 ;; recent commit to fix some bugs.
60 ;; https://github.com/Alexays/Waybar/issues/565
61 (let ((commit "9a0ee2542848ab8625984fc8cdbfb9b5414c0082"))
62 (package
63 (name "date")
64 (version (string-append "2.4.1-" (string-take commit 8)))
65 (source
66 (origin
67 (method git-fetch)
68 (uri (git-reference
69 (url "https://github.com/HowardHinnant/date")
70 (commit "9a0ee2542848ab8625984fc8cdbfb9b5414c0082")))
71 (file-name (git-file-name name version))
72 (sha256
73 (base32 "0yxsn0hj22n61bjywysxqgfv7hj5xvsl6isma95fl8xrimpny083"))
74 (patches
75 ;; Install pkg-config files
76 ;; https://github.com/HowardHinnant/date/pull/538
77 (search-patches "date-output-pkg-config-files.patch"))))
78 (inputs `(("tzdata" ,tzdata)))
79 (build-system cmake-build-system)
80 (arguments
81 '(#:configure-flags (list "-DUSE_SYSTEM_TZ_DB=ON"
82 "-DBUILD_SHARED_LIBS=ON"
83 "-DBUILD_TZ_LIB=ON"
84 "-DENABLE_DATE_TESTING=ON")
85 #:phases
86 (modify-phases %standard-phases
87 (add-after 'unpack 'patch-bin-bash
88 (lambda* (#:key inputs #:allow-other-keys)
89 (substitute* "compile_fail.sh"
90 (("/bin/bash") (which "bash")))
91 #t))
92 (add-after 'unpack 'patch-zoneinfo-path
93 (lambda* (#:key inputs #:allow-other-keys)
94 (substitute* "src/tz.cpp"
95 (("/usr/share/zoneinfo")
96 (string-append (assoc-ref inputs "tzdata") "/share/zoneinfo")))
97 #t))
98 (replace 'check
99 (lambda _
100 ;; Disable test that requires checking timezone that
101 ;; isn't set in the build environment.
102 (substitute* "CTestTestfile.cmake"
103 (("add_test.tz_test_pass_zoned_time_deduction_test.*") "")
104 (("set_tests_properties.tz_test_pass_zoned_time_deduction_test.*") ""))
105 (invoke "make" "testit"))))))
106 (synopsis "Date and time library for C++11 and C++14")
107 (description "Date is a header only C++ library that extends the chrono
108 date algorithms library for calendar dates and durations. It also provides
109 the <tz.h> library for handling time zones and leap seconds.")
110 (home-page "https://howardhinnant.github.io/date/date.html")
111 (license license:expat))))
112
113 (define-public libical
114 (package
115 (name "libical")
116 (version "3.0.8")
117 (source (origin
118 (method url-fetch)
119 (uri (string-append
120 "https://github.com/libical/libical/releases/download/v"
121 version "/libical-" version ".tar.gz"))
122 (sha256
123 (base32
124 "0vr8s7hn8204lyc4ys5bs3j5qss4lmc9ffly2m1a59avyz5cmzh9"))))
125 (build-system cmake-build-system)
126 (arguments
127 '(#:tests? #f ; test suite appears broken
128 #:parallel-build? #f ;may cause GIR generation failure
129 #:configure-flags '("-DSHARED_ONLY=true"
130 ;; required by evolution-data-server
131 "-DGOBJECT_INTROSPECTION=true"
132 "-DICAL_GLIB_VAPI=true")
133 #:phases
134 (modify-phases %standard-phases
135 (add-after 'unpack 'patch-docbook-reference
136 (lambda* (#:key inputs #:allow-other-keys)
137 (substitute* "doc/reference/libical-glib/libical-glib-docs.sgml.in"
138 (("http://www.oasis-open.org/docbook/xml/4.3/")
139 (string-append (assoc-ref inputs "docbook-xml")
140 "/xml/dtd/docbook/")))
141 #t))
142 (add-before 'configure 'patch-paths
143 (lambda* (#:key inputs #:allow-other-keys)
144 ;; TODO: libical 3.1.0 supports using TZDIR instead of a hard-coded
145 ;; zoneinfo database. When that is released we can drop
146 ;; the tzdata dependency.
147 (let ((tzdata (assoc-ref inputs "tzdata")))
148 (substitute* "src/libical/icaltz-util.c"
149 (("\\\"/usr/share/zoneinfo\\\",")
150 (string-append "\"" tzdata "/share/zoneinfo\""))
151 (("\\\"/usr/lib/zoneinfo\\\",") "")
152 (("\\\"/etc/zoneinfo\\\",") "")
153 (("\\\"/usr/share/lib/zoneinfo\\\"") "")))
154 #t)))))
155 (native-inputs
156 `(("docbook-xml" ,docbook-xml-4.3)
157 ("gobject-introspection" ,gobject-introspection)
158 ("gtk-doc" ,gtk-doc)
159 ("perl" ,perl)
160 ("pkg-config" ,pkg-config)
161 ("vala" ,vala)))
162 (inputs
163 `(("glib" ,glib)
164 ("libxml2" ,libxml2)
165 ("tzdata" ,tzdata)))
166 (propagated-inputs
167 ;; In Requires.private of libical.pc.
168 `(("icu4c" ,icu4c)))
169 (home-page "https://libical.github.io/libical/")
170 (synopsis "iCalendar protocols and data formats implementation")
171 (description
172 "Libical is an implementation of the iCalendar protocols and protocol
173 data units.")
174 ;; Can be used with either license. See COPYING.
175 (license (list license:lgpl2.1 license:mpl2.0))))
176
177 (define-public khal
178 (package
179 (name "khal")
180 (version "0.10.1")
181 (source (origin
182 (method url-fetch)
183 (uri (pypi-uri "khal" version))
184 (sha256
185 (base32
186 "1r8bkgjwkh7i8ygvsv51h1cnax50sb183vafg66x5snxf3dgjl6l"))
187 (patches
188 (list
189 (origin
190 (method url-fetch)
191 ;; This patch fixes an issue with python-urwid-2.1.0
192 (uri "https://github.com/pimutils/khal/commit/2c5990c2de2015b251ba23617faa40ee11b8c22a.patch")
193 (file-name "khal-compat-urwid-2.1.0.patch")
194 (sha256
195 (base32
196 "11nd8hkjz68imwqqn0p54zmb53z2pfxmzchaviy7jc1ky5s9l663")))))))
197 (build-system python-build-system)
198 (arguments
199 `(#:phases (modify-phases %standard-phases
200 ;; Building the manpage requires khal to be installed.
201 (add-after 'install 'manpage
202 (lambda* (#:key inputs outputs #:allow-other-keys)
203 ;; Make installed package available for running the tests
204 (add-installed-pythonpath inputs outputs)
205 (invoke "make" "--directory=doc/" "man")
206 (install-file
207 "doc/build/man/khal.1"
208 (string-append (assoc-ref outputs "out") "/share/man/man1"))
209 #t))
210 (add-before 'check 'fix-tests
211 (lambda _
212 ;; Reported upstream: <https://github.com/pimutils/khal/issues/947>.
213 (substitute* "tests/cli_test.py"
214 (("Invalid value for \"\\[ICS\\]\"") "Invalid value for \\'[ICS]\\'"))
215 #t))
216 (replace 'check
217 (lambda* (#:key inputs #:allow-other-keys)
218 ;; The tests require us to choose a timezone.
219 (setenv "TZ"
220 (string-append (assoc-ref inputs "tzdata")
221 "/share/zoneinfo/Zulu"))
222 (invoke "py.test" "tests"))))))
223 (native-inputs
224 `(("python-pytest" ,python-pytest)
225 ("python-pytest-cov" ,python-pytest-cov)
226 ("python-setuptools-scm" ,python-setuptools-scm)
227 ;; Required for tests
228 ("python-freezegun" ,python-freezegun)
229 ("tzdata" ,tzdata-for-tests)
230 ("vdirsyncer" ,vdirsyncer)
231 ;; Required to build manpage
232 ("python-sphinxcontrib-newsfeed" ,python-sphinxcontrib-newsfeed)
233 ("python-sphinx" ,python-sphinx)))
234 (inputs
235 `(("sqlite" ,sqlite)
236 ("python-configobj" ,python-configobj)
237 ("python-dateutil" ,python-dateutil)
238 ("python-icalendar" ,python-icalendar)
239 ("python-tzlocal" ,python-tzlocal)
240 ("python-urwid" ,python-urwid)
241 ("python-pyxdg" ,python-pyxdg)))
242 (synopsis "Console calendar program")
243 (description "Khal is a standards based console calendar program,
244 able to synchronize with CalDAV servers through vdirsyncer.")
245 (home-page "https://lostpackets.de/khal/")
246 (license license:expat)))
247
248 (define-public remind
249 (package
250 (name "remind")
251 (version "3.1.17")
252 (source
253 (origin
254 (method url-fetch)
255 (uri (string-append "https://dianne.skoll.ca/projects/remind/download/"
256 "remind-"
257 (string-join (map (cut string-pad <> 2 #\0)
258 (string-split version #\.))
259 ".")
260 ".tar.gz"))
261 (sha256
262 (base32 "0lgyc2j69aqqk4knywr8inz4fsnni0zq54dgqh7p4s6kzybc2mf9"))))
263 (build-system gnu-build-system)
264 (arguments
265 '(#:tests? #f)) ; no "check" target
266 (home-page "https://dianne.skoll.ca/projects/remind/")
267 (synopsis "Sophisticated calendar and alarm program")
268 (description
269 "Remind allows you to remind yourself of upcoming events and appointments.
270 Each reminder or alarm can consist of a message sent to standard output, or a
271 program to be executed. It also features: sophisticated date calculation,
272 moon phases, sunrise/sunset, Hebrew calendar, alarms, PostScript output and
273 proper handling of holidays.")
274 (license license:gpl2)))
275
276 (define-public libhdate
277 (package
278 (name "libhdate")
279 (version "1.6.02")
280 (source
281 (origin
282 (method url-fetch)
283 (uri (string-append "mirror://sourceforge/libhdate/libhdate/libhdate-"
284 version "/" name "-" version ".tar.bz2"))
285 (sha256
286 (base32
287 "0qkpq412p78znw8gckwcx3l0wcss9s0dgw1pvjb1ih2pxf6hm4rw"))))
288 (build-system gnu-build-system)
289 (home-page "http://libhdate.sourceforge.net/")
290 (synopsis "Library to use Hebrew dates")
291 (description "LibHdate is a small library for the Hebrew calendar and times
292 of day, written in C, and including bindings for C++, pascal, perl, php, python,
293 and ruby. It includes two illustrative command-line programs, @code{hcal} and
294 @code{hdate}, and some snippets and scripts written in the binding languages.")
295 (license license:gpl3+)))
296
297 (define-public confclerk
298 (package
299 (name "confclerk")
300 (version "0.6.4")
301 (source
302 (origin
303 (method url-fetch)
304 (uri (string-append "https://www.toastfreeware.priv.at/tarballs/"
305 "confclerk/confclerk-" version ".tar.gz"))
306 (sha256
307 (base32
308 "10rhg44px4nvbkd3p341cmp2ds43jn8r4rvgladda9v8zmsgr2b3"))))
309 (build-system gnu-build-system)
310 (arguments
311 '(#:phases
312 (modify-phases %standard-phases
313 (replace 'configure
314 (lambda* (#:key outputs #:allow-other-keys)
315 (let ((out (assoc-ref outputs "out")))
316 ;; Install directory is currently hard-coded.
317 (substitute* "src/app/app.pro"
318 (("PREFIX = /usr/bin")
319 (string-append "PREFIX =" out "/bin")))
320 (invoke "qmake"))))
321 (add-after 'install 'install-docs
322 (lambda* (#:key outputs #:allow-other-keys)
323 (let* ((out (assoc-ref outputs "out"))
324 (share (string-append out "/share")))
325 (install-file "data/confclerk.1"
326 (string-append share "/man/man1"))
327 (install-file "data/confclerk.desktop"
328 (string-append share "/applications"))
329 (install-file "data/confclerk.svg"
330 (string-append share "/icons/hicolor/scalable/apps"))
331 #t))))
332 #:tests? #f)) ; no tests
333 (native-inputs
334 `(("perl" ,perl))) ; pod2man
335 (inputs
336 `(("qtbase" ,qtbase)))
337 (home-page "https://www.toastfreeware.priv.at/confclerk")
338 (synopsis "Offline conference schedule application")
339 (description
340 "ConfClerk is an application written in Qt, which makes conference schedules
341 available offline. It displays the conference schedule from various views,
342 support searches on various items (speaker, speech topic, location, etc.) and
343 enables you to select favorite events and create your own schedule.
344
345 At the moment ConfClerk is able to import schedules in XML format created by
346 the PentaBarf conference management system (or frab) used by e.g. FOSDEM,
347 DebConf, FrOSCon, Grazer LinuxTage, and the CCC congresses.
348
349 ConfClerk is targeted at mobile devices but works on any system running Qt.")
350 (license (list license:gpl2+
351 license:lgpl3)))) ; or cc-by3.0 for src/icons/*