aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/agda.scm
blob: d2113555eb9d1c5ddd2ae0435704651b2885e513 (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
146
147
148
149
150
151
152
153
154
155
156
157
158
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2018 Alex ter Weele <alex.ter.weele@gmail.com>
;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com>
;;;
;;; 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 agda)
  #:use-module (gnu packages haskell)
  #:use-module (gnu packages haskell-check)
  #:use-module (gnu packages haskell-web)
  #:use-module (guix build-system emacs)
  #:use-module (guix build-system haskell)
  #:use-module (guix build-system trivial)
  #:use-module (guix download)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages))

(define-public agda
  (package
    (name "agda")
    (version "2.5.4.1")
    (source
     (origin
       (method url-fetch)
       (uri (string-append
             "https://hackage.haskell.org/package/Agda/Agda-"
             version ".tar.gz"))
       (sha256
        (base32
         "0bxpibsk98n9xp42d92ma5vj2fam8rsnl61fbhr3askfjdvalnbp"))))
    (build-system haskell-build-system)
    (inputs
     `(("cpphs" ,cpphs)
       ("ghc-alex" ,ghc-alex)
       ("ghc-async" ,ghc-async)
       ("ghc-blaze-html" ,ghc-blaze-html)
       ("ghc-boxes" ,ghc-boxes)
       ("ghc-data-hash" ,ghc-data-hash)
       ("ghc-edisoncore" ,ghc-edisoncore)
       ("ghc-edit-distance" ,ghc-edit-distance)
       ("ghc-equivalence" ,ghc-equivalence)
       ("ghc-filemanip" ,ghc-filemanip)
       ("ghc-geniplate-mirror" ,ghc-geniplate-mirror)
       ("ghc-gitrev" ,ghc-gitrev)
       ("ghc-happy" ,ghc-happy)
       ("ghc-hashable" ,ghc-hashable)
       ("ghc-hashtables" ,ghc-hashtables)
       ("ghc-ieee754" ,ghc-ieee754)
       ("ghc-murmur-hash" ,ghc-murmur-hash)
       ("ghc-uri-encode" ,ghc-uri-encode)
       ("ghc-parallel" ,ghc-parallel)
       ("ghc-regex-tdfa" ,ghc-regex-tdfa)
       ("ghc-stm" ,ghc-stm)
       ("ghc-strict" ,ghc-strict)
       ("ghc-text" ,ghc-text)
       ("ghc-unordered-containers" ,ghc-unordered-containers)
       ("ghc-zlib" ,ghc-zlib)))
    (arguments
     `(#:modules ((guix build haskell-build-system)
                  (guix build utils)
                  (srfi srfi-26)
                  (ice-9 match))
       #:phases
       (modify-phases %standard-phases
         ;; FIXME: This is a copy of the standard configure phase with a tiny
         ;; difference: this package needs the -package-db flag to be passed
         ;; to "runhaskell" in addition to the "configure" action, because
         ;; Setup.hs depends on filemanip.  Without this option the Setup.hs
         ;; file cannot be evaluated.  The haskell-build-system should be
         ;; changed to pass "-package-db" to "runhaskell" in any case.
         (replace 'configure
           (lambda* (#:key outputs inputs tests? (configure-flags '())
                     #:allow-other-keys)
             (let* ((out (assoc-ref outputs "out"))
                    (name-version (strip-store-file-name out))
                    (input-dirs (match inputs
                                  (((_ . dir) ...)
                                   dir)
                                  (_ '())))
                    (ghc-path (getenv "GHC_PACKAGE_PATH"))
                    (params (append `(,(string-append "--prefix=" out))
                                    `(,(string-append "--libdir=" out "/lib"))
                                    `(,(string-append "--bindir=" out "/bin"))
                                    `(,(string-append
                                        "--docdir=" out
                                        "/share/doc/" name-version))
                                    '("--libsubdir=$compiler/$pkg-$version")
                                    '("--package-db=../package.conf.d")
                                    '("--global")
                                    `(,@(map
                                         (cut string-append "--extra-include-dirs=" <>)
                                         (search-path-as-list '("include") input-dirs)))
                                    `(,@(map
                                         (cut string-append "--extra-lib-dirs=" <>)
                                         (search-path-as-list '("lib") input-dirs)))
                                    (if tests?
                                        '("--enable-tests")
                                        '())
                                    configure-flags)))
               (unsetenv "GHC_PACKAGE_PATH")
               (apply invoke "runhaskell" "-package-db=../package.conf.d"
                      "Setup.hs" "configure" params)
               (setenv "GHC_PACKAGE_PATH" ghc-path)
               #t)))
         (add-after 'compile 'agda-compile
           (lambda* (#:key outputs #:allow-other-keys)
             (let* ((out (assoc-ref outputs "out"))
                    (agda-compiler (string-append out "/bin/agda")))
               (for-each (cut invoke agda-compiler <>)
                         (find-files (string-append out "/share") "\\.agda$"))
               #t))))))
    (home-page "http://wiki.portal.chalmers.se/agda/")
    (synopsis
     "Dependently typed functional programming language and proof assistant")
    (description
     "Agda is a dependently typed functional programming language: it has
inductive families, which are similar to Haskell's GADTs, but they can be
indexed by values and not just types.  It also has parameterised modules,
mixfix operators, Unicode characters, and an interactive Emacs interface (the
type checker can assist in the development of your code).  Agda is also a
proof assistant: it is an interactive system for writing and checking proofs.
Agda is based on intuitionistic type theory, a foundational system for
constructive mathematics developed by the Swedish logician Per Martin-Löf.  It
has many similarities with other proof assistants based on dependent types,
such as Coq, Epigram and NuPRL.")
    ;; Agda is distributed under the MIT license, and a couple of
    ;; source files are BSD-3.  See LICENSE for details.
    (license (list license:expat license:bsd-3))))

(define-public emacs-agda2-mode
  (package
    (inherit agda)
    (name "emacs-agda2-mode")
    (build-system emacs-build-system)
    (inputs '())
    (arguments
     `(#:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'enter-elisp-dir
           (lambda _ (chdir "src/data/emacs-mode") #t)))))
    (home-page "https://agda.readthedocs.io/en/latest/tools/emacs-mode.html")
    (synopsis "Emacs mode for Agda")
    (description "This Emacs mode enables interactive development with
Agda.  It also aids the input of Unicode characters.")))
quot;) (("^MANPATH_(BASE|DEFAULT)=.*" _ which) (string-append "MANPATH_" which "=" "/run/current-system/profile/share/man\n")) (("^PREFIX=.*") (string-append "PREFIX=" (assoc-ref outputs "out") "\n")))))))) (native-inputs (list (libc-utf8-locales-for-target) perl)) ;used to run tests (inputs (list zlib)) (native-search-paths (list (search-path-specification (variable "MANPATH") (files '("share/man"))))) (synopsis "Tools for BSD mdoc and man pages") (description "mandoc is a suite of tools compiling mdoc, the roff macro language of choice for BSD manual pages, and man, the predominant historical language for UNIX manuals. It is small and quite fast. The main component of the toolset is the @command{mandoc} utility program, based on the libmandoc validating compiler, to format output for UTF-8 and ASCII UNIX terminals, HTML 5, PostScript, and PDF. Additional tools include the @command{man} viewer, and @command{apropos} and @command{whatis}.") (home-page "https://mandoc.bsd.lv/") (license license:isc))) (define-public man-pages (package (name "man-pages") (version "6.02") (source (origin (method url-fetch) (uri (list (string-append "mirror://kernel.org/linux/docs/man-pages/" "man-pages-" version ".tar.xz") (string-append "mirror://kernel.org/linux/docs/man-pages/Archive/" "man-pages-" version ".tar.xz"))) (sha256 (base32 "159p60a0w5ri3i7bbfxzjfmj8sbpf030m38spny1ws585fv0kn36")))) (build-system gnu-build-system) (arguments (list #:phases #~(modify-phases %standard-phases (add-after 'unpack 'skip-html ;; As of 6.00, this package tries to convert man pages to HTML with ;; man2html. The only Guix package currently providing that script ;; is man-for-txr, but that version seems unable to handle relative ;; ‘.so’ statements properly. Disable HTML generation. (lambda _ (substitute* "lib/build-html.mk" (("(html:) .*" _ target) (string-append target "\n"))))) (delete 'configure)) ;; The 'all' target depends on three targets that directly populate ;; $(MANDIR) based on its current contents. Doing that in parallel ;; leads to undefined behavior (see <http://bugs.gnu.org/18701>.) #:parallel-build? #f #:tests? #f #:make-flags #~(list (string-append "mandir=" #$output "/share/man")))) (home-page "https://www.kernel.org/doc/man-pages/") (synopsis "Development manual pages from the Linux project") (description "This package provides traditional Unix \"man pages\" documenting the Linux kernel and C library interfaces employed by user-space programs.") ;; Each man page has its own license; some are GPLv2+, some are MIT/X11. (license license:gpl2+))) (define-public man-pages-posix (package (name "man-pages-posix") ;; Make sure that updates are still legally distributable. 2017-a is not. (version "2013-a") (source (origin (method url-fetch) (uri (string-append "mirror://kernel.org/linux/docs/man-pages/" "man-pages-posix/man-pages-posix-" version ".tar.xz")) (sha256 (base32 "0258j05zdrxpgdj8nndbyi7bvrs8fxdksb0xbfrylzgzfmf3lqqr")))) (build-system gnu-build-system) (arguments `(#:tests? #f #:make-flags ,#~(list (string-append "prefix=" #$output)) #:license-file-regexp "POSIX-COPYRIGHT" ;; The build phase only compresses documentation, which we already do. #:phases (modify-phases %standard-phases (delete 'configure) (delete 'build)))) (home-page "https://www.kernel.org/doc/man-pages/") (synopsis "Man pages from the POSIX.1-2013 standard") (description "This package provides excerpts from the POSIX.1-2008 and TC1 standards (collectively, POSIX.1-2013) in manual page form. While the Linux man-pages project documents the system as it exists on Linux- and glibc-based systems, this package documents the portable software API as nominally implemented by many Unix-likes.") (license (license:fsdg-compatible "file://POSIX-COPYRIGHT" "Redistribution of this material is permitted so long as this notice and the corresponding notices within each POSIX manual page are retained on any distribution, and the nroff source is included.")))) (define-public help2man ;; TODO: Manual pages for languages not available from the implicit ;; input "locales" contain the original (English) text. (package (name "help2man") (version "1.49.2") (source (origin (method url-fetch) (uri (string-append "mirror://gnu/help2man/help2man-" version ".tar.xz")) (sha256 (base32 "0dnxx96lbcb8ab8yrdkqll14cl5n0bch8qpd9qj3c2ky78hhwbly")))) (build-system gnu-build-system) (arguments (list #:tests? #f ;no `check' target #:phases #~(modify-phases %standard-phases (add-after 'unpack 'patch-help2man-with-perl-gettext (lambda* (#:key inputs #:allow-other-keys) (let ((lib #$(this-package-input "perl-gettext")) (fmt "use lib '~a/lib/perl5/site_perl';~%~a")) (substitute* "help2man.PL" (("^use Locale::gettext.*$" load) (format #f fmt lib load))))))))) (inputs (append (list perl) (if (%current-target-system) '() (list perl-gettext)))) (native-inputs (list perl gettext-minimal)) (home-page "https://www.gnu.org/software/help2man/") (synopsis "Automatically generate man pages from program --help") (description "GNU help2man is a program that converts the output of standard \"--help\" and \"--version\" command-line arguments into a manual page automatically.") (license license:gpl3+))) (define-public scdoc (package (name "scdoc") (version "1.11.2") (source (origin (method git-fetch) (uri (git-reference (url "https://git.sr.ht/~sircmpwn/scdoc") (commit version))) (file-name (git-file-name name version)) (sha256 (base32 "07c2vmdgqifbynm19zjnrk7h102pzrriv73izmx8pmd7b3xl5mfq")))) (build-system gnu-build-system) (arguments `(#:make-flags (list (string-append "CC=" ,(cc-for-target)) (string-append "PREFIX=" (assoc-ref %outputs "out"))) #:phases (modify-phases %standard-phases (delete 'configure)))) (home-page "https://git.sr.ht/~sircmpwn/scdoc") (synopsis "Simple man page generator") (description "scdoc is a simple man page generator written for POSIX systems in C99.") ;; MIT license, see /share/doc/scdoc-1.6.0/COPYING. (license license:expat))) (define-public txt2man (package (name "txt2man") (version "1.6.0") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/mvertes/txt2man") (commit (string-append "txt2man-" version)))) (file-name (git-file-name name version)) (sha256 (base32 "1razjpvlcp85hqli77mwr9nmn5jnv3lm1fxbbqjpx1brv3h1lvm5")))) (build-system gnu-build-system) (arguments `(#:tests? #f ; no "check" target #:make-flags (list (string-append "prefix=" (assoc-ref %outputs "out"))) #:phases (modify-phases %standard-phases (delete 'configure)))) (inputs (list gawk)) (home-page "https://github.com/mvertes/txt2man") (synopsis "Convert text to man page") (description "Txt2man converts flat ASCII text to man page format.") (license license:gpl2+)))