agda.scm 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2018 Alex ter Weele <alex.ter.weele@gmail.com>
  3. ;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
  4. ;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com>
  5. ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
  6. ;;; Copyright © 2018 John Soo <jsoo1@asu.edu>
  7. ;;; Copyright © 2019 Ludovic Courtès <ludo@gnu.org>
  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. (define-module (gnu packages agda)
  24. #:use-module (gnu packages haskell-check)
  25. #:use-module (gnu packages haskell-web)
  26. #:use-module (gnu packages haskell-xyz)
  27. #:use-module (guix build-system emacs)
  28. #:use-module (guix build-system gnu)
  29. #:use-module (guix build-system haskell)
  30. #:use-module (guix build-system trivial)
  31. #:use-module (guix download)
  32. #:use-module (guix git-download)
  33. #:use-module ((guix licenses) #:prefix license:)
  34. #:use-module (guix packages))
  35. (define-public agda
  36. (package
  37. (name "agda")
  38. (version "2.6.2")
  39. (source
  40. (origin
  41. (method url-fetch)
  42. (uri (string-append
  43. "https://hackage.haskell.org/package/Agda/Agda-"
  44. version ".tar.gz"))
  45. (sha256
  46. (base32
  47. "159hznnsxg7hlp80r1wqizyd7gwgnq0j13cm4d27cns0ganslb07"))))
  48. (build-system haskell-build-system)
  49. (inputs
  50. `(("ghc-aeson" ,ghc-aeson)
  51. ("ghc-alex" ,ghc-alex)
  52. ("ghc-async" ,ghc-async)
  53. ("ghc-blaze-html" ,ghc-blaze-html)
  54. ("ghc-boxes" ,ghc-boxes)
  55. ("ghc-case-insensitive" ,ghc-case-insensitive)
  56. ("ghc-data-hash" ,ghc-data-hash)
  57. ("ghc-edit-distance" ,ghc-edit-distance)
  58. ("ghc-equivalence" ,ghc-equivalence)
  59. ("ghc-gitrev" ,ghc-gitrev)
  60. ("ghc-happy" ,ghc-happy)
  61. ("ghc-hashable" ,ghc-hashable)
  62. ("ghc-hashtables" ,ghc-hashtables)
  63. ("ghc-monad-control" ,ghc-monad-control)
  64. ("ghc-murmur-hash" ,ghc-murmur-hash)
  65. ("ghc-parallel" ,ghc-parallel)
  66. ("ghc-regex-tdfa" ,ghc-regex-tdfa)
  67. ("ghc-split" ,ghc-split)
  68. ("ghc-strict" ,ghc-strict)
  69. ("ghc-unordered-containers" ,ghc-unordered-containers)
  70. ("ghc-uri-encode" ,ghc-uri-encode)
  71. ("ghc-zlib" ,ghc-zlib)))
  72. (arguments
  73. `(#:modules ((guix build haskell-build-system)
  74. (guix build utils)
  75. (srfi srfi-26)
  76. (ice-9 match))
  77. #:phases
  78. (modify-phases %standard-phases
  79. ;; This allows us to call the 'agda' binary before installing.
  80. (add-after 'unpack 'set-ld-library-path
  81. (lambda _
  82. (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/dist/build"))
  83. #t))
  84. (add-after 'compile 'agda-compile
  85. (lambda* (#:key outputs #:allow-other-keys)
  86. (let* ((out (assoc-ref outputs "out"))
  87. (agda-compiler (string-append out "/bin/agda")))
  88. (for-each (cut invoke agda-compiler <>)
  89. (find-files (string-append out "/share") "\\.agda$"))
  90. #t))))))
  91. (home-page "https://wiki.portal.chalmers.se/agda/")
  92. (synopsis
  93. "Dependently typed functional programming language and proof assistant")
  94. (description
  95. "Agda is a dependently typed functional programming language: it has
  96. inductive families, which are similar to Haskell's GADTs, but they can be
  97. indexed by values and not just types. It also has parameterised modules,
  98. mixfix operators, Unicode characters, and an interactive Emacs interface (the
  99. type checker can assist in the development of your code). Agda is also a
  100. proof assistant: it is an interactive system for writing and checking proofs.
  101. Agda is based on intuitionistic type theory, a foundational system for
  102. constructive mathematics developed by the Swedish logician Per Martin-Löf. It
  103. has many similarities with other proof assistants based on dependent types,
  104. such as Coq, Epigram and NuPRL.")
  105. ;; Agda is distributed under the MIT license, and a couple of
  106. ;; source files are BSD-3. See LICENSE for details.
  107. (license (list license:expat license:bsd-3))))
  108. (define-public emacs-agda2-mode
  109. (package
  110. (inherit agda)
  111. (name "emacs-agda2-mode")
  112. (build-system emacs-build-system)
  113. (inputs '())
  114. (arguments
  115. `(#:phases
  116. (modify-phases %standard-phases
  117. (add-after 'unpack 'enter-elisp-dir
  118. (lambda _ (chdir "src/data/emacs-mode") #t)))))
  119. (home-page "https://agda.readthedocs.io/en/latest/tools/emacs-mode.html")
  120. (synopsis "Emacs mode for Agda")
  121. (description "This Emacs mode enables interactive development with
  122. Agda. It also aids the input of Unicode characters.")))
  123. (define-public agda-ial
  124. (package
  125. (name "agda-ial")
  126. (version "1.5.0")
  127. (home-page "https://github.com/cedille/ial")
  128. (source (origin
  129. (method git-fetch)
  130. (uri (git-reference (url home-page)
  131. (commit (string-append "v" version))))
  132. (file-name (git-file-name name version))
  133. (sha256
  134. (base32
  135. "0dlis6v6nzbscf713cmwlx8h9n2gxghci8y21qak3hp18gkxdp0g"))))
  136. (build-system gnu-build-system)
  137. (inputs
  138. `(("agda" ,agda)))
  139. (arguments
  140. `(#:parallel-build? #f
  141. #:phases
  142. (modify-phases %standard-phases
  143. (delete 'configure)
  144. (add-before 'build 'patch-dependencies
  145. (lambda _ (patch-shebang "find-deps.sh") #t))
  146. (delete 'check)
  147. (replace 'install
  148. (lambda* (#:key outputs #:allow-other-keys)
  149. (let* ((out (assoc-ref outputs "out"))
  150. (include (string-append out "/include/agda/ial")))
  151. (for-each (lambda (file)
  152. (make-file-writable file)
  153. (install-file file include))
  154. (find-files "." "\\.agdai?(-lib)?$"))
  155. #t))))))
  156. (synopsis "The Iowa Agda Library")
  157. (description
  158. "The goal is to provide a concrete library focused on verification
  159. examples, as opposed to mathematics. The library has a good number
  160. of theorems for booleans, natural numbers, and lists. It also has
  161. trees, tries, vectors, and rudimentary IO. A number of good ideas
  162. come from Agda's standard library.")
  163. (license license:expat)))