gnu: Add python-pytzdata.
[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 Ludovic Courtès <ludo@gnu.org>
4 ;;; Copyright © 2017 Ben Woodcroft <donttrustben@gmail.com>
5 ;;;
6 ;;; This file is part of GNU Guix.
7 ;;;
8 ;;; GNU Guix is free software; you can redistribute it and/or modify it
9 ;;; under the terms of the GNU General Public License as published by
10 ;;; the Free Software Foundation; either version 3 of the License, or (at
11 ;;; your option) any later version.
12 ;;;
13 ;;; GNU Guix is distributed in the hope that it will be useful, but
14 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;;; GNU General Public License for more details.
17 ;;;
18 ;;; You should have received a copy of the GNU General Public License
19 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21 (define-module (gnu packages time)
22 #:use-module (guix licenses)
23 #:use-module (guix packages)
24 #:use-module (guix download)
25 #:use-module (guix build-system gnu)
26 #:use-module (guix build-system python)
27 #:use-module (gnu packages python))
28
29 (define-public time
30 (package
31 (name "time")
32 (version "1.7")
33 (source
34 (origin
35 (method url-fetch)
36 (uri (string-append "mirror://gnu/time/time-"
37 version ".tar.gz"))
38 (sha256
39 (base32
40 "0va9063fcn7xykv658v2s9gilj2fq4rcdxx2mn2mmy1v4ndafzp3"))))
41 (build-system gnu-build-system)
42 (arguments
43 '(#:phases
44 (alist-replace 'configure
45 (lambda* (#:key outputs #:allow-other-keys)
46 ;; This old `configure' script doesn't support
47 ;; variables passed as arguments.
48 (let ((out (assoc-ref outputs "out")))
49 (setenv "CONFIG_SHELL" (which "bash"))
50 (zero?
51 (system* "./configure"
52 (string-append "--prefix=" out)))))
53 %standard-phases)))
54 (home-page "https://www.gnu.org/software/time/")
55 (synopsis "Run a command, then display its resource usage")
56 (description
57 "Time is a command that displays information about the resources that a
58 program uses. The display output of the program can be customized or saved
59 to a file.")
60 (license gpl2+)))
61
62 (define-public python-pytzdata
63 (package
64 (name "python-pytzdata")
65 (version "2017.2")
66 (source
67 (origin
68 (method url-fetch)
69 (uri (pypi-uri "pytzdata" version))
70 (sha256
71 (base32
72 "1c1az8spm2d3km6qhjy69y4dlj71p6984l48mizr83nh4f0ipld4"))))
73 (build-system python-build-system)
74 (native-inputs
75 `(("python-pytest" ,python-pytest)
76 ("python-nose" ,python-nose)))
77 (home-page "https://github.com/sdispater/pytzdata")
78 (synopsis "Timezone database for Python")
79 (description
80 "This library provides a timezone database for Python.")
81 (license expat)))
82
83 (define-public python2-tzdata
84 (package-with-python2 python-pytzdata))