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