aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/ada.scm
blob: 6fcd689be0ef63a01e7480e0496dec1e74894f37 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2018 Danny Milosavljevic <dannym@scratchpost.org>
;;; Copyright © 2020 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2021 Efraim Flashner <efraim@flashner.co.il>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu packages ada)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix build-system gnu)
  #:use-module (guix packages)
  #:use-module (guix git-download)
  #:use-module (gnu packages)
  #:use-module (gnu packages base)
  #:use-module (ice-9 match))

(define-public ada/ed
  (package
    (name "ada-ed")
    (version "1.11.2")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             ;; The HOME-PAGE sources, mirrored by one of the original authors.
             (url "https://github.com/daveshields/AdaEd")
             (commit "57daecfb7ccadfd9aaf13b4d54f51065affbe599")))
       (sha256
        (base32 "1k97a8nqsvbsadizrmhhypcx758sxqkai8wq3ckk853qxvzaasd8"))
       (file-name (git-file-name name version))))
    (build-system gnu-build-system)
    (supported-systems (list "i686-linux" "x86_64-linux"
                             "armhf-linux" "aarch64-linux"
                             "powerpc-linux"))
    (outputs (list "out" "debug"))
    (arguments
     `(#:system
       ,@(match (%current-system)
           ;; This package predates 64-bit PCs: a ‘64-bit’ adaexec segfaults.
           ;; Force a 32-bit build targeting a similar architecture.
           ("aarch64-linux"
            `("armhf-linux"))
           ("x86_64-linux"
            `("i686-linux"))
           (_
            (list (%current-system))))
       #:make-flags
       (let ((out (assoc-ref %outputs "out")))
         (list (string-append
                "CFLAGS=-g"             ; compile with :debug symbols
                " -DOP_SYS='\"GNU\"'"   ; sic; quoting gets mangled somewhere
                " -DSYSTEM_V"           ; closest to modern GNU
                " -DWORDSIZE32"
                " -DALIGN4")            ; suffices on both x86 and ARM
               "LFLAGS="                ; don't link against -lg
               (string-append "BINDIR=" out "/bin")
               (string-append "LIBDIR=" out "/lib")
               (string-append "MANDIR=" out "/share/man")))
       #:modules ((guix build gnu-build-system)
                  (guix build utils)
                  (srfi srfi-26))
       #:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'patch-sources
           (lambda _
             ;; Rename the custom (and incompatible) getline() implementation.
             (substitute* "adalex.c"
               (("getline") "adaed_getline"))
             ;; Work around ‘error: initializer element is not constant’ by not
             ;; initialising MSGFILE.
             (substitute* "vars.ch"
               (("INIT\\(stdout\\)") ""))
             #t))
         (delete 'configure)            ; no configure script
         (add-before 'build 'find-build-scripts
           (lambda _
             (setenv "PATH" (string-append ".:" (getenv "PATH")))
             #t))
         (add-after 'build 'build-predef
           (lambda* (#:key make-flags #:allow-other-keys)
             ;; These aren't otherwise compiled until the ‘install’ phase.
             (apply invoke "make" "predef" make-flags)
             #t))
         (delete 'check)                ; no test suite; run our own below
         (add-before 'install 'create-output-directories
           (lambda* (#:key outputs #:allow-other-keys)
             (let ((out (assoc-ref outputs "out")))
               (mkdir-p (string-append out "/share/man/manl"))
               #t)))
         (add-after 'install 'check
           ;; Run most of the included demos as our own ‘test suite’.
           (lambda* (#:key outputs tests? #:allow-other-keys)
             (let ((out (assoc-ref outputs "out")))
               (when tests?
                 (setenv "ADAED" (string-append out "/lib"))
                 (setenv "PATH" (string-append out "/bin:" (getenv "PATH")))
                 (with-directory-excursion "demos" ; won't run outside of it
                   (for-each
                    delete-file
                    '("runc"   ; ‘invalid data. Please make it a positive no.’
                      "rund"   ; deadlocks by design
                      "rune"   ; ‘dining2.ada: No such file or directory’
                      "rung")) ; ‘mathlib cannot be used as a library’ (!)
                   (for-each (lambda (script)
                               (format #t "\n=== Invoking ~a ===\n" script)
                               (invoke script))
                             (find-files "." "^run")))))))
         (add-after 'install 'clean-up-output
           (lambda* (#:key outputs #:allow-other-keys)
             (let ((out (assoc-ref outputs "out")))
               (with-directory-excursion out
                 ;; These needn't be executable.
                 (for-each (cut chmod <> #o644)
                           (append (find-files "lib" "\\....$")
                                   (find-files "share" ".")))
                 #t)))))))
    (native-inputs
     (list sed))
    (home-page (string-append "https://web.archive.org/web/20140902150609/"
                              "http://www2.informatik.uni-stuttgart.de/iste/ps/"
                              "ada-software/html/dos_ada.html"))
    (synopsis "Ada 83 interpreter")
    (description "Ada/Ed is a translator-interpreter for Ada 83.  It's intended
primarily as a teaching tool and lacks the capacity, performance, and robustness
of other contemporary or modern-day Ada compilers.

Ada/Ed was the first Ada compiler to pass the @acronym{ACVC, Ada Compiler
Validation Suite} version 1.7 but fails many newer tests and is not a validated
Ada system.  Being an interpreter, it does not implement most representation
clauses, and thus does not support systems programming close to the machine
level.")
    (license license:gpl2+)))
python-markdown rpcsvc-proto ;for 'rpcgen' python-pyasn1 ;for krb5 tests ;; For generating man pages. docbook-xml-4.2 docbook-xsl libxslt))) (home-page "https://www.samba.org/") (synopsis "The standard Windows interoperability suite of programs for GNU and Unix") (description "Since 1992, Samba has provided secure, stable and fast file and print services for all clients using the SMB/CIFS protocol, such as all versions of DOS and Windows, OS/2, GNU/Linux and many others. Samba is an important component to seamlessly integrate Linux/Unix Servers and Desktops into Active Directory environments using the winbind daemon.") (license license:gpl3+)))) (define-public samba (package (inherit samba/pinned) (version "4.18.1") (source ;; For updaters: the current PGP fingerprint is ;; 81F5E2832BD2545A1897B713AA99442FB680B620. (origin (method url-fetch) (uri (string-append "https://download.samba.org/pub/samba/stable/" "samba-" version ".tar.gz")) (sha256 (base32 "03ncp49pfpzjla205y3xpb9iy61dz4pryyrvyz26422a4hpsmpnf")))) (properties (alist-delete 'hidden? (package-properties samba/pinned))))) (define-public talloc (package (name "talloc") (version "2.3.4") (source (origin (method url-fetch) (uri (string-append "https://www.samba.org/ftp/talloc/talloc-" version ".tar.gz")) (sha256 (base32 "01b5pq39z1l26f86dy8jqb37fsjbvsvx5ji65jmy8rsy4sz9x7qp")))) (build-system gnu-build-system) (arguments '(#:phases (modify-phases %standard-phases (add-after 'unpack 'remove-crypt-reference ;; The following is needed because Python.h propagates ;; HAVE_CRYPT_H, which is then seen from lib/replace/ but talloc ;; doesn't need it at all. (lambda _ (substitute* "lib/replace/replace.h" (("#include <crypt.h>") "")))) (replace 'configure (lambda* (#:key outputs #:allow-other-keys) ;; talloc uses a custom configuration script that runs a Python ;; script called 'waf', and doesn't tolerate unknown options. (setenv "CONFIG_SHELL" (which "sh")) (let ((out (assoc-ref outputs "out"))) (invoke "./configure" (string-append "--prefix=" out)))))))) (native-inputs (list which)) (inputs (list python)) (home-page "https://talloc.samba.org") (synopsis "Hierarchical, reference counted memory pool system") (description "Talloc is a hierarchical, reference counted memory pool system with destructors. It is the core memory allocator used in Samba.") (license license:gpl3+))) ;; The bundled "replace" library uses LGPL3. (define-public talloc/static (package (inherit talloc) (name "talloc-static") (synopsis "Hierarchical, reference counted memory pool system (static library)") (arguments (substitute-keyword-arguments (package-arguments talloc) ((#:phases phases) ;; Since Waf, the build system talloc uses, apparently does not ;; support building static libraries from a ./configure flag, roll our ;; own build process. No need to be ashamed, we're not the only ones ;; doing that: ;; <https://github.com/proot-me/proot-static-build/blob/master/GNUmakefile>. ;; :-) `(modify-phases ,phases (replace 'build (lambda _ (invoke "gcc" "-c" "-Ibin/default" "-I" "lib/replace" "-I." "-Wall" "-g" "-D__STDC_WANT_LIB_EXT1__=1" "talloc.c") (invoke "ar" "rc" "libtalloc.a" "talloc.o"))) (replace 'install (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (lib (string-append out "/lib")) (include (string-append out "/include"))) (mkdir-p lib) (install-file "libtalloc.a" lib) (install-file "talloc.h" include) #t))) (delete 'check))))))) ;XXX: tests rely on Python modules (define-public tevent (package (name "tevent") (version "0.13.0") (source (origin (method url-fetch) (uri (string-append "https://www.samba.org/ftp/tevent/tevent-" version ".tar.gz")) (sha256 (base32 "030x6ziapxiqvmi2m23ri2p9rsa202gfqr7b3cv48lx5gy8plhxr")))) (build-system gnu-build-system) (arguments '(#:phases (modify-phases %standard-phases (add-after 'unpack 'remove-crypt-reference ;; The following is needed because Python.h propagates ;; HAVE_CRYPT_H, which is then seen from lib/replace/ but talloc ;; doesn't need it at all. (lambda _ (substitute* "lib/replace/replace.h" (("#include <crypt.h>") "")))) (replace 'configure ;; tevent uses a custom configuration script that runs waf. (lambda* (#:key outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) (invoke "./configure" (string-append "--prefix=" out) "--bundled-libraries=NONE"))))))) (native-inputs (list cmocka pkg-config python which)) (propagated-inputs (list talloc)) ; required by tevent.pc (synopsis "Event system library") (home-page "https://tevent.samba.org/") (description "Tevent is an event system based on the talloc memory management library. It is the core event system used in Samba. The low level tevent has support for many event types, including timers, signals, and the classic file descriptor events.") (license license:lgpl3+))) (define-public ldb (package (name "ldb") (version "2.6.1") (source (origin (method url-fetch) (uri (string-append "https://www.samba.org/ftp/ldb/ldb-" version ".tar.gz")) (sha256 (base32 "1j9n2yzhd35xjh0mdfgym58xfbma1d27bcavjv1q4rzqgpvh6x26")) (modules '((guix build utils))) (snippet '(begin (for-each (lambda (file) ;; Delete everything except the build tools. (unless (or (string-prefix? "third_party/waf" file) (string-suffix? "wscript" file)) (delete-file file))) (find-files "third_party")))))) (build-system gnu-build-system) (arguments '(;; LMDB is only supported on 64-bit systems, yet the test suite ;; requires it. #:tests? (assoc-ref %build-inputs "lmdb") #:phases (modify-phases %standard-phases (add-after 'unpack 'remove-crypt-reference ;; The following is needed because Python.h propagates ;; HAVE_CRYPT_H, which is then seen from lib/replace/ but talloc ;; doesn't need it at all. (lambda _ (substitute* "lib/replace/replace.h" (("#include <crypt.h>") "")))) (replace 'configure ;; ldb use a custom configuration script that runs waf. (lambda* (#:key outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) (invoke "./configure" (string-append "--prefix=" out) (string-append "--with-modulesdir=" out "/lib/ldb/modules") "--bundled-libraries=NONE"))))))) (native-inputs (list cmocka pkg-config python which)) (propagated-inputs ;; ldb.pc refers to all these. (list talloc tdb)) (inputs `(,@(if (target-64bit?) `(("lmdb" ,lmdb)) '()) ("popt" ,popt) ("tevent" ,tevent))) (synopsis "LDAP-like embedded database") (home-page "https://ldb.samba.org/") (description "Ldb is a LDAP-like embedded database built on top of TDB. What ldb does is provide a fast database with an LDAP-like API designed to be used within an application. In some ways it can be seen as a intermediate solution between key-value pair databases and a real LDAP database.") (license license:lgpl3+))) (define-public ppp (package (name "ppp") (version "2.5.0") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/ppp-project/ppp") (commit (string-append "ppp-" version)))) (file-name (git-file-name name version)) (sha256 (base32 "1pkvaxi5318lvsadspj603wdkxah01vgjhywri7rv249p249vfr7")))) (build-system gnu-build-system) (arguments (list #:tests? #f ; no tests #:configure-flags #~(list (string-append "CC=" #$(cc-for-target)) (string-append "--with-openssl=" (assoc-ref %build-inputs "openssl"))) #:make-flags #~(list "V=1") ; better build logs #:phases #~(modify-phases %standard-phases (add-before 'bootstrap 'no-/bin/sh (lambda _ (delete-file "autogen.sh")))))) (native-inputs (list autoconf automake libtool)) (inputs (list libpcap libxcrypt openssl)) (synopsis "Implementation of the Point-to-Point Protocol") (home-page "https://ppp.samba.org/") (description "The Point-to-Point Protocol (PPP) provides a standard way to establish a network connection over a serial link. At present, this package supports IP and IPV6 and the protocols layered above them, such as TCP and UDP.") ;; pppd, pppstats and pppdump are under BSD-style notices. ;; some of the pppd plugins are GPL'd. ;; chat is public domain. (license (list license:bsd-3 license:bsd-4 license:gpl2+ license:public-domain)))) (define-public ppp-2.4.9 (package (inherit ppp) (name "ppp") (version "2.4.9") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/ppp-project/ppp") (commit (string-append "ppp-" version)))) (file-name (git-file-name name version)) (sha256 (base32 "1bhhksdclsnkw54a517ndrw55q5zljjbh9pcqz1z4a2z2flxpsgk")))) (arguments (list #:tests? #f ;; No "check" target #:make-flags #~(list (string-append "CC=" #$(cc-for-target))) #:phases #~(modify-phases %standard-phases (add-before 'configure 'patch-Makefile (lambda* (#:key inputs #:allow-other-keys) (let ((openssl (assoc-ref inputs "openssl")) (libpcap (assoc-ref inputs "libpcap"))) (substitute* "pppd/Makefile.linux" (("/usr/include/openssl") (string-append openssl "/include")) (("-DPPP_FILTER") (string-append "-DPPP_FILTER -I" libpcap "/include"))) (substitute* "pppd/pppcrypt.h" (("des\\.h") "openssl/des.h"))) #t))))))) (define-public wsdd (package (name "wsdd") (version "0.7.1") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/christgau/wsdd") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "16kk7x80jlargrvh643m23j277p0drs2yylqz54f9inf5ld5bxn5")))) (build-system gnu-build-system) (arguments (list #:tests? #f ; no test suite, only examples #:phases #~(modify-phases %standard-phases (delete 'configure) ; no configure script (delete 'build) ; nothing to build (replace 'install (lambda _ (with-directory-excursion "src" (rename-file "wsdd.py" "wsdd") (install-file "wsdd" (string-append #$output "/bin"))) (for-each (lambda (file) (install-file file (string-append #$output "/share/man/man" (string-take-right file 1)))) (find-files "man" "\\.[0-9]$"))))))) (inputs (list python)) (home-page "https://github.com/christgau/wsdd") (synopsis "Web Service Discovery host daemon") (description "This daemon allows (Samba) hosts to be found by Web Service Dicovery Clients. It also implements the client side of the discovery protocol which searches for devices implementing WSD.") (license license:expat)))