| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 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 | |
| 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 | |
| 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 | |
| 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
|
| 99 | part of COBOL 85, X/Open COBOL and newer ISO COBOL standards as well as many
|
| 100 | extensions from other COBOL compilers (IBM COBOL, MicroFocus COBOL, ACUCOBOL-GT
|
| 101 | and others).")
|
| 102 | (license gpl3+)))
|