gnu: bdb: Update to 6.2.23.
[jackhill/guix/guix.git] / gnu / packages / ninja.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
3 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
4 ;;;
5 ;;; This file is part of GNU Guix.
6 ;;;
7 ;;; GNU Guix is free software; you can redistribute it and/or modify it
8 ;;; under the terms of the GNU General Public License as published by
9 ;;; the Free Software Foundation; either version 3 of the License, or (at
10 ;;; your option) any later version.
11 ;;;
12 ;;; GNU Guix is distributed in the hope that it will be useful, but
13 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;;; GNU General Public License for more details.
16 ;;;
17 ;;; You should have received a copy of the GNU General Public License
18 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19
20 (define-module (gnu packages ninja)
21 #:use-module ((guix licenses) #:select (asl2.0))
22 #:use-module (guix packages)
23 #:use-module (guix download)
24 #:use-module (guix build-system gnu)
25 #:use-module (gnu packages)
26 #:use-module (gnu packages python))
27
28 (define-public ninja
29 (package
30 (name "ninja")
31 (version "1.5.3")
32 (source (origin
33 (method url-fetch)
34 (uri (string-append "https://github.com/martine/ninja/"
35 "archive/v" version ".tar.gz"))
36 (file-name (string-append name "-" version ".tar.gz"))
37 (sha256
38 (base32
39 "1h3yfwcfl61v493vna6jia2fizh8rpig7qw2504cvkr6gid3p5bw"))
40 (patches (search-patches "ninja-zero-mtime.patch"
41 "ninja-tests.patch"))))
42 (build-system gnu-build-system)
43 (native-inputs `(("python" ,python-2)))
44 (arguments
45 '(#:phases
46 (modify-phases %standard-phases
47 (replace
48 'configure
49 (lambda _
50 (substitute* "src/subprocess-posix.cc"
51 (("/bin/sh") (which "sh")))
52 #t))
53 (replace
54 'build
55 (lambda _
56 (zero? (system* "./configure.py" "--bootstrap"))))
57 (replace
58 'check
59 (lambda _
60 (and (zero? (system* "./configure.py"))
61 (zero? (system* "./ninja" "ninja_test"))
62 (zero? (system* "./ninja_test")))))
63 (replace
64 'install
65 (lambda* (#:key outputs #:allow-other-keys)
66 (let* ((out (assoc-ref outputs "out"))
67 (bin (string-append out "/bin"))
68 (doc (string-append out "/share/doc/ninja")))
69 (install-file "ninja" bin)
70 (install-file "doc/manual.asciidoc" doc)
71 #t))))))
72 (home-page "http://martine.github.io/ninja/")
73 (synopsis "Small build system")
74 (description
75 "Ninja is a small build system with a focus on speed. It differs from
76 other build systems in two major respects: it is designed to have its input
77 files generated by a higher-level build system, and it is designed to run
78 builds as fast as possible.")
79 (license asl2.0)))