gnu: Add ccal.
[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 ;;; Copyright © 2020 Peng Mei Yu <pengmeiyu@riseup.net>
13 ;;;
14 ;;; This file is part of GNU Guix.
15 ;;;
16 ;;; GNU Guix is free software; you can redistribute it and/or modify it
17 ;;; under the terms of the GNU General Public License as published by
18 ;;; the Free Software Foundation; either version 3 of the License, or (at
19 ;;; your option) any later version.
20 ;;;
21 ;;; GNU Guix is distributed in the hope that it will be useful, but
22 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
23 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 ;;; GNU General Public License for more details.
25 ;;;
26 ;;; You should have received a copy of the GNU General Public License
27 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
28
29 (define-module (gnu packages calendar)
30 #:use-module (gnu packages)
31 #:use-module ((guix licenses) #:prefix license:)
32 #:use-module (guix git-download)
33 #:use-module (guix packages)
34 #:use-module (guix download)
35 #:use-module (guix build-system gnu)
36 #:use-module (guix build-system cmake)
37 #:use-module (guix build-system python)
38 #:use-module (gnu packages base)
39 #:use-module (gnu packages check)
40 #:use-module (gnu packages dav)
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 #:configure-flags '("-DSHARED_ONLY=true"
129 ;; required by evolution-data-server
130 "-DGOBJECT_INTROSPECTION=true"
131 "-DICAL_GLIB_VAPI=true")
132 #:phases
133 (modify-phases %standard-phases
134 (add-before 'configure 'patch-paths
135 (lambda* (#:key inputs #:allow-other-keys)
136 ;; TODO: libical 3.1.0 supports using TZDIR instead of a hard-coded
137 ;; zoneinfo database. When that is released we can drop
138 ;; the tzdata dependency.
139 (let ((tzdata (assoc-ref inputs "tzdata")))
140 (substitute* "src/libical/icaltz-util.c"
141 (("\\\"/usr/share/zoneinfo\\\",")
142 (string-append "\"" tzdata "/share/zoneinfo\""))
143 (("\\\"/usr/lib/zoneinfo\\\",") "")
144 (("\\\"/etc/zoneinfo\\\",") "")
145 (("\\\"/usr/share/lib/zoneinfo\\\"") "")))
146 #t)))))
147 (native-inputs
148 `(("gobject-introspection" ,gobject-introspection)
149 ("gtk-doc" ,gtk-doc)
150 ("perl" ,perl)
151 ("pkg-config" ,pkg-config)
152 ("vala" ,vala)))
153 (inputs
154 `(("glib" ,glib)
155 ("libxml2" ,libxml2)
156 ("tzdata" ,tzdata)))
157 (propagated-inputs
158 ;; In Requires.private of libical.pc.
159 `(("icu4c" ,icu4c)))
160 (home-page "https://libical.github.io/libical/")
161 (synopsis "iCalendar protocols and data formats implementation")
162 (description
163 "Libical is an implementation of the iCalendar protocols and protocol
164 data units.")
165 ;; Can be used with either license. See COPYING.
166 (license (list license:lgpl2.1 license:mpl2.0))))
167
168 (define-public khal
169 (package
170 (name "khal")
171 (version "0.10.1")
172 (source (origin
173 (method url-fetch)
174 (uri (pypi-uri "khal" version))
175 (sha256
176 (base32
177 "1r8bkgjwkh7i8ygvsv51h1cnax50sb183vafg66x5snxf3dgjl6l"))
178 (patches
179 (list
180 (origin
181 (method url-fetch)
182 ;; This patch fixes an issue with python-urwid-2.1.0
183 (uri "https://github.com/pimutils/khal/commit/2c5990c2de2015b251ba23617faa40ee11b8c22a.patch")
184 (file-name "khal-compat-urwid-2.1.0.patch")
185 (sha256
186 (base32
187 "11nd8hkjz68imwqqn0p54zmb53z2pfxmzchaviy7jc1ky5s9l663")))))))
188 (build-system python-build-system)
189 (arguments
190 `(#:phases (modify-phases %standard-phases
191 ;; Building the manpage requires khal to be installed.
192 (add-after 'install 'manpage
193 (lambda* (#:key inputs outputs #:allow-other-keys)
194 ;; Make installed package available for running the tests
195 (add-installed-pythonpath inputs outputs)
196 (invoke "make" "--directory=doc/" "man")
197 (install-file
198 "doc/build/man/khal.1"
199 (string-append (assoc-ref outputs "out") "/share/man/man1"))
200 #t))
201 (add-before 'check 'fix-tests
202 (lambda _
203 ;; Reported upstream: <https://github.com/pimutils/khal/issues/947>.
204 (substitute* "tests/cli_test.py"
205 (("Invalid value for \"\\[ICS\\]\"") "Invalid value for \\'[ICS]\\'"))
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+)))
287
288 (define-public confclerk
289 (package
290 (name "confclerk")
291 (version "0.6.4")
292 (source
293 (origin
294 (method url-fetch)
295 (uri (string-append "https://www.toastfreeware.priv.at/tarballs/"
296 "confclerk/confclerk-" version ".tar.gz"))
297 (sha256
298 (base32
299 "10rhg44px4nvbkd3p341cmp2ds43jn8r4rvgladda9v8zmsgr2b3"))))
300 (build-system gnu-build-system)
301 (arguments
302 '(#:phases
303 (modify-phases %standard-phases
304 (replace 'configure
305 (lambda* (#:key outputs #:allow-other-keys)
306 (let ((out (assoc-ref outputs "out")))
307 ;; Install directory is currently hard-coded.
308 (substitute* "src/app/app.pro"
309 (("PREFIX = /usr/bin")
310 (string-append "PREFIX =" out "/bin")))
311 (invoke "qmake"))))
312 (add-after 'install 'install-docs
313 (lambda* (#:key outputs #:allow-other-keys)
314 (let* ((out (assoc-ref outputs "out"))
315 (share (string-append out "/share")))
316 (install-file "data/confclerk.1"
317 (string-append share "/man/man1"))
318 (install-file "data/confclerk.desktop"
319 (string-append share "/applications"))
320 (install-file "data/confclerk.svg"
321 (string-append share "/icons/hicolor/scalable/apps"))
322 #t))))
323 #:tests? #f)) ; no tests
324 (native-inputs
325 `(("perl" ,perl))) ; pod2man
326 (inputs
327 `(("qtbase" ,qtbase)))
328 (home-page "https://www.toastfreeware.priv.at/confclerk")
329 (synopsis "Offline conference schedule application")
330 (description
331 "ConfClerk is an application written in Qt, which makes conference schedules
332 available offline. It displays the conference schedule from various views,
333 support searches on various items (speaker, speech topic, location, etc.) and
334 enables you to select favorite events and create your own schedule.
335
336 At the moment ConfClerk is able to import schedules in XML format created by
337 the PentaBarf conference management system (or frab) used by e.g. FOSDEM,
338 DebConf, FrOSCon, Grazer LinuxTage, and the CCC congresses.
339
340 ConfClerk is targeted at mobile devices but works on any system running Qt.")
341 (license (list license:gpl2+
342 license:lgpl3)))) ; or cc-by3.0 for src/icons/*
343
344 (define-public ccal
345 (package
346 (name "ccal")
347 (version "2.5.3")
348 (source (origin
349 (method url-fetch)
350 (uri (string-append "http://ccal.chinesebay.com/ccal/ccal-"
351 version ".tar.gz"))
352 (sha256
353 (base32
354 "15nza1d1lvk3dp0wcl53wsd32yhbgyzznha092mh5kh5z74vsk1x"))))
355 (build-system gnu-build-system)
356 (arguments
357 '(#:phases
358 (modify-phases %standard-phases
359 (replace 'configure
360 (lambda* (#:key outputs #:allow-other-keys)
361 (let ((out (assoc-ref outputs "out")))
362 (substitute* "Makefile"
363 (("/usr/local/bin")
364 (string-append out "/bin"))
365 (("/usr/local/man")
366 (string-append out "/share/man"))))
367 #t))
368 (add-after 'install 'install-manuals
369 (lambda _
370 (invoke "make" "install-man"))))
371 ;; no tests
372 #:tests? #f))
373 (home-page "http://ccal.chinesebay.com/ccal/ccal.htm")
374 (synopsis "Command line program for Chinese calendar")
375 (description "@command{ccal} is a command line program which writes a
376 Gregorian calendar together with Chinese calendar to standard output. Its
377 usage is similar to the @command{cal} program. In addition to console output,
378 it can also generate Encapsulated Postscript and HTML table outputs for use in
379 do-it-yourself calendars and web pages. It supports both simplified and
380 traditional Chinese characters.")
381 ;; Both licenses are in use in various source files. Note that
382 ;; COPYING.LESSER specifies LGPL 3.0, but all source files say
383 ;; 'Lesser GPL version 2 or later'.
384 (license (list license:gpl2+ license:lgpl2.1+))))