ninja.scm 3.1 KB

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