| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 |
|
| 21 | (define-module (gnu packages ada)
|
| 22 | #:use-module ((guix licenses) #:prefix license:)
|
| 23 | #:use-module (guix build-system gnu)
|
| 24 | #:use-module (guix packages)
|
| 25 | #:use-module (guix git-download)
|
| 26 | #:use-module (gnu packages)
|
| 27 | #:use-module (gnu packages base)
|
| 28 | #:use-module (ice-9 match))
|
| 29 |
|
| 30 | (define-public ada/ed
|
| 31 | (package
|
| 32 | (name "ada-ed")
|
| 33 | (version "1.11.2")
|
| 34 | (source
|
| 35 | (origin
|
| 36 | (method git-fetch)
|
| 37 | (uri (git-reference
|
| 38 | |
| 39 | (url "https://github.com/daveshields/AdaEd")
|
| 40 | (commit "57daecfb7ccadfd9aaf13b4d54f51065affbe599")))
|
| 41 | (sha256
|
| 42 | (base32 "1k97a8nqsvbsadizrmhhypcx758sxqkai8wq3ckk853qxvzaasd8"))
|
| 43 | (file-name (git-file-name name version))))
|
| 44 | (build-system gnu-build-system)
|
| 45 | (supported-systems (list "i686-linux" "x86_64-linux"
|
| 46 | "armhf-linux" "aarch64-linux"
|
| 47 | "powerpc-linux"))
|
| 48 | (outputs (list "out" "debug"))
|
| 49 | (arguments
|
| 50 | `(#:system
|
| 51 | ,@(match (%current-system)
|
| 52 | |
| 53 | |
| 54 | ("aarch64-linux"
|
| 55 | `("armhf-linux"))
|
| 56 | ("x86_64-linux"
|
| 57 | `("i686-linux"))
|
| 58 | (_
|
| 59 | (list (%current-system))))
|
| 60 | #:make-flags
|
| 61 | (let ((out (assoc-ref %outputs "out")))
|
| 62 | (list (string-append
|
| 63 | "CFLAGS=-g" |
| 64 | " -DOP_SYS='\"GNU\"'" |
| 65 | " -DSYSTEM_V" |
| 66 | " -DWORDSIZE32"
|
| 67 | " -DALIGN4") |
| 68 | "LFLAGS=" |
| 69 | (string-append "BINDIR=" out "/bin")
|
| 70 | (string-append "LIBDIR=" out "/lib")
|
| 71 | (string-append "MANDIR=" out "/share/man")))
|
| 72 | #:modules ((guix build gnu-build-system)
|
| 73 | (guix build utils)
|
| 74 | (srfi srfi-26))
|
| 75 | #:phases
|
| 76 | (modify-phases %standard-phases
|
| 77 | (add-after 'unpack 'patch-sources
|
| 78 | (lambda _
|
| 79 | |
| 80 | (substitute* "adalex.c"
|
| 81 | (("getline") "adaed_getline"))
|
| 82 | |
| 83 | |
| 84 | (substitute* "vars.ch"
|
| 85 | (("INIT\\(stdout\\)") ""))
|
| 86 | #t))
|
| 87 | (delete 'configure) |
| 88 | (add-before 'build 'find-build-scripts
|
| 89 | (lambda _
|
| 90 | (setenv "PATH" (string-append ".:" (getenv "PATH")))
|
| 91 | #t))
|
| 92 | (add-after 'build 'build-predef
|
| 93 | (lambda* (#:key make-flags #:allow-other-keys)
|
| 94 | |
| 95 | (apply invoke "make" "predef" make-flags)
|
| 96 | #t))
|
| 97 | (delete 'check) |
| 98 | (add-before 'install 'create-output-directories
|
| 99 | (lambda* (#:key outputs #:allow-other-keys)
|
| 100 | (let ((out (assoc-ref outputs "out")))
|
| 101 | (mkdir-p (string-append out "/share/man/manl"))
|
| 102 | #t)))
|
| 103 | (add-after 'install 'check
|
| 104 | |
| 105 | (lambda* (#:key outputs tests? #:allow-other-keys)
|
| 106 | (let ((out (assoc-ref outputs "out")))
|
| 107 | (when tests?
|
| 108 | (setenv "ADAED" (string-append out "/lib"))
|
| 109 | (setenv "PATH" (string-append out "/bin:" (getenv "PATH")))
|
| 110 | (with-directory-excursion "demos" |
| 111 | (for-each
|
| 112 | delete-file
|
| 113 | '("runc" |
| 114 | "rund" |
| 115 | "rune" |
| 116 | "rung")) |
| 117 | (for-each (lambda (script)
|
| 118 | (format #t "\n=== Invoking ~a ===\n" script)
|
| 119 | (invoke script))
|
| 120 | (find-files "." "^run")))))))
|
| 121 | (add-after 'install 'clean-up-output
|
| 122 | (lambda* (#:key outputs #:allow-other-keys)
|
| 123 | (let ((out (assoc-ref outputs "out")))
|
| 124 | (with-directory-excursion out
|
| 125 | |
| 126 | (for-each (cut chmod <> #o644)
|
| 127 | (append (find-files "lib" "\\....$")
|
| 128 | (find-files "share" ".")))
|
| 129 | #t)))))))
|
| 130 | (native-inputs
|
| 131 | (list sed))
|
| 132 | (home-page (string-append "https://web.archive.org/web/20140902150609/"
|
| 133 | "http://www2.informatik.uni-stuttgart.de/iste/ps/"
|
| 134 | "ada-software/html/dos_ada.html"))
|
| 135 | (synopsis "Ada 83 interpreter")
|
| 136 | (description "Ada/Ed is a translator-interpreter for Ada 83. It's intended
|
| 137 | primarily as a teaching tool and lacks the capacity, performance, and robustness
|
| 138 | of other contemporary or modern-day Ada compilers.
|
| 139 |
|
| 140 | Ada/Ed was the first Ada compiler to pass the @acronym{ACVC, Ada Compiler
|
| 141 | Validation Suite} version 1.7 but fails many newer tests and is not a validated
|
| 142 | Ada system. Being an interpreter, it does not implement most representation
|
| 143 | clauses, and thus does not support systems programming close to the machine
|
| 144 | level.")
|
| 145 | (license license:gpl2+)))
|