m4.scm 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2012, 2013, 2015 Ludovic Courtès <ludo@gnu.org>
  3. ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
  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. (define-module (gnu packages m4)
  20. #:use-module (guix licenses)
  21. #:use-module (gnu packages)
  22. #:use-module (guix packages)
  23. #:use-module (guix download)
  24. #:use-module (guix build-system gnu))
  25. (define-public m4
  26. (package
  27. (name "m4")
  28. (version "1.4.18")
  29. (source (origin
  30. (method url-fetch)
  31. (uri (string-append "mirror://gnu/m4/m4-"
  32. version ".tar.xz"))
  33. (patches (search-patches "m4-gnulib-libio.patch"))
  34. (sha256
  35. (base32
  36. "01sfjd5a4waqw83bibvmn522g69qfqvwig9i2qlgy154l1nfihgj"))))
  37. (build-system gnu-build-system)
  38. (arguments
  39. `(;; Explicitly disable tests when cross-compiling, otherwise 'make check'
  40. ;; proceeds and fails, unsurprisingly.
  41. #:tests? ,(not (%current-target-system))
  42. #:phases
  43. (modify-phases %standard-phases
  44. (add-before 'check 'pre-check
  45. (lambda* (#:key inputs #:allow-other-keys)
  46. ;; Fix references to /bin/sh.
  47. (let ((bash (assoc-ref inputs "bash")))
  48. (for-each patch-shebang
  49. (find-files "tests" "\\.sh$"))
  50. (substitute* (find-files "tests"
  51. "posix_spawn")
  52. (("/bin/sh")
  53. (format #f "~a/bin/sh" bash)))
  54. #t))))))
  55. (synopsis "Macro processor")
  56. (description
  57. "GNU M4 is an implementation of the M4 macro language, which features
  58. some extensions over other implementations, some of which are required by GNU
  59. Autoconf. It is used as a macro processor, which means it processes text,
  60. expanding macros as it encounters them. It also has some built-in functions,
  61. for example to run shell commands or to do arithmetic.")
  62. (license gpl3+)
  63. (home-page "https://www.gnu.org/software/m4/")))