gnu: ungoogled-chromium: Update to 81.0.4044.129-0.c2a89fb [security fixes].
[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 ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com
10 ;;; Copyright © 2020 Brendan Tildesley <mail@brendan.scot>
11 ;;;
12 ;;; This file is part of GNU Guix.
13 ;;;
14 ;;; GNU Guix is free software; you can redistribute it and/or modify it
15 ;;; under the terms of the GNU General Public License as published by
16 ;;; the Free Software Foundation; either version 3 of the License, or (at
17 ;;; your option) any later version.
18 ;;;
19 ;;; GNU Guix is distributed in the hope that it will be useful, but
20 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 ;;; GNU General Public License for more details.
23 ;;;
24 ;;; You should have received a copy of the GNU General Public License
25 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
26
27 (define-module (gnu packages calendar)
28 #:use-module (gnu packages)
29 #:use-module ((guix licenses) #:prefix license:)
30 #:use-module (guix git-download)
31 #:use-module (guix packages)
32 #:use-module (guix download)
33 #:use-module (guix build-system gnu)
34 #:use-module (guix build-system cmake)
35 #:use-module (guix build-system python)
36 #:use-module (gnu packages base)
37 #:use-module (gnu packages check)
38 #:use-module (gnu packages dav)
39 #:use-module (gnu packages freedesktop)
40 #:use-module (gnu packages glib)
41 #:use-module (gnu packages gtk)
42 #:use-module (gnu packages icu4c)
43 #:use-module (gnu packages perl)
44 #:use-module (gnu packages pkg-config)
45 #:use-module (gnu packages python)
46 #:use-module (gnu packages python-xyz)
47 #:use-module (gnu packages sphinx)
48 #:use-module (gnu packages sqlite)
49 #:use-module (gnu packages time)
50 #:use-module (gnu packages xml)
51 #:use-module (srfi srfi-26))
52
53 (define-public date
54 ;; We make the same choice as the Arch package maintainer by choosing a
55 ;; recent commit to fix some bugs.
56 ;; https://github.com/Alexays/Waybar/issues/565
57 (let ((commit "9a0ee2542848ab8625984fc8cdbfb9b5414c0082"))
58 (package
59 (name "date")
60 (version (string-append "2.4.1-" (string-take commit 8)))
61 (source
62 (origin
63 (method git-fetch)
64 (uri (git-reference
65 (url "https://github.com/HowardHinnant/date.git")
66 (commit "9a0ee2542848ab8625984fc8cdbfb9b5414c0082")))
67 (file-name (git-file-name name version))
68 (sha256
69 (base32 "0yxsn0hj22n61bjywysxqgfv7hj5xvsl6isma95fl8xrimpny083"))
70 (patches
71 ;; Install pkg-config files
72 ;; https://github.com/HowardHinnant/date/pull/538
73 (search-patches "date-output-pkg-config-files.patch"))))
74 (inputs `(("tzdata" ,tzdata)))
75 (build-system cmake-build-system)
76 (arguments
77 '(#:configure-flags (list "-DUSE_SYSTEM_TZ_DB=ON"
78 "-DBUILD_SHARED_LIBS=ON"
79 "-DBUILD_TZ_LIB=ON"
80 "-DENABLE_DATE_TESTING=ON")
81 #:phases
82 (modify-phases %standard-phases
83 (add-after 'unpack 'patch-bin-bash
84 (lambda* (#:key inputs #:allow-other-keys)
85 (substitute* "compile_fail.sh"
86 (("/bin/bash") (which "bash")))
87 #t))
88 (add-after 'unpack 'patch-zoneinfo-path
89 (lambda* (#:key inputs #:allow-other-keys)
90 (substitute* "src/tz.cpp"
91 (("/usr/share/zoneinfo")
92 (string-append (assoc-ref inputs "tzdata") "/share/zoneinfo")))
93 #t))
94 (replace 'check
95 (lambda _
96 ;; Disable test that requires checking timezone that
97 ;; isn't set in the build environment.
98 (substitute* "CTestTestfile.cmake"
99 (("add_test.tz_test_pass_zoned_time_deduction_test.*") "")
100 (("set_tests_properties.tz_test_pass_zoned_time_deduction_test.*") ""))
101 (invoke "make" "testit"))))))
102 (synopsis "Date and time library for C++11 and C++14")
103 (description "Date is a header only C++ library that extends the chrono
104 date algorithms library for calendar dates and durations. It also provides
105 the <tz.h> library for handling time zones and leap seconds.")
106 (home-page "https://howardhinnant.github.io/date/date.html")
107 (license license:expat))))
108
109 (define-public libical
110 (package
111 (name "libical")
112 (version "3.0.7")
113 (source (origin
114 (method url-fetch)
115 (uri (string-append
116 "https://github.com/libical/libical/releases/download/v"
117 version "/libical-" version ".tar.gz"))
118 (sha256
119 (base32
120 "1z33wzaazbd7drl6qbh1750whd78xl2cg0gjnxyya9m83vgndgha"))
121 (patches
122 ;; Add a patch slated for 3.0.8 which preserves backwards-
123 ;; compatibility in the icalattach_new_from_data() function,
124 ;; which accidentally changed in 3.0.7 and could break some uses.
125 ;; https://gitlab.gnome.org/GNOME/evolution-data-server/issues/185
126 ;; http://lists.infradead.org/pipermail/libical-devel/2020-January/000907.html
127 (list (origin
128 (method url-fetch)
129 (uri (string-append
130 "https://github.com/libical/libical/commit/"
131 "ae394010c889e4c185160da5e81527849f9de350.patch"))
132 (file-name "libical-3.0.7-preserve-icalattach-api.patch")
133 (sha256
134 (base32
135 "0v8qcxn8a6sh78grzxd61j9478928dx38l5mf8mkdrbxv47vmvvp")))))))
136 (build-system cmake-build-system)
137 (arguments
138 '(#:tests? #f ; test suite appears broken
139 #:configure-flags '("-DSHARED_ONLY=true")
140 #:phases
141 (modify-phases %standard-phases
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 `(("gtk-doc" ,gtk-doc)
157 ("perl" ,perl)
158 ("pkg-config" ,pkg-config)))
159 (inputs
160 `(("glib" ,glib)
161 ("libxml2" ,libxml2)
162 ("tzdata" ,tzdata)))
163 (propagated-inputs
164 ;; In Requires.private of libical.pc.
165 `(("icu4c" ,icu4c)))
166 (home-page "https://libical.github.io/libical/")
167 (synopsis "iCalendar protocols and data formats implementation")
168 (description
169 "Libical is an implementation of the iCalendar protocols and protocol
170 data units.")
171 ;; Can be used with either license. See COPYING.
172 (license (list license:lgpl2.1 license:mpl2.0))))
173
174 (define-public khal
175 (package
176 (name "khal")
177 (version "0.10.1")
178 (source (origin
179 (method url-fetch)
180 (uri (pypi-uri "khal" version))
181 (sha256
182 (base32
183 "1r8bkgjwkh7i8ygvsv51h1cnax50sb183vafg66x5snxf3dgjl6l"))
184 (patches
185 (list
186 (origin
187 (method url-fetch)
188 ;; This patch fixes an issue with python-urwid-2.1.0
189 (uri "https://github.com/pimutils/khal/commit/2c5990c2de2015b251ba23617faa40ee11b8c22a.patch")
190 (file-name "khal-compat-urwid-2.1.0.patch")
191 (sha256
192 (base32
193 "11nd8hkjz68imwqqn0p54zmb53z2pfxmzchaviy7jc1ky5s9l663")))))))
194 (build-system python-build-system)
195 (arguments
196 `(#:phases (modify-phases %standard-phases
197 ;; Building the manpage requires khal to be installed.
198 (add-after 'install 'manpage
199 (lambda* (#:key inputs outputs #:allow-other-keys)
200 ;; Make installed package available for running the tests
201 (add-installed-pythonpath inputs outputs)
202 (invoke "make" "--directory=doc/" "man")
203 (install-file
204 "doc/build/man/khal.1"
205 (string-append (assoc-ref outputs "out") "/share/man/man1"))
206 #t))
207 (replace 'check
208 (lambda* (#:key inputs #:allow-other-keys)
209 ;; The tests require us to choose a timezone.
210 (setenv "TZ"
211 (string-append (assoc-ref inputs "tzdata")
212 "/share/zoneinfo/Zulu"))
213 (invoke "py.test" "tests"))))))
214 (native-inputs
215 `(("python-pytest" ,python-pytest)
216 ("python-pytest-cov" ,python-pytest-cov)
217 ("python-setuptools-scm" ,python-setuptools-scm)
218 ;; Required for tests
219 ("python-freezegun" ,python-freezegun)
220 ("tzdata" ,tzdata-for-tests)
221 ("vdirsyncer" ,vdirsyncer)
222 ;; Required to build manpage
223 ("python-sphinxcontrib-newsfeed" ,python-sphinxcontrib-newsfeed)
224 ("python-sphinx" ,python-sphinx)))
225 (inputs
226 `(("sqlite" ,sqlite)
227 ("python-configobj" ,python-configobj)
228 ("python-dateutil" ,python-dateutil)
229 ("python-icalendar" ,python-icalendar)
230 ("python-tzlocal" ,python-tzlocal)
231 ("python-urwid" ,python-urwid)
232 ("python-pyxdg" ,python-pyxdg)))
233 (synopsis "Console calendar program")
234 (description "Khal is a standards based console calendar program,
235 able to synchronize with CalDAV servers through vdirsyncer.")
236 (home-page "https://lostpackets.de/khal/")
237 (license license:expat)))
238
239 (define-public remind
240 (package
241 (name "remind")
242 (version "3.1.17")
243 (source
244 (origin
245 (method url-fetch)
246 (uri (string-append "https://dianne.skoll.ca/projects/remind/download/"
247 "remind-"
248 (string-join (map (cut string-pad <> 2 #\0)
249 (string-split version #\.))
250 ".")
251 ".tar.gz"))
252 (sha256
253 (base32 "0lgyc2j69aqqk4knywr8inz4fsnni0zq54dgqh7p4s6kzybc2mf9"))))
254 (build-system gnu-build-system)
255 (arguments
256 '(#:tests? #f)) ; no "check" target
257 (home-page "https://dianne.skoll.ca/projects/remind/")
258 (synopsis "Sophisticated calendar and alarm program")
259 (description
260 "Remind allows you to remind yourself of upcoming events and appointments.
261 Each reminder or alarm can consist of a message sent to standard output, or a
262 program to be executed. It also features: sophisticated date calculation,
263 moon phases, sunrise/sunset, Hebrew calendar, alarms, PostScript output and
264 proper handling of holidays.")
265 (license license:gpl2)))
266
267 (define-public libhdate
268 (package
269 (name "libhdate")
270 (version "1.6.02")
271 (source
272 (origin
273 (method url-fetch)
274 (uri (string-append "mirror://sourceforge/libhdate/libhdate/libhdate-"
275 version "/" name "-" version ".tar.bz2"))
276 (sha256
277 (base32
278 "0qkpq412p78znw8gckwcx3l0wcss9s0dgw1pvjb1ih2pxf6hm4rw"))))
279 (build-system gnu-build-system)
280 (home-page "http://libhdate.sourceforge.net/")
281 (synopsis "Library to use Hebrew dates")
282 (description "LibHdate is a small library for the Hebrew calendar and times
283 of day, written in C, and including bindings for C++, pascal, perl, php, python,
284 and ruby. It includes two illustrative command-line programs, @code{hcal} and
285 @code{hdate}, and some snippets and scripts written in the binding languages.")
286 (license license:gpl3+)))