You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
3.7 KiB

  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
  3. ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
  4. ;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il>
  5. ;;;
  6. ;;; This file is part of GNU Guix.
  7. ;;;
  8. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  9. ;;; under the terms of the GNU General Public License as published by
  10. ;;; the Free Software Foundation; either version 3 of the License, or (at
  11. ;;; your option) any later version.
  12. ;;;
  13. ;;; GNU Guix is distributed in the hope that it will be useful, but
  14. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  15. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. ;;; GNU General Public License for more details.
  17. ;;;
  18. ;;; You should have received a copy of the GNU General Public License
  19. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  20. (define-module (gnu packages gawk)
  21. #:use-module (guix licenses)
  22. #:use-module (gnu packages)
  23. #:use-module (gnu packages bash)
  24. #:use-module (gnu packages libsigsegv)
  25. #:use-module (guix packages)
  26. #:use-module (guix download)
  27. #:use-module (guix build-system gnu))
  28. (define-public gawk
  29. (package
  30. (name "gawk")
  31. (version "5.0.1")
  32. (source (origin
  33. (method url-fetch)
  34. (uri (string-append "mirror://gnu/gawk/gawk-" version
  35. ".tar.xz"))
  36. (sha256
  37. (base32 "15570p7g2x54asvr2fsc56sxzmm08fbk4mzpcs5n92fp9vq8cklf"))))
  38. (build-system gnu-build-system)
  39. (arguments
  40. `(#:phases (modify-phases %standard-phases
  41. (add-before 'configure 'set-shell-file-name
  42. (lambda* (#:key inputs #:allow-other-keys)
  43. ;; Refer to the right shell.
  44. (let ((bash (assoc-ref inputs "bash")))
  45. (substitute* "io.c"
  46. (("/bin/sh")
  47. (string-append bash "/bin/sh")))
  48. ;; When cross-compiling, remove dependencies on the
  49. ;; `check-for-shared-lib-support' target, which tries
  50. ;; to run the cross-built `gawk'.
  51. ,@(if (%current-target-system)
  52. '((substitute* "extension/Makefile.in"
  53. (("^.*: check-for-shared-lib-support" match)
  54. (string-append "### " match))))
  55. '())
  56. #t)))
  57. (add-before 'check 'adjust-test-infrastructure
  58. (lambda _
  59. ;; Remove dependency on 'more' (from util-linux), which
  60. ;; would needlessly complicate bootstrapping.
  61. (substitute* "test/Makefile"
  62. (("\\| more") ""))
  63. ;; Adjust the shebang in that file since it is then diff'd
  64. ;; against the actual test output.
  65. (substitute* "test/watchpoint1.ok"
  66. (("#! /usr/bin/gawk")
  67. (string-append "#!" (which "gawk"))))
  68. #t)))))
  69. (inputs `(("libsigsegv" ,libsigsegv)
  70. ,@(if (%current-target-system)
  71. `(("bash" ,bash))
  72. '())))
  73. (home-page "https://www.gnu.org/software/gawk/")
  74. (synopsis "Text scanning and processing language")
  75. (description
  76. "Gawk is the GNU implementation of Awk, a specialized programming
  77. language for the easy manipulation of formatted text, such as tables of data.
  78. Gawk features many extensions beyond the traditional implementation,
  79. including network access, sorting, and large libraries.")
  80. (license gpl3+)))