gnu: Move sqlite to separate module.
[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 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 icu4c)
39 #:use-module (gnu packages perl)
40 #:use-module (gnu packages pkg-config)
41 #:use-module (gnu packages python)
42 #:use-module (gnu packages python-xyz)
43 #:use-module (gnu packages sqlite)
44 #:use-module (gnu packages time)
45 #:use-module (gnu packages xml)
46 #:use-module (srfi srfi-26))
47
48 (define-public libical
49 (package
50 (name "libical")
51 (version "3.0.4")
52 (source (origin
53 (method url-fetch)
54 (uri (string-append
55 "https://github.com/libical/libical/releases/download/v"
56 version "/libical-" version ".tar.gz"))
57 (sha256
58 (base32
59 "0ifisnh42cw5z53hp9p52l3ggc7k877zlqk0n06gdhrk0bhidckj"))))
60 (build-system cmake-build-system)
61 (arguments
62 '(#:tests? #f ; test suite appears broken
63 #:configure-flags '("-DSHARED_ONLY=true")
64 #:phases
65 (modify-phases %standard-phases
66 (add-before 'configure 'patch-paths
67 (lambda* (#:key inputs #:allow-other-keys)
68 ;; FIXME: This should be patched to use TZDIR so we can drop
69 ;; the tzdata dependency.
70 (let ((tzdata (assoc-ref inputs "tzdata")))
71 (substitute* "src/libical/icaltz-util.c"
72 (("\\\"/usr/share/zoneinfo\\\",")
73 (string-append "\"" tzdata "/share/zoneinfo\""))
74 (("\\\"/usr/lib/zoneinfo\\\",") "")
75 (("\\\"/etc/zoneinfo\\\",") "")
76 (("\\\"/usr/share/lib/zoneinfo\\\"") "")))
77 #t)))))
78 (native-inputs
79 `(("perl" ,perl)
80 ("pkg-config" ,pkg-config)))
81 (inputs
82 `(("glib" ,glib)
83 ("libxml2" ,libxml2)
84 ("tzdata" ,tzdata)))
85 (propagated-inputs
86 ;; In Requires.private of libical.pc.
87 `(("icu4c" ,icu4c)))
88 (home-page "https://libical.github.io/libical/")
89 (synopsis "iCalendar protocols and data formats implementation")
90 (description
91 "Libical is an implementation of the iCalendar protocols and protocol
92 data units.")
93 ;; Can be used with either license. See COPYING.
94 (license (list license:lgpl2.1 license:mpl2.0))))
95
96 (define-public khal
97 (package
98 (name "khal")
99 (version "0.9.10")
100 (source (origin
101 (method url-fetch)
102 (uri (pypi-uri "khal" version))
103 (sha256
104 (base32
105 "03h0j0d3xyqh98x5v2gv63wv3g91hip3vsaxvybsn5iz331d23h4"))))
106 (build-system python-build-system)
107 (arguments
108 `(#:phases (modify-phases %standard-phases
109 ;; Building the manpage requires khal to be installed.
110 (add-after 'install 'manpage
111 (lambda* (#:key inputs outputs #:allow-other-keys)
112 ;; Make installed package available for running the tests
113 (add-installed-pythonpath inputs outputs)
114 (invoke "make" "--directory=doc/" "man")
115 (install-file
116 "doc/build/man/khal.1"
117 (string-append (assoc-ref outputs "out") "/share/man/man1"))
118 #t))
119 (replace 'check
120 (lambda* (#:key inputs #:allow-other-keys)
121 ;; The tests require us to choose a timezone.
122 (setenv "TZ"
123 (string-append (assoc-ref inputs "tzdata")
124 "/share/zoneinfo/Zulu"))
125 (invoke "py.test" "tests" "-k"
126 (string-append
127 ;; These tests are known to fail in when not
128 ;; running in a TTY:
129 ;; https://github.com/pimutils/khal/issues/683
130 "not test_printics_read_from_stdin "
131 "and not test_import_from_stdin "
132 ;; https://github.com/pimutils/khal/issues/825
133 "and not test_description_and_location_and_categories")))))))
134 (native-inputs
135 `(("python-pytest" ,python-pytest)
136 ("python-pytest-cov" ,python-pytest-cov)
137 ("python-setuptools-scm" ,python-setuptools-scm)
138 ;; Required for tests
139 ("python-freezegun" ,python-freezegun)
140 ("tzdata" ,tzdata)
141 ("vdirsyncer" ,vdirsyncer)
142 ;; Required to build manpage
143 ("python-sphinxcontrib-newsfeed" ,python-sphinxcontrib-newsfeed)
144 ("python-sphinx" ,python-sphinx)))
145 (inputs
146 `(("sqlite" ,sqlite)))
147 (propagated-inputs
148 `(("python-configobj" ,python-configobj)
149 ("python-dateutil" ,python-dateutil)
150 ("python-icalendar" ,python-icalendar)
151 ("python-tzlocal" ,python-tzlocal)
152 ("python-urwid" ,python-urwid)
153 ("python-pyxdg" ,python-pyxdg)))
154 (synopsis "Console calendar program")
155 (description "Khal is a standards based console calendar program,
156 able to synchronize with CalDAV servers through vdirsyncer.")
157 (home-page "http://lostpackets.de/khal/")
158 (license license:expat)))
159
160 (define-public remind
161 (package
162 (name "remind")
163 (version "3.1.15")
164 (source
165 (origin
166 (method url-fetch)
167 (uri (string-append "https://www.roaringpenguin.com/files/download/"
168 "remind-"
169 (string-join (map (cut string-pad <> 2 #\0)
170 (string-split version #\.))
171 ".")
172 ".tar.gz"))
173 (sha256
174 (base32
175 "1hcfcxz5fjzl7606prlb7dgls5kr8z3wb51h48s6qm8ang0b9nla"))))
176 (build-system gnu-build-system)
177 (arguments
178 '(#:tests? #f)) ;no "check" target
179 (home-page "http://www.roaringpenguin.com/products/remind/")
180 (synopsis "Sophisticated calendar and alarm program")
181 (description
182 "Remind allows you to remind yourself of upcoming events and appointments.
183 Each reminder or alarm can consist of a message sent to standard output, or a
184 program to be executed. It also features: sophisticated date calculation,
185 moon phases, sunrise/sunset, Hebrew calendar, alarms, PostScript output and
186 proper handling of holidays.")
187 (license license:gpl2)))
188
189 (define-public libhdate
190 (package
191 (name "libhdate")
192 (version "1.6.02")
193 (source
194 (origin
195 (method url-fetch)
196 (uri (string-append "mirror://sourceforge/libhdate/libhdate/libhdate-"
197 version "/" name "-" version ".tar.bz2"))
198 (sha256
199 (base32
200 "0qkpq412p78znw8gckwcx3l0wcss9s0dgw1pvjb1ih2pxf6hm4rw"))))
201 (build-system gnu-build-system)
202 (home-page "http://libhdate.sourceforge.net/")
203 (synopsis "Library to use Hebrew dates")
204 (description "LibHdate is a small library for the Hebrew calendar and times
205 of day, written in C, and including bindings for C++, pascal, perl, php, python,
206 and ruby. It includes two illustrative command-line programs, @code{hcal} and
207 @code{hdate}, and some snippets and scripts written in the binding languages.")
208 (license license:gpl3+)))