cobol.scm 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2017, 2018, 2021 Efraim Flashner <efraim@flashner.co.il>
  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. (define-module (gnu packages cobol)
  19. #:use-module (gnu packages)
  20. #:use-module (guix build-system gnu)
  21. #:use-module (guix licenses)
  22. #:use-module (guix packages)
  23. #:use-module (guix download)
  24. #:use-module (gnu packages dbm)
  25. #:use-module (gnu packages multiprecision)
  26. #:use-module (gnu packages ncurses)
  27. #:use-module (gnu packages perl)
  28. #:use-module (gnu packages web)
  29. #:use-module (gnu packages xml))
  30. (define-public gnucobol
  31. (package
  32. (name "gnucobol")
  33. (version "3.1.2")
  34. (source
  35. (origin
  36. (method url-fetch)
  37. (uri (string-append
  38. "mirror://gnu/gnucobol/gnucobol-"
  39. version ".tar.xz"))
  40. (sha256
  41. (base32
  42. "0x15ybfm63g7c9340fc6712h9v59spnbyaz4rf85pmnp3zbhaw2r"))))
  43. (arguments
  44. '(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
  45. (assoc-ref %outputs "out")
  46. "/lib")
  47. (string-append "JSON_C_CFLAGS=-I"
  48. (assoc-ref %build-inputs "json-c")
  49. "/include/json-c"))
  50. #:phases
  51. (modify-phases %standard-phases
  52. (add-after 'unpack 'place-cobol85-test-suite
  53. (lambda* (#:key inputs #:allow-other-keys)
  54. (let ((newcob (assoc-ref inputs "newcob")))
  55. (copy-file newcob "tests/cobol85/newcob.val.Z"))))
  56. (add-before 'check 'set-TERM
  57. ;; Some tests expect a known terminal
  58. (lambda _ (setenv "TERM" "xterm-256color"))))
  59. #:test-target "checkall"))
  60. (native-inputs
  61. `(("perl" ,perl)
  62. ("newcob" ,(origin
  63. (method url-fetch)
  64. (uri "https://www.itl.nist.gov/div897/ctg/suites/newcob.val.Z")
  65. (sha256
  66. (base32
  67. "1yb1plmv4firfnbb119r2vh1hay221w1ya34nyz0qwsxppfr56hy"))))))
  68. (inputs
  69. `(("bdb" ,bdb)
  70. ("gmp" ,gmp)
  71. ("json-c" ,json-c)
  72. ("libxml2" ,libxml2)
  73. ("ncurses" ,ncurses)))
  74. (build-system gnu-build-system)
  75. (home-page "https://www.gnu.org/software/gnucobol/")
  76. (synopsis "A modern COBOL compiler")
  77. (description "GnuCOBOL is a free, modern COBOL compiler. GnuCOBOL
  78. implements a substantial part of the COBOL 85, COBOL 2002 and COBOL 2014
  79. standards and X/Open COBOL, as well as many extensions included in other
  80. COBOL compilers (IBM COBOL, MicroFocus COBOL, ACUCOBOL-GT and others).
  81. GnuCOBOL translates COBOL into C and compiles the translated code using
  82. a native C compiler.")
  83. (license gpl3+)))