projects/guix·blob javascript-team · refs

102 lines · 4.0 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2017, 2018, 2021-2024 Efraim Flashner <[email protected]>
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 cobol)
20 #:use-module (gnu packages)
21 #:use-module (guix build-system gnu)
22 #:use-module (guix licenses)
23 #:use-module (guix packages)
24 #:use-module (guix download)
25 #:use-module (guix gexp)
26 #:use-module (gnu packages bison)
27 #:use-module (gnu packages dbm)
28 #:use-module (gnu packages compiler-tools)
29 #:use-module (gnu packages multiprecision)
30 #:use-module (gnu packages ncurses)
31 #:use-module (gnu packages perl)
32 #:use-module (gnu packages web)
33 #:use-module (gnu packages xml))
34
35(define-public gnucobol
36 (package
37 (name "gnucobol")
38 (version "3.2")
39 (source
40 (origin
41 (method url-fetch)
42 (uri (string-append
43 "mirror://gnu/gnucobol/gnucobol-"
44 version ".tar.xz"))
45 (sha256
46 (base32
47 "1qifkkrmscc5csri1l4rm9pbik74c3pc5za1rzx7jizddks8md1v"))
48 (snippet
49 #~(begin (use-modules (guix build utils))
50 ;; Remove some files generated by bison and flex.
51 (for-each delete-file
52 '("cobc/parser.c"
53 "cobc/parser.h"
54 "cobc/ppparse.c"
55 "cobc/ppparse.h"
56 "cobc/pplex.c"
57 "cobc/scanner.c"))))))
58 (arguments
59 (list
60 #:configure-flags
61 #~(list (string-append "LDFLAGS=-Wl,-rpath="
62 #$output "/lib")
63 (string-append "JSON_C_CFLAGS=-I"
64 (search-input-directory %build-inputs
65 "/include/json-c")))
66 #:phases
67 #~(modify-phases %standard-phases
68 (add-after 'unpack 'fix-build
69 (lambda _
70 ;; Fix build with libxml2 >= 2.14.
71 (substitute* "libcob/common.c"
72 (("#include <libxml/xmlwriter.h>" all)
73 (string-append all "\n#include <libxml/parser.h>")))))
74 (add-after 'unpack 'place-cobol85-test-suite
75 (lambda* (#:key inputs #:allow-other-keys)
76 (let ((newcob (assoc-ref inputs "newcob")))
77 (copy-file newcob "tests/cobol85/newcob.val.Z"))))
78 (add-before 'check 'set-TERM
79 ;; Some tests expect a known terminal
80 (lambda _ (setenv "TERM" "xterm-256color"))))
81 #:test-target "checkall"))
82 (native-inputs
83 `(("bison" ,bison)
84 ("flex" ,flex)
85 ("perl" ,perl)
86 ("newcob" ,(origin
87 (method url-fetch)
88 (uri "https://www.itl.nist.gov/div897/ctg/suites/newcob.val.Z")
89 (sha256
90 (base32
91 "1yb1plmv4firfnbb119r2vh1hay221w1ya34nyz0qwsxppfr56hy"))))))
92 (inputs
93 (list bdb gmp json-c libxml2 ncurses))
94 (build-system gnu-build-system)
95 (home-page "https://www.gnu.org/software/gnucobol/")
96 (synopsis "Modern COBOL compiler")
97 (description
98 "GnuCOBOL is a free, modern COBOL compiler. It implements a substantial
99part of COBOL 85, X/Open COBOL and newer ISO COBOL standards as well as many
100extensions from other COBOL compilers (IBM COBOL, MicroFocus COBOL, ACUCOBOL-GT
101and others).")
102 (license gpl3+)))