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 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 gnome)
42 #:use-module (gnu packages gtk)
43 #:use-module (gnu packages icu4c)
44 #:use-module (gnu packages perl)
45 #:use-module (gnu packages pkg-config)
46 #:use-module (gnu packages python)
47 #:use-module (gnu packages python-xyz)
48 #:use-module (gnu packages sphinx)
49 #:use-module (gnu packages sqlite)
50 #:use-module (gnu packages time)
51 #:use-module (gnu packages xml)
52 #:use-module (srfi srfi-26))
53
54 (define-public date
55 ;; We make the same choice as the Arch package maintainer by choosing a
56 ;; recent commit to fix some bugs.
57 ;; https://github.com/Alexays/Waybar/issues/565
58 (let ((commit "9a0ee2542848ab8625984fc8cdbfb9b5414c0082"))
59 (package
60 (name "date")
61 (version (string-append "2.4.1-" (string-take commit 8)))
62 (source
63 (origin
64 (method git-fetch)
65 (uri (git-reference
66 (url "https://github.com/HowardHinnant/date.git")
67 (commit "9a0ee2542848ab8625984fc8cdbfb9b5414c0082")))
68 (file-name (git-file-name name version))
69 (sha256
70 (base32 "0yxsn0hj22n61bjywysxqgfv7hj5xvsl6isma95fl8xrimpny083"))
71 (patches
72 ;; Install pkg-config files
73 ;; https://github.com/HowardHinnant/date/pull/538
74 (search-patches "date-output-pkg-config-files.patch"))))
75 (inputs `(("tzdata" ,tzdata)))
76 (build-system cmake-build-system)
77 (arguments
78 '(#:configure-flags (list "-DUSE_SYSTEM_TZ_DB=ON"
79 "-DBUILD_SHARED_LIBS=ON"
80 "-DBUILD_TZ_LIB=ON"
81 "-DENABLE_DATE_TESTING=ON")
82 #:phases
83 (modify-phases %standard-phases
84 (add-after 'unpack 'patch-bin-bash
85 (lambda* (#:key inputs #:allow-other-keys)
86 (substitute* "compile_fail.sh"
87 (("/bin/bash") (which "bash")))
88 #t))
89 (add-after 'unpack 'patch-zoneinfo-path
90 (lambda* (#:key inputs #:allow-other-keys)
91 (substitute* "src/tz.cpp"
92 (("/usr/share/zoneinfo")
93 (string-append (assoc-ref inputs "tzdata") "/share/zoneinfo")))
94 #t))
95 (replace 'check
96 (lambda _
97 ;; Disable test that requires checking timezone that
98 ;; isn't set in the build environment.
99 (substitute* "CTestTestfile.cmake"
100 (("add_test.tz_test_pass_zoned_time_deduction_test.*") "")
101 (("set_tests_properties.tz_test_pass_zoned_time_deduction_test.*") ""))
102 (invoke "make" "testit"))))))
103 (synopsis "Date and time library for C++11 and C++14")
104 (description "Date is a header only C++ library that extends the chrono
105 date algorithms library for calendar dates and durations. It also provides
106 the <tz.h> library for handling time zones and leap seconds.")
107 (home-page "https://howardhinnant.github.io/date/date.html")
108 (license license:expat))))
109
110 (define-public libical
111 (package
112 (name "libical")
113 (version "3.0.8")
114 (source (origin
115 (method url-fetch)
116 (uri (string-append
117 "https://github.com/libical/libical/releases/download/v"
118 version "/libical-" version ".tar.gz"))
119 (sha256
120 (base32
121 "0vr8s7hn8204lyc4ys5bs3j5qss4lmc9ffly2m1a59avyz5cmzh9"))))
122 (build-system cmake-build-system)
123 (arguments
124 '(#:tests? #f ; test suite appears broken
125 #:configure-flags '("-DSHARED_ONLY=true"
126 ;; required by evolution-data-server
127 "-DGOBJECT_INTROSPECTION=true"
128 "-DICAL_GLIB_VAPI=true")
129 #:phases
130 (modify-phases %standard-phases
131 (add-before 'configure 'patch-paths
132 (lambda* (#:key inputs #:allow-other-keys)
133 ;; TODO: libical 3.1.0 supports using TZDIR instead of a hard-coded
134 ;; zoneinfo database. When that is released we can drop
135 ;; the tzdata dependency.
136 (let ((tzdata (assoc-ref inputs "tzdata")))
137 (substitute* "src/libical/icaltz-util.c"
138 (("\\\"/usr/share/zoneinfo\\\",")
139 (string-append "\"" tzdata "/share/zoneinfo\""))
140 (("\\\"/usr/lib/zoneinfo\\\",") "")
141 (("\\\"/etc/zoneinfo\\\",") "")
142 (("\\\"/usr/share/lib/zoneinfo\\\"") "")))
143 #t)))))
144 (native-inputs
145 `(("gobject-introspection" ,gobject-introspection)
146 ("gtk-doc" ,gtk-doc)
147 ("perl" ,perl)
148 ("pkg-config" ,pkg-config)
149 ("vala" ,vala)))
150 (inputs
151 `(("glib" ,glib)
152 ("libxml2" ,libxml2)
153 ("tzdata" ,tzdata)))
154 (propagated-inputs
155 ;; In Requires.private of libical.pc.
156 `(("icu4c" ,icu4c)))
157 (home-page "https://libical.github.io/libical/")
158 (synopsis "iCalendar protocols and data formats implementation")
159 (description
160 "Libical is an implementation of the iCalendar protocols and protocol
161 data units.")
162 ;; Can be used with either license. See COPYING.
163 (license (list license:lgpl2.1 license:mpl2.0))))
164
165 (define-public khal
166 (package
167 (name "khal")
168 (version "0.10.1")
169 (source (origin
170 (method url-fetch)
171 (uri (pypi-uri "khal" version))
172 (sha256
173 (base32
174 "1r8bkgjwkh7i8ygvsv51h1cnax50sb183vafg66x5snxf3dgjl6l"))
175 (patches
176 (list
177 (origin
178 (method url-fetch)
179 ;; This patch fixes an issue with python-urwid-2.1.0
180 (uri "https://github.com/pimutils/khal/commit/2c5990c2de2015b251ba23617faa40ee11b8c22a.patch")
181 (file-name "khal-compat-urwid-2.1.0.patch")
182 (sha256
183 (base32
184 "11nd8hkjz68imwqqn0p54zmb53z2pfxmzchaviy7jc1ky5s9l663")))))))
185 (build-system python-build-system)
186 (arguments
187 `(#:phases (modify-phases %standard-phases
188 ;; Building the manpage requires khal to be installed.
189 (add-after 'install 'manpage
190 (lambda* (#:key inputs outputs #:allow-other-keys)
191 ;; Make installed package available for running the tests
192 (add-installed-pythonpath inputs outputs)
193 (invoke "make" "--directory=doc/" "man")
194 (install-file
195 "doc/build/man/khal.1"
196 (string-append (assoc-ref outputs "out") "/share/man/man1"))
197 #t))
198 (replace 'check
199 (lambda* (#:key inputs #:allow-other-keys)
200 ;; The tests require us to choose a timezone.
201 (setenv "TZ"
202 (string-append (assoc-ref inputs "tzdata")
203 "/share/zoneinfo/Zulu"))
204 (invoke "py.test" "tests"))))))
205 (native-inputs
206 `(("python-pytest" ,python-pytest)
207 ("python-pytest-cov" ,python-pytest-cov)
208 ("python-setuptools-scm" ,python-setuptools-scm)
209 ;; Required for tests
210 ("python-freezegun" ,python-freezegun)
211 ("tzdata" ,tzdata-for-tests)
212 ("vdirsyncer" ,vdirsyncer)
213 ;; Required to build manpage
214 ("python-sphinxcontrib-newsfeed" ,python-sphinxcontrib-newsfeed)
215 ("python-sphinx" ,python-sphinx)))
216 (inputs
217 `(("sqlite" ,sqlite)
218 ("python-configobj" ,python-configobj)
219 ("python-dateutil" ,python-dateutil)
220 ("python-icalendar" ,python-icalendar)
221 ("python-tzlocal" ,python-tzlocal)
222 ("python-urwid" ,python-urwid)
223 ("python-pyxdg" ,python-pyxdg)))
224 (synopsis "Console calendar program")
225 (description "Khal is a standards based console calendar program,
226 able to synchronize with CalDAV servers through vdirsyncer.")
227 (home-page "https://lostpackets.de/khal/")
228 (license license:expat)))
229
230 (define-public remind
231 (package
232 (name "remind")
233 (version "3.1.17")
234 (source
235 (origin
236 (method url-fetch)
237 (uri (string-append "https://dianne.skoll.ca/projects/remind/download/"
238 "remind-"
239 (string-join (map (cut string-pad <> 2 #\0)
240 (string-split version #\.))
241 ".")
242 ".tar.gz"))
243 (sha256
244 (base32 "0lgyc2j69aqqk4knywr8inz4fsnni0zq54dgqh7p4s6kzybc2mf9"))))
245 (build-system gnu-build-system)
246 (arguments
247 '(#:tests? #f)) ; no "check" target
248 (home-page "https://dianne.skoll.ca/projects/remind/")
249 (synopsis "Sophisticated calendar and alarm program")
250 (description
251 "Remind allows you to remind yourself of upcoming events and appointments.
252 Each reminder or alarm can consist of a message sent to standard output, or a
253 program to be executed. It also features: sophisticated date calculation,
254 moon phases, sunrise/sunset, Hebrew calendar, alarms, PostScript output and
255 proper handling of holidays.")
256 (license license:gpl2)))
257
258 (define-public libhdate
259 (package
260 (name "libhdate")
261 (version "1.6.02")
262 (source
263 (origin
264 (method url-fetch)
265 (uri (string-append "mirror://sourceforge/libhdate/libhdate/libhdate-"
266 version "/" name "-" version ".tar.bz2"))
267 (sha256
268 (base32
269 "0qkpq412p78znw8gckwcx3l0wcss9s0dgw1pvjb1ih2pxf6hm4rw"))))
270 (build-system gnu-build-system)
271 (home-page "http://libhdate.sourceforge.net/")
272 (synopsis "Library to use Hebrew dates")
273 (description "LibHdate is a small library for the Hebrew calendar and times
274 of day, written in C, and including bindings for C++, pascal, perl, php, python,
275 and ruby. It includes two illustrative command-line programs, @code{hcal} and
276 @code{hdate}, and some snippets and scripts written in the binding languages.")
277 (license license:gpl3+)))