gnu: VLC: Update to 3.0.10.
[jackhill/guix/guix.git] / gnu / packages / time.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
3 ;;; Copyright © 2013, 2017 Ludovic Courtès <ludo@gnu.org>
4 ;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr>
5 ;;; Copyright © 2015, 2016, 2017, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
6 ;;; Copyright © 2015, 2017 Leo Famulari <leo@famulari.name>
7 ;;; Copyright © 2015, 2017 Cyril Roelandt <tipecaml@gmail.com>
8 ;;; Copyright © 2016 Sou Bunnbu <iyzsong@gmail.com>
9 ;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
10 ;;; Copyright © 2016 Danny Milosavljevic <dannym+a@scratchpost.org>
11 ;;; Copyright © 2016, 2020 Marius Bakke <mbakke@fastmail.com>
12 ;;; Copyright © 2016, 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
13 ;;; Copyright © 2017 Ben Woodcroft <donttrustben@gmail.com>
14 ;;; Copyright © 2017 ng0 <ng0@n0.is>
15 ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
16 ;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com>
17 ;;; Copyright © 2019 Kyle Meyer <kyle@kyleam.com>
18 ;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>
19 ;;; Copyright © 2020 Lars-Dominik Braun <ldb@leibniz-psychology.org>
20 ;;;
21 ;;; This file is part of GNU Guix.
22 ;;;
23 ;;; GNU Guix is free software; you can redistribute it and/or modify it
24 ;;; under the terms of the GNU General Public License as published by
25 ;;; the Free Software Foundation; either version 3 of the License, or (at
26 ;;; your option) any later version.
27 ;;;
28 ;;; GNU Guix is distributed in the hope that it will be useful, but
29 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
30 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31 ;;; GNU General Public License for more details.
32 ;;;
33 ;;; You should have received a copy of the GNU General Public License
34 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
35
36 (define-module (gnu packages time)
37 #:use-module (guix licenses)
38 #:use-module (guix packages)
39 #:use-module (guix download)
40 #:use-module (guix git-download)
41 #:use-module (guix build-system gnu)
42 #:use-module (guix build-system python)
43 #:use-module (gnu packages check)
44 #:use-module (gnu packages compression)
45 #:use-module (gnu packages perl)
46 #:use-module (gnu packages python)
47 #:use-module (gnu packages python-xyz))
48
49 (define-public time
50 (package
51 (name "time")
52 (version "1.9")
53 (source
54 (origin
55 (method url-fetch)
56 (uri (string-append "mirror://gnu/time/time-"
57 version ".tar.gz"))
58 (sha256
59 (base32
60 "07jj7cz6lc13iqrpgn81ivqh8rkm73p4rnivwgrrshk23v4g1b7v"))))
61 (build-system gnu-build-system)
62 (home-page "https://www.gnu.org/software/time/")
63 (synopsis "Run a command, then display its resource usage")
64 (description
65 "Time is a command that displays information about the resources that a
66 program uses. The display output of the program can be customized or saved
67 to a file.")
68 (license gpl3+)))
69
70 (define-public python-pytimeparse
71 (package
72 (name "python-pytimeparse")
73 (version "1.1.8")
74 (source
75 (origin
76 (method url-fetch)
77 (uri (pypi-uri "pytimeparse" version))
78 (sha256
79 (base32
80 "02kaambsgpjx3zi42j6l11rwms2p35b9hsk4f3kdf979gd3kcqg8"))))
81 (native-inputs
82 `(("python-nose" ,python-nose)))
83 (build-system python-build-system)
84 (home-page "https://github.com/wroberts/pytimeparse")
85 (synopsis "Time expression parser")
86 (description "This small Python module parses various kinds of time
87 expressions.")
88 (license expat)))
89
90 (define-public python-pytzdata
91 (package
92 (name "python-pytzdata")
93 (version "2019.3")
94 (source
95 (origin
96 (method url-fetch)
97 (uri (pypi-uri "pytzdata" version))
98 (sha256
99 (base32
100 "0ppfc6kz4p41mxyqxq1g1zp6gvns99g6b344qj6ih0x9vxy6zh7s"))))
101 (build-system python-build-system)
102 ;; XXX: The PyPI distribution contains no tests, and the upstream
103 ;; repository lacks a setup.py! How to build from git?
104 (arguments '(#:tests? #f))
105 (propagated-inputs
106 `(("python-cleo" ,python-cleo)))
107 (home-page "https://github.com/sdispater/pytzdata")
108 (synopsis "Timezone database for Python")
109 (description
110 "This library provides a timezone database for Python.")
111 (license expat)))
112
113 (define-public python2-tzdata
114 (package-with-python2 python-pytzdata))
115
116 (define-public python-pytz
117 (package
118 (name "python-pytz")
119 (version "2019.1")
120 (source
121 (origin
122 (method url-fetch)
123 (uri (pypi-uri "pytz" version))
124 (sha256
125 (base32
126 "0hg1r2c41gnmljdsdmdgy6kb1zkfmxsf49imd96g8znp4cyxsiyp"))))
127 (build-system python-build-system)
128 (home-page "http://pythonhosted.org/pytz")
129 (synopsis "Python timezone library")
130 (description "This library brings the Olson tz database into Python. It
131 allows accurate and cross platform timezone calculations using Python 2.4 or
132 higher. It also solves the issue of ambiguous times at the end of daylight
133 saving time. Almost all of the Olson timezones are supported.")
134 (license expat)))
135
136 (define-public python2-pytz
137 (package-with-python2 python-pytz))
138
139 (define-public python-pendulum
140 (package
141 (name "python-pendulum")
142 (version "2.1.0")
143 (source
144 (origin
145 (method url-fetch)
146 (uri (pypi-uri "pendulum" version))
147 (sha256
148 (base32
149 "1zhzk0ai8is8zclw4v73dllf0hx0l5nmm4sbwrh6cl8h5qsang09"))))
150 (build-system python-build-system)
151 ;; XXX: The PyPI distribution lacks tests, and the upstream repository
152 ;; lacks a setup.py!
153 (arguments '(#:tests? #f))
154 (propagated-inputs
155 `(("python-dateutil" ,python-dateutil)
156 ("python-pytzdata" ,python-pytzdata)))
157 (home-page "https://github.com/sdispater/pendulum")
158 (synopsis "Alternate API for Python datetimes")
159 (description "Pendulum is a drop-in replacement for the standard
160 @{datetime} class, providing an alternative API. As it inherits from the
161 standard @code{datetime} all @code{datetime} instances can be replaced by
162 Pendulum instances.")
163 (license expat)))
164
165 (define-public python2-pendulum
166 (package-with-python2 python-pendulum))
167
168 (define-public python-dateutil
169 (package
170 (name "python-dateutil")
171 (version "2.8.0")
172 (source
173 (origin
174 (method url-fetch)
175 (uri (pypi-uri "python-dateutil" version))
176 (sha256
177 (base32
178 "17nsfhy4xdz1khrfxa61vd7pmvd5z0wa3zb6v4gb4kfnykv0b668"))))
179 (build-system python-build-system)
180 (arguments
181 `(#:phases (modify-phases %standard-phases
182 (replace 'check
183 (lambda _
184 ;; Delete tests that depend on "freezegun" to avoid a
185 ;; circular dependency.
186 (delete-file "dateutil/test/test_utils.py")
187 (delete-file "dateutil/test/test_rrule.py")
188
189 ;; XXX: Fails to get timezone from /etc/localtime.
190 (delete-file "dateutil/test/test_tz.py")
191
192 (invoke "pytest" "-vv"))))))
193 (native-inputs
194 `(("python-pytest" ,python-pytest)
195 ("python-setuptools-scm" ,python-setuptools-scm)))
196 (propagated-inputs
197 `(("python-six" ,python-six)))
198 (home-page "https://dateutil.readthedocs.io/en/stable/")
199 (synopsis "Extensions to the standard datetime module")
200 (description
201 "The dateutil module provides powerful extensions to the standard
202 datetime module, available in Python 2.3+.")
203 ;; The license was changed from the three-clause BSD license to a dual
204 ;; Apache 2.0/BSD-3 variant at 2017-12-01. Some code is only available as
205 ;; BSD-3 still; but all new code is dual licensed (the user can choose).
206 (license (list bsd-3 asl2.0))))
207
208 (define-public python2-dateutil
209 (package-with-python2 python-dateutil))
210
211 (define-public python-parsedatetime
212 (package
213 (name "python-parsedatetime")
214 (version "2.4")
215 (source
216 (origin
217 (method url-fetch)
218 (uri (pypi-uri "parsedatetime" version))
219 (sha256
220 (base32
221 "0jxqkjks7z9dn222cqgvskp4wr6d92aglinxq7pd2w4mzdc7r09x"))))
222 (build-system python-build-system)
223 (native-inputs
224 `(("python-nose" ,python-nose)
225 ("python-pyicu" ,python-pyicu)
226 ("python-pytest" ,python-pytest)
227 ("python-pytest-runner" ,python-pytest-runner)))
228 (propagated-inputs
229 `(("python-future" ,python-future)))
230 (home-page "https://github.com/bear/parsedatetime/")
231 (synopsis "Parse human-readable date/time text")
232 (description
233 "Parse human-readable date/time text.")
234 (license asl2.0)))
235
236 (define-public python2-parsedatetime
237 (package-with-python2 python-parsedatetime))
238
239 (define-public python-ciso8601
240 (package
241 (name "python-ciso8601")
242 (version "2.1.3")
243 (source
244 (origin
245 (method git-fetch)
246 ;; The PyPi distribution doesn't include the tests.
247 (uri (git-reference
248 (url "https://github.com/closeio/ciso8601.git")
249 (commit (string-append "v" version))))
250 (file-name (git-file-name name version))
251 (sha256
252 (base32
253 "0g1aiyc1ayh0rnibyy416m5mmck38ksgdm3jsy0z3rxgmgb24951"))))
254 (build-system python-build-system)
255 ;; Pytz should only be required for Python 2, but the test suite fails
256 ;; without it.
257 (native-inputs
258 `(("python-pytz" ,python-pytz)))
259 (home-page "https://github.com/closeio/ciso8601")
260 (synopsis
261 "Fast ISO8601 date time parser")
262 (description
263 "The package ciso8601 converts ISO 8601 or RFC 3339 date time strings into
264 Python datetime objects.")
265 (license expat)))
266
267 (define-public python-tzlocal
268 (package
269 (name "python-tzlocal")
270 (version "1.5.1")
271 (source
272 (origin
273 (method url-fetch)
274 (uri (pypi-uri "tzlocal" version))
275 (sha256
276 (base32
277 "0kiciwiqx0bv0fbc913idxibc4ygg4cb7f8rcpd9ij2shi4bigjf"))))
278 (build-system python-build-system)
279 (arguments
280 `(#:phases
281 (modify-phases %standard-phases
282 (add-before 'check 'fix-symlink-test
283 ;; see: https://github.com/regebro/tzlocal/issues/53
284 (lambda _
285 (delete-file "tzlocal/test_data/symlink_localtime/etc/localtime")
286 (symlink "../usr/share/zoneinfo/Africa/Harare"
287 "tzlocal/test_data/symlink_localtime/etc/localtime")
288 #t)))))
289 (propagated-inputs
290 `(("python-pytz" ,python-pytz)))
291 (native-inputs
292 `(("python-mock" ,python-mock)))
293 (home-page "https://github.com/regebro/tzlocal")
294 (synopsis "Local timezone information for Python")
295 (description
296 "Tzlocal returns a tzinfo object with the local timezone information.
297 This module attempts to fix a glaring hole in pytz, that there is no way to
298 get the local timezone information, unless you know the zoneinfo name, and
299 under several distributions that's hard or impossible to figure out.")
300 (license expat)))
301
302 (define-public python-isodate
303 (package
304 (name "python-isodate")
305 (version "0.6.0")
306 (source
307 (origin
308 (method url-fetch)
309 (uri (pypi-uri "isodate" version))
310 (sha256
311 (base32
312 "1n7jkz68kk5pwni540pr5zdh99bf6ywydk1p5pdrqisrawylldif"))))
313 (build-system python-build-system)
314 (native-inputs
315 `(("python-six" ,python-six)))
316 (home-page "https://github.com/gweis/isodate/")
317 (synopsis "Python date parser and formatter")
318 (description
319 "Python-isodate is a python module for parsing and formatting
320 ISO 8601 dates, time and duration.")
321 (license bsd-3)))
322
323 (define-public python2-isodate
324 (package-with-python2 python-isodate))
325
326 (define-public python-iso8601
327 (package
328 (name "python-iso8601")
329 (version "0.1.12")
330 (source
331 (origin
332 (method url-fetch)
333 (uri (pypi-uri "iso8601" version))
334 (sha256
335 (base32
336 "10nyvvnrhw2w3p09v1ica4lgj6f4g9j3kkfx17qmraiq3w7b5i29"))))
337 (build-system python-build-system)
338 (native-inputs
339 `(("python-pytest" ,python-pytest)))
340 (home-page "https://bitbucket.org/micktwomey/pyiso8601")
341 (synopsis "Module to parse ISO 8601 dates")
342 (description
343 "This module parses the most common forms of ISO 8601 date strings (e.g.
344 @code{2007-01-14T20:34:22+00:00}) into @code{datetime} objects.")
345 (license expat)))
346
347 (define-public python2-iso8601
348 (package-with-python2 python-iso8601))
349
350 (define-public python-monotonic
351 (package
352 (name "python-monotonic")
353 (version "1.5")
354 (source
355 (origin
356 (method url-fetch)
357 (uri (pypi-uri "monotonic" version))
358 (sha256
359 (base32
360 "1c6z46yb600klbfhqadyl7vq0jdjdxkm72k43ra3iw3d0xakv593"))))
361 (build-system python-build-system)
362 (arguments '(#:tests? #f)) ; no tests
363 (home-page "https://github.com/atdt/monotonic")
364 (synopsis "Implementation of time.monotonic() for Python 2 & < 3.3")
365 (description
366 "This module provides a @code{monotonic()} function which returns the
367 value (in fractional seconds) of a clock which never goes backwards.")
368 (license asl2.0)))
369
370 (define-public python2-monotonic
371 (package-with-python2 python-monotonic))
372
373 (define-public python-pyrfc3339
374 (package
375 (name "python-pyrfc3339")
376 (version "1.1")
377 (source
378 (origin
379 (method url-fetch)
380 (uri (pypi-uri "pyRFC3339" version))
381 (sha256
382 (base32
383 "06jv7ar7lpvvk0dixzwdr3wgm0g1lipxs429s2z7knwwa7hwpf41"))))
384 (build-system python-build-system)
385 (propagated-inputs
386 `(("python-pytz" ,python-pytz)))
387 (native-inputs
388 `(("python-nose" ,python-nose)))
389 (home-page "https://github.com/kurtraschke/pyRFC3339")
390 (synopsis "Python timestamp library")
391 (description "Python library for generating and parsing RFC 3339-compliant
392 timestamps.")
393 (license expat)))
394
395 (define-public python2-pyrfc3339
396 (package-with-python2 python-pyrfc3339))
397
398 (define-public python-arrow
399 (package
400 (name "python-arrow")
401 (version "0.10.0")
402 (source (origin
403 (method url-fetch)
404 (uri (pypi-uri "arrow" version))
405 (sha256
406 (base32
407 "08n7q2l69hlainds1byd4lxhwrq7zsw7s640zkqc3bs5jkq0cnc0"))))
408 (build-system python-build-system)
409 (native-inputs
410 `(;; For testing
411 ("python-chai" ,python-chai)
412 ("python-simplejson" ,python-simplejson)))
413 (propagated-inputs
414 `(("python-dateutil" ,python-dateutil)))
415 (home-page "https://github.com/crsmithdev/arrow/")
416 (synopsis "Dates and times for Python")
417 (description
418 "Arrow is a Python library to creating, manipulating, formatting and
419 converting dates, times, and timestamps. It implements and updates the
420 datetime type.")
421 (license asl2.0)))
422
423 (define-public python2-arrow
424 (package-with-python2 python-arrow))
425
426 (define-public python-aniso8601
427 (package
428 (name "python-aniso8601")
429 (version "1.3.0")
430 (source
431 (origin
432 (method url-fetch)
433 (uri (pypi-uri "aniso8601" version))
434 (sha256
435 (base32
436 "1waj54iv3n3lw1fapbz8a93yjgrybgpc86wif5baxdh1arpj9df3"))))
437 (build-system python-build-system)
438 (propagated-inputs
439 `(("python-dateutil" ,python-dateutil)))
440 (home-page "https://bitbucket.org/nielsenb/aniso8601")
441 (synopsis "Python library for parsing ISO 8601 strings")
442 (description
443 "This package contains a library for parsing ISO 8601 datetime strings.")
444 (license bsd-3)))
445
446 (define-public python2-aniso8601
447 (package-with-python2 python-aniso8601))
448
449 (define-public datefudge
450 (package
451 (name "datefudge")
452 (version "1.23")
453 (source (origin
454 (method git-fetch)
455 (uri (git-reference
456 (url "https://salsa.debian.org/debian/datefudge.git")
457 (commit (string-append "debian/" version))))
458 (file-name (git-file-name name version))
459 (sha256
460 (base32
461 "0r9g8v9xnv60hq3j20wqy34kyig3sc2pisjxl4irn7jjx85f1spv"))))
462 (build-system gnu-build-system)
463 (arguments
464 `(#:test-target "test"
465 #:make-flags (list "CC=gcc"
466 (string-append "prefix=" (assoc-ref %outputs "out")))
467 #:phases
468 (modify-phases %standard-phases
469 (add-after 'unpack 'patch-makefile
470 (lambda _
471 (substitute* "Makefile"
472 ((" -o root -g root") "")
473 (("VERSION := \\$\\(shell dpkg-parsechangelog .*")
474 (string-append "VERSION = " ,version)))
475 #t))
476 (delete 'configure))))
477 (native-inputs
478 `(("perl" ,perl)))
479 (home-page "https://salsa.debian.org/debian/datefudge")
480 (synopsis "Pretend the system date is different")
481 (description
482 "Utility that fakes the system time by pre-loading a small library that
483 modifies the @code{time}, @code{gettimeofday} and @code{clock_gettime} system
484 calls.")
485 (license gpl2)))