Commit | Line | Data |
---|---|---|
f61682e7 AW |
1 | ;;; GNU Guix --- Functional package management for GNU |
2 | ;;; Copyright © 2018 Alex ter Weele <alex.ter.weele@gmail.com> | |
787231e9 | 3 | ;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net> |
58352f26 | 4 | ;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com> |
d9c80098 | 5 | ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr> |
276f598a | 6 | ;;; Copyright © 2018 John Soo <jsoo1@asu.edu> |
48752f27 | 7 | ;;; Copyright © 2019 Ludovic Courtès <ludo@gnu.org> |
f61682e7 AW |
8 | ;;; |
9 | ;;; This file is part of GNU Guix. | |
10 | ;;; | |
11 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
12 | ;;; under the terms of the GNU General Public License as published by | |
13 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
14 | ;;; your option) any later version. | |
15 | ;;; | |
16 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
17 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 | ;;; GNU General Public License for more details. | |
20 | ;;; | |
21 | ;;; You should have received a copy of the GNU General Public License | |
22 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
23 | ||
24 | (define-module (gnu packages agda) | |
f61682e7 AW |
25 | #:use-module (gnu packages haskell-check) |
26 | #:use-module (gnu packages haskell-web) | |
dddbc90c | 27 | #:use-module (gnu packages haskell-xyz) |
1237653a | 28 | #:use-module (guix build-system emacs) |
276f598a | 29 | #:use-module (guix build-system gnu) |
f61682e7 AW |
30 | #:use-module (guix build-system haskell) |
31 | #:use-module (guix build-system trivial) | |
32 | #:use-module (guix download) | |
48752f27 | 33 | #:use-module (guix git-download) |
f61682e7 AW |
34 | #:use-module ((guix licenses) #:prefix license:) |
35 | #:use-module (guix packages)) | |
36 | ||
37 | (define-public agda | |
38 | (package | |
39 | (name "agda") | |
d9c80098 | 40 | (version "2.5.4.2") |
f61682e7 AW |
41 | (source |
42 | (origin | |
43 | (method url-fetch) | |
44 | (uri (string-append | |
45 | "https://hackage.haskell.org/package/Agda/Agda-" | |
46 | version ".tar.gz")) | |
47 | (sha256 | |
48 | (base32 | |
d9c80098 | 49 | "07wvawpfjhx3gw2w53v27ncv1bl0kkx08wkm6wzxldbslkcasign")))) |
f61682e7 AW |
50 | (build-system haskell-build-system) |
51 | (inputs | |
d9c80098 | 52 | `(("ghc-alex" ,ghc-alex) |
f61682e7 AW |
53 | ("ghc-async" ,ghc-async) |
54 | ("ghc-blaze-html" ,ghc-blaze-html) | |
55 | ("ghc-boxes" ,ghc-boxes) | |
56 | ("ghc-data-hash" ,ghc-data-hash) | |
57 | ("ghc-edisoncore" ,ghc-edisoncore) | |
58 | ("ghc-edit-distance" ,ghc-edit-distance) | |
59 | ("ghc-equivalence" ,ghc-equivalence) | |
787231e9 | 60 | ("ghc-filemanip" ,ghc-filemanip) |
f61682e7 AW |
61 | ("ghc-geniplate-mirror" ,ghc-geniplate-mirror) |
62 | ("ghc-gitrev" ,ghc-gitrev) | |
63 | ("ghc-happy" ,ghc-happy) | |
64 | ("ghc-hashable" ,ghc-hashable) | |
65 | ("ghc-hashtables" ,ghc-hashtables) | |
66 | ("ghc-ieee754" ,ghc-ieee754) | |
f61682e7 AW |
67 | ("ghc-murmur-hash" ,ghc-murmur-hash) |
68 | ("ghc-uri-encode" ,ghc-uri-encode) | |
69 | ("ghc-parallel" ,ghc-parallel) | |
70 | ("ghc-regex-tdfa" ,ghc-regex-tdfa) | |
f61682e7 | 71 | ("ghc-strict" ,ghc-strict) |
f61682e7 AW |
72 | ("ghc-unordered-containers" ,ghc-unordered-containers) |
73 | ("ghc-zlib" ,ghc-zlib))) | |
253340dc AW |
74 | (arguments |
75 | `(#:modules ((guix build haskell-build-system) | |
76 | (guix build utils) | |
787231e9 RW |
77 | (srfi srfi-26) |
78 | (ice-9 match)) | |
253340dc AW |
79 | #:phases |
80 | (modify-phases %standard-phases | |
787231e9 RW |
81 | ;; FIXME: This is a copy of the standard configure phase with a tiny |
82 | ;; difference: this package needs the -package-db flag to be passed | |
83 | ;; to "runhaskell" in addition to the "configure" action, because | |
84 | ;; Setup.hs depends on filemanip. Without this option the Setup.hs | |
85 | ;; file cannot be evaluated. The haskell-build-system should be | |
86 | ;; changed to pass "-package-db" to "runhaskell" in any case. | |
87 | (replace 'configure | |
88 | (lambda* (#:key outputs inputs tests? (configure-flags '()) | |
89 | #:allow-other-keys) | |
90 | (let* ((out (assoc-ref outputs "out")) | |
58352f26 | 91 | (name-version (strip-store-file-name out)) |
787231e9 RW |
92 | (input-dirs (match inputs |
93 | (((_ . dir) ...) | |
94 | dir) | |
95 | (_ '()))) | |
96 | (ghc-path (getenv "GHC_PACKAGE_PATH")) | |
97 | (params (append `(,(string-append "--prefix=" out)) | |
98 | `(,(string-append "--libdir=" out "/lib")) | |
99 | `(,(string-append "--bindir=" out "/bin")) | |
100 | `(,(string-append | |
101 | "--docdir=" out | |
58352f26 | 102 | "/share/doc/" name-version)) |
787231e9 RW |
103 | '("--libsubdir=$compiler/$pkg-$version") |
104 | '("--package-db=../package.conf.d") | |
105 | '("--global") | |
106 | `(,@(map | |
107 | (cut string-append "--extra-include-dirs=" <>) | |
108 | (search-path-as-list '("include") input-dirs))) | |
109 | `(,@(map | |
110 | (cut string-append "--extra-lib-dirs=" <>) | |
111 | (search-path-as-list '("lib") input-dirs))) | |
112 | (if tests? | |
113 | '("--enable-tests") | |
114 | '()) | |
115 | configure-flags))) | |
116 | (unsetenv "GHC_PACKAGE_PATH") | |
117 | (apply invoke "runhaskell" "-package-db=../package.conf.d" | |
118 | "Setup.hs" "configure" params) | |
119 | (setenv "GHC_PACKAGE_PATH" ghc-path) | |
120 | #t))) | |
253340dc AW |
121 | (add-after 'compile 'agda-compile |
122 | (lambda* (#:key outputs #:allow-other-keys) | |
123 | (let* ((out (assoc-ref outputs "out")) | |
124 | (agda-compiler (string-append out "/bin/agda"))) | |
125 | (for-each (cut invoke agda-compiler <>) | |
126 | (find-files (string-append out "/share") "\\.agda$")) | |
127 | #t)))))) | |
f61682e7 AW |
128 | (home-page "http://wiki.portal.chalmers.se/agda/") |
129 | (synopsis | |
130 | "Dependently typed functional programming language and proof assistant") | |
131 | (description | |
132 | "Agda is a dependently typed functional programming language: it has | |
133 | inductive families, which are similar to Haskell's GADTs, but they can be | |
134 | indexed by values and not just types. It also has parameterised modules, | |
135 | mixfix operators, Unicode characters, and an interactive Emacs interface (the | |
136 | type checker can assist in the development of your code). Agda is also a | |
137 | proof assistant: it is an interactive system for writing and checking proofs. | |
138 | Agda is based on intuitionistic type theory, a foundational system for | |
139 | constructive mathematics developed by the Swedish logician Per Martin-Löf. It | |
140 | has many similarities with other proof assistants based on dependent types, | |
141 | such as Coq, Epigram and NuPRL.") | |
142 | ;; Agda is distributed under the MIT license, and a couple of | |
143 | ;; source files are BSD-3. See LICENSE for details. | |
144 | (license (list license:expat license:bsd-3)))) | |
1237653a AW |
145 | |
146 | (define-public emacs-agda2-mode | |
147 | (package | |
148 | (inherit agda) | |
149 | (name "emacs-agda2-mode") | |
150 | (build-system emacs-build-system) | |
151 | (inputs '()) | |
152 | (arguments | |
153 | `(#:phases | |
154 | (modify-phases %standard-phases | |
155 | (add-after 'unpack 'enter-elisp-dir | |
156 | (lambda _ (chdir "src/data/emacs-mode") #t))))) | |
157 | (home-page "https://agda.readthedocs.io/en/latest/tools/emacs-mode.html") | |
158 | (synopsis "Emacs mode for Agda") | |
159 | (description "This Emacs mode enables interactive development with | |
160 | Agda. It also aids the input of Unicode characters."))) | |
276f598a JS |
161 | |
162 | (define-public agda-ial | |
163 | (package | |
164 | (name "agda-ial") | |
165 | (version "1.5.0") | |
48752f27 LC |
166 | (home-page "https://github.com/cedille/ial") |
167 | (source (origin | |
168 | (method git-fetch) | |
169 | (uri (git-reference (url home-page) | |
170 | (commit (string-append "v" version)))) | |
171 | (file-name (git-file-name name version)) | |
172 | (sha256 | |
173 | (base32 | |
174 | "0dlis6v6nzbscf713cmwlx8h9n2gxghci8y21qak3hp18gkxdp0g")))) | |
276f598a JS |
175 | (build-system gnu-build-system) |
176 | (inputs | |
177 | `(("agda" ,agda))) | |
178 | (arguments | |
179 | `(#:parallel-build? #f | |
180 | #:phases | |
181 | (modify-phases %standard-phases | |
182 | (delete 'configure) | |
183 | (add-before 'build 'patch-dependencies | |
184 | (lambda _ (patch-shebang "find-deps.sh") #t)) | |
185 | (delete 'check) | |
186 | (replace 'install | |
187 | (lambda* (#:key outputs #:allow-other-keys) | |
48752f27 LC |
188 | (let* ((out (assoc-ref outputs "out")) |
189 | (include (string-append out "/include/agda/ial"))) | |
190 | (for-each (lambda (file) | |
191 | (make-file-writable file) | |
192 | (install-file file include)) | |
83ac4c09 | 193 | (find-files "." "\\.agdai?(-lib)?$")) |
48752f27 LC |
194 | #t)))))) |
195 | (synopsis "The Iowa Agda Library") | |
276f598a JS |
196 | (description |
197 | "The goal is to provide a concrete library focused on verification | |
198 | examples, as opposed to mathematics. The library has a good number | |
199 | of theorems for booleans, natural numbers, and lists. It also has | |
200 | trees, tries, vectors, and rudimentary IO. A number of good ideas | |
201 | come from Agda's standard library.") | |
202 | (license license:expat))) |