gnu: Move testing packages from python.scm to check.scm.
[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 ;;;
9 ;;; This file is part of GNU Guix.
10 ;;;
11 ;;; GNU Guix is free software; you can redistribute it and/or modify it
12 ;;; under the terms of the GNU General Public License as published by
13 ;;; the Free Software Foundation; either version 3 of the License, or (at
14 ;;; your option) any later version.
15 ;;;
16 ;;; GNU Guix is distributed in the hope that it will be useful, but
17 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;;; GNU General Public License for more details.
20 ;;;
21 ;;; You should have received a copy of the GNU General Public License
22 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23
24 (define-module (gnu packages calendar)
25 #:use-module (gnu packages)
26 #:use-module (guix licenses)
27 #:use-module (guix packages)
28 #:use-module (guix download)
29 #:use-module (guix build utils)
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 databases)
36 #:use-module (gnu packages dav)
37 #:use-module (gnu packages freedesktop)
38 #:use-module (gnu packages icu4c)
39 #:use-module (gnu packages perl)
40 #:use-module (gnu packages python)
41 #:use-module (srfi srfi-26))
42
43 (define-public libical
44 (package
45 (name "libical")
46 (version "2.0.0")
47 (source (origin
48 (method url-fetch)
49 (uri (string-append
50 "https://github.com/libical/libical/releases/download/v"
51 version "/libical-" version ".tar.gz"))
52 (sha256
53 (base32
54 "1njn2kr0rrjqv5g3hdhpdzrhankyj4fl1bgn76z3g4n1b7vi2k35"))))
55 (build-system cmake-build-system)
56 (arguments
57 '(#:tests? #f ; test suite appears broken
58 #:configure-flags
59 (list (string-append "-DCMAKE_INSTALL_LIBDIR="
60 (assoc-ref %outputs "out") "/lib"))
61 #:phases
62 (modify-phases %standard-phases
63 (add-before 'configure 'patch-paths
64 (lambda _
65 (let ((tzdata (assoc-ref %build-inputs "tzdata")))
66 (substitute* "src/libical/icaltz-util.c"
67 (("\\\"/usr/share/zoneinfo\\\",")
68 (string-append "\"" tzdata "/share/zoneinfo\""))
69 (("\\\"/usr/lib/zoneinfo\\\",") "")
70 (("\\\"/etc/zoneinfo\\\",") "")
71 (("\\\"/usr/share/lib/zoneinfo\\\"") "")))
72 #t)))))
73 (native-inputs
74 `(("perl" ,perl)))
75 (inputs
76 `(("icu4c" ,icu4c)
77 ("tzdata" ,tzdata)))
78 (home-page "https://libical.github.io/libical/")
79 (synopsis "iCalendar protocols and data formats implementation")
80 (description
81 "Libical is an implementation of the iCalendar protocols and protocol
82 data units.")
83 (license lgpl2.1)))
84
85 (define-public khal
86 (package
87 (name "khal")
88 (version "0.9.8")
89 (source (origin
90 (method url-fetch)
91 (uri (pypi-uri "khal" version))
92 (sha256
93 (base32
94 "1blx3gxnv7sj302biqphfw7i6ilzl2xlmvzp130n3113scg9w17y"))))
95 (build-system python-build-system)
96 (arguments
97 `(#:phases (modify-phases %standard-phases
98 ;; Building the manpage requires khal to be installed.
99 (add-after 'install 'manpage
100 (lambda* (#:key inputs outputs #:allow-other-keys)
101 ;; Make installed package available for running the tests
102 (add-installed-pythonpath inputs outputs)
103 (and
104 (zero? (system* "make" "--directory=doc/" "man"))
105 (install-file
106 "doc/build/man/khal.1"
107 (string-append (assoc-ref outputs "out") "/share/man/man1")))))
108 (replace 'check
109 (lambda* (#:key inputs #:allow-other-keys)
110 ;; The tests require us to choose a timezone.
111 (setenv "TZ"
112 (string-append (assoc-ref inputs "tzdata")
113 "/share/zoneinfo/Zulu"))
114 (zero? (system* "py.test" "tests" "-k"
115 (string-append
116 ;; These tests are known to fail in when not
117 ;; running in a TTY:
118 ;; https://github.com/pimutils/khal/issues/683
119 "not test_printics_read_from_stdin "
120 "and not test_import_from_stdin"))))))))
121 (native-inputs
122 ;; XXX Uses tmpdir_factory, introduced in pytest 2.8.
123 `(("python-pytest" ,python-pytest-3.0)
124 ("python-pytest-cov" ,python-pytest-cov)
125 ("python-setuptools-scm" ,python-setuptools-scm)
126 ;; Required for tests
127 ("python-freezegun" ,python-freezegun)
128 ("tzdata" ,tzdata)
129 ("vdirsyncer" ,vdirsyncer)
130 ;; Required to build manpage
131 ("python-sphinxcontrib-newsfeed" ,python-sphinxcontrib-newsfeed)
132 ("python-sphinx" ,python-sphinx)))
133 (inputs
134 `(("sqlite" ,sqlite)))
135 (propagated-inputs
136 `(("python-configobj" ,python-configobj)
137 ("python-dateutil" ,python-dateutil)
138 ("python-icalendar" ,python-icalendar)
139 ("python-tzlocal" ,python-tzlocal)
140 ("python-urwid" ,python-urwid)
141 ("python-pyxdg" ,python-pyxdg)))
142 (synopsis "Console calendar program")
143 (description "Khal is a standards based console calendar program,
144 able to synchronize with CalDAV servers through vdirsyncer.")
145 (home-page "http://lostpackets.de/khal/")
146 (license expat)))
147
148 (define-public remind
149 (package
150 (name "remind")
151 (version "3.1.15")
152 (source
153 (origin
154 (method url-fetch)
155 (uri (string-append "https://www.roaringpenguin.com/files/download/"
156 "remind-"
157 (string-join (map (cut string-pad <> 2 #\0)
158 (string-split version #\.))
159 ".")
160 ".tar.gz"))
161 (sha256
162 (base32
163 "1hcfcxz5fjzl7606prlb7dgls5kr8z3wb51h48s6qm8ang0b9nla"))))
164 (build-system gnu-build-system)
165 (arguments
166 '(#:tests? #f)) ;no "check" target
167 (home-page "http://www.roaringpenguin.com/products/remind/")
168 (synopsis "Sophisticated calendar and alarm program")
169 (description
170 "Remind allows you to remind yourself of upcoming events and appointments.
171 Each reminder or alarm can consist of a message sent to standard output, or a
172 program to be executed. It also features: sophisticated date calculation,
173 moon phases, sunrise/sunset, Hebrew calendar, alarms, PostScript output and
174 proper handling of holidays.")
175 (license gpl2)))
176
177 (define-public libhdate
178 (package
179 (name "libhdate")
180 (version "1.6.02")
181 (source
182 (origin
183 (method url-fetch)
184 (uri (string-append "mirror://sourceforge/libhdate/libhdate/libhdate-"
185 version "/" name "-" version ".tar.bz2"))
186 (sha256
187 (base32
188 "0qkpq412p78znw8gckwcx3l0wcss9s0dgw1pvjb1ih2pxf6hm4rw"))))
189 (build-system gnu-build-system)
190 (home-page "http://libhdate.sourceforge.net/")
191 (synopsis "Library to use Hebrew dates")
192 (description "LibHdate is a small library for the Hebrew calendar and times
193 of day, written in C, and including bindings for C++, pascal, perl, php, python,
194 and ruby. It includes two illustrative command-line programs, @code{hcal} and
195 @code{hdate}, and some snippets and scripts written in the binding languages.")
196 (license gpl3+)))