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